Advertisement
theitd

Useful ffmpeg commands

Aug 29th, 2018
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.10 KB | None | 0 0
  1. # useful ffmpeg cmds
  2. brew install ffmpeg $(brew options ffmpeg | grep -vE '\s' | grep -- '--with-' | tr '\n' ' ')
  3.  
  4. # convert audio stream to mp3
  5. ffmpeg -i input.mkv -map 0 -c copy -c:a libmp3lame -ac 2 output.mkv
  6.  
  7. # merge multiple AVIs to one
  8. for f in $PWD/*.avi;do echo "file '$f'" >> mylist.txt; done
  9. ffmpeg -f concat -i mylist.txt -c copy output.avi
  10.  
  11. # 2x normal speed (timelapse)
  12. ffmpeg -i output.avi -r 16 -q:v 1 -filter:v "setpts=0.5*PTS" sped-upx2.avi
  13. # 4x normal speed
  14. ffmpeg -i output.avi -r 16 -q:v 1 -filter:v "setpts=0.25*PTS" sped-upx4.avi
  15.  
  16. # WebM conversion
  17. ffmpeg -i IN -f webm -vcodec libvpx -acodec libvorbis -b:v 0 -crf 22 -s 640x360 OUT.webm
  18. ffmpeg -i ./INPUT.avi -f webm -vcodec libvpx -acodec libvorbis -b:v 0 -crf 22 -s 640x360 OUTPUT.webm
  19.  
  20. # Master command from AVI to WebM/MP4 with speed x4
  21. ffmpeg -i output.avi -r 16 -q:v 1 -filter:v "setpts=0.25*PTS" -f webm -vcodec libvpx -acodec libvorbis -b:v 0 -crf 22 -s 640x360 OUTPUT.webm
  22. ffmpeg -i output.avi -r 16 -q:v 1 -filter:v "setpts=0.25*PTS" -profile:v baseline -vcodec libx264 -pix_fmt yuv420p -b:v 0 -crf 22 -s 640x360 OUTPUT.mp4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement