FORUMS: list search recent posts

Re: Padding

COW Forums : FFmpeg

Respond to this post   •   Return to posts index   •   Read entire thread

Michael Rampe
Re: Padding
on Jul 4, 2011 at 10:35:14 pm

[Jay Patel] "I want to convert 1920x1080(16:9) .mov video to 720x526 (4:3) .mov"

Your first problem is that 720x526 IS NOT 4:3!!! (720/526=1.3688 and it should be 1.3333)
Try 768x576 which IS true 4:3.

Rounding errors become problematic very quickly in encoding.

Your second problem is the size and aspect flags outside of the filter chain. These should now be performed inside the filter chain.

I replicated your command line to get a working solution from a 1920p source.

ffmpeg -i tilt_shift_1.mp4 -vcodec libx264 -preset ultrafast -vf "scale=768:432,pad=768:576:0:72,setdar=4:3" -b 15000k

Now all scale, pad and aspect is done inside the filter chain which avoids the conflicts you were experiencing.
1. scale the 1920x1080 source to 768x432 dimensions (square pixel 16:9)
2. Pad this to the output size of 768x576
3. Set the aspect ratio to 4:3

NOTE: When using libx264 in recent versions of FFmpeg, the -vpre option has been replaced by -preset. Modify the code or update your FFmpeg as required. Also, I left out your audio options for simplicity.


Posts IndexRead Thread 

Current Message Thread:
  • Padding by Jay Patel on Jul 4, 2011 at 5:30:10 am
    • Re: Padding by Michael Rampe on Jul 4, 2011 at 10:35:14 pm

© 2018 All Rights Reserved