VideoHelp Forum
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. Member
    Join Date
    Mar 2012
    Location
    United Kingdom
    Search PM
    Hi, i'm trying to create a screenshot from a video, at the resolution the video is encoded at, however when taking the screenshot, it appears to ignore the Aspect ratios, so that the screenshot appears stretched slightly (I believe because the pixel shape is stretched?. is there any way to compensate for this within the ffmpeg command (ideally in a manner that's not specific to each individual video)?

    The command i'm using is:
    Code:
    fffmpeg -ss 00:10:00 -t 1 -i Video.ts -f mjpeg 101.jpg
    And the video's properties are:
    Code:
    Stream #0:0[0x1011]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 720x480 [SAR 8:9 DAR 4:3], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
    The aspect ratio of the screenshot I want is 4:3, when taking a screenshot with VLC (which gives me the correct aspect ratio) the resolution is: 720x540, yet the screenshot i'm getting from ffmpeg is 720x480

    Just to clarify, this is for a script, so I can't know the fixed (720x540 in this case) resolution as I could be taking screenshots from a variety of videos, so the solution can't involve specifying the fixed resolution by hand, i'd need to calcuate it using the resolution reported by FFMPEG.
    Last edited by bergqvistjl; 12th Aug 2014 at 12:07.
    Quote Quote  
  2. Technically, the proper way of scaling is the width only. So a 720x480 4:3 DVD would scale to 640x480, not 720x540. When you have interlaced sources, vertical scaling can be very tricky (you can use il flag in ffmpeg, but there are no restrictions to horizontal scaling of interlaced material)

    Code:
    -vf scale=w=(sar*iw):h=ih
    Quote Quote  
  3. Member
    Join Date
    Mar 2012
    Location
    United Kingdom
    Search PM
    Originally Posted by poisondeathray View Post
    Technically, the proper way of scaling is the width only. So a 720x480 4:3 DVD would scale to 640x480, not 720x540. When you have interlaced sources, vertical scaling can be very tricky (you can use il flag in ffmpeg, but there are no restrictions to horizontal scaling of interlaced material)

    Code:
    -vf scale=w=(sar*iw):h=ih
    So why is VLC giving me 720x540 then and not 640x480?
    Quote Quote  
  4. Originally Posted by bergqvistjl View Post
    So why is VLC giving me 720x540 then?
    Because that is how VLC chooses to display 4:3.
    Quote Quote  
  5. Originally Posted by bergqvistjl View Post
    Originally Posted by poisondeathray View Post
    Technically, the proper way of scaling is the width only. So a 720x480 4:3 DVD would scale to 640x480, not 720x540. When you have interlaced sources, vertical scaling can be very tricky (you can use il flag in ffmpeg, but there are no restrictions to horizontal scaling of interlaced material)

    Code:
    -vf scale=w=(sar*iw):h=ih
    So why is VLC giving me 720x540 then?
    Because it's doing "incorrectly." That the choice some players make. MPCHC does it that way as well. Potplayer/kmplayer will give 640x480, Quicktime as well

    Eitherway the AR is the same 640/480 = 4:3 , 720/540 = 4:3 , so in either case AR is correct. But 640w : 480h is technically "more correct" from its NTSC roots, and because of the possible interlaced issue
    Quote Quote  
Visit our sponsor! Try DVDFab and backup Blu-rays!