-
Convert mp4 to swf
13Oct2011
ffmpeg.exe -i in.mp4 -loop 0 -ar 22050 out.swf
- Extract mpg to jpeg
13Oct2011)
ffmpeg.exe -i in.mpg -r 0.08 -f image2 out%03d.jpeg
09Dec2011
ffmpeg.exe -i in.mpg -r 2.4 -f image2 out%03d.jpeg
- Convert 3gp to mp4
13Nov2011
ffmpeg.exe -i "in.3gp" -sameq -ab 64k -ar 44100 out.mp4
- Convert vob to mp4
15Jan2012
ffmpeg.exe -i "in.vob" -target vcd out.mp4
- Convert dat to mp4
15Jan2012
ffmpeg.exe -i "in.dat" -target vcd out.mp4
- Convert mp4 to mp4 (phone)
03/04/2012)
ffmpeg.exe -i "in.mp4" -vtag xvid out.mp4
- Convert wmv to mp4
06May2016
ffmpeg.exe -i "in.wmv" -c:v libx264 -crf 19 -preset slow -c:a aac -strict experimental -b:a 192k -ac 2 out.mp4
- Convert mov to mp4 by default h264
04Jan2020
ffmpeg -i in.mov out.mp4
- Convert mov to mp4 with more control
04Jan2020
ffmpeg -i in.mov -c:v libx264 -crf 20 -preset slow -profile:v high -level 4.0 -color_primaries 1 -color_trc 1 -colorspace 1 -movflags +faststart -c:a aac -b:a 128k out.mp4
- Convert .mov to .mp4 with resize
04Jan2020
ffmpeg -i in.mov -vf "scale=1280:-2" out.mp4
- Convert .mov to .mp4 with padding
04Jan2020
ffmpeg -i in.mov -vf "scale=720:720:force_original_aspect_ratio=decrease,pad=720:720:(ow-iw)/2:(oh-ih)/2:black" out.mp4
- Convert .mov to .mp4 with cropping
04Jan2020
ffmpeg -i in.mov -vf "crop='min(iw,1*ih)':'min(iw/1,ih)',scale=720:720" out.mp4
- Convert .mov to .mp4 with blurred background
04Jan2020
ffmpeg -i in.mov -filter_complex "[0:v]scale=720:720,boxblur=luma_radius=min(h\,w)/20:luma_power=1:chroma_radius=min(cw\,ch)/20:chroma_power=1[bg];[0:v]scale=720:720:force_original_aspect_ratio=decrease[fg];[bg][fg]overlay=(W-w)/2:(H-h)/2[outv]" -map [outv] -map 0:a? out.mp4
- Convert .mov to .mp4 with trim
04Jan2020
ffmpeg -i in.mov -ss 13.2 -to 16 out.mp4
- Convert .mov to .mp4 with trim
04Jan2020
ffmpeg -i in.mov -ss 13.2 -t 2.8 out.mp4
- Convert .mp4 to .mp4 with overlay
04Jan2020
ffmpeg -i in.mp4 -i logo.png -filter_complex "overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" out.mp4
- Convert .mp4 to .jpg
04Jan2020
ffmpeg -i in.mp4 -ss 14.5 -vframes 1 -q:v 2 out.jpg
- Convert .mp4 to .gif animated
04Jan2020
ffmpeg -i in.mp4 -vf "fps=10,scale=320:-2:flags=lanczos" out.gif
- Convert .mp4 to .png palette
04Jan2020
ffmpeg -i in.mp4 -vf "fps=10,scale=320:-2:flags=lanczos,palettegen" out.png
- Convert .mp4 to .gif animated with palette
04Jan2020
ffmpeg -i in.mp4 -i palette.png -filter_complex "fps=10,scale=320:-2:lanczos[video];[video][1:v]paletteuse" video_clip-palette.gif
- Convert stream to mp4
05Jan2020
ffmpeg -i rtmp://192.168.1.101:19035/live/ -map 0 out.mp4
- Convert stream to live
05Jan2020
ffplay -rtsp_transport tcp rtsp://192.168.1.102:554/stream.sdp
- Convert .avi to mp3
05Jan2020
ffmpeg -i in.avi -map 0:a out.mp3
- Convert stream to mp3
05Jan2020
ffmpeg -i rtmp://192.168.1.101:19035/live/ -map 0:a out.mp3
- Convert stream to mp4:v
05Jan2020
ffmpeg -i rtmp://92.168.1.101:19035/live -map 0:v out.mp4
- Convert .mp3 to .mp3:1 and .mp3:2
05Jan2020
ffmpeg -i in.mp3 -map_channel 0.0.0 out1.mp3 -map_channel 0.0.1 out2.mp3
- Convert .mp4 to .mp4:v and .mp3
05Jan2020
ffmpeg -i in.mp4 -map 0:v out.mp4 -map 0:a out.mp3
- Convert .mp4 and .mp3 to .mp4
05Jan2020
ffmpeg -i in.mp4 -i in.mp3 -map 0:v -map 1:a out.mp4
- Convert .mp4 and .png to /mp4
05Jan2020
ffmpeg -i in.mp4 -i in.png -filter_complex 'overlay' out.mp4
- Convert .mp4 to yuv
05Jan2020
ffmpeg -i in.mp4 out.yuv
- Convert .mp4 to jpgs
05Jan2020
ffmpeg -i in.mp4 -r 1 -s 640x480 -f image2 out-%03d.jpeg
- Convert .mp4 to jpgs
05Jan2020
ffmpeg -i in.mp4 -r 1 -ss 50 -vframes 3 -s 640x480 -f image2 out-%03d.jpeg
- Convert .jpgs to .avi
05Jan2020
ffmpeg -f image2 -framerate 25 -i in-%03d.jpeg -s 1280x720 out.avi
- Convert codec
05Jan2020
ffmpeg -i in.mp4 -vcodec libx264 -s 640x480 -acodec aac -strict experimental -ar 44100 -ac 2 -b:a 96k out.mp4
- Convert size
05Jan2020
ffmpeg -i in.mp4 -vf scale=iw/2:ih/2 out.mp4
- Trim .mp4
05Jan2020
ffmpeg -ss 00:00:30 -vsync 0 -t 00:00:30 -i in.mp4 -vcodec libx264-acodec libfaac out.mp4
- Crop .mp4
05Jan2020
ffmpeg -i in.mp4 -vf crop=iw/2:ih/2 out.mp4
- Crop .mp4
05Jan2020
ffmpeg -i in.mp4 -vf crop=iw/3:ih/3:100:100 out.mp4
- ffplay detect
05Jan2020
ffplay in.mp4 -vf cropdetect
- Add border
05Jan2020
ffmpeg -i in.mp4 -vf pad=iw+60:ih+60:30:30:pink out.mp4
- Hflip
05Jan2020
ffmpeg -i in.mp4 -vf hflip out.mp4
- Vflip
05Jan2020
ffmpeg -i in.mp4 -vf vflip out.mp4
- transpose
05Jan2020
ffmpeg -i in.mp4 -vf transpose=2 out.mp4
- blur
05Jan2020
ffmpeg -i in.mp4 -vf boxblur=1:10:4:10 out.mp4
- unshape
05Jan2020
ffmpeg -i in.mp4 -vf unsharp=5:5:1.0:5:5:0.0 out.mp4
- delete logo
05Jan2020
ffmpeg -i in.mp4 -vf delogo=10:10:256:256:0:0 out.mp4
- drawtext
05Jan2020
ffmpeg -i in.mp4 -vf drawtext="fontfile=arial.ttf:text='test':x=(w-tw)/2:y=(h-th)/2:fontcolor=green:fontsize=60" in.mp4
- drawtext moving
05Jan2020
ffmpeg -i in.mp4 -vf drawtext="fontfile=ARIALUNI.ttf:text='test':x=w-mod(t*50\,w):fontcolor=darkorange:fontsize=30" out.mp4
- drawtext moving
05Jan2020
ffmpeg -i in.mp4 -vf drawtext="fontfile=ARIALUNI.ttf:text='test':x=w-mod(t*50\,w):y=h-th:fontcolor=darkorange:fontsize=30" out_.mp4
- Add time
05Jan2020
ffmpeg -i in.mp4 -vf drawtext="fontfile=arial.ttf:x=w-tw:fontcolor=white:fontsize=30:text='%{localtime\:%H\\\:%M\\\:%S}'" out.mp4
- play with rolling
05Jan2020
ffplay -i in.mp4 -vf crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2+((in_h-out_h)/2)*sin(n/7)
- play with changing color
05Jan2020
ffplay -i in.mp4 -vf hue="H=2*PI*t:s=sin(2*PI*t)+1"
- Convert color to gray
05Jan2020
ffmpeg -i in.mp4 -vf lutyuv="u=128:v=128" out.mp4
- Convert speed
05Jan2020
ffmpeg -i in.mp4 -vf setpts=PTS/2 -af atempo=2 out.mp4
- Convert mp4 to gif
05Jan2020
ffmpeg -i in.mp4 -ss 50 -t 10 -pix_fmt rgb24 -s 640x480 out.gif
- extract mp4 to 1 png
05Jan2020
ffmpeg -i in.mp4 -frames 1 -vf "select=not(mod(n\,300)),scale=320:240,tile=2x3" out.png
- Error! Convert to lmp4 and rmp4 to mp4
05Jan2020
ffmpeg -i "in1.mp4" -vf "[in] scale=iw/2:ih/2, pad=2*iw:ih [left]; movie=\'in2.mp4\', scale=iw/2:ih/2 [right];[left][right] overlay=main_w/2:0 [out]" -b:v 768k out.mp4
- Error! Convert to ump4 and lmp4 to mp4
05Jan2020
ffmpeg -i "in1.mp4" -vf "[in] scale=iw/2:ih/2, pad=iw:2*ih [top]; movie=\'in2.mp4\', scale=iw/2:ih/2 [bottom];[top][bottom] overlay=0:main_h/2 [out]" -b:v 768k out.mp4
- Error! Combine and edit
05Jan2020
ffmpeg -i "in1.mp4" -vf "[in] scale=iw:ih, pad=iw:ih [top]; movie=\'in2.mp4\', scale=iw/4:ih/4 [bottom];[top][bottom] overlay=main_w/8:main_h/8 [out]" -b:v 768k out.mp4
- Combine 2 video in sequence
05Jan2020
ffmpeg -i in1.mp4 -qscale 0 out1.mpg
ffmpeg -i in2.mp4 -qscale 0 out2.mpg
copy /b "out1.mpg"+"out2.mpg" "out3.mpg"
ffmpeg -i out3.mpg -qscale 0 out4.mp4
- Combine audio only
05Jan2020
fmpeg.exe -ss 00:00:08.5 -vsync 0 -t 00:00:09 -i file1.mp3 file1end.mp3
ffmpeg.exe -ss 00:00:00 -vsync 0 -t 00:00:08 -i file1.mp3 file1New.mp3
ffmpeg -i file2.mp3 -i file1end.mp3 -filter_complex amix=inputs=2:duration=first:dropout_transition=0 file2forNew1.mp3
ffmpeg.exe -ss 00:00:00 -vsync 0 -t 00:00:04 -i file2forNew1.mp3 file2New.mp3
ffmpeg.exe -ss 00:00:04 -vsync 0 -t 00:00:05 -i file3.mp3 file2End.mp3
ffmpeg -i file3.mp3 -i file2End.mp3 -filter_complex amix=inputs=2:duration=first:dropout_transition=0 file3New.mp3
ffmpeg -i file1New.mp3 -qscale 0 inputfile_01.mpg
ffmpeg -i file2New.mp3 -qscale 0 inputfile_02.mpg
copy /b "inputfile_01.mpg"+"inputfile_02.mpg" "inputfile_all.mpg"
ffmpeg -i file3New.mp3 -qscale 0 inputfile_05.mpg
copy /b "inputfile_all.mpg"+"inputfile_05.mpg" "inputfile_al2.mpg"
ffmpeg -i inputfile_al2.mpg -qscale 0 file5.mp4
ffmpeg -i file5.mp4 -map 0:a result.mp3
https://medium.com/abraia/basic-video-editing-for-social-media-with-ffmpeg-commands-1e873801659