VideoHelp Forum




+ Reply to Thread
Results 1 to 16 of 16
  1. I'm going crazy with this aspect ratio business using vdubmod/xvid to encode a DVD to avi AND keep the correct aspect ratio. Example, a DVD I ripped that has 2.35:1 aspect ratio.

    filter>null trans>crop then I cropped out the black bars to give a video of 720x366
    After encoding to xvid avi file and playing it in mplayer with this command:

    mplayer video.avi

    the resulting picture is not correct at all (squished) and I get this output
    Code:
    AVI file format detected.
    AVI_NI: No audio stream found -> no sound.
    AVI: No audio stream found -> no sound.
    VIDEO:  [XVID]  720x366  24bpp  23.976 fps  1433.1 kbps (174.9 kbyte/s)
    Clip info:
     Software: VirtualDubMod 1.5.10.2 (build 2542/release)
    ==========================================================================
    Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
    Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
    ==========================================================================
    Audio: no sound
    Starting playback...
    VDec: vo config request - 720 x 366 (preferred colorspace: Planar YV12)
    VDec: using Planar YV12 as output csp (no 0)
    Movie-Aspect is 1.50:1 - prescaling to correct movie aspect.
    VO: [directx] 720x366 => 720x480 Planar YV12
    Notice that it thinks the aspect ratio is 1.50:1

    If play the movie like this:

    mplayer -aspect 235:100 video.avi

    it looks great and gives this output:
    Code:
    AVI file format detected.
    AVI_NI: No audio stream found -> no sound.
    AVI: No audio stream found -> no sound.
    VIDEO:  [XVID]  720x366  24bpp  23.976 fps  1433.1 kbps (174.9 kbyte/s)
    Clip info:
     Software: VirtualDubMod 1.5.10.2 (build 2542/release)
    ==========================================================================
    Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
    Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
    ==========================================================================
    Audio: no sound
    Starting playback...
    VDec: vo config request - 720 x 366 (preferred colorspace: Planar YV12)
    VDec: using Planar YV12 as output csp (no 0)
    Movie-Aspect is 2.35:1 - prescaling to correct movie aspect.
    VO: [directx] 720x366 => 860x366 Planar YV12
    Notice that now the aspect ratio is correct since I forced it.

    My question is, how can I "hard code" this 2.35:1.00 aspect ratio into the avi file such that I don't have to issue the -aspect 235:100 switch when playing it with mplayer?
    http://encoding.n3.net <-- for all your DVD and CD backup needs!
    Quote Quote  
  2. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Tried MPEG4 Modifier ?
    Quote Quote  
  3. I'll give that a try, thanks for the suggestion. Do you or does anyone else know how do accomplish this natively from within vdmod?
    http://encoding.n3.net <-- for all your DVD and CD backup needs!
    Quote Quote  
  4. Note that the AVI container does not support Display Aspect Ratios. The DAR of an MPEG4 file is private data in the Xvid stream. Not all players and not all decoders will support it. I don't know about mplayer. Media Player Classic supports MPEG4 DAR (at least with some of its AR settings). The Divx decoder doesn't. The Xvid decoder does (recent ones anyway). You need to use both a decoder and a player that support MPEG4 DAR.
    Quote Quote  
  5. And if you have a standalone DVD/MPEG-4 player, the chances are good that it doesn't support AR signalling anyway. Why not just resize it when done cropping to 640x272 or 720x304 or some such?

    Notice that it thinks the aspect ratio is 1.50:1

    Because that's what it is at that point.
    Quote Quote  
  6. Originally Posted by manono
    Notice that it thinks the aspect ratio is 1.50:1Because that's what it is at that point.
    I don't understand that... I cropped a 720x480 to 720x366 which comes out to about 1.97:1. mplayer converts it (somehow) to 720x480 which gives the 1.5:1... how and why is it doing that?


    [quote="manono"]Why not just resize it when done cropping to 640x272 or 720x304 or some such?[/code]

    I tried that.

    1) crop to 720x366
    2) lanzo resize to 720x304

    When I play that resulting file w/ mplayer, the video is stretched and here is the output:
    Code:
    Playing d:\crop and resize.avi.
    AVI file format detected.
    AVI_NI: No audio stream found -> no sound.
    AVI: No audio stream found -> no sound.
    VIDEO:  [XVID]  720x304  24bpp  23.976 fps  815.2 kbps (99.5 kbyte/s)
    Clip info:
     Software: VirtualDubMod 1.5.10.2 (build 2542/release)
    ==========================================================================
    Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
    Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
    ==========================================================================
    Audio: no sound
    Starting playback...
    VDec: vo config request - 720 x 304 (preferred colorspace: Planar YV12)
    VDec: using Planar YV12 as output csp (no 0)
    Movie-Aspect is 1.50:1 - prescaling to correct movie aspect.
    VO: [directx] 720x304 => 720x480 Planar YV12
    V:   1.1  28/ 28  4%  0%  0.0% 0 0
    Exiting... (Quit)
    Again, why does it use the aspect ratio of 1.5:1? You can see it scale to 720x480. If I force it to use 2.35:1 (with the mplayer -aspect 235:100 flag) it plays just fine.
    http://encoding.n3.net <-- for all your DVD and CD backup needs!
    Quote Quote  
  7. Here's another question. When I play the VOB right off the DVD with mplayer, why does mplayer scale the video to 854x480?

    Code:
    MPEG-PS file format detected.
    VIDEO:  MPEG2  720x480  (aspect 3)  29.970 fps  6750.0 kbps (843.8 kbyte/s)
    ==========================================================================
    Opening audio decoder: [liba52] AC3 decoding with liba52
    Using 3DNowEx optimized IMDCT transform
    AC3: 1.0 (mono)  48000 Hz  192.0 kbit/s
    Using MMX optimized resampler
    AUDIO: 48000 Hz, 2 ch, s16le, 192.0 kbit/12.50% (ratio: 24000->192000)
    Selected audio codec: [a52] afm: liba52 (AC3-liba52)
    ==========================================================================
    ==========================================================================
    Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough
    VDec: vo config request - 720 x 480 (preferred colorspace: Mpeg PES)
    Could not find matching colorspace - retrying with -vf scale...
    Opening video filter: [scale]
    The selected video_out device is incompatible with this codec.
    Try adding the scale filter, e.g. -vf spp,scale instead of -vf spp.
    VDecoder init failed :(
    Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder libmpeg2-v0.4.0b
    Selected video codec: [mpeg12] vfm: libmpeg2 (MPEG-1 or 2 (libmpeg2))
    ==========================================================================
    AO: [dsound] 48000Hz 2ch s16le (2 bytes per sample)
    Starting playback...
    VDec: vo config request - 720 x 480 (preferred colorspace: Planar YV12)
    VDec: using Planar YV12 as output csp (no 0)
    Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
    VO: [directx] 720x480 => 854x480 Planar YV12
    A:5882.7 V:5883.2 A-V: -0.448 ct: -0.023  15/ 12 ??% ??% ??,?% 0 0
    demux_mpg: 24000/1001fps progressive NTSC content detected, switching framerate.
    
    A:5884.3 V:5884.6 A-V: -0.260 ct: -0.164  49/ 46  6%  9%  0.0% 0 0
    Exiting... (Quit)
    http://encoding.n3.net <-- for all your DVD and CD backup needs!
    Quote Quote  
  8. Because the Display Aspect Ratio is 16:9. To get a 16:9 picture on a square pixel computer display requires an 854x480 window.
    Quote Quote  
  9. OK... so how can I account for this when encoding to xvid? Resize to 854x480? What about using the 16:9 DAR in the codec?
    http://encoding.n3.net <-- for all your DVD and CD backup needs!
    Quote Quote  
  10. You can resize to any 16:9 frame size and use square pixel encoding, or you can use any frame size you want and use XVID's Display Aspect Ratio setting. But not all players support XVID DAR so the latter method won't always play right.
    Quote Quote  
  11. I get it... I have found the following to work:

    1) crop out black bars
    2) resize to a frame that is consistent w/ the DVD AR and encode in vdmod
    3) apply the 16:9 display AR setting in mpeg-4 modifier and save the resulting avi

    That works! I don't see why I can't simply roll step 3 into vdmod. I have messed with the pixel sizes (selected 16:9) but the resulting movie AR according to mplayer is still 1.5:1.0 regardless of the my custom setting in the xvid codec.
    http://encoding.n3.net <-- for all your DVD and CD backup needs!
    Quote Quote  
  12. Can one (or all) of you guys read my post here and give me your opinions?

    Thanks!
    http://encoding.n3.net <-- for all your DVD and CD backup needs!
    Quote Quote  
  13. Originally Posted by Baldrick
    @Baldrick: do you know of an application that works on mkv files directly? I can manually go through and load up the mkv in vdmod, demux the audio and save as AVI. I then apply MPEG4 Modifier, add the audio, and finally save as mkv. I'm hoping there's something out there that'll allow me to simply add the DAR to the mkv. Anyone?
    http://encoding.n3.net <-- for all your DVD and CD backup needs!
    Quote Quote  
  14. Member nbarzgar's Avatar
    Join Date
    Sep 2004
    Location
    Austria
    Search Comp PM
    Late reply, of course, but still might be useful to some:

    Generally to get the aspect ratio of an .avi-file right during/before encoding, try Aspect. Nice little app that shows the desired resolutions for different kinds of aspect ratio, i.e. you set in it's small very simple window
    a) aspect ratio of file/movie, as desired, esp. useful if the existing file is stretched/contorted in any way
    b) the desired multiplier, e.g. in many cases DiVX/XViD/mpeg4-encoders (depends on versions) only allow resolutions that may be divided by 4
    c) have it show you the best possible resolutions and filter those, e.g. show only 100% correct ARs or allow for slight errors (it also shows the percentage of aberration).

    examples:
    a.
    b.
    Quote Quote  
  15. Member mats.hogberg's Avatar
    Join Date
    Jul 2002
    Location
    Sweden (PAL)
    Search Comp PM
    But keep in mind that AVI doesn't have a (P)AR like mpg (where the video can have "any" resolution but still be displayed at 16:9 or 4:3) - even if some video codecs usable in AVI container do support this.
    Some players (hard and soft) check this - some don't. For AVI, square (1:1) pixels is the only safe setting.

    /Mats
    Quote Quote  
  16. I have since solved this problem using MeGUI. The solution is to simply use the anamorphic resizing option. I wrote a guide on this that resides on my webpage (link in sig).
    http://encoding.n3.net <-- for all your DVD and CD backup needs!
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!