0

I have a MPEG-4 Simple Profile video with size 720x288, pixel aspect ratio of 2:21:1 (ffmpeg says SAR 1:1, DAR 5:2). I'm trying to use the command I usually use to convert it do DVD format:

ffmpeg -i inputfile.avi -target pal-dvd outputfile.mpg

This produces a 720x576 video which plays fine with video players on the PC. But when I try to burn this to a DVD (with 16:9 aspect ratio), the image is stretched. Playing around with VLC, I understand the video has a pixel aspect ratio of 2:21:1, so when reproduced at 16:9 images are vertically stretched.

I would have expected "-target pal-dvd" to fix this automatically, but it does not. I read some information on the Internet and I think the key is about setting the correct sar/dar, but I tried some combination and I was not able to obtain the result I want, probably because I don't perfectly understand the logic to determine the right values to set. It's fine for me to have black bands over and below the image, but the video aspect ratio must be preserved, of course.

By the way, I'm getting the same results with avconv instead of ffmpeg.

Thanks in advance.

1

Having seen the sample, this is the command

ffmpeg -i in.avi -vf pad=720:576:0:144,setdar=4/3 -target pal-dvd out.mpg

The video is square-pixel, so scaling is not required. The frame should be treated as 4:3, not 16:9 (which isn't the right ratio for this movie anyway).


For widescreen playback in the PAL standard, your rendered raster has to be 1024x576. So,

ffmpeg -i in.avi -vf scale=1024:288,pad=1024:576:0:144 -target pal-dvd out.mpg

scale=1024:288 --> the video is scaled to the final display width.

pad=1024:576:0:144 --> vertical pixels are added to make it to 1024x576.

-target pal-dvd --> this will rescale the video to 720x576 and set a DAR of 16:9.

  • This indeed fixes the aspect ratio, although I'm not sure which step actually does this. But this produces a DVD with black bands on both sides, as well as on top and bottom. Indeed it's not very clear to me why I should pass through the 1024x288 resolution, which I expect it to stretch the image even further. And how it is possible that the final scale from 1024x576 to 720x576 does not warp the video. – Mauro Molinari Jun 1 '17 at 19:42
  • I must correct myself: the side bands disappear if I force 16:9 aspect ratio in my video player (VLC). So I think I also have to set the DAR to get the resulting video declaring itself as 16:9. However, forcing 16:9 shows that the resulting video is actually stretched horizontally. Also, it seems like I obtain the exact same result as you if I skip the first scaling to 1024x288, and hence if I use: ffmpeg -i in.avi -vf pad=720x576:0:144 -target pal-dvd out.mpg. – Mauro Molinari Jun 1 '17 at 19:52
  • Add setsar=1 after the pad in my command and check. – Gyan Jun 1 '17 at 19:55
  • If I add setsar=1, to your command, I do not need any more to force the aspect ratio in rhe video player to 16:9 (it is automatically detected), but the video is still stretched horizontally... People look very fat :-). – Mauro Molinari Jun 2 '17 at 19:19
  • Share a screenshot: ffmpeg -ss 300 -i in.avi -vf setsar=1 -vframes 1 out.png – Gyan Jun 2 '17 at 19:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.