View Full Version : AC3-sound losing dialog
eswrite
5th April 2005, 16:52
I am using DGIndex 1.3.0b5 to demux a captured HDTV .tp file: I selected Audio->Output Method->Demux (AC3, MPA, DTS, AAC). [My goal is to test in VDubMod, then feed the .avs directly to QuEnc to generate an MPEG2 DVD-compliant file I can feed to DVD authoring sw.]
The resulting .ac3 sound file plays fine in Windows Media Player, but when I mux video and audio in VDubMod, a strange thing happens:
a) during commercials (at the start of the clip) all sound is fine.
b) when the broadcast switches to the HDTV movie, I only hear the background music, but all dialog is gone.
Here is the .avs script snippet I'm using:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
code:
LoadPlugin("C:\Program Files\VirtualDub\DGMpgDec\DGDecode.dll")
LoadPlugin("C:\Program Files\VirtualDub\AviSynth 2.5\plugins\AC3Source.dll")
Video_i=MPEG2Source("hdtv_src.d2v")
# Must specify input video or else get script wrong arguments error.
Audio=AC3Source(Video_i,"hdtv_src.ac3")
AudioDub(Video_i,Audio)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
What's causing this? I also tried bringing in the audio through Streams->Streams List as a .wav file (generated in DGIndex with Audio->Output Method->Decode) in VirtualDub with the same result.
Boulder
5th April 2005, 18:15
Is the WAV file okay? If there happens to be something wrong with demuxing the audio track (or decoding to WAV) from the transport stream, I'm sure Don will look at it if you provide a sample to him.
niamh
5th April 2005, 18:21
Usually when you lose the dialog, that means it isn't downmixed for playback. And it's all I know on the subject :)
eswrite
5th April 2005, 18:54
@Boulder:
Both the WAV and AC3 files play fine in Windows Media Player (the latter because I have an AC3 filter installed), so I'd say, yes.
@niamh
I dug up an old thread (http://forum.doom9.org/showthread.php?s=&threadid=90029&highlight=AC3Source) on AC3Source saying something about it not handling downmixing correctly. They suggest installing the latest AC3 filters (in Windows, not AVISynth) and using DirectShowSource, like so:
code:
#Audio=AC3Source("hdtv_audio.ac3") #downmixing problem???
### Use DirectShowSource instead after installing latest AC3 Filters
Audio=DirectShowSource("hdtv_audio.ac3")
AudioDub(Video,Audio)
niamh
5th April 2005, 19:04
At a guess, I'd say you're better off muxing outside of avisynth anyway if you can help it
eswrite
5th April 2005, 19:22
@niamh
I have heard that recommendation elsewhere as well, but I'd like to set up and .avs file that muxes video and audio so that, once I have verified it works in VDubMod, I can use QuEnc to load and run the .avs file. I discovered last night, much to my delight, that I could eliminate the need for creating an AVI file and just go straight to MPEG2 with QuEnc. As I said above, with my .avs script I hope to generate DVD-compliant output so I can just feed the output MPEG2 file into my DVD authoring sw without further modification. So the process would be something like:
1) Use HDTVtoMPEG2 to get the audio and video PIDs.
2) Use DGIndex to demux the .tp stream (after specifying the PIDs).
3) Use my .avs script & AVISynth in VDubMod to make sure everything is looking/sounding okay.
4) Load my .avs script into QuEnc and crank out an MPEG2 file.
5) Use VideoReDo (or comparable app) to cut commercials.
6) Load MPEG2 file into DVD authoring sw.
If I have to mux the video+audio, I'll have to add a step between 4 and 5, and my head is already spinning from all the software and options I am managing (or mismanaging, as the case may be).
Boulder
5th April 2005, 19:47
There is a newer (and working) plugin for loading AC3 tracks in Avisynth. I believe the thread was on the first page on this forum not so long ago.
FuPP
5th April 2005, 23:36
http://nic.dnsalias.com/NicAudio.zip
Guest
6th April 2005, 05:00
>1) Use HDTVtoMPEG2 to get the audio and video PIDs.
DGIndex can detect the PIDs. Use Raw PID Detection if your stream does not have PAT/PMT tables.
Mug Funky
6th April 2005, 05:54
just my 2 cents: transcoding is evil.
try keep the original ac3 and resync it in the authoring app.
there are programs out there that'll cut ac3 nicely.
eswrite
6th April 2005, 14:29
@Mug Funky
try keep the original ac3 and resync it in the authoring app.
It's looking like that's indeed what I'll have to do: QuEnc is not doing too well when the audio is muxed in the .avs script. I just hope the audio doesn't lose sync in the authoring tool, especially if I have de-interlance to resize in VdubMod, with a re-interlace as the last step.
@eswrite: If you have any notions on what QuEnc is doing wrong, or any more info, please post in the "Other MPEG-1/2 Encoder" part of the forum and i'll do my best to resolve any issues.
eswrite
6th April 2005, 17:18
@Nic
I spent a very frustrating night trying to get this to work. To be honest, I'm not entirely sure whether it's AVISync + NicAC3Source that's causing the problem. At one point I could write AVIs from VDubMod which had sound, but the same .avs would not work in QuEnc, which would start processing, then exit without message/explanation and produce a 0-byte MPG file.
Later on, after trying many things, I couldn't even get VDubMod to produce an AVI with sound, so I dropped the whole thing and hope that my DVD authoring software does a good job of joining the demuxed audio I produced with GIndex with the down-sized soundless MPEG I generate with .avs re-sizing in QuEnc 1 step later. To be honest, if the DVD authoring tool does okay, I may not retry muxing with AVISynth. I am that traumatized about it :confused:. I have a feeling this won't work either, as I've had issues with keeping audio sync when letting the DVD authoring sw (ULead MovieFactory 4) do the entire job of down-sizing video, demuxing, re-encoding, etc. [MF4's inability to do keep audio sync is the reason I came here to investigate using VDubMod and QuEnc to generate DVD-compliant MPEG2 files that need not be re-encoded during the authoring step.]
Boulder
6th April 2005, 18:14
In case you didn't know : AviSynth is not meant for "muxing";). Actually it decodes the AC3 track as Avisynth only handles uncompressed video and audio. Importing audio can be very useful if you have a WAV track and want to trim the video and audio at the same time. If you want to use the original track, you can't feed it in Avisynth because you'll only get PCM audio out;)
And yes, you definitely should use the original AC3 track. It should be in sync provided that you don't remove or add any frames during processing the video.
If you have problems loading the script and encoding in QuEnc, please post the script. Otherwise it's very hard to analyze the problem and give suggestions.
eswrite
6th April 2005, 19:38
@Boulder,
below you will find the script (one of several) I used. Dirt simple stuff. Load video and audio, dub, resize. Nothing more. If I removed the dub so that it was video only, QuEnc had no problems.
LoadPlugin("C:\Program Files\VirtualDub\DGMpgDec\DGDecode.dll")
LoadPlugin("C:\Program Files\VirtualDub\AviSynth 2.5\plugins\NicAudio.dll")
LoadPlugin("C:\Program Files\VirtualDub\AviSynth 2.5\plugins\SimpleResize.dll")
Video=MPEG2Source("hdtv_src.d2v")
### Use NicAC3Source
Audio=NicAC3Source("hdtv_audio.ac3")
AudioDub(Video,Audio)
### For Source AR of 1.778:1 -- 16:9 Wide-Ssreen
Crop(4,4,-4,-4) # only for 1088 scan lines
BicubicResize(720,480,0,0.5)
#Lanczos4Resize(720,480)
Boulder
6th April 2005, 19:48
Yep, looks ok to me as well. I actually misread your post and thought that you couldn't get the script working at all.
By the way, is HDTV stuff interlaced or does it depend on the content? If it's interlaced, you shouldn't resize it that way.
eswrite
6th April 2005, 20:05
@Boulder,
This clip would be at 1080i. I've been reading up and asking questions re: resizing interlaced content (see http://forum.doom9.org/showthread.php?s=&postid=635525#post635525 and a couple of posts up the page). Due to the audio problems, I haven't had the chance to test the various algorithms suggested, though in one pass with TDeint, it was sloooow. Here's another sample script I tried with mixed results, using InterlacedResize. Unfortunately, it requires YUY2 color space, and the conversions aren't lossless.
LoadPlugin("C:\Program Files\VirtualDub\DGMpgDec\DGDecode.dll")
LoadPlugin("C:\Program Files\VirtualDub\AviSynth 2.5\plugins\NicAudio.dll")
LoadPlugin("C:\Program Files\VirtualDub\AviSynth 2.5\plugins\SimpleResize.dll")
Video=MPEG2Source("hdtv_src.d2v")
### Use NicAC3Source
Audio=NicAC3Source("hdtv_audio.ac3")
AudioDub(Video,Audio)
### For Source AR of 1.778:1 -- 16:9 Wide-Ssreen
#Crop(4,4,-4,-4) # only for 1088 scan lines
#BicubicResize(720,480,0,0.5)
#Lanczos4Resize(720,480)
#Use InterlacedResize, with YV12->YUY2->YV12 conversions:
return ConvertToYUY2().InterlacedResize(720,480).ConvertToYV12()
Boulder
6th April 2005, 20:44
For faster processing, try
LoadPlugin("C:\Program Files\VirtualDub\DGMpgDec\DGDecode.dll")
LoadPlugin("C:\Program Files\VirtualDub\AviSynth 2.5\plugins\NicAudio.dll")
LoadPlugin("C:\Program Files\VirtualDub\AviSynth 2.5\plugins\leakkerneldeint.dll")
Video=MPEG2Source("hdtv_src.d2v")
### Use NicAC3Source
Audio=NicAC3Source("hdtv_audio.ac3")
AudioDub(Video,Audio)
LeakKernelBob(order=1,threshold=7)
### For Source AR of 1.778:1 -- 16:9 Wide-Ssreen
#Crop(4,4,-4,-4) # only for 1088 scan lines
#BicubicResize(720,480,0,0.5)
Lanczos4Resize(720,480)
AssumeTFF()
SeparateFields()
SelectEvery(4,0,3)
Weave()
I assume the video is top field first, if it's not, use order=0 and AssumeBFF in the script. LeakKernelDeint can be found in this forum with the search engine.
eswrite
6th April 2005, 22:29
Thanks for the code snippet. I tried it out, and I still get the type of jaggies I point out at http://eswrite.50megs.com/photo.html. I am just as confused about this resizing of interlaced video as I was about ac3 sound last night. I thought proper handling was supposed to avoid the combing/jaggies effect, not make it worst. I have no idea why the allegedly erroneous Bicubic resize of interlaced material looks better than what the more "correct" methods yield.
Boulder
7th April 2005, 15:03
Could you upload a short sample somewhere? A few frames will do.
Wilbert
7th April 2005, 15:54
@Nic,
Does QuEnc work when your audio comes from a script? If so, does it work when the script serves uncompressed 5.1 audio?
Guest
7th April 2005, 17:28
Originally posted by Boulder
Could you upload a short sample somewhere? A few frames will do. I already asked him and he didn't respond.
eswrite
7th April 2005, 19:44
@Boulder and @neuron2
I have a zip file containing a sample clip and the accompanying scripts used to process with Avisynth/Vdubmod. Email me at eswrite at yahoo dot com so I can forward you details on how to download it.
Guest
7th April 2005, 19:54
PM me.
eswrite
8th April 2005, 20:19
Update on sound issues:
1) NicAudio.dll's NicAC3Source does okay, but I am having some problems:
- Dialog goes to right channel
- It flags an AC3 error about 40 minutes into my clip: still investigating whether there is an actual error in the AC3 file and or video which were generated using DGIndex (maybe due to an OTA HD drop-out that VideoReDo and/or DGIndex don't account for?).
2) DirectShowSource: with AC3Filter installed
- Dialog does not go to right channel, sound is more like original .tp
- Works on one of my PCs, but the other one seems flaky; more investigating.
- Drops last bit of sound at end of clip; will make sure my clip has at least 1 sec of "dead time" if I use this filter.
BTW, I just realized I had forgotten to use the delay values from the AC3 file name DGIndex generates. Though my delays are small, this is a nice way to ensure/improve lip-sync.
UPDATE: The PC I was using to test only has 2 channel audio. When I selected 3/2 in AC3Filter, dialog also went to the right channel with DirectShowSource. Will re-test on my other PC, which has 5.1 output.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.