View Full Version : correct usage of clever anamorphic encoding - is this a bug
graysky
11th March 2007, 16:12
I read on the MeWiki that Anamorphic (http://mewiki.project357.com/wiki/Glossary#Anamorphic) means the the MAR (movie or encode AR) is different from the DAR. If I'm understanding this correctly, we encode to 720x480 but convert that via the player to whatever the correct DAR should be. So how can I verify that MeGUI is doing this calculation correctly manually?
I'd like to encode a movie that has an AR of 2.40:1 as per the back of the DVD box. When I load the d2v in the aviscript creator, I unchecked resize, but enabled cropping (removing the vertical black bars). At this point I took off a total of 64+60=124 pixels. Then checked then "Clever Anamorphic encoding" box and set it to "Resize mod16" and got this script:# Set DAR in encoder to 47 : 20. The following line is for automatic signalling
global MeGUI_darx = 47
global MeGUI_dary = 20
DGDecode_mpeg2source("D:\work\V\VIDEO_TS\VTS_01_PGC_01_1.d2v",info=3)
ColorMatrix(hints=true)
#deinterlace
crop( 0, 64, 0, -60)
Spline36Resize(720,352) # Spline36 (Neutral)
#denoise
Questions:
1) How can I manually calculate the AR for this movie to double check MeGUI's calculations?
2) If the box of the DVD says its AR is 2.40:1, why does MeGUI want to using a signaling AR of 47/20=2.35:1? Shouldn't it be 12/5 = 2.40:1?
3) Why is MeGUI wanting to resize the video to 720x352 which is an AR of 2.04:1?
I'm confused as hell by this!
graysky
11th March 2007, 16:21
I think I can answer question #1 from my first post this way if I'm understanding the math correctly, please correct me if I'm mistaken:
DAR is 16/9 (1.7778) which is hardcoded into the DVD source.
The true video aspect ratio can be calculated from this times the height or 480x1.778 = 853.44 or a total of 853x480. Now I take my cropping into consideration by taking away the 124 off the 480 like this: 480-124 = 356. I can now calculate my signal AR or "true AR" by dividing the width by height like this: 853/356=2.39 or 2.40:1 which is what the box says.
Is this right? Also, what are the answers to questions 2 and 3?
graysky
11th March 2007, 17:38
When I play the resulting file in mplayer it thinks the AR is 2.04:1 and NOT 2.40:1. Here is the output:VDec: vo config request - 720 x 352 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 2.05:1 - prescaling to correct movie aspect.
VO: [directx] 720x352 => 720x352 Planar YV12
I can get it to play correctly if I do a mplayer -aspect 12:5 movie.mkv which gives this partial output:VDec: vo config request - 720 x 352 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 2.40:1 - prescaling to correct movie aspect.
VO: [directx] 720x352 => 844x352 Planar YV12
What's going wrong with this?
nurbs
11th March 2007, 18:02
3) Why is MeGUI wanting to resize the video to 720x352 which is an AR of 2.04:1?
Because when you clicked on "Resize to mod16" you told megui to do so. It looks at what you cropped away and then resizes to the next mod16 resolution.
When I play the resulting file in mplayer it thinks the AR is 2.04:1 and NOT 2.40:1.
That seems alright as 720/352 = 2,04/1. The log also says that it is being scaled to the correct AR. Does it look right if you don't use the -aspect switch?
graysky
11th March 2007, 18:16
Because when you clicked on "Resize to mod16" you told megui to do so. It looks at what you cropped away and then resizes to the next mod16 resolution.
That makes sense.... but what should I select if I want the resulting video to play at an AR of 2.40:1?
That seems alright as 720/352 = 2,04/1. The log also says that it is being scaled to the correct AR. Does it look right if you don't use the -aspect switch?
No, if I just play it with no switches it thinks the AR is 2.04:1 which isn't right since both the movie box and my calculation show it to be 2.40:1. I don't understand what I need to do to get mplayer to play the resulting file with the correct AR (12:5 or 2.40:1) without me adding that -aspect 12:5 switch to the commandline. What are the global MeGUI_dar lines doing if mplayer ignores them?
The correct behavior of mplayer should be to see the 720x352 video and prescale by the 2.40 AR and giving an output window of 853x356.
480 x 1.778 = 853 (DAR of DVD)
720x352 is my resize so it should be: 853/2.40 = 355
Does that make sense or am I totally missing the boat?
graysky
11th March 2007, 21:18
The correct behavior of mplayer should be to see the 720x352 video and prescale by the 2.40 AR and giving an output window of 853x356.
480 x 1.778 = 853 (DAR of DVD)
720x352 is my resize so it should be: 853/2.40 = 355
Does that make sense or am I totally missing the boat?
Success!VDec: vo config request - 720 x 352 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 2.40:1 - prescaling to correct movie aspect.
VO: [directx] 720x352 => 846x352 Planar YV12
Notice the prescaling to 846x352 line. The solution to this problem was to take MeGUI out of the loop and manually set the aspect ratio from within mkvmergeGUI. I simple used 12/5 for the video stream. here is the resulting commandline it used"mkvmerge" -o "D:\work\V\trial\forced 12to5 in mkvmerge" --language 1:eng --default-track 1:yes --aspect-ratio 1:12/5 -d 1 -A -S D:\work\V\trial\megui.mkv --sync 0:0 -a 0 -D -S "D:\work\V\trial\audio.ogg" --track-order 0:1,1:0
Now the question in my mind is what the hell are the global MeGUI_darx = x and global MeGUI_dary = y good for if they don't get passed on to the muxer? Is this a bug or is this me?
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.