PDA

View Full Version : Help on MeGUI Encode of Chronicles of Narnia


divin1ty
4th April 2009, 10:44
Help!

So it has been a while since I have been on here. I posted a guide not to long ago and my sincere apologies for not responding. Things have happened in my life that has changed everything and I have had very little time to be online.

Here is the problem. I am encoding my entire movie collection and the last 11 went perfect, some with subtitles too. Anyway, I am trying to encode Chronicles of Narnia: The Lion, The Witch and The Wardrobe with the same settings I use for all my movies. Here are the settings I use:

Filesize: 1/3 DVD

Splitting: Don't split

Output Resolution: 640

Autocrop: checked

Signal AR: checked

Avisynth template: default settings

Avisynth Extra Setup: Resize Filter checked and set to "Spline64 (Sharp)", Noise filter checked and set to "Minimal Noise", "Colour Correction" checked, Clever (TM) anamorphic encoding checked and set to "Resize to mod16", all other settings as default

x264: program --pass 2 --bitrate 600 --stats ".stats" --level 3 --ref 5 --mixed-refs --no-fast-pskip --no-cabac --partitions p8x8,b8x8,i4x4,p4x4 --vbv-bufsize 768 --vbv-maxrate 2000 --me umh --threads auto --thread-input --progress --no-psnr --no-ssim --output "output" "input"

audio codec: Nero AAC-LC, "Apply Dynamic Range Compression" checked, Output Channels set to "Downmix multichannel to Stereo", SampleRate set to "Keep Original", "Normalize Peaks to" checked and set to 100, "Constant Bitrate" selected and set to "160 kbit/s"

Container type: MP4

Track 1 input: AC-3-6 channels / 48.0 KHz / English

Track 2 input: None

Chapter File: From DVD Decrypter "Chapter Information - OGG"

AR: Auto-detect later

Automatic Deinterlacing: checked

Okay here is what happens, and only with this movie. Once the encode is finished I check the log file and there is no errors what so ever. I play the MP4 and it is exactly 2 seconds off from start to finish. So I play the original VOB files from the DVD and they play fine using Nero Showtime, VLC, Media Player Classic and KMPlayer. I play the VOB files after being ripped from DVD Decrypter in all the same players and they play fine.

I even went as far as to encode my ripped VOB files using Handbrake with all the same settings and it plays fine. And here are the settings from Handbrake...

-i "C:\Users\nathan\Desktop\VIDEO_TS" -t 1 -c 1-25 -f m4v -I -X 640 -l 320 -e x264 -S 1493 -2 -a 1 -E faac -B 160 -R 48 -6 stereo -D 2.5 --markers="C:\Users\nathan\AppData\Local\Temp\VIDEO_TS-1-chapters.csv" -x level=30:bframes=0:cabac=0:ref=5:vbv-maxrate=1500:vbv-bufsize=2000:analyse=all:me=umh:no-fast-pskip=1:mixed-refs=1:8x8dct=1 -v

But, 2 seconds worth of black frames have been inserted, every time, into the MeGUI encode and I cannot for the life of me figure out why. I know it is not in the muxing, because even in the encode, the x264 extension (example_of_movie.264) has the added black frames and is 2 seconds off as well. Just to make sure I was not just going crazy, I opened the file built from Handbrake and the file from MeGUI in Avidemux 2.5 and notice more black frames in the beginning were added into the MeGUI MP4 and it shows more total frames than the file from Handbrake. And it also shows 2 more seconds being added in the MeGUI file than the file from Handbrake.

What could be causing this? I do not recall this happening in the past with an older version of MeGUI when I encoded this movie, but now I am using 0.3.1.1023 and all updates available. I am also using the latest Nero AAC encoder as found on their website.

For further info on my system see below:
Windows Vista Premium Edition x86 SP1 (6.0.65536.6001)
Framework: 2.0 SP1 (2.0.50727.3053
CPU: AMD Turion 64X2 Mobile Technology TL-64

Again, this is the only movie this happens to and there is no errors found within the log file (it shows it was successful) and as mentioned before my original DVD VOB files, the ripped VOB files and the final encode from Handbrake all play fine, But the x264 extension (example_of_movie.264), before muxing, in MeGUI is inserting extra black frames into the beginning of the movie which causes the Audio to be 2 seconds ahead of everything from the start of the movie to the finish when everything gets muxed together, but it is not in the mux the problem is occuring, just the x264 file before mux. So when I add the audio, because there are added black frames to the movie it throws my audio off by exactly 2 seconds. Sorry for repeating myself, it is late.

Thanks,
Nathan :)

RyaNJ
4th April 2009, 16:13
You should be careful, this may be in violation of rule 6 (http://forum.doom9.org/forum-rules.htm).

Inspector.Gadget
4th April 2009, 16:45
Post your AVS Script.

divin1ty
4th April 2009, 20:36
As mentioned this is my own private collection of movies that I am encoding, and they will be placed on my ipod. These are not rentals or borrowed movie titles. It is illegal to encode such movies to your ipod if you are not the owner of the movie. On a more personal note this is just simply not right to do and the guilt that I would feel for doing something wrong is not worth it. Besides I would have to answer for that someday. Back to the issue, but I do appreciate your concerns. I either encode straight from my DVD or put it on my hard drive first using DVD Decrypter because I like the option to make it all one VOB file and this is also where I get my chapter information from. And it also saves on wear and tear on the DVD drive. I just don't like the thought of my DVD drive working for over 6 hours at a time.

Maybe there is a way I could just delay the audio from starting, since there are extra black frames in the beginning, so that the audio will start 2 seconds later. Most of the time I just use OneClick Encoder, but for this movie I have tried to do everything manually as well and add the delay on the input screen after the D2V and AVS files have been loaded and saved to the input screen. This method has not worked for me. So after the .264 video file and audio files have been created I do a MP4 mux and try to add the delay at this point, and still no change in the audio delaying. Am I doing something wrong or is there a better way to try and make the audio start 2 seconds later? Any help would be greatly appreciated as all of this will eventually get put into the MeGUI I have been trying to keep updated.

Thanks,
Nathan

divin1ty
4th April 2009, 20:39
# Set DAR in encoder to 29 : 12. The following line is for automatic signalling
global MeGUI_darx = 29
global MeGUI_dary = 12
DGDecode_mpeg2source("C:\Users\nathan\Desktop\VIDEO_TS\Desktop.d2v", info=3)
ColorMatrix(hints=true, threads=0)
#deinterlace
crop( 0, 56, 0, -62)

Spline64Resize(640,320) # Spline64 (Sharp)
Undot() # Minimal Noise

divin1ty
4th April 2009, 20:51
Also, what I find interesting is when the D2V file was created I find a file titled VTS_01_1.d2v, VTS_01_1.fix.txt and VTS_01_1.d2v.bad. The supposed bad D2V, when I analyze the film, shows as partial film and gives me options to deinterlace it with. The corrected D2V file, when I analyze the film, shows progressive. But, both of these files have the same result when I use them to encode the movie. Nothing changes if I use the supposed bad D2V file or the corrected one when all is said and done. But, just in case this info is needed, here is the .txt info from the correction.

D2V Fix Output

Field order transition: 0 -> 2
d00 5 0 63488 0 3 1 b0 b0 90 a0
d00 5 0 75776 0 4 1 d2 f2 e2 f2 f2 e2 f2 f2 e2 f2 f2 e2 f2 f2 e2
corrected...
d00 5 0 63488 0 3 1 b0 b0 90 a1
d00 5 0 75776 0 4 1 d2 f2 e2 f2 f2 e2 f2 f2 e2 f2 f2 e2 f2 f2 e2

Inspector.Gadget
4th April 2009, 21:00
Divin1ty, MeGUI will automatically create a "d2v.bad" when on the first creation of the .d2v file it detects that the stream is greater than a certain percentage (typically 95%) film, and then create the normal d2v file by forcing film on a second pass. The reason they turn out the same is because you're IVTCing the first one in Avisynth down to 23.976fps and the second one is 23.976fps anyway as a consequence of forcing film. You should generally use the one that isn't marked bad, as not needing to IVTC in Avisynth will speed up your encoding.
Edit: Incorrect, see below. Sorry.

If you're not having good luck with the automatic force film option, try this: Open your VOB(s) with DGIndex manually (it's in the MeGUI tools folder), and make sure under "Video" -> "Field Operation" that you have it set to "Honor pulldown flags". Go to File -> Save Project... and wait for it to complete. Open the resulting D2V in MeGUI's AVS Script Creator and then use "Analyse" to automatically detect the field older and interlacing pattern. In the present case, you'll probably get "Hybrid Film/Interlaced (mostly film)" and be presented with an option to use TIVTC (with settings automatically set to use blend decimation on the few video sections). Try encoding that script and see if you have any problems.

divin1ty
5th April 2009, 00:45
It is encoding at the moment, but here is what has happened so far. I added all the VOB files directly into DGIndex and made sure it said "honor Pulldown Flags", then went to save the project. I was prompted with the following message so I chose "yes":

A field order transition was detected.
It is not possible to decide automatically if this should be corrected.
Refer to the DGIndex Users Manual for an explanation.
You can choose to correct it by hitting the Yes button below or
you can correct it later using the FixD2V tool.

Correct the field order transition?

--------------------------------------------------------------

Below is the information of the DGIndex file:

Stream Type: MPEG2 program
Profile: main@main
Frame Size: 720x480
Aspect Ratio: 16:9 [3]
Frame Rate: 29.970030 fps
Video Type: Film 99.97%
Sequence: Field/Frame
Frame Struct: Frame
Frame Type: progressive
Coding Type: B
Colorimetry: BT.470-2 B,G
Coded #: 205807
Playback #: 2
Frame Rpts: 0
Field Rpts: 0
Vob Cell ID: 10 and 1

--------------------------------------------------------------

As before here is the D2V info within the text, which is identical to what it was with my first method.

D2V Fix Output

Field order transition: 0 -> 2
d00 5 0 63488 0 3 1 b0 b0 90 a0
d00 5 0 75776 0 4 1 d2 f2 e2 f2 f2 e2 f2 f2 e2 f2 f2 e2 f2 f2 e2
corrected...
d00 5 0 63488 0 3 1 b0 b0 90 a1
d00 5 0 75776 0 4 1 d2 f2 e2 f2 f2 e2 f2 f2 e2 f2 f2 e2 f2 f2 e2

-------------------------------------------------------------

I load the saved file into the AVS Script Creator and I get the following when I analyse as default before making any changes:

Source Type: Partially Film
Field Order: Bottom Field First
Deinterlace: TIVTC

The AVS Script is also as follows from this new DGIndex D2V:

# Set DAR in encoder to 29 : 12. The following line is for automatic signalling
global MeGUI_darx = 29
global MeGUI_dary = 12
DGDecode_mpeg2source("C:\Users\nathan\Desktop\VIDEO_TS\VTS_07_1.d2v", info=3)
ColorMatrix(hints=true, interlaced=true, threads=0)
tfm(order=0).tdecimate(hybrid=1)
crop( 0, 56, 0, -62)

Spline64Resize(640,320) # Spline64 (Sharp)
Undot() # Minimal Noise

--------------------------------------------------------------

I will post more with the final result, unless there is more I should be doing. One thing I did notice is that before, when I did not use DGIndex directly to create my D2V file, the Field Order, when analyzed in the AVS Script Creator said "Top Field First". I do not know if this could have caused the 2 seconds of black frames and audio being 2 seconds too fast, but we will see.

RunningSkittle
5th April 2009, 00:52
how did you decrypt the files? If using dvd decrypter, can you use the "split by cell id" function. Likely there are some blank cells at the beginning that are causing issues.

divin1ty
5th April 2009, 01:01
I would think this would be the issue, but this happens even when i do not decrypt the video and I use the VOB files straight from the DVD or even from a rip I made with AnyDVD. I will look into that further, but I do not think that is it.

neuron2
5th April 2009, 01:52
Divin1ty, MeGUI will automatically create a "d2v.bad" when on the first creation of the .d2v file it detects that the stream is greater than a certain percentage (typically 95%) film, and then create the normal d2v file by forcing film on a second pass. Not correct.

divin1ty
5th April 2009, 06:21
Okay,

This encode is going to take a while longer, so I will post an update in the morning.

Also, @RunningSkittle, I went ahead and used DVD Decrypter and chose "Split by Cell ID", at the very least to see what this option does. I noticed that the first two cell ID's are almost 2 seconds between the two of them. I started at the first Cell ID VOB after these two and it seemed to start right where I noticed the audio does after my encode using x264. So, maybe when you play the movie from the DVD or rip, before encoding, it sees these first two Cell ID VOB's but ignores them when playing the movie. But, the encoded version does not see it that way and it adds these cells as normal frames causing the encoded version to add extra time to the entire movie, hence my 2 second increase in the audio being out of sync.

If my current encode does not do the job, I am going to try with the Cell ID VOB version and see if by removing the first two cells before the encode it solves my problem. I will post on what I find tomorrow night.

Thanks for all the help,
Nathan

Capsbackup
5th April 2009, 07:12
If you know for sure your audio delay, you could run the audio file thru Delaycut and input the amount you want to cut/add. Then you could use this corrected audio file for your mux. Also, you could create an avs script of the video file, and use VirtualDub to check for the correct audio delay, just to be certain if it is 2 seconds.
EDIT:
You could also run DGIndex manually on the VOB's, and advance to the start of the video to try and eliminate most ( it is not frame accurate ) of the blank black frames in the beginning, and set the "mark in" . Or set a start value in your avs script ( trim(60,102500)), to eliminate the 2 seconds of black in the beginning. Testing with audio delays would be a quicker resolve and avoid reencoding the video though.

divin1ty
6th April 2009, 05:34
Okay,

First, by using DGIndex within the tools folder to create the D2V file, this method did not work. I still had an exact 2 seconds off from start to finish.

BUT, thanks to RunningSkittle, I went ahead and ripped my DVD using DVD Decrypter with the "By Cell ID" option. Then, when the rip was finished I examined all the Cell ID VOB's and found two that were blank. The two Cell ID VOB's I noticed that were blank I deleted. I then used VobMerge 2.5.0 to merge the remaining Cell ID VOB's into one VOB file and proceeded to use MeGUI as I always have. The final mux just finished and I tested the mp4 file. Everything is exactly in sync from start to finish and ended up being a perfect encode. My ipod will like that.:)

Anyway, this is good to know as it is a great work around to solve audio sync issues. I know some audio sync issues progress throughout the movie, but for this type of sync issue it ended up being two Cell ID's that on the original DVD it did not matter, but the encode did not distinguish this and treated it as a normal frame adding extra frames that should not have been there. So, to recap, in this case, you have to rip the DVD to the hard drive "By Cell ID", then remove the blank Cell ID's not being used...in my case the two were 24kb in size each. Then use VOBMerge 2.5.0 to merge all the Cell ID's together and run MeGUI as normal.

Thanks for all the help,
Nathan

Inspector.Gadget
6th April 2009, 05:52
I don't know for a fact, but I think you can do this

http://img12.imageshack.us/img12/7726/cells.png (http://img12.imageshack.us/my.php?image=cells.png)

to avoid having to deal with the problem in the future. At least, I've always left it checked and never had problems with blank cells.

RunningSkittle
6th April 2009, 13:10
I have this problem with a few of my dvds, mostly anime and specifically i know my neighbor totoro has this problem. the "uncheck suspect cells" AND using anydvd do not help.

I only discovered this problem after many hours of trying to sync the subs and audio.

There are two 24kb cells that just mess everything up:
http://deep.phpwebhosting.com/~mactownkrisp/computer/VTS_07_VOBID_003_CELLID_001_1.VOB
http://deep.phpwebhosting.com/~mactownkrisp/computer/VTS_07_VOBID_004_CELLID_001_1.VOB

Skipping these two cells fixes the timing issues.

divin1ty
6th April 2009, 16:01
@RunningSkittle

The "Uncheck suspect Cell" option in DVD Decrypter and using "AnyDVD HD", that I recently purchased, also do not solve this problem for me. I love those two programs, and pair them with MeGUI and all my backups of my movie collection to my computer or ipod so I can view them via our home entertainment system, has been great. I just don't like using my DVD drive anymore. I have had to replace too many of them due to them just wearing down, so that is why I am putting all my movies onto my harddrive and also on my ipod.

Anyway, I just found it strange that this is the only movie this does it to. And now that I have thought about it, I never did get this movie properly encoded in the past, I just used Nero Recode, of which I have left all together for MeGUI as of now. The reason why I did not think of ripping the movie to my hard disk using the "By Cell ID" option is

#1 I forgot about that option
#2 because the DVD or ripped VOB's never revealed this issue when I was testing and playing them before the encode.

All this has definitely been a learning process. The guide that I did put out a while ago is being dumb"ed" down so beginners will have no trouble using MeGUI as well. This experience is a good one to put in the troubleshooting section.

Thanks for everyone's help,
Nathan

Inspector.Gadget
6th April 2009, 17:24
Weird. I'll have to pick up Chronicles of Narnia and find out what the situation is. This is just the normal US NTSC release? Special Edition or anything?