Skip to content

ffmpeg

Cropping video with ffmpeg

What didn't work:

ffmpeg -ss 00:08:05 -t 00:09:34 -i file.mp4 -pix_fmt yuv420p toji.mp4

What worked:

ffmpeg -ss 00:08:05 -to 00:09:34 -i file.mp4 -pix_fmt yuv420p toji.mp4

It should be ss which stands for start time and to which stands for end time.

What took the least amount of time:

ffmpeg -ss 00:08:05 -to 00:09:34 -i file.mp4 -pix_fmt yuv420p -c copy toji.mp4

Burning subtitles to video

ffmpeg -ss 00:30:53 -to 00:31:11 -copyts -i "/home/vector/media/Season 6/The Sopranos S06E19 The Second Coming.mkv" -ss 00:30:53 -to 00:31:11 -vf subtitles="/home/vector/media/Season 6/The Sopranos S06E19 The Second Coming.srt" -pix_fmt yuv420p out.mp4

One image + audio

source: https://trac.ffmpeg.org/wiki/Slideshow#Addingaudio

ffmpeg -loop 1 -i brutedeforce.jpg -i 'Absurdity of goals [1DXxyjoppWnKM].m4a' -c:v libx264 -c:a copy -shortest -pix_fmt yuv420p out2.mp4

Comments