Rotating videos with FFmpeg

Rotate 90 clockwise: ffmpeg -i in.mov -vf “transpose=1” out.mov For the transpose parameter you can pass: 0 = 90CounterCLockwise and Vertical Flip (default) 1 = 90Clockwise 2 = 90CounterClockwise 3 = 90Clockwise and Vertical Flip Use -vf “transpose=2,transpose=2” for 180 degrees. Make sure you use a recent ffmpeg version from here (a static build will … Read more

FFMPEG (libx264) “height not divisible by 2”

The answer to the original question should not scale the video but instead fix the height not divisible by 2 error. This can be achieve using this filter: -vf “pad=ceil(iw/2)*2:ceil(ih/2)*2” Full command: ffmpeg -i frame_%05d.jpg -vcodec libx264 \ -vf “pad=ceil(iw/2)*2:ceil(ih/2)*2” -r 24 \ -y -an video.mp4 Basically, .h264 needs even dimensions so this filter will: … Read more

Vertically or horizontally stack (mosaic) several videos using ffmpeg? [closed]

Use the vstack (vertical), hstack (horizontal), or xstack (custom layout) filters. It is easier and faster than other methods. Combine/stack two videos or images Vertical Using the vstack filter. ffmpeg -i input0 -i input1 -filter_complex vstack=inputs=2 output Videos must have the same width. Horizontal Using the hstack filter. ffmpeg -i input0 -i input1 -filter_complex hstack=inputs=2 … Read more