ffmpeg combine files

Assuming the codecs are the same you create a file (example mylist.txt):

file ‘/path/here/file1.avi’
file ‘/path/here/file2.avi’
file ‘/path/here/file3.avi’

Then pass that file to ffmpeg

ffmpeg -f concat -i mylist.txt -c copy x.avi

You can use this command to make the list:

ls *.avi | while read each; do echo “file ‘$each'” >> mylist.txt; done

to convert

ffmpeg -i example.mp4 -f webm -c:v libvpx -b:v 1M -acodec libvorbis example.webm -hide_banner
ffmpeg -f concat -i mylist.txt -f webm -c:v libvpx -b:v 1M -acodec libvorbis oupu.webm -hide_banner
ffmpeg -f concat -i mylist.txt -strict -2 -c:a aac -b:a 128k -c:v libx264 -crf 23 -y output.mp4

to add some keyframes
-x264-params keyint=15:min-keyint=15
ffmpeg -f concat -i mylist.txt -strict -2 -c:a aac -b:a 128k -c:v libx264 -x264-params keyint=15:min-keyint=15 -crf 23 -y output.mp4

ffmpeg -strict -2 -i Collection1-Video124.Kiki.mpg -preset slow -codec:a aac -b:a 128k -codec:v libx264 -pix_fmt yuv420p -b:v 2500k -minrate 1500k -maxrate 4000k -bufsize 5000k -vf scale=-1:720 -strict -2 Collection1-Video124.Kiki2.mp4

ffmpeg -i input.mpg -preset fast -strict -2 -y output.mp4
ffmpeg -i video.mp4 -c:v mpeg2video -q:v 5 -c:a mp2 -f vob video.mpg

Leave a Reply

Your email address will not be published. Required fields are marked *