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
Notice that it thinks the aspect ratio is 1.50:1Code: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
If play the movie like this:
mplayer -aspect 235:100 video.avi
it looks great and gives this output:Notice that now the aspect ratio is correct since I forced it.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
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?
+ Reply to Thread
Results 1 to 16 of 16
-
http://encoding.n3.net <-- for all your DVD and CD backup needs!
-
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! -
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.
-
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. -
Originally Posted by manono
[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)
http://encoding.n3.net <-- for all your DVD and CD backup needs! -
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! -
Because the Display Aspect Ratio is 16:9. To get a 16:9 picture on a square pixel computer display requires an 854x480 window.
-
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! -
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.
-
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! -
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! -
Originally Posted by Baldrickhttp://encoding.n3.net <-- for all your DVD and CD backup needs!
-
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. -
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 -
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!
Similar Threads
-
changing aspect ratio flag inside xvid avi's, flexibly
By vhelp in forum ProgrammingReplies: 5Last Post: 1st Feb 2012, 19:56 -
how to get correct aspect ratio when adding subs to avi file using auto GK
By neds81 in forum SubtitleReplies: 5Last Post: 29th Dec 2009, 18:01 -
Manually altering flag to correct aspect ratio error...
By Board Room in forum DVD & Blu-ray RecordersReplies: 1Last Post: 11th Aug 2008, 06:26 -
how to correct the aspect ratio of AVI
By edong in forum Authoring (DVD)Replies: 4Last Post: 17th Jul 2008, 18:04 -
how to add the correct aspect ratio flag in both an mkv and mp4 container
By graysky in forum DVD RippingReplies: 2Last Post: 22nd Sep 2007, 13:18