Log in

View Full Version : DGDecodeNV, Decomb, and Audio Dub


blazer003
26th January 2010, 03:56
I'm thinking this may not be possible, but I'll give it a shot:

I have AVCHD footage that I've processed with DGIndexNV from nueron2. I also am redubbing the audio, so my script looks like this:

LoadPlugin("C:\Program Files\DG Software\dgavcdec109\DGDecodeNV.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\decomb.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\NicAudio.dll")
DGSource("00006.dga")
video=DGSource("00006.dga")
AssumeTFF()
Telecide()
Decimate(cycle=5)
audio=NicAC3Source("00001 PID 1100 2_0ch 48KHz 192Kbps DELAY 0ms.ac3")
AudioDub (video, audio)

So far so good.

This is footage from a Panasonic GH1, so it is 24p footage in a 60i wrapper. I open up the avs file with VirtualDub, and I have 3 progressive frames followed by 2 interlaced, or 3:2 Telecine (or Pulldown), just like I would expect. But I want to get rid of that.

So now I want to load up the decomb plugin by neuron2.
At first I tried this next script and it doesn't work. I assume it's because video is being defined by DGSource("00006.dga") and the decomb plugin and it's parameters don't know to look to "video" for the stream.

LoadPlugin("C:\Program Files\DG Software\dgavcdec109\DGDecodeNV.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\decomb.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\NicAudio.dll")
video=DGSource("00006.dga")
AssumeTFF()
Telecide()
Decimate(cycle=5)
audio=NicAC3Source("00001 PID 1100 2_0ch 48KHz 192Kbps DELAY 0ms.ac3")
AudioDub (video, audio)

If I set up this next script like this, the video does the reverse telecine and pulldown, but there's no audio.

LoadPlugin("C:\Program Files\DG Software\dgavcdec109\DGDecodeNV.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\decomb.dll")
DGSource("00006.dga")
AssumeTFF()
Telecide(guide=1,post=0,show=true)
Decimate()

So my questions are:

1. How would I set this up so that the decomb plugins also look to "video", or AudioDub looks to the result of the decombing process when it goes to rejoin the audio and video. I'm guessing it's just some syntax of parentheses or quotes.

2. I'm guessing that after decimating frames from the video, the audio would be out of sync even if I did get this to work (but I'd still like to know how to do it for future reference). Is there a way inside Avisynth to adjust the audio to fit the new framerate?

If you need any more information, or for me to clarify anything please let me know

poisondeathray
26th January 2010, 04:03
LoadPlugin("C:\Program Files\DG Software\dgavcdec109\DGDecodeNV.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\decomb.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\NicAudio.dll")
DGSource("00006.dga")
video=DGSource("00006.dga").AssumeTFF().Telecide().Decimate(cycle=5)
audio=NicAC3Source("00001 PID 1100 2_0ch 48KHz 192Kbps DELAY 0ms.ac3")
AudioDub (video, audio)


When you have AssumeTFF(), Telecide and Decimate without video= , it doesn't know what that is referring to

Guest
26th January 2010, 04:07
Lots of errors in your scripts. Try this:

DGSource("00006.dga")
AssumeTFF()
Telecide()
video=Decimate(cycle=5)
audio=NicAC3Source("00001 PID 1100 2_0ch 48KHz 192Kbps DELAY 0ms.ac3")
AudioDub(video, audio)

2. I'm guessing that after decimating frames from the video, the audio would be out of sync Wrong. It will be fine. You remove fields but you reduce the frame rate in proportion, so the video playing time remains the same as the audio playing time.

blazer003
26th January 2010, 07:23
Thanks, I just picked up Avisynth for the first time in a long time yesterday, and I'd never done anything but the most basic DGDecoder script, so I'm still learning the scripting language.

Neruon2, that worked perfectly for VirtualDub. Once I thought about the audio/video question, I'm still showing the same amount of video each second, just using less frames to do so.

Ok, so here's a new problem, and this may not be something you can help with. The script works perfectly in Virtualdub, both video and audio, both playback (though choppy) and export. But when I bring the script into Premiere CS3, the audio is heavily distorted like when you record with your mic gain way to high. The actual volume never goes over -5db, but the clip, though recognizable as the actual audio, is jacked up so loud in that range, if that makes sense.

Turning the volume down only gives you a quieter, but still distorted audio clip. Anyone have any suggestions about AC3 audio, scripts, and CS3?

BTW, thanks for your hard work on the DGDecoderNV, neuron2. When I bought it, I wasn't sure what to expect, but it really works like a charm. Also, before I miscredited the decomb filters. I didn't realize those are yours as well. (And I recorrect as I figure out that you are in fact Donald Graft,) Anyways, thanks for all the plugins and filters.

Guest
26th January 2010, 15:35
You say the audio is fine when you play the script in VirtualDub but not in CS3. What happens if you ignore that and render the output from CS3? Is the resulting stream OK? I'm wondering if it's just a playback issue in CS3.

blazer003
26th January 2010, 20:12
You say the audio is fine when you play the script in VirtualDub but not in CS3. What happens if you ignore that and render the output from CS3? Is the resulting stream OK? I'm wondering if it's just a playback issue in CS3.

Thanks again for more help. After a bit more research, I figured out that AC3 is not actually supported in Premiere CS3. I have a plugin that allows DVD style AC3 audio that is often in .VOBs, but apparently it doesn't work for the AC3 audio my camera produces as I tried to import just the raw AC3 file that is produced by DGIndexNV and Premiere won't accept it.

Is there a way to make the ac3 audio, I don't know, look to Premiere like the AC3 audio you'd find in a .VOB file off of a DVD? Does anyone know what the differences are? Or any other way to get this to play or read like a different format through the script? Otherwise I'll be converting the audio, unfortunately.

um3k
26th January 2010, 21:36
To fix the problem with Premiere, add this to the end of your script:

ConvertAudioto16bit()

At least, that's what works for me.

Guest
26th January 2010, 22:18
The Avisynth script delivers uncompressed audio, not AC3. That is why I asked what happens when you just go ahead and render. But you didn't answer that question.

blazer003
26th January 2010, 22:35
The Avisynth script delivers uncompressed audio, not AC3. That is why I asked what happens when you just go ahead and render. But you didn't answer that question.

Ok, knowing that, I will give it a try. I just assumed I had answered my own question. I will try both suggestions and get back to you.

blazer003
27th January 2010, 00:26
The Avisynth script delivers uncompressed audio, not AC3. That is why I asked what happens when you just go ahead and render. But you didn't answer that question.

The audio comes out just as it is in the timeline, like someone just cranked the gain way up, however um3k's suggestion worked.

My script now looks like this:

LoadPlugin("C:\Program Files\DG Software\dgavcdec109\DGDecodeNV.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\decomb.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\NicAudio.dll")
DGSource("00013.dgi")
AssumeTFF()
Telecide(guide=1)
video=Decimate()
audio=NicAC3Source("00013 PID 1100 2_0ch 48KHz 192Kbps DELAY 0ms.ac3").ConvertAudioto16bit()
AudioDub (video, audio)

It seems to work pretty well. How is my syntax?

neuron2, you suggested that in my script I should put

Decimate(cycle=5)

but in one of the guides for decomb (possibly written by you) it says for a standard 3:2 pulldown frame removal that

Decimate()

will work, and it appears to be working correctly like that. Are there any speed/quality/other advantages to putting (cycle=5) on there?

Guest
27th January 2010, 01:04
How is my syntax? Just fine.

Decimate(cycle=5) is the same as Decimate(), because the default value for cycle is 5.

blazer003
27th January 2010, 01:24
My plan is to use this script to render out proxy files in VirtualDub (possibly 16:9 DV Clips?), edit with those proxies in Premiere, and then replace the proxies with these scripts to frame serve the original AVCHD into the final render.

Any caveats in this workflow? Some have suggested that there are advantages to converting the AVCHD into a lossless format before applying effects and color correction. It seems to me that encoding in a lossless format will still include the compression artifacts from the original files anyway, so if I'm applying all the effects to the original file, I shouldn't be losing anything. But then again, I'm not very experienced with how AVCHD works.

Finally, thank you guys (especially neuron2) for your help. It would have taken me weeks to figure out all these intricacies by searches and forum and manual reading. I appreciate the time you've taken to help.

osgZach
27th January 2010, 22:36
The main benefits of working in lossless, is that it allows you to do intermediate work, without slowing down the final encoding process with slow script functions that take high CPU, and make the overall final encode take longer.

When you do your final encode, nothing but your encoder will be hogging your CPU. Which is good if you particularly like to use slow settings that might take a couple hours anyway.