psychohobbit
5th May 2008, 22:23
OK, I've come to the conclusion that I'm an idiot -- because I just can NOT figure out how to properly convert DVD MPEG2 video to MP4/X264 using MeGUI in "clever anamorphic" mode. As near as I can tell, certain things simply do not work at all, and that surely cannot be right -- so please, can someone help me make sense of this?
I'll use an example to illustrate what I'm doing, as well as my thought process. Here we go...
I'm backing up my DVD of the movie "Legally Blonde". I rip the DVD using DVD Decrypter in IFO mode, extracting and demuxing the video and audio streams as well as the chapter information. For now, I only worry about the video portion.
I now have a file called VTS_09_1 - 0xE0 - Video - MPEG-2 - 720x480 (NTSC) - 16~9 - Letterboxed.m2v. MediaInfo says it's MPEG2, 720x480 with a display aspect ratio of 16/9. So far, so good.
From MeGUI, I take that file and create a .d2v file. I open the .d2v file from MeGUI, and it launches the AVS script creator and video preview window. I notice that the video is strethced vertically, which I figure is normal since the DVD is encoded anamorphically.
This movie has an aspect ratio of 2.35:1, more or less, so even at 16x9 I have black bars above and below the video. To fix this, I use MeGUI's "Auto Crop" feature, and it suggests cropping 54 pixels above and 58 below. Looks reasonable enough, no more letterboxing in the preview window. Since I started at 720x480, my video size is now 720x368. Viewed with those dimensions, the video is still stretched, which makes sense since all I've done is crop the top and bottom.
Now, I guess the easy way to eliminate the stretching is to simply resize the video. MeGUI suggests dimensions of 720x304, which very nearly matches the 2.35:1 aspect ratio of the movie. This works quite well, and I have no aspect ratio problems when I just resize the movie.
But I don't WANT to just resize the movie, because I want to keep as much picture detail as possible and going from 720x368 to 720x304 means discarding 64 rows of video.
So I select "clever anamorphic" mode with the "overcrop to mod16" option. To finish the script, I let MeGUI analyze the file and determine that it's progressive and does not need to be deinterlaced. My AVS script looks like this:
# Set DAR in encoder to 11887 : 5000. The following line is for automatic signalling
global MeGUI_darx = 11887
global MeGUI_dary = 5000
DGDecode_mpeg2source("H:\LEGALLYBLONDE\VIDEO_TS\VTS_09_1 - 0xE0 - Video - MPEG-2 - 720x480 (NTSC) - 16~9 - Letterboxed.d2v")
crop( 0, 54, 0, -58)
LanczosResize(720,368)
Undot()
OK, now is when I start to lose my mind. I notice that my DAR is being set to 11887:5000, which is pretty close to 2.35:1. This seems sensible enough to me -- I want to view the movie at the movie's actual aspect ratio. But in MeGUI's "preview AVS script" window, the video still looks stretched.
I go ahead and encode the video anyway (using the PD-PS3-Xbox360" profile), and end up with a .mp4 file. When I play that file in VLC, the video is still stretched. The aspect ratio has not changed visibly from the original MeGUI preview window.
VLC tells me that my new .mp4 file has 720x368 both for its "resolution" and its "display resolution". And when I take the .mp4 file and feed it to MediaInfo, it tells me that the "Display Aspect Ratio" is 1.957.
Why?
I mean, the AVS script explicitly set the DARX and DARY for a DAR of 2.35:1. But it looks like those values were not used for anything in the actual encoding process?
On a whim, I have tried manually editing the AVS script to use other values for DARX and DARY. I have used 16:9, 4:3, 1.77:1, and a few others. Regardless of which values I use, they have no effect whatsoever.
That is, when I encode the file I ALWAYS end up with a DAR that is derived strictly from the pixel dimensions (720/368=1.957), instead of from the DAR value specified in the AVS script.
Someone please help me understand what is going on here? Is this stuff actually broken, or am I doing something stupid?
If I can't get the anamorphic mode to work, another option might be to upscale the video to a resolution based on 1280x720 -- that way all 368 pixel rows would at least be used. But that seems like a dumb approach, honestly -- any opinions or better suggestions?
Please?!
Thanks in advance!
I'll use an example to illustrate what I'm doing, as well as my thought process. Here we go...
I'm backing up my DVD of the movie "Legally Blonde". I rip the DVD using DVD Decrypter in IFO mode, extracting and demuxing the video and audio streams as well as the chapter information. For now, I only worry about the video portion.
I now have a file called VTS_09_1 - 0xE0 - Video - MPEG-2 - 720x480 (NTSC) - 16~9 - Letterboxed.m2v. MediaInfo says it's MPEG2, 720x480 with a display aspect ratio of 16/9. So far, so good.
From MeGUI, I take that file and create a .d2v file. I open the .d2v file from MeGUI, and it launches the AVS script creator and video preview window. I notice that the video is strethced vertically, which I figure is normal since the DVD is encoded anamorphically.
This movie has an aspect ratio of 2.35:1, more or less, so even at 16x9 I have black bars above and below the video. To fix this, I use MeGUI's "Auto Crop" feature, and it suggests cropping 54 pixels above and 58 below. Looks reasonable enough, no more letterboxing in the preview window. Since I started at 720x480, my video size is now 720x368. Viewed with those dimensions, the video is still stretched, which makes sense since all I've done is crop the top and bottom.
Now, I guess the easy way to eliminate the stretching is to simply resize the video. MeGUI suggests dimensions of 720x304, which very nearly matches the 2.35:1 aspect ratio of the movie. This works quite well, and I have no aspect ratio problems when I just resize the movie.
But I don't WANT to just resize the movie, because I want to keep as much picture detail as possible and going from 720x368 to 720x304 means discarding 64 rows of video.
So I select "clever anamorphic" mode with the "overcrop to mod16" option. To finish the script, I let MeGUI analyze the file and determine that it's progressive and does not need to be deinterlaced. My AVS script looks like this:
# Set DAR in encoder to 11887 : 5000. The following line is for automatic signalling
global MeGUI_darx = 11887
global MeGUI_dary = 5000
DGDecode_mpeg2source("H:\LEGALLYBLONDE\VIDEO_TS\VTS_09_1 - 0xE0 - Video - MPEG-2 - 720x480 (NTSC) - 16~9 - Letterboxed.d2v")
crop( 0, 54, 0, -58)
LanczosResize(720,368)
Undot()
OK, now is when I start to lose my mind. I notice that my DAR is being set to 11887:5000, which is pretty close to 2.35:1. This seems sensible enough to me -- I want to view the movie at the movie's actual aspect ratio. But in MeGUI's "preview AVS script" window, the video still looks stretched.
I go ahead and encode the video anyway (using the PD-PS3-Xbox360" profile), and end up with a .mp4 file. When I play that file in VLC, the video is still stretched. The aspect ratio has not changed visibly from the original MeGUI preview window.
VLC tells me that my new .mp4 file has 720x368 both for its "resolution" and its "display resolution". And when I take the .mp4 file and feed it to MediaInfo, it tells me that the "Display Aspect Ratio" is 1.957.
Why?
I mean, the AVS script explicitly set the DARX and DARY for a DAR of 2.35:1. But it looks like those values were not used for anything in the actual encoding process?
On a whim, I have tried manually editing the AVS script to use other values for DARX and DARY. I have used 16:9, 4:3, 1.77:1, and a few others. Regardless of which values I use, they have no effect whatsoever.
That is, when I encode the file I ALWAYS end up with a DAR that is derived strictly from the pixel dimensions (720/368=1.957), instead of from the DAR value specified in the AVS script.
Someone please help me understand what is going on here? Is this stuff actually broken, or am I doing something stupid?
If I can't get the anamorphic mode to work, another option might be to upscale the video to a resolution based on 1280x720 -- that way all 368 pixel rows would at least be used. But that seems like a dumb approach, honestly -- any opinions or better suggestions?
Please?!
Thanks in advance!