digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth: Audio Import? (http://www.digitalfaq.com/archives/avisynth/13382-avisynth-audio-import.html)

the viking 03-07-2005 06:49 AM

Avisynth: Audio Import?
 
Hello,
Some days ago I bought a KISS DP-558 Hd recorder/dvdplayer.
It works great so far.I have tried with most of the KVCD/KDVD resolutions,and all plays fine.The only thing that troubles is AutoGK
produced XviD,but thats another story.

The recorder produces one .vob file for each tv show you record.
The audio is AC3 2ch 192kbs.

So with the ftp connection I transfer my recorded shows to the pc,
uses DGIndex 1.2.1 to produce .d2v file for avs script.
The demuxed ac3 stream always reports a delay of 152ms.

When I record tv shows,the recordings starts one or two minutes before,
and ends two minutes after the shows.This stuff I want to cut with
trim() command in the script,and to get things done in a "easy" way
with audio in sync,and cutted on the right places,I want to take the audio
through the script as well.

So I found two methods of doing this,one with ac3source() and another
with directshowsource.
I read somewhere that ac3source() downmixes incorrectly so its better
to use directshowsource() for audio import.
I made two tests yesterday,and both methods seems to play fine .
I used TMPGnc with toolame do to the encoding.

Any one of you have any ideas whats the "best" one to use??

Script with DirectShowSource:

Quote:

LoadPlugin("C:\Programfiles\MovieStacker\Filters\D GDecode.dll")
LoadPlugin("C:\Programfiles\MovieStacker\Filters\U ndot.dll")
Video=Mpeg2Source("C:\Documents and Settings\Eier\Skrivebord\codemercury.d2v")
Audio=DelayAudio(DirectShowSource("C:\Documents and Settings\Eier\Skrivebord\codemercury.ac3"),0.152)
AudioDub(Video,Audio)
AssumeTFF()
bob(0,0.5)
Crop(8,88,704,400)
Undot()
AddBorders(8,88,8,88 )
ConvertToRGB24() # For TMPGEnc or VFAPI
SeparateFields()
SelectEvery(4,1,2) # SelectEvery(4,0,3) for bottom field first video
Weave()
#Trim(0,6000).FadeOut(150)
#info()

Script With AC3Source:

Quote:

LoadPlugin("C:\Programfiles\MovieStacker\Filters\D GDecode.dll")
LoadPlugin("C:\Programfiles\MovieStacker\Filters\A C3source.dll")
Mpeg2Source("C:\Documents and Settings\Eier\Skrivebord\disney.d2v")
AC3Source("C:\Documents and Settings\Eier\Skrivebord\disney.ac3")
DelayAudio(0.152)
AssumeTFF()
bob(0,0.5)
ConvertToRGB24() # For TMPGEnc or VFAPI
SeparateFields()
SelectEvery(4,1,2) # SelectEvery(4,0,3) for bottom field first video
Weave()
Trim(0,6000)

Also look at the delay audio stuff in the scripts,I think its correct,
,but im not sure :wink:


-------------------------
viking

Dialhot 03-07-2005 07:11 AM

I would have said that the best to use it to cut the file in dgindex !
Your solution is interresting to cut a part in the middle of the movie, but to trim begining and/or end of the video, it's far easier to use the "[" and "]" button of dgindex : it will produce a correct (trimed) d2v and ac3 files.

the viking 03-07-2005 07:50 AM

Thanks a lot ,I was sure there was a easier way :D

But another question,I do the trimming in DGIndex,the AC3 file
reports Delay 152ms.

If I only put the video into the script and then mux with the ac3 file
when finished,is there any of the dvdauthor programs that
"take care" of the delay so the authored result will be in sync?

(Ive just formatted the pc ,so I havent any authors installed right now)

Cause if that works I can use the ac3 track as it is.

----------------------------
viking

Dialhot 03-07-2005 08:02 AM

Quote:

Originally Posted by the viking
But another question,I do the trimming in DGIndex,the AC3 file reports Delay 152ms.

The delay can change depending on where you cut the file (not sure).

Quote:

If I only put the video into the script and then mux with the ac3 file
when finished,is there any of the dvdauthor programs that
"take care" of the delay so the authored result will be in sync?
First, you do not need to mux as all dvd author programms work on elementary streams, that means that they will demux all muxed things you give to them !
Secondly, tools like DVDLab has an internal tool to add/cut delays in ac3 but this is not automatically done. Other software don't have such tool. So I prefer to use an external tool, very convenient, called AC3 Delay Corrector : http://home.t-online.de/home/520072193568-0001/

You just have to run it on you ac3 stream before to authort the DVD.

the viking 03-07-2005 08:16 AM

This is what I found with DVDAuthorGUI:
(I havent tried it ,so I dont know if it works)

http://www.digitalfaq.com/archives/i.../2005/03/1.jpg

Yes I have tried AC3 Delay Corrector,and I feed it with the AC3 file with
152ms delay,here what the log file says after processing:
Quote:

Source file information:

Sampling rate: 48 kHz
Nominal bit rate: 192 kbps
Framelength: 0x0300
Length: 108601frames (00:57:55,232)
There are 31.25 frames in one second.
152ms (00:00:00,160) to be add at beginning.

Target file information:

5 frames (160ms) have been added at start.
108606 frames (00:57:55,392) have been written.
There are 31.25 frames in one second.

For some reason it adds 160ms at the start and not 152ms.
And then is my question,isnt the audio still out off sync by 8ms??

-------------------
viking

Dialhot 03-07-2005 08:41 AM

Quote:

Originally Posted by the viking
For some reason it adds 160ms at the start and not 152ms.

31.25 frame per second means a frame last for 32 ms. 152 is not divisible by 32 while 160 is. As ac3 delay corrector does not works on uncompressed datas but directly in ac3 format, it can't manipulate smaller piece than a frame.
Note: It's strange to have a delay that is not a mutiple of a frame length 8O

Quote:

And then is my question,isnt the audio still out off sync by 8ms??
Your bat will probably suffer from this but not you :-)

the viking 03-07-2005 03:26 PM

Yep its probably hard to notice a 8 ms delay :lol:

But I found another way to fix the delay,AC3Machine,if it
set delay to 0ms or 8ms I dont know,and I guess
its hard to find out as well.

-----------------
viking

Boulder 03-07-2005 03:39 PM

Ac3Machine/BeSweet don't do correct delay correction, there was some information about this at the D9 forum some time ago. IIRC it was that they cut one frame too much or something like that.

EDIT: Just found it : http://forum.doom9.org/showthread.php?s=&threadid=85113 .

the viking 03-07-2005 03:51 PM

Hmmm,okay,then the Doom9 guide for AC3 machine is wrong as well,it says:
"Leave Set Delay to checked so you won't have to tamper with offsets when adding the AC3 to your DVD projects (or AVIs)."

So then I guess AC3 delay corrector or setting delay in
the authoring prog will be the solution for me!

---------------------------
viking


All times are GMT -5. The time now is 10:50 PM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.