Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > New and alternative video codecs

Reply
 
Thread Tools Search this Thread Display Modes
Old 9th May 2007, 06:42   #1  |  Link
homerpez
Registered User
 
Join Date: May 2007
Posts: 98
HD-DVD to h.264+ac3, sound progressively out of sync, and not the usual reason???

This one's got me baffled...

With the help of threads like THIS, I've been able to successfully demux HD-DVD and re-encode to a .mkv file, which has an h264 video stream, and 5.1 channel AC3 audio. (This is so I don't have to fumble with too many discs, I like to keep them nice and play movies off a server - but I don't like the 20GB imprint on my hard drive either.

The first movie I did, "Army Of Darkness", I encoded with the method described in the thead link above...

VIDEO: Demuxed .EVO referenced in AVS file, and that opened up in Virtualdub, using the ffdshow h264 encoder.

AUDIO: demuxed 7.1 DD+ -> Graphedit (file async->Sonic HD demuxer->Sonic Audio decoder), AVS file, and converted to 5.1 channel ac3 using BeHappy.

MUX: With mkvmerge GUI, no delay settings, just "add, add, mux".

The result was a nice, perfectly synched movie!

I then tried it the exact same way, only using my "Superman" disc (we're talking the one from the 70's) ... I also tried the Mainconcept encoder to see how it would do with VBR.

Using the exact process above, the result was audio going progressively out on sync throughout the movie! That is, it gets more and more out of sync as it plays, it's not a simple delay.

I know usually when this happens, it's often a sound stream being 48000 khz being converted to 44100khz, or vise-versa.

The problem is, and I checked, the source DD+ AND the resulting AC3 stream are both 48000khz. In addition, the frame numbers in both AVS scripts are exactly the same. So both streams should at least play at the same rate??? (At least the way I understand it.)

I tried muxing and re-muxing, setting framerates manually again... nothing seems to want to fix this one. Just for kicks, I even tried to resample the stream to 44100khz to see if that made a difference, and it's still progressively out of sync!

So, I'm starting to wonder if something is off with the video... I put in the correct number of frames, and the correct framerate into the Mainconcept encoder, but possibly that's not enough...

Here's my scripts, if that helps:

VIDEO:

DirectShowSource ("C:\temp\TEST\PEVOB_1_PEVOB_2.rebuilt.EVO", video=true, audio=false, fps=23.976, framecount=217843, seek=true, seekzero=false)
spline36resize(1280,720)
Crop(0,96,0,-96)
ConvertToYV12 ()

AUDIO:

Directshowsource("C:\temp\TEST\AUDIO.GRF",audio=true,video=false,fps=23.976,framecount=217843)

The only thing I can think of is, does it matter what kind of stream you encode video to? Such as program, transport, etc? or would that have nothing to do with this?

I'm completely out of ideas, so I'm hoping someone else ran across this and has solved it... thanks for any help in advance!

Last edited by homerpez; 9th May 2007 at 06:54.
homerpez is offline   Reply With Quote
Old 9th May 2007, 07:39   #2  |  Link
homerpez
Registered User
 
Join Date: May 2007
Posts: 98
UPDATE: Just to be certain, I loaded up the stream Mainconcept produced, as well as the AC3 stream, just to see what the info brought up...

The timecodes match up exactly, and it is the same framerate and timecode as the source...



So what's left to try?... This seems to eliminate all causes that I know of... what could it be?...

Last edited by homerpez; 9th May 2007 at 07:42.
homerpez is offline   Reply With Quote
Old 9th May 2007, 14:31   #3  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Use the MPV and try a different muxer, such as Imago Muxer.
Guest is offline   Reply With Quote
Old 10th May 2007, 00:16   #4  |  Link
homerpez
Registered User
 
Join Date: May 2007
Posts: 98
Quote:
Originally Posted by neuron2 View Post
Use the MPV and try a different muxer, such as Imago Muxer.
Imago Muxer is for MPEG-2/DVD muxing, this is going to a .mkv container (h.264 video, ac3 streams)... I may have confused things by encoding to an "elemental" stream in Mainconcept, which made that .mpv extension. It's actually h.264 codec material. Thanks anyway though for the reply.

Digging really, really deeply, I found one more thing that might be causing this, but it doesn't explain why one movie worked perfectly with no adjustment, and this one isn't syncing the right way...

It's been posted elsewhere how for some reason, when you demux an HD-DVD, and note the CALCULATED frames to encode, this will work work for video, but not for audio. For that, you need to use actual COUNTED frames, and the two can be off from one another by several seconds (and as it goes along, it becomes more and more off).

Sure enough, on "Superman", the "calculated" frames are a full 4 seconds less than the "counted" frames...

So I'm trying the "timestretch" feature of BeHappy, and trying to bring the audio to the same duration as the video... unfortunately I managed to delete the video stream I was using (bonehead mistake) so I'm now re-encoding to an MP4 stream.

Hopefully the re-stretched .ac3 and the .mp4 video stream will like each other this time - I won't know for a few hours now.

This still doesn't explain to me why some work, and others don't... I believe there was a discrepancy between "calculated" and "counted" frames on that movie also, yet it encoded and synched just fine...?

If someone's solved this different way, I would love more input on this...

Last edited by homerpez; 10th May 2007 at 00:18.
homerpez is offline   Reply With Quote
Old 11th May 2007, 01:36   #5  |  Link
homerpez
Registered User
 
Join Date: May 2007
Posts: 98
Ok, PLEASE someone help... I think I'm cursed.

I finish the Mainconcept encode, and the result was an .mp4 stream that NOTHING could mux or decode. It appears I will be sticking with MeGUI for some time to come, at least it works...

So while I wait a full day for that to encode...

I check the ac3 file that I performed the "time stretch" on in BeHappy. I play it back quick in MPC, and the timecode is roughly 6 hours.

The source was maybe 2 hours 31 minutes or so. I only adjusted the timescale a tiny amount (the ratio of 24->23.976, which I calculated to be close to the 4 seconds I wanted to squish).

Sure enough, I play back the file, and during the first 2 1/2 hours of it, I have movie audio playing nicely in 5.1... and silence for 4 hours.

All I did was load up my AVS file:

Directshowsource("C:\temp\TEST\AUDIO.GRF",audio=true,video=false)

...added a 16db amplification, and the tiny 24/23.976 ratio timestretch, and got 4 hours of junk material tacked on the end somehow.

Is there a simple program that will just let me trim the ac3 stream? Maybe that's all I need?

If it did the timestretch to all 6 hours of that, the answer is "no".

Has this happened to anyone else?... I'm SO close to fixing this...

Last edited by homerpez; 11th May 2007 at 01:40.
homerpez is offline   Reply With Quote
Old 11th May 2007, 14:49   #6  |  Link
diogen
Registered User
 
Join Date: Dec 2005
Posts: 365
Quote:
Originally Posted by homerpez View Post
...Sure enough, I play back the file, and during the first 2 1/2 hours of it, I have movie audio playing nicely in 5.1... and silence for 4 hours.
Was the audio in sync during the first 2.5 hours?

Diogen.
diogen is offline   Reply With Quote
Old 12th May 2007, 01:54   #7  |  Link
Toti
Registered User
 
Join Date: Oct 2002
Posts: 160
@ Homerpez, the problem is not with your process is MAINCONCEPT has BUGS. I have started a post http://forum.doom9.org/showthread.php?t=123409

Hope that helps.
__________________
VAIO VGX-XL3 4gig RAM, 4Tb HDD. MEDIA CENTER WINDOWS 7 simply the best!!
Toti is offline   Reply With Quote
Old 14th May 2007, 05:58   #8  |  Link
homerpez
Registered User
 
Join Date: May 2007
Posts: 98
Ok... I figured out the 6-hours thing was because apparently, you need to specify EVERYTHING in an avs script... when I had frames, but not fps=23.976, it went totally haywire.

Also, no, that 2-hr section wasn't in sync either.

I fixed the avisynth, and seemingly nothing I can do will make the audio the same as the video. This is INTENSELY frustrating because tons of people seem to be having sucesses every time.

There HAS to be a 100% working method to do this...
homerpez is offline   Reply With Quote
Old 14th May 2007, 22:27   #9  |  Link
homerpez
Registered User
 
Join Date: May 2007
Posts: 98
...aaaaand here we go again, this time with "Batman Begins".

I was very easily able to encode both video and audio...

VIDEO: Demuxed vc1 -> Sonic HD Demux -> Sonic Video Decoder 4.2 -> AVS -> H264 (V-dub)

AUDIO: Demuxed ddp -> Sonic Audio Decoder 4.2 -> AVS -> 5.1 channel AC3 (BeHappy)

MUX: MKVmerge GUI

Seems everything works ok, except the sync is again wildly off. And it almost seems like it's arbitrary - it seems like it needs more delay one minute, I add more delay and it's now off the OTHER way. I can use every delay setting in between, and nothing seems to "zero in" on the correct delay! (I can't tell now, if it's the progressive delay problem from before, or if it's "something in the way she mux'ed") :P

That "all in one, step-by-step guide" is badly needed right about now... either that, or I need a less stressfull hobby.
homerpez is offline   Reply With Quote
Old 15th May 2007, 19:52   #10  |  Link
bluesk1d
Uber n00b
 
Join Date: Apr 2007
Location: Orange County, CA
Posts: 158
Incase anyone else runs across this thread ready to pull out their hair over the odd progressive sync issues, homerpez and I discussed this briefly in one of the Xbox/WMV threads. The issue here is not the audio. The problem is with Sonic Video Decoder 4.2. No one is quite sure why yet but it seems it only happen on some movies and the amount of sync lost by the end of the movie doesnt always amount to a plain 23.976 <-> 24 fps problem.

The solution that has consistently worked for me (this only works for VC-1 as far as I am aware) is to use a graph that consists of the Haali media splitter handling the direct EVO ripped from the disk --> WMV DMO Decoder (the green one near the bottom of the direct show filter list). Since a lot of movies have the EVOs split into 2 parts you will need to create a graph for each and combine them in your avs script.

DirectShowSource(blah1.grf, options)+DirectShowSource(blah2.grf, options)

Each source within its parenthesis will have to have its individual framecount. You can get that from EVOdemux by unchecking the proceed to next evo box and then loading them individually to see the calculated frames. I had a hell of a time with Batman Begins thinking it was something with the audio but this method worked perfectly. Now I use this exclusively to avoid the random sync issues whenever possible.
bluesk1d is offline   Reply With Quote
Old 15th May 2007, 20:26   #11  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,770
dont encode with x264 in virtualdub, this will lead to mkv files in vfw mode, which is borked

encode the avs to h264 via x264cli, ffmpeg or via any of the guis using that tools (megui, staxrip...)

this will create correct native mkv files
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free
bond is offline   Reply With Quote
Old 15th May 2007, 22:06   #12  |  Link
homerpez
Registered User
 
Join Date: May 2007
Posts: 98
Quote:
Originally Posted by bluesk1d View Post
Incase anyone else runs across this thread ready to pull out their hair over the odd progressive sync issues, homerpez and I discussed this briefly in one of the Xbox/WMV threads. The issue here is not the audio. The problem is with Sonic Video Decoder 4.2. No one is quite sure why yet but it seems it only happen on some movies and the amount of sync lost by the end of the movie doesnt always amount to a plain 23.976 <-> 24 fps problem.

The solution that has consistently worked for me (this only works for VC-1 as far as I am aware) is to use a graph that consists of the Haali media splitter handling the direct EVO ripped from the disk --> WMV DMO Decoder (the green one near the bottom of the direct show filter list). Since a lot of movies have the EVOs split into 2 parts you will need to create a graph for each and combine them in your avs script.

DirectShowSource(blah1.grf, options)+DirectShowSource(blah2.grf, options)

Each source within its parenthesis will have to have its individual framecount. You can get that from EVOdemux by unchecking the proceed to next evo box and then loading them individually to see the calculated frames. I had a hell of a time with Batman Begins thinking it was something with the audio but this method worked perfectly. Now I use this exclusively to avoid the random sync issues whenever possible.
It's true.

I ended up doing filesource(rebuilt EVO) -> Haaili splitter -> ffdshow , which accomplishes this same thing... AVOIDING THE SONIC VIDEO 4.2 FILTER. It does seem to process the video frames incorrectly.

The magic formula for me seems to be haali -> ffdshow for video, DD+ Source Filter -> Sonic 4.2 Audio filter for the audio stream. I noted the first video stream delay in the info window in EVO Demux, and sure enough, when it came time to mux (MKVmerge GUI), I just typed that number in, and it was done!

Last edited by homerpez; 15th May 2007 at 22:08.
homerpez is offline   Reply With Quote
Old 23rd May 2007, 20:24   #13  |  Link
muaddib.dk
Registered User
 
Join Date: Nov 2006
Posts: 2
Just stopped by to say thanks for the tip on avoiding the sonic video 4.2 filter.
Was encoding Pitch Black and it went completely out of sync (lost a second within the first 30 minutes of the movie). Used the WMV DMO Decoder on a rebuilt EVO and no more sync issues.

Thanks a bunch guys
muaddib.dk is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:55.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.