FFmpeg command learning

When -ss and -t are placed after the input, ffmpeg counts demuxed packets. This will be accurate.

  • From the start of the video, the interception of a length of 10 seconds:

ffmpeg -t 0:0:10 -i extern.mp4 -vcodec copy -acodec copy output.mp4

  • 2 minutes and 30 seconds from the start of the video, taken 20 seconds: -ss start time, such as: 00:00:20, represented by 20 seconds from the start; -t duration, such as: 00:00:10, length represents taken 10 seconds video; -i input, followed by a space, followed by that of the input file; -vcodec copy and copy -acodec represent video and audio encoding format to be used, here designated as showing copy copy; the iNPUT, the input file; oUTPUT, output video file;

ffmpeg -ss 0:2:30 -t 0:0:20 -i input.mp4 -vcodec copy -acodec copy output.mp4

  • -58 segments between points 21 points taken video

ffmpeg -i WebViewJavascriptBridge.mp4 -vcodec copy -acodec copy -ss 00:21:00 -to 00:58:13 1.mp4 -y

Note: SS, t, to the position.

  • The FFMPEG rmvb format video converted into mp4 format command: [instruction after this transfer finished, no sound]

ffmpeg -i 88.rmvb -an -vcodec libx264 -b 560k -pass 1 -f mp4 -y 88.mp4

  • FFMPEG mkv video format converted into MP4 format :( encoding format specified)

ffmpeg -i 88.rmvb -acodec aac -vcodec libx264 -b 560k -pass 1 -f mp4 -y 88.mp4

  • FFMPEG video format will be transferred to MP4 format:

ffmpeg -i 91.rmvb -b:v 560k 91.mp4
ffmpeg -i movie.mov -vcodec copy -acodec copy out.mp4

  • FFMPEG extract mp3 from video formats:

ffmpeg -i qing.mp4 -f mp3 -vn qing.mp3

  • FFMPEG gif will turn into mp4:

ffmpeg -f gif -i tt.gif output.mp4

  • Sometimes convert MP4 can not play, you need to use the following command, add the parameter -pix_fmt

ffmpeg -i tt2.gif -pix_fmt yuv420p out.mp4

  • FFMPEG audio and video for the merger:

ffmpeg -i output.mp4 -i 1.mp3 -vcodec copy -acodec copy output1.mp4
ffmpeg -i new_video.mp3 -i new_video.mp4 output.mp4

  • FFMPEG taken MP3 (10 seconds from the beginning, taken 1 minute):

ffmpeg -ss 00:00:10 -t 00:01:00 -i input.mp3 -c copy output.mp3

  • The mosaic is a two MP3:

ffmpeg -i 1.mp3 -i 2.mp3 -filter_complex ‘[0:0][1:0] concat=n=2:v=0:a=1 [a]’ -map ‘[a]’ new.mp3

  • Mp3 speaking a length, taken from the beginning 17 seconds 15 seconds:

ffmpeg -i 1.mp3 -vn -acodec copy -ss 00:00:17 -t 00:00:15 out.mp3

Published 203 original articles · won praise 68 · views 720 000 +

Guess you like

Origin blog.csdn.net/philosophyatmath/article/details/103984851