PDA

View Full Version : MeGui Problem with Aspect Ratio


Lorek
22nd December 2007, 10:19
Ok so I've run into quite a strange problem here now. I'm using version 0.2.6.1043 of Megui and x264. So here's what's going on. Typically my encode process begins like this.
I start out with an Mpeg2 source. Tools -> D2V Creator and select Demux all channels. Save Queue. Start.
Next I go to Tools-> AVS Script Creator, uncheck resize as I don't want to resize and verify that the correct AR is selected in this case ITU 4:3. Save the Script and Load it into Megui. Here's where the problem comes in. Upon the script being loaded into Megui a preview window pops up. It is set to 1.5 AR (Not ITU 4:3) I then set it to ITU 4:3 and continue. I click Auto Encode, set my desired bitrate and prepare for a several hour encode. 2-3 Hours later my encode finishes up. I open up my test file and immediately see something wrong. My AR is not set by default to ITU 4:3 like I had selected but an annoying 1.5 like I had specifically changed it from.

Now besides the two preview windows and AVS Script Creator where do I need to change it so it will encode in the correct AR?

Does anyone know of an easy way to fix this aspect ratio problem without having to reencode. As I didn't catch the problem right away I've now got many movies encoded that are stuck with a default aspect ratio of 1.5 instead of 1.88 / 1.33.

showergel
29th February 2008, 01:53
I can repeat your problem over and over. My process is identical to yours. Excerpt from my log:


Job commandline: "C:\MeGUI\tools\x264\x264.exe" --crf 22 --level 4 --ref 16 --mixed-refs --no-fast-pskip --bframes 16 --b-pyramid --b-rdo --bime --weightb --direct auto --filter -2,-1 --subme 7 --trellis 2 --analyse p8x8,b8x8,i4x4,i8x8 --8x8dct --me esa --threads auto --thread-input --sar 1:1 --progress --no-dct-decimate --no-psnr --no-ssim --output "Y:\Mommie Dearest\mommie.mp4" "Y:\Mommie Dearest\mommie.avs"
avis [info]: 720x480 @ 23.98 fps (185370 frames)
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX MMXEXT SSE SSE2 SSE3 Cache64
mp4 [info]: initial delay 2002 (scale 24000)
x264 [info]: slice I:1357 Avg QP:18.79 size: 32678
x264 [info]: slice P:72963 Avg QP:20.45 size: 10217
x264 [info]: slice B:111050 Avg QP:22.07 size: 2513
x264 [info]: mb I I16..4: 16.2% 62.9% 20.9%
x264 [info]: mb P I16..4: 4.2% 13.8% 1.7% P16..4: 55.4% 14.2% 6.0% 0.0% 0.0% skip: 4.7%
x264 [info]: mb B I16..4: 0.6% 1.5% 0.1% B16..8: 28.9% 1.0% 1.5% direct: 1.7% skip:64.8%
x264 [info]: 8x8 transform intra:69.4% inter:76.2%
x264 [info]: direct mvs spatial:99.8% temporal:0.2%
x264 [info]: ref P 49.9% 17.5% 8.5% 4.8% 3.4% 3.4% 2.6% 1.6% 1.3% 1.4% 1.1% 1.2% 1.0% 1.0% 0.9% 0.7%
x264 [info]: ref B 51.8% 16.0% 7.7% 4.6% 3.4% 3.4% 2.6% 1.8% 1.4% 1.5% 1.3% 1.3% 1.1% 1.2% 1.0%
x264 [info]: kb/s:1105.9

encoded 185370 frames, 1.25 fps, 1106.00 kb/s

desired video bitrate of this job: 22 kbit/s - obtained video bitrate (approximate): 1108 kbit/s

The source is 720x480, SAR should be 32/27. But MeGUI sets the command line to --sar1:1 whereas it needs to be --sar32:27.

I can replicate this over and over and over.. the only fix I have right now is to resize it. I would rather keep the original source intact. This problem can also be replicated by using a predefined profile, not just with the auto encode option.

check
29th February 2008, 05:50
Just mux the video to MKV and add the aspect flag to the container, instead of relying on putting it into the bitstream.

showergel
3rd March 2008, 14:41
Just mux the video to MKV and add the aspect flag to the container, instead of relying on putting it into the bitstream.

While a good suggestion, I don't use MKV or have equipment other than my PC that can play MKV.

Perhaps this is just an observation, but I usually encode with a custom profile. When I tried one of the other profiles, MeGUI passed the correct SAR along to x264. Bug?

check
4th March 2008, 09:57
While a good suggestion, I don't use MKV or have equipment other than my PC that can play MKV. You should be able to set the same thing in MP4 (see mp4box+YAMB). If you use a more exotic format like TS/VOB/EVOB you'll probably need to find a proprietary program to use this method.

RsVolcom
5th March 2008, 07:57
Just mux the video to MKV and add the aspect flag to the container, instead of relying on putting it into the bitstream.

How do you add an aspect flag to the container? I mux to mkv with megui or mkvmerge. Better yet...how can I encode it into the video with megui?

check
5th March 2008, 11:47
Adding it to MKV with mkvmerge is a simple combobox selection for the video stream. It even has preset values: 4/3, 16/9, 2.35:1, etc

RsVolcom
5th March 2008, 18:51
Adding it to MKV with mkvmerge is a simple combobox selection for the video stream. It even has preset values: 4/3, 16/9, 2.35:1, etc

Thank you...apparently I can only find this checkbox on Wednesdays!

showergel
24th March 2008, 13:48
So the answer is to not rely on MeGUI to set the SAR for you since it does do it but on a hit and miss basis.

When setting up the AVISynth script, use the "Clever Anamorphic Encoding" option. If your video is already evenly divisble by 16, choose "encode to non-mod 16" (i.e. DVD's 720x480). This will set a global SAR flag that megui will pick up and send to x264, also it will not incur the resize function so it should pick up some encoding speed.

If your video isn't divisible by 16, choose the "resize to mod16" option-- there are two other options depending on how you want your output for unusual sized videos.

Good luck!

fight2win
24th March 2008, 15:31
thks for info