View Full Version : (H)DTV to DVD Audio Problems
Xesdeeni
14th January 2004, 17:18
I'm in the process of converting Fox's 24 to DVD for viewing this summer (when everything else is in reruns). I'm trying to convert the video without having to process the audio, which is already in Dolby Digital format, which is OK for a DVD. But I'm having a bear of a time with audio synchronization. For reference, here are the gory details of my non-trivial process:
1. Load TP file into HDTVtoMPEG2 (1.10) to determine PID of video and audio streams.
2. Edit DVD2AVI.ini to set PID of video and audio streams.
3. Load TP files into DVD2AVI. The first one has no # at the end, so DVD2AVI won't load any more. So add the second, and DVD2AVI will load up to the next one that ends in 9. To get more, load the next. (E.g. If you have TEST.TP, TEST_01.TP, TEST_02.TP,... TEST_09.TP, TEST_10.TP, TEST_11.TP, you need to load TEST.TP, TEST_01.TP, and TEST_10.TP to get all 12 files).
4. Select Video|Field Operation|None
5. Select Video|Clip & Resize and click Reset
6. Select Audio|Track Number|Track 1
7. Select Audio|Channel Format|Dolby Digital
8. Select Audio|Dolby Digital|Demux All Tracks
9. Save D2V file (and AC3 audio).
10. Create AVISynth script:MPEG2Source("16x9_480p.D2V")
SeparateFields()
SelectEvery(4,1,2)
Weave()
ConvertToRGB()I realize that I could also convert to 23.976 fps, but it looks like much of the post-processing is done in the 60 fps domain, so to avoid the issue, I just decided on a simple conversion from progressive to interlaced.
11. Load AVISynth script into VirtualDubMod
12. Load AC3 file into VirtualDubMod using StreamList
13. [Either this or 17 below]Set delay from AC3 filename in AC3 properties
14. Edit video by selecting start and end of regions and deleting them.
15. Save Processor Settings
16. Export edited AC3 using Stream List and Demux button
17. [Either this or 13 above]Load AC3 stream into AC3 Delay Corrector and correct stream delay using value from original AC3 filename.
NOTE: I tried doing this with the originally demuxed AC3, but AC3 Delay Corrector always ran into an error, that I suspect was a transmission error that it couldn't handle.
18. Start VirtualDubMod frameserver and create VDR file
19. Load VDR file into MPEG encoder [In my case CinemaCraft] and encode MPV (or M2V) file
20. Use MPV (or M2V) and AC3 files to author DVD
The problem appears to be that the delay reported by DVD2AVI in the filename isn't actually correct. Whether I add the delay into VirtualDubMod or use AC3 Delay Corrector, I can't get the audio to sync.
I have done some trial-and-error to adjust the sync, and I can eventually get it. But that takes re-authoring and checking the VOB over and over, where each iteration takes 15-20 minutes. I just can't see doing this for 24 episodes!
Is anyone else doing this? How have you solved the audio sync issue? Any bright ideas?
Xesdeeni
timecop
16th January 2004, 07:06
audio sync depends on the distance between video and audio PES in the transport stream.
unless hdtv2mpeg is borked, the delay it calculates should be correct.
what are you "editing" out of the streams? commercials I assume?
why not use hdtv2mpeg's cutting feature to cut that shit right out of the stream, mix then into program stream and then demux/encode that without any cutting?
Xesdeeni
16th January 2004, 15:15
Originally posted by timecop
audio sync depends on the distance between video and audio PES in the transport stream.So why would one want to have packets of audio interleaved with packets of video that were not in sync with one another?unless hdtv2mpeg is borked, the delay it calculates should be correct.I don't see where HDTVtoMPEG2 calculates the delay. The info I get is from DVD2AVI.what are you "editing" out of the streams? commercials I assume?Yup.why not use hdtv2mpeg's cutting feature to cut that shit right out of the stream, mix then into program stream and then demux/encode that without any cutting?Let me count the reasons:
1. HDTVtoMPEG2 can only cut on GOP boundaries, meaning part of the commercials must be left in.
2. Using HDTVtoMPEG2 requires an additional amount of hard drive storage up to the length of the original program (in this case 10GB).
3. Using HDTVtoMPEG2 requires additional processing.
4. HDTVtoMPEG2 does not allow saving the edit list in case something goes wrong or I need to re-do the process.
5. The HDTVtoMPEG2 version that can save out MPEG files (1.09b, I believe) hangs sometimes on the first edit point.
Xesdeeni
timecop
16th January 2004, 16:09
1. HDTVtoMPEG2 can only cut on GOP boundaries, meaning part of the commercials must be left in.
yeah, or trim it right before commercial. its not like you are authoring a professional disk. you can live without 0.5 seconds of the episode.
2. Using HDTVtoMPEG2 requires an additional amount of hard drive storage up to the length of the original program (in this case 10GB).
how is this a problem? are ARE editing HDTV material. prepare to have 50-100gb free space just for temp work.
3. Using HDTVtoMPEG2 requires additional processing.
Doing what you are doing with frameserving wasted ungodly amounts of CPU time.
4. HDTVtoMPEG2 does not allow saving the edit list in case something goes wrong or I need to re-do the process.
yeah once you trimmed the files, what else would you need originals for?
5. The HDTVtoMPEG2 version that can save out MPEG files (1.09b, I believe) hangs sometimes on the first edit point.
If you didn't insist on using ac3 (and for a home recording project I dont really see why you do), i'd just recommend making a avs script that MPEG2Source()'s the video + audio, Trim()'s the crap out, and encoding that.
But, other than telling you that whenever I demux transport streams, and i'm given a delay value, its always correct in my case, I can't suggest anything else.
Would be nice if someone written something like "DirectStreamSource()" avisynth filter, that would pass a mp3|ac3|dts|aac|whatever stream as-is in the audio stream, but trim it according to the general video trims. Perhaps something to throw at the avisynth dudes.
Xesdeeni
16th January 2004, 16:39
Good grief. Are you always this disagreeable? In case you couldn't tell from all this info, I've tried HDTVtoMPEG2 ad nausium--it just doesn't cut it (ha, pun not intended). It's not a single reason, but the combination of all of the above. At some point, it just becomes more trouble than it's worth. YMMV, but I found an easier way that (so far) takes less of my personal time. I have a single issue left to solve and I'll be home free. If you have a solution for this, please help.If you didn't insist on using ac3 (and for a home recording project I dont really see why you do)To ensure the DVD will play in any DVD player (including my MyHD card, which does a better job of upscaling 480i to 1080i than my TV, but only plays AC3)?But, other than telling you that whenever I demux transport streams, and i'm given a delay value, its always correct in my case, I can't suggest anything else.Where do you get the delay value (you said HDTVtoMPEG2 above, but I don't see that feature there)?
Where do you use it?
Do you include the (-) sign?
Are you converting to DVD (trbarry says WMV works better)?
Have you tried with episodes of 24?
Have you seen differing delays on different episodes of the same program (i.e. would I get away with calculating the dealy once and using it in all 24 episodes)?Would be nice if someone written something like "DirectStreamSource()" avisynth filter, that would pass a mp3|ac3|dts|aac|whatever stream as-is in the audio stream, but trim it according to the general video trims. Perhaps something to throw at the avisynth dudes.I don't think AVISynth can deal with any compressed data. I believe, since it's really emulating an AVI codec, that it serves only uncompressed video and audio. So I don't think passing through AC3 would be an option.
VirtualDubMod, on the other hand, seems to be able to take an AC3 stream in parallel with a video stream, and output the edited version. It's just the sync that is giving me problems.
Xesdeeni
timecop
16th January 2004, 22:56
> Where do you get the delay value (you said HDTVtoMPEG2 above, but I
> don't see that feature there)?
DVD2AVI will output a file with a delay value during demux. The only thing I was suggesting hdtv2mpeg for was to combine all the split .tp files into a single transport stream (and edit, but you say its not good enough), since you seemed to have so many issues with loading them.
> Do you include the (-) sign?
For example if delay reported is -0.247, and I'm decoding the audio,
I would decode to .wav, and add DelayAudio(-0.247)
So yes, the sign matters. Sometimes delay is negative, sometimes is positive.
> Are you converting to DVD (trbarry says WMV works better)?
I've re-encoded some material from hd to dvd, yes. the only difference
is that hdtv audio in my area is AAC (not ac3), so I have to re-encode it anyway.
> Have you seen differing delays on different episodes of the same
> program (i.e. would I get away with calculating the dealy once and
> using it in all 24 episodes)?
The delay will always be different (from my experience). So yes, you would have to adjust it for each episode / clip.
Xesdeeni
16th January 2004, 23:38
Originally posted by timecop
> Where do you get the delay value (you said HDTVtoMPEG2 above, but I
> don't see that feature there)?
DVD2AVI will output a file with a delay value during demux. The only thing I was suggesting hdtv2mpeg for was to combine all the split .tp files into a single transport stream (and edit, but you say its not good enough), since you seemed to have so many issues with loading them.Not to pick nits, but you said "unless hdtv2mpeg is borked, the delay it calculates should be correct."> Do you include the (-) sign?
For example if delay reported is -0.247, and I'm decoding the audio,
I would decode to .wav, and add DelayAudio(-0.247)
So yes, the sign matters. Sometimes delay is negative, sometimes is positive.The question isn't whether the minus sign is relavent (I know that it is), but is instead do you input the minus sign into the program you use to adjust for the delay? I.e., do you enter - when DVD2AVI says - or do you invert the sign to make the adjustment? I believe you answered this for AVISynth scripts. Do you use another program (maybe VirtualDubMod or AC3 Delay Corrector)? If so, do invert the sign there? I've tried it both ways, but as I mentioned, the resulting audio is not in sync, so something is wrong.> Are you converting to DVD (trbarry says WMV works better)?
I've re-encoded some material from hd to dvd, yes. the only difference
is that hdtv audio in my area is AAC (not ac3), so I have to re-encode it anyway.That's odd, according to the ATSC specification (http://www.atsc.org/standards/a_53b_with_amendment_1-2.pdf : page 35, section 5), "The audio compression system conforms with the Digital Audio Compression (AC-3) Standard...." There doesn't appear to be a mention of AAC in the spec at all.> Have you seen differing delays on different episodes of the same
> program (i.e. would I get away with calculating the dealy once and
> using it in all 24 episodes)?
The delay will always be different (from my experience). So yes, you would have to adjust it for each episode / clip. Bummer.
Xesdeeni
Stux
17th January 2004, 05:04
Japan's digital HDTV system uses AAC :)
Not all HDTV systems are ATSC (just like all analog systems aren't NTSC really)
Xesdeeni
19th January 2004, 15:18
Good point. Maybe I should have been more specific:
Anyone have any idea how to synchronize the audio of an ATSC HD stream when converting to DVD?
;)
Xesdeeni
dano
12th February 2004, 02:21
@Xesdeeni
I converted many TV episodes captured from HDTV to DVD. From my experience the audio delay as reported by DVD2AVI has never been correct for streams recorded off of FOX. I resorted to manually syncing the audio to the video. My convertion process is practically identical to what you are doing, so I'll describe how I corrected the delay.
Load the avs script in VirtualDubMod. Add the original demuxed AC3 stream and enter a delay (just a guess at this point). Select a small portion (30 Seconds) of the episode to test audio sync on. I found the flashing 24 LEDs at the begining to be particulary helpful. Then save the clip as an avi (Huffyuv, or uncompressed), it should be quicker then encoding in MPEG
Open this clip in Zoom Player. Zoom player has great slowmotion / frame advance controls with audio output. This allows you to count the number of frames between video and audio elements. Thats where the 24 LEDs come in handy. Say the audio was off by 6 frames, 6 * 1000 ms / 23.976 fps = 250 ms. Now you just have to add 250 to the delay.
Sometimes you may have to do a few rough guesses first. Now that I am used to this method I can get the audio synced in a few mins.
One other thing. How many passes are you encoding in CCE? If it is a high pass count it maybe quicker to save an AVI (HuffYUV) in VirtualDubMod and then load that AVI in CCE. This way you only process the AVS file once.
-dano
Xesdeeni
14th February 2004, 00:17
Originally posted by dano
I converted many TV episodes captured from HDTV to DVD. From my experience the audio delay as reported by DVD2AVI has never been correct for streams recorded off of FOX. I resorted to manually syncing the audio to the video. My convertion process is practically identical to what you are doing, so I'll describe how I corrected the delay.Well, at least I feel better knowing I didn't miss anything. The delay information is definitely wrong. I used a process similar to yours and created a HuffYUV 352x240 (VirtualDubMod 2:1 reduction) video of the first few minutes and used BeSweet to convert the edited AC3 to WAV. I loaded both into Premiere and manually synced. The last three episodes I did needed 300ms, -300ms, and 0ms, although they were reported as around -400ms each.
I found that the LEDs at the start were not synced in a way that let me sync the voices to the mouths later. If I tried to sync using this, the sync wasn't right on dialog. I found I had to look for a hard consonant like a 'b' or 'p' to key on. Unfortunatley, this means I have to watch most of the "previously on 24," which is annoying since I'm saving the episodes for the summer repeat time period :-)One other thing. How many passes are you encoding in CCE? If it is a high pass count it maybe quicker to save an AVI (HuffYUV) in VirtualDubMod and then load that AVI in CCE. This way you only process the AVS file once.I've been using just a 1 pass VBR. This is actually two passes, and for my purposes of time-shifting to this summer, it's very good quality...well, considering the crappy temporal filtering FOX does on their end before they broadcast.
You say that FOX isn't right, but are the other networks? I haven't done any HD to DVD yet, but I will soon. Can I trust them, or should I plan on the above process as well?
Xesdeeni
dano
16th February 2004, 12:25
Originally posted by Xesdeeni
You say that FOX isn't right, but are the other networks? I haven't done any HD to DVD yet, but I will soon. Can I trust them, or should I plan on the above process as well?
The two networks that give me trouble are FOX and the WB. I usually have to manunally sync audio for FOX captures.
The WB captures are even worse. For some reason (Don't know why), the recorded TP file has 5 sub-channels. The first sub channel is empty. 2 and 3 are identical except that 2 has muted audio for the episode. 4 and 5 are copies of 2 and 3. So 3 is the sub-channel that you need to process to convert your capture and it uses strange PIDs. I have only tried one convertion with a WB capture, and I failed to complete it because the audio seemed to run slightly faster than the video. I just gave up on it. Hopefully your WB affiliate won't be as screwed up as mine is.
As for the other channels (ABC, NBC, CBS) I haven't had any problems making DVD convertions. I always do a test clip to check audio delay and the values reported by DVD2AVI seem to be correct.
Xesdeeni
16th February 2004, 17:01
I tried a short test this weekend from an ABC capture. The DVD2AVI delay did not seem to be correct, so I had to do it by eye.
I've also seen our WB affiliate with weird stuff. Their closed caption only shows every other line of text. And there is a 75-1 virtual channel in their stream, as well as the 33-2 and 33-3 (labeled as SAP) streams. I e-mailed them about this, but I didn't get a response. If I get obstinate one day, I may call them and see if I get a response that way ;-)
Xesdeeni
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.