View Full Version : ac3/dts/mpa/wav delay+cut tool: v1.2.0.4
jsoto
24th February 2004, 22:14
Hi all,
I've written a tool able to manage dts and ac3 for:
- cutting
- delay correction
- fix crc errors (only in ac3)
May be someone finds it useful...
: Deleted the links, not updated
Web sites
http://www.videohelp.com/~jsoto
http://jsoto.posunplugged.com/
Any bug report will be welcome
jsoto
patja
25th February 2004, 03:04
Cool. I record HDTV programming and there are often errors in the AC3 audio that I've had to run through ac3fix. But then the audio would get out of synch with the video. Would I be correct in hoping that using this tool, with the option to replace CRC errors with Silience, would keep the audio in synch with the video?
I am trying it now.
What does the message "some basic parameters changed between frame #1 and this frame" mean? I get row after row of this message.
imel6
25th February 2004, 03:40
Nice. Lookign forward to more development -
multiple cuts at once
cut by frame
Thanks for the tool
daphy
25th February 2004, 09:56
new developments are always welcome on this board :D
so letīs check it out ;)
CYA Daphy
irulat
25th February 2004, 10:17
Excellent work. Excuse the naievity, but would it be a big jump in capabilities for a tool to allow a volume change?
UNICO
25th February 2004, 12:05
Great tool!
What about "delaycut.dll"? I'm afraid I wouldn't be the only one that would merge it into his own DVD->DivX app... or am I??? :eek:
Thanks
Joan
SeeMoreDigital
25th February 2004, 13:47
Fab tool!
Just used it to create a 000ms AC3 clip from a -300ms AC3 clip.
I then converted the AC3 stream to AAC stream prior to muxing with an XviD Mpeg4 video stream into an MP4 container!
Everything was very nicely in sync!
Over the past few weeks I've been experimenting with converting Mpeg2/AC3 .TS HiDef TV captures to anamorphic Mpeg4/AAC .MP4 and this tool looks like it can do the business!
However, you may not be aware that a lot of HiDef TV broadcasts in Japan use AAC audio (not AC3). And, when the AAC audio stream is demuxed from the Mpeg2 video stream the AAC stream becomes delayed....
So it would really be great if your tool could fix the delay in AAC audio streams too!
Cheers and many thanks
depressya
25th February 2004, 17:25
cool tool :) and what about normalizing tool for ac3 files? :) it could be useful tool like this for videoclip compilations from different dvd's
gizmau
25th February 2004, 20:13
@SeeMoreDigital
are you sure that your cutted track came out at 0ms?
afaik ac3 has fixed frame duration of 32ms, which would result in an offset of 12ms, which is virtually a zero-delay due to the frame duration of 40ms (pal).
i am if i remember right, but didnt besplit allready cut dts and aac, too? maybe its worth a try (again...).
jsoto
25th February 2004, 20:56
Too much interest for this little prog (I found the reason, it was mentioned in doom9 news...)
Well, some clarifications:
- I've written this tool just to be able to cut dts tracks. The rest of features are already supported by freeware (ac3 delay corrector, BeSweet). I didn't know besplit was able to cut dts...
- This is a simple tool, which only manages frames.
@patja
"some basic parameters changed between frame #1 and this frame.."
This message advices about a major change (bitrate, framesize, etc) between first frame and the current one. I know I have to modify this, only one message per change..
Target file calculations are done using framelength (taken from the first frame) so if there is a major change on this, probably the output file will be unuseful.
with the option to replace CRC errors with Silence
This is the "normal" behavior of a tool like this (IIRC BeSweet does the same). But in the case of an uncompleted frame, you really do not know how many frames have been lost, and there is no way to recover the synch.
@imel6
multiple cuts at once: You can use CLI support. Seeking is fast.
cut by frame: I'll look into it, but I'm now busy in other stuff..
@irulat
to allow a volume change?
delaycut is a very SIMPLE tool. Only cuts/adds frames, it is unable to decode, sorry. The maximum it could do is to change some BSI parameters (but IMHO it has no sense)
jsoto
xixi2000
26th February 2004, 03:53
Cool,2DISK DVD black frame ok?
try
irulat
26th February 2004, 10:03
@jsoto
delaycut is a very SIMPLE tool. Only cuts/adds frames, it is unable to decode, sorry. The maximum it could do is to change some BSI parameters (but IMHO it has no sense)
Thank's for the reply, all the same!
SeeMoreDigital
26th February 2004, 21:08
Originally posted by gizmau
@SeeMoreDigital
are you sure that your cutted track came out at 0ms?
afaik ac3 has fixed frame duration of 32ms, which would result in an offset of 12ms, which is virtually a zero-delay due to the frame duration of 40ms (pal)... You're right. It was just a fluke that I managed to get the audio in sync with the video!
Anyway, speaking as a total beginner to this sort of application. Do you have any tips on how I can convert an AC3 file with -504ms delay to 000ms?
Cheers
jsoto
27th February 2004, 18:24
@xixi2000
2DISK DVD black frame ok? What does it mean? :confused:
@SeeMoreDigital
Do you have any tips on how I can convert an AC3 file with -504ms delay to 000ms?
Using this tool (or any other loseless one) you will be able to correct delay in frame steps (32 msec). This method gives a maximum of 1/2 frame (+-16 msec) of delay error. (Delaycut shows this error in the parameter NotFixedDelay of target file info).
For an exact delay correction you will need to reencode, which, IMHO, is a worse solution in terms of quality.
BTW, delay can also be corrected in a loseless way during DVD authoring (if this is final destination of the ac3 file).
jsoto
Trahald
2nd March 2004, 05:48
Your app has a hard time with files fixed with the old ac3 delay corrector. It isnt able to detect the ac3/dts settings and therefor wont process the file. It does fine with files that ac3 corrector makes no correction on (ie you create a 'fix' file but without setting a delay) but with a delay , delaycut doesnt read it. the format might be slightly off after the delay, but everything else (scenarist, ac3 correcter itself, dvd lab etc) has no problem with the file. Just wondering if you can take a look at adding something so it can handle these files.
Thanx for the great app, btw.
jsoto
2nd March 2004, 23:51
@Trahald
the old ac3 delay corrector.
Which one?. I've tested v2.0 and v2.1b1 without any problems.
Could you give me more detailed info?
jsoto
Trahald
3rd March 2004, 20:20
2.1.b.1
so far.. if i take an ac3.. and with 2.1.b.1 i set -212ms delay (made up a number for the example).. then i load that file into delaycut. delay cut will not pull any info about the ac3/dts and there for will fail to process the file
now if i take the new ac3 that 2.1.b.1 delay corrected, and run it through 2.1.b.1 again but with 0 delay (so essentially it just rewrites the file with a new name) .. the new file loads into delaycut fine.. shows all ac3 info and will perform any requested operations
it does it on every file ive tried it on that 2.1.b.1 has delay fixed. shows this message
====== INPUT FILE INFO ========================
File is unknown
=============================================
====== TARGET FILE INFO ======================
=============================================
if i load the same file through 2.1.b.1, it it shows all the details and if i make a new file from that file but with delay 0 - then rerun the new file with delay cut, delaycut shows the full ac3 details
example
====== INPUT FILE INFO ========================
File is ac3
Bitrate (kbit/s) 192
Act rate (kbit/s) 192.000
File size (bytes) 139385088
Channels mode 1/0: C
Low Frec Effects LFE: Not present
Duration 01:36:47.712
Frame length (ms) 32.000000
Frames/second 31.250000
Num of frames 181491
Bytes per Frame 768
Size % Framesize 0
CRC present: YES
=============================================
====== TARGET FILE INFO ======================
Start Frame 0
End Frame 181490
Num of Frames 181491
Duration 01:36:47.712
NotFixedDelay 0.0000
=============================================
jsoto
3rd March 2004, 20:46
Humm, it's a mono track...
I never tested one, and not sure if I have access to one, could you cut one second and send it to me?
jsoto
Trahald
4th March 2004, 01:32
that just happened to be one i picked.. same thing happens with DTS or 5.1 ac3 ;)
also the version i use is the one that is included with doitfast4u.. i dont know if its been altered at all.. i dont thing so.. but if you may want to use that version if your not already .. thanx
jsoto
4th March 2004, 01:58
May be it's a little bit stupid, but delaycut needs file extensions .ac3 or .dts, are you changing it with ac3 delay corrector?.
I've tested several dts, 5.1 ac3 and 2/0 ac3 without any problems...
jsoto
Trahald
4th March 2004, 02:05
thanx for the quick reply.. well doitfast4u names them with the proper extensions. like i said.. everything i load them into takes them fine.. just not delay cut :/
Trahald
4th March 2004, 15:37
Ahh.. I figured it out... it has to do with the extension.. but not the way you think.. doitfast4u uses all capitals in the extension AC3 and DTS... i guess your app only checks for lowercase. once i rename it from .AC3 to .ac3 .. voila! delaycut takes it without a problem
nicolati
4th March 2004, 15:44
Even to me it gives the same error. It doesn't like the ac3 file (unknown) and any operations done on this file gives "Finished with errors". This file is an Ac3 doing with the VOBID process of DoItFast4U.
Bye.
nicolati
jsoto
4th March 2004, 23:55
Thanks Trahald,
Stupid bug.. fixed. Please download again same links.
jsoto
Trahald
5th March 2004, 00:44
thanks for the fast fix.. will test when i get home
gatormac
12th March 2004, 05:00
Thank you! I've been looking for something like this.
nicolati
16th March 2004, 12:37
Hi. Why doesn't delaycut correct the lenght correctly. I do an example: I have an Ac3 of 19.328 seconds, if I set an end lenght of -200 (msec), it will be 19.712; instead it should be 19.528. Why does delaycut does this thing???
Bye.
nicolati
jsoto
16th March 2004, 19:35
I cannot reproduce the problem. Please, could you post the complete info window?
jsoto
wasp
23rd March 2004, 10:13
Simple question.
I have got an ac3 audio stream, which has got a -280ms delay.
I'm trying to set it to 0ms.
Which settings I must put into delaycut to do this?
Because I still have: NotFixedDelay= 8.0000
?
jsoto
23rd March 2004, 20:29
@wasp
280 msec is not an exact multiple of 32 msec. The closest multiple is 288 msec (=9x32), which is the value selected by delaycut. This will give you a "delay error" of 8 msec which is virtually zero.
To get a real zero delay it is required to recode the ac3, but IMHO it will give a worse quality than 8 msec of "delay error".
jsoto
D3s7
24th March 2004, 07:47
jsoto :
thanks again for such a great tool and the source...
I was having a problem finding correct duration lengths for DTS for ScenAid and low and behold the slight corrections you have to bitrate were the key
You run across those somewhere?
jsoto
24th March 2004, 12:53
@D3s7
thanks again...
You are welcome.
correct duration lengths for DTS
Me too, but finally I understood the difference between actual and targeted in dts specs (http://webapp.etsi.org/action%5CPU/20021224/ts_102114v010201p.pdf) , page 14, table 5-8.
jsoto
numlock
13th August 2004, 19:05
The download links don't work. Is htere a mirror somewhere ?
jsoto
22nd August 2004, 01:40
A performance improvement...
v1.1.0.3 Changelog
Improvement: Using fread and fwrite functions, delaycut is much
faster than before.
Changed: Log window automaticaly scrolls to the end
www.posunplugged.com/jsoto
www.iespana.es/jsoto
@numlock
Sometimes iespana.es is down...
jsoto
Emp3r0r
15th November 2004, 18:50
jsoto: thanks for your progam
I have a small request: can you make delaycut automatically detect a delay in an AC3 filename use that for the -start value.
For example, DGIndex usually spits out files that look like:
file 2ch DELAY -133ms.ac3
Running delaycut from command line would look like
delaycut "file 2ch DELAY -133ms.ac3"
instead of
delaycut -start -133 "file 2ch DELAY -133ms.ac3"
Also, can you add an output parameter so we can specify the output filename.
Thanks
SeeMoreDigital
15th November 2004, 18:59
Nice idea :)
Cheers
jsoto
15th November 2004, 20:07
Originally posted by Emp3r0r
I have a small request: can you make delaycut automatically detect a delay in an AC3 filename use that for the -start value.
I'll look into it.
Also, can you add an output parameter so we can specify the output filename.
Sure.
jsoto
planet1
16th November 2004, 01:06
Hi jsoto,
first "gracias por este gran pedazo de software", ;)
could you implement some drag and drop mode into the tool - should speed up things...
last but not least - since your tool has a pretty good dts support - could you write a programme which extracts a DTS stream from a WAV container ?
Basically this covers only dts from Audio CDs (5.1 Music Discs)
[if we ignore some exotic dts-wavs recorded from LaserDiscs]:
http://dtspassion.free.fr/Cd%20Audio.htm
http://www.dtsentertainment.com/music-featured.php
BeSplit from dspguru and DTS-Parser from hypercube used to do the job, but they are far from beeing perfect - they often create weird dts outputs, which play horrible or even make your delaycut freeze ;).
adios
btw are there any other ways to find out the delay of an ac3 or dts file than using vobedit ?
jsoto
16th November 2004, 18:41
Originally posted by planet1
could you implement some drag and drop mode into the tool - should speed up things...
I'll look into it.
could you write a programme which extracts a DTS stream from a WAV container ? No in this tool.
are there any other ways to find out the delay of an ac3 or dts file than using vobedit ? VobBlanker and DVD2AVI also give you the delay. I prefer to use VobBlanker to get the delay ;)
jsoto
jsoto
22nd November 2004, 22:48
v1.2.0.1
Added: mpa (fsample=48k) support.
Added: drag/drop files in main dialog (thanks to jeanl for the example) and also in icon ("open with")
Added: -auto option in CLI mode: autodetect the delay in input filename (assuming DVD2AVI naming style)
Added: -out option in CLI mode to specify the output filename.
jsoto
jorel
23rd November 2004, 00:49
great news.
thanks!
:)
GZZ
29th November 2004, 01:46
What about delaycut in LPCM file (wave files). if its possible to correct these, will it then be in the next version ??
GZZ
GZZ
29th November 2004, 12:52
I can't get delaycut working with my MPA files. I get nothing but noise in my output file are applying delay and yes my MPA file are 48khz
It still works fine with DTS and AC3 sound, but not with MPA files..:/
GZZ
jsoto
29th November 2004, 14:07
It still works fine with DTS and AC3 sound, but not with MPA files True. Seems I've broken something in the last build. I'll fix it this night.
What about delaycut in LPCM file (wave files). if its possible to correct these, will it then be in the next version ?? Mmm. May be in a future. Wave files are not based on frames, but I can work with one sample as "one frame".
jsoto
jsoto
30th November 2004, 14:16
v1.2.0.2
BugFix: mpa was broken in 1.2.0.1
BugFix: Info dlg refresh.
jsoto
buzzqw
30th November 2004, 15:49
could be possible to implement an auto-detect delay value based on filename ? Es. "Movie AC3 T02 2_0ch 256Kbps DELAY 80ms.ac3" has a delay of 80...
Would be very usefull for command line application :)
Thanks
BHH
jsoto
30th November 2004, 19:43
@buzzqw
could be possible to implement an auto-detect delay value based on filename ? Es. "Movie AC3 T02 2_0ch 256Kbps DELAY 80ms.ac3" has a delay of 80...
:confused: :confused: do you mean it doesn't work?.
Already requested by Emp3r0r and included in 1.2.0.1.
Added: -auto option in CLI mode: autodetect the delay in input filename (assuming DVD2AVI naming style)
jsoto
buzzqw
1st December 2004, 08:25
my mistake, this fuction is already present
but for me is broken
here the command line
---> delaycut.exe -auto -out aaa.ac3 "qqq AC3 T02 2_0ch 192Kbps DELAY -144ms.ac3"
---> log
[Input info]
Bitrate=0
Actual rate=0.000000
TotalFrames=0
Bytesperframe=0
Filesize=0
FrameDuration= 0.0000
Framespersecond= 0.0000
Duration=
Channels mode=
LFE=
[Target info]
StartFrame=0
EndFrame=0
NotFixedDelay=-144.0000
Duration=00:00:00.000
EDIT : this command produce a 0-byte aaa.ac3 file
---> only info
[Input info]
Bitrate=192
Actual rate=192.000000
TotalFrames=1839
Bytesperframe=768
Filesize=1412925
FrameDuration= 32.0000
Framespersecond= 31.2500
Duration=00:00:58.871
Channels mode=2/0: L+R
LFE=LFE: Not present
i will try with longer audio file
Thanks again
BHH
jsoto
1st December 2004, 18:42
You're right. It's broken :( . I don't understand how can I do it so bad ...
Anyway, try again with 1.2.0.3, already uploaded
v1.2.0.3
BugFix: -auto option in CLI mode was broken
jsoto
buzzqw
2nd December 2004, 08:08
It's OK !
Thanks Jsoto !
delaycut.exe -auto -out fix.ac3 "qqq AC3 T02 2_0ch 192Kbps DELAY 144
ms.ac3"
--->log
[Input info]
Bitrate=192
Actual rate=192.000000
TotalFrames=1839
Bytesperframe=768
Filesize=1412925
FrameDuration= 32.0000
Framespersecond= 31.2500
Duration=00:00:58.871
Channels mode=2/0: L+R
LFE=LFE: Not present
[Target info]
StartFrame=-5
EndFrame=1838
NotFixedDelay=-16.0000
Duration=00:00:59.008
====== PROCESSING LOG ======================
Number of written frames = 1844
Number of Errors= 0
A final question: is this way of fix audio delay the same (or produce the same result) as BeSweet when transoding from ac3 to xxx ?
Thanks
BHH
jsoto
2nd December 2004, 19:46
BeSweet is able to transcode and correct the delay in an exact amount. But it is also able to do a loseless (in -payload mode) conversion, obviously without changing the code, that means: from ac3 to ac3 or from mp2 to mp2, just the same that delaycut does.
IIRC, BeSweet had a bug in positive delays, but it has been fixed. Currently, the only issue I know (not sure if it is going to be addressed) is an inexact number of frames calculation (one frame more than the right value) when fixings delay in -payload mode.
jsoto
GZZ
3rd December 2004, 17:39
Another cosmic error I found are the status field. Its showing Processing...0% all the time even when it working, but show 100% when its done...
This is in Version 1.2.0.3.
GZZ
jsoto
3rd December 2004, 19:05
This is due the change in dlg refresh I did in 1.2.0.2... Well, I'll fix in next version.
jsoto
GZZ
3rd December 2004, 23:42
another thing I found out that will be very useful for mpa files are if you set the CRC check to be ON in the first frame only, then scenarist will import it.
Its the second byte in the frame header (4 byte) and then the last bit in the second byte have to be Zero. Then scenarist will alow it to be imported.
link: http://www.dv.co.yu/mpgscript/mpeghdr.htm
GZZ
jsoto
8th December 2004, 00:13
I know, but the goal should be to add a correct checksum, not only the flag, isn't it?. I'd like to add checksum control to mpa files, like ac3 have.
But I'm currently busy in other stuff, so I cannot work on this in a short term.
jsoto
GZZ
8th December 2004, 20:07
but the goal should be to add a correct checksum, not only the flag, isn't it?.
I think you are talking about the 16 bit CRC checksum which the MPA file structure allow you to add...
I really don't know what you can use it for, I made a code that change the second byte in the header to 252 (11111100), the last bit are CRC on/off (0=on) and its enough for scenarist and I really can't hear any difference and as Iīm only changing the second byte, it only apply for the first frame header. Anyway, you could make an option, so people can se it to on or off. HEHE
Just an idea I came up with..
GZZ
neo75903
10th December 2004, 05:01
Just dropped in to say how fantastic this tool is, now i can apply delays for my AC3 to AAC conversions. It is now part of my tool box :)
Thx alot!
Longinus
18th December 2004, 08:53
Hello, this is a very nice tool!!
I use it for correcting delays and it works just fine!!
But I'm having a problem with an AC3, that I can't fix with your app...
It's from an HDTV source, and so it have a bad frame in the middle of the movie... If I don't fix it, when I convert to MP3 the audio gets out of sync after the bad frame. If I just play the movie with original AC3 track, the Media Player Classic or FFDSHOW AC3 decoder's, play black fine, with no sync errors.
So I tried to correct the ac3 with Delaycut, but it didn't work (gets out of sync). I tried with all the CRC options. They give the same result...
BUT with ac3fix it does work... So I'm wondering if Ac3fix use another method for fixing this???
jsoto
18th December 2004, 16:12
The right option in CRC is silence. I cannot imaging why delaycut does not fix it. Could you post the log?
jsoto
GZZ
20th December 2004, 11:04
I think I found another bug in your delaycut. I got LOTR 3 EE version and when I demux the sound (DTS track) from main movie using DVDdecrypter its working fine, but it got a delay of -80 ms. So I load it up in delaycut and set the start delay to -80 and it working just fine until the last procent, then it hangs or go into endless loop...
So I loaded up the last vob file and notice that the last cell in the main movie (only 12 frames long) got another bitrate then the rest of the movie...The Movie got a DTS bitrate of 768 kbit, but the last cell got a bitrate of 1536 kbit and that might be the reason your program hangs or go into a endless loop.
GZZ
jsoto
20th December 2004, 18:11
Yep, this is something I had in mind... A bitrate change (even in ac3) is not well managed by delaycut.
jsoto
planet1
20th December 2004, 19:47
Thanks again jsoto for your great useful tools.
Does delaycut show DTS-ES streams as 6.1 ?
(If so then only for DTS-ES discrete I guess cause my stream was shown as 5.1 (C+L+R+SL+SR - LFE: Present) which was most likely just DTS-ES matrix then)
What about MPEG-2 Audio Multichannel - is this format supported by delaycut ? If thats the case what about files produced by the HyperCube Transcoder http://hypercube.is.dreaming.org/ - they are shown as "normal" MP2 stereo streams ?
Has anyone got an early PAL-DVD with Mpeg )|( to test such streams with delaycut ...
cya ;)
jsoto
21st December 2004, 23:53
Does delaycut show DTS-ES streams as 6.1 ? Well, I did not test too much this area, but what delaycut does is: reads the header and, depending on "amode" (see dts specs) reports this:
if (amode==0) fileinfo->csMode="Mono";
else if (amode==1) fileinfo->csMode="A+B (Dual Mono)";
else if (amode==2) fileinfo->csMode="L+R (Stereo)";
else if (amode==3) fileinfo->csMode="(L+R) + (L-R): (Sum + Diff)";
else if (amode==4) fileinfo->csMode="LT + RT ";
else if (amode==5) fileinfo->csMode="C+L+R";
else if (amode==6) fileinfo->csMode="L+R+S";
else if (amode==7) fileinfo->csMode="C+L+R+S";
else if (amode==8) fileinfo->csMode="L+R+SL+SR";
else if (amode==9) fileinfo->csMode="C+L+R+SL+SR";
else if (amode==10) fileinfo->csMode="CL+CR+L+R+SL+SR";
else if (amode==11) fileinfo->csMode="C+L+R+LR+RR+OV";
else if (amode==12) fileinfo->csMode="CF+CR+LF+RF+LR+RR";
else if (amode==13) fileinfo->csMode="CL+C+CR+L+R+SL+SR";
else if (amode==14) fileinfo->csMode="CL+CR+L+R+SL1+SL2+SR1+SR2";
else if (amode==15) fileinfo->csMode="CL+C+CR+L+R+SL+S+SR";
else fileinfo->csMode="User defined";
What about MPEG-2 Audio Multichannel No, it is not supported. (I didn't do any test with this code). I've a PAL DVD with MPEG sound, but it is a MPEG1 L2 (2 channels).
jsoto
buzzqw
29th December 2004, 09:41
Could be possible to include wav (lpcm) file support ?
Thanks anyway
BHH
jsoto
1st January 2005, 00:26
v1.2.0.4
Added: Linear PCM (wav) support (16 & 24 bits; 20 bits untested)
Added: mpa checksum calculation and fixing.
Added: 44.100 mpa minimum support. (short delays)
BugFix: Percentage dlg refresh
BugFix: Different rate frames in dts caused delaycut to hang
jsoto
EDIT: I've also updated "Silence.exe" to support wav and mp2 files
D3s7
1st January 2005, 02:09
awesome... thanks :)
(minor thing.. the res dir in the source is empty)
jsoto
1st January 2005, 04:13
(minor thing.. the res dir in the source is empty)Sorry, I forgot to check "include subfolders" in WinZip. I've uploaded it again.
jsoto
buzzqw
1st January 2005, 15:28
Thanks Jsoto !!!
and happy new year :)
BHH
D3s7
1st January 2005, 16:27
Jsoto:
just noticed with silence that you have on the menu "Dolby Digital" and "DTS"
I'm assuming by the code "Dolby Digital" is suppose to be AC3 or has AC3 been removed from the dialog
Thanks again for the application :)
jsoto
1st January 2005, 17:49
Originally posted by D3s7
I'm assuming by the code "Dolby Digital" is suppose to be AC3 You're right. Dobly Digital is ac3. Changing the code, the parameters group will change to the supported values, but also the file extension if you have already selected one.
jsoto
jsoto
1st January 2006, 20:37
Incredible!! Just one year after...
I don't follow much this forum, so may be these tools are quite old and unuseful today, but, in any case:
I did some minor improvements in delaycut (suggested by tebasuna51) and silence.
delaycut v1.2.1.0
Added: 44.1kHz and 32 kHz ac3 support (suggested by tebasuna51)
Improvement: In case of unsynchronized frame, rewind one frame more to look for the synch word inside the previous frame (suggested by tebasuna51).
Changed: AC3 silence frames are now calculated from only two patterns (2/0 and 5.1)
Silence 1.2.0.1
Added: ac3 at 44.1 and 32 KHz
Changed: AC3 silence frames are now calculated from only two patterns (2/0 and 5.1)
Happy new year (the next one this time) to all
jsoto
SeeMoreDigital
1st January 2006, 21:16
Thanks mate :)
tebasuna51
2nd January 2006, 03:17
Thanks for your job, jsoto.
Tested the support for 32, 44.1 KHz. and the rewind improvement. All seems ok.
I want to explain a bit my suggestion. If we have an ac3 stream (movie soundtrack) bad cut and join, there are incomplete frames inside. In previous DelayCut version not only this incomplete frame can be rejected, also the next correct frame is lost. Then the audio is out of sync 16 ms (half frame in average) + 32 ms (next correct frame rejected). Now the next correct frame is preserved.
I agree with you, jsoto, "these tools are quite old" but not "unuseful today". We need manage the old ac3 to make DVD and surround sound for standalone players a little bit more.
Thanks.
buzzqw
2nd January 2006, 08:11
Thanks again JSoto !
i think i found a little bug
in command line mode if output file is within a directory with spaces Delaycut will output a file named as first part of directory name , and not in directory output
let's say
Delaycut.exe -auto -out "c:\test test\fixed.ac3" "c:\in\movie with a delay.ac3"
i will find a file named "test" in c:\
thanks !
BHH
jsoto
2nd January 2006, 14:43
@buzzqw
You're right. Fixed, but I'll wait a few days before release it. Additional bugs could appear....
jsoto
Sajan
5th January 2006, 15:22
@jsoto Feature request
Can you increase number limit in delay start/end editboxes?
Cause negative delay can be less than 10 sec...
Something as:
CDelaycutDlg::OnInitDialog()
pCEdit = (CEdit*) GetDlgItem(IDC_EDITDELAYS);
pCEdit->SetLimitText(8);
pCEdit = (CEdit*) GetDlgItem(IDC_EDITDELAYE);
pCEdit->SetLimitText(8);
jsoto
6th January 2006, 00:25
@jsoto Feature request
Can you increase number limit in delay start/end editboxes?
Done. Tremendous and difficult feature... :D
jsoto
Xayd
6th January 2006, 03:29
if you're still updating this... ;)
the delay values seem to have a maximum of 9999, it would be nice to have more. in the case of muxing replacement soundtracks from DVDs into HDTV captures, to get a better bitrate ac3 or dts to replace the broadcast audio, it's often a huge delay adjustment you need to fix, like 30 seconds or more. i've been using your tool and just using multiple 'passes' on successive files with 9999 until i get to the target delay, but that's a bit tedious obviously.
i can't remember having a delay longer than a minute or so to adjust, a max of 100 seconds instead of 10 seconds, if possible, would cover just about anything.
thanks for the app, it works great.
jsoto
6th January 2006, 11:55
@Xayd
Is there any other limit than the GUI?
I think you are asking the same than Sajan three posts above, aren't you?
jsoto
Sajan
6th January 2006, 14:14
@Xayd
Yes. I was asking about the same thing. So it's done. Just wait for release.
@jsoto
Thanks a lot for "tremendous and difficult" work:)))
Sajan
6th January 2006, 14:20
@jsoto
BTW, your tool is really good. It do it's work fantastic fast:) Before I've met Delaycut I used BeSweet just for delaying AC3... it's much slower...
jsoto
6th January 2006, 22:07
Thanks, Sajan...but BeSweet is much much more (I know you know it).
delaycut 1.2.1.1 is out. Check my sites..
Changed: Maximum number of char changed to 8 in delay edit boxes
BugFix: Spaces in output path (CLI mode)
jsoto
Sajan
7th January 2006, 08:08
@jsoto
Yes, I know about BeSweet. But sometimes powerful programs can't do very simple operations..... no, they can but do it very slowly because optimized on other work. So BeSweet is optimized on processing audio and implement delay not by delaying but through processing entire audio.
Such as PGCdemux creates celltimes.txt by processing entire PGC (try create celltimes without audio & video demuxing in PGCdemux and in IFOedit).
Xayd
8th January 2006, 00:31
@Xayd
Is there any other limit than the GUI?
I think you are asking the same than Sajan three posts above, aren't you?
jsoto
whoops, yes, completely missed sajan's post.
thanks!
katjarella
4th February 2006, 17:33
BugReport from 24th May 2005, 15:41
Hello jsoto.
Can you correct the Duration indication with delaycut?
delaycut.exe -info audio.wav
[Input info]
Bitrate=2304000
Actual rate=2304000.000000
Byte rate=288000
Sampling Frec=48000
Bits of Prec=24
TotalSamples=13599557
Bytespersample= 6.0000
Filesize=81597386
Duration=00:00:00.283
Channels mode=2 Channels
Delaycut Info Window
====== INPUT FILE INFO ========================
File is wav
Bitrate (kbit/s) 2304000
Act rate (kbit/s) 2304000.000
Byte rate (kbit/s) 288000
File size (bytes) 81597386
Channels mode 2 Channels
Sampling Frec 48000
Bits of Prec. 24
Duration 00:00:00.283
Sample length (ms) 0.020833
Num of samples 13599557
Bytes per Sample 6
Size % Samplesize 0
=============================================
====== TARGET FILE INFO ======================
Start Sample 0
End Sample 13599556
Num of Samples 13599557
Duration 00:04:43.324
NotFixedDelay 0.0000
=============================================
Thanks beautifully.
jsoto
12th February 2006, 13:32
Done (I hope) in 1.2.1.2
jsoto
katjarella
13th February 2006, 07:22
Done (I hope) in 1.2.1.2
jsoto
Many Many Many thank you.
wenjia
27th February 2006, 12:28
Hi jsoto,
I'm a total newbie at ripping and encoding. I am currently using dgindex to generate d2v files along with mpa files. Typically there is a whole family of mpa files with various delay times associated with a single stream. (Maybe because of those "chrink" sounds in poorly encoding dvds and vcds). This results for example in an mpa file which is about 2 seconds shorter.
My question is, how can I use your tool (or is there any other?) where I can put in all dgindex mpa files and it automagically spits out a single mpa file with the correct run time (i.e. delay corrected)?
If there isn't an easy way, is there a painful way? My goal is to eventually encode the (dgindex delay corrected) mpa stream into aac and then mux with mp4 video into and mkv container.
Any help will be appreciated! Thanks!
jsoto
27th February 2006, 22:37
I am currently using dgindex to generate d2v files along with mpa files. Typically there is a whole family of mpa files with various delay times associated with a single stream.
May be I do not understand what you want to do, but the different files are due the different tracks in the VOB, normally used one per each language... It has no sense to concatenate them...
jsoto
FreQi
6th April 2006, 18:31
Of all the programs I have used to correct these errors (others being besliced and ac3fix), Delaycut seems to keep the audio in sync with the video the best. However, some of these cut points that are "fixed" or "silenced" will beep or pop on playback. If I were to send you some sample files that exhibit this behaviour, do you think it would be something you could use to correct these audible errors?
tebasuna51
6th April 2006, 19:05
However, some of these cut points that are "fixed" or "silenced" will beep or pop on playback. If I were to send you some sample files that exhibit this behaviour, do you think it would be something you could use to correct these audible errors?
When a frame have a error there are only four things to do without recompression:
- Ignore: ignore the error and mantain the frame with the error
- Fix: fix the CRC's expecting the error remain unnoticed.
- Silence: fill the frame with silence.
- Skip: delete the output frame
FreQi
6th April 2006, 22:00
Can you also explain the ramifications of selecting each option?
Does Ignore really do nothing other than print a log message indicating that an error exists?
Does Fix replace an embeded CRC code but leave bad data in the stream?
Does Silence mute any audio in the truncated frame, but leave bad data?
Does Skip remove the truncated frame but cause desync to associated video?
What about some sort of combination of Fix and Silence where you mute the bad frame then fix the CRC code...? Would that make sense?
tebasuna51
7th April 2006, 03:12
All truncated frames (too short) are skipped. The next options are applied only for full frames with bad CRC's.
Does Ignore really do nothing other than print a log message indicating that an error exists?
Yes
Does Fix replace an embeded CRC code but leave bad data in the stream?
Yes
Does Silence mute any audio in the truncated frame, but leave bad data?
Silence replace a full (not truncated) erroneous frame with a correct frame containing only silence (without bad data)
Does Skip remove the truncated frame but cause desync to associated video?
Skip remove full erroneous frame (truncated frames are always skipped). And, yes, cause desync to associated video.
What about some sort of combination of Fix and Silence where you mute the bad frame then fix the CRC code...? Would that make sense?
Of course silenced frames have the correct CRC's
jsoto
7th April 2006, 22:03
Thanks for the perfect answer tebasuna51, everything you said is correct.
So, the preferred option (at least to me) is silenced.
jsoto
BTW, I found a problem sometimes (due the last code change) in the case of last frame uncompleted/errored..., seems delaycut rewinds and rewinds and never ends... A simple workaround is to cut away just the last frame.
ganeshpetkar
11th October 2006, 08:10
Hi all,
I m doing AC3 decoder project,
The code wat i m using CRC check is
checksum = 0xffff;
for (i = 0; i < 5/8framesize ; i++)
{
Check_Sum = (Check_Sum ^ CRC_Data [i]);
Check_Sum = (Check_Sum & 0x8000)? (Check_Sum<<1) ^ 0x8005 : (Check_Sum <<1);
}
by using i m not getting the result so can any body snd the algorithm or c-code for CRC error check.
regards
Ganesh
tebasuna51
11th October 2006, 10:26
In delayac3.cpp (DelayCut sources (http://jsoto.posunplugged.com/audiotools.htm)) you have the c-code.
Search for:
ac3_crc_init
ac3_crc
mul_poly
pow_poly
...
ganeshpetkar
12th October 2006, 09:36
Hi all,
Can anybody send AC3 Encoded File or link.
Regards
Ganesh
ganeshpetkar
12th October 2006, 10:22
Hi all,
Can anybody send AC3 Encoded File or link.
Regards
Ganesh
raquete
12th October 2006, 15:28
Hi all,
Can anybody send AC3 Encoded File or link.
Regards
Ganesh
can be this AC3-5.1 448Kbps - ~19.5Mb?
http://rapidshare.de/files/36084216/Overture.rar.html
ganeshpetkar
22nd November 2006, 13:54
Hi all,
I m doing AC3 Decoder code development.
In that i got doubt, that how to transform LFE samples into time domain. since we are using 256 and 512 blocklength transform.
Here we will get 7 LFE samples after mantissa decoding.
and i am in confusion that whether we should mixup with FullBandwidth channel. please
Let me know the solution......
ganeshpetkar
23rd November 2006, 04:26
Hi all,
I m doing AC3 Decoder code development.
In that i got doubt, that how to transform LFE samples into time domain. since we are using 256 and 512 blocklength transform.
Here we will get 7 LFE samples after mantissa decoding.
and i am in confusion that whether we should mixup with FullBandwidth channel. please
Let me know the solution......
jsoto
23rd November 2006, 21:55
Sorry I have no idea, but DGindex is open source and is able to decode ac3. You can take a look to the sources.
http://neuron2.net/dgmpgdec/
Good luck!.
jsoto
ganeshpetkar
27th November 2006, 11:18
Hi all,
I m doing AC-3 Decoder, so i need some Standard Test vectors to test it. So can any body send me standard test vetcor or Link..
Regards
Ganesh
MattO
5th January 2007, 15:00
Stupid question time ;)
I have a .AC3 file with -128ms delay, created in DGIndex, but the delay is not recognised in delaycut.
In which box do I put the -128, and what boxes do I need to check? I am assuming I enter '-128' in the 'Start' box under 'Delay', and that I have to check 'Original Length', but is this correct?
Thank you for any answers
tebasuna51
5th January 2007, 15:48
A negative delay means cut the stream, then you need check 'Cut file' and put
Start: 128
End: you need calculate Num of Frames x Frame length (ms)
You can't obtain always the exact cut without reencode because DelayCut can only cut a exact number of frames i. e. a Frame length multiple.
With 48 KHz the Frame length is 32 ms then cutting 4 frames the cut is exact.
jsoto
5th January 2007, 15:50
delaycut recognizes the delay in the file name only in CLI mode
You have to write -128 in start (msec) box.
You can check or not "original length".
Because your're fixing a negative delay, some frames from the beginning of the file will be dropped (you can see it in "target file info". Checking "original length", the same number of frames (silences) will be added at the end of the file.
EDIT: Didn't see tebasuna51 answer (I was replying).
Yes, using cut is other way in negative delays, but I prefer to use the delay area, (it is more clear to me, and can be also used with positive delays)
jsoto
MattO
6th January 2007, 16:38
Thanks for the help guys :thanks:
Revgen
10th May 2007, 07:35
@jsoto
Do you have any plans to include Dolby Digital Plus (EC3, DD+) cutting support?
madshi
11th September 2007, 21:59
I've just updated delaycut to v1.3.0.0 with full E-AC3 support. Here's the download with "delaycut.exe" and the full source code:
http://madshi.net/delaycut.rar
Of course jsoto is greatly welcome to take the changes over into his code base. And many thanks to him for his extremely useful tool.
menlvd
12th September 2007, 23:04
I've just updated delaycut to v1.3.0.0 with full E-AC3 support. Here's the download with "delaycut.exe" and the full source code:
http://madshi.net/delaycut.rar
Of course jsoto is greatly welcome to take the changes over into his code base. And many thanks to him for his extremely useful tool.
:thanks:
jsoto
12th September 2007, 23:19
I've just updated delaycut to v1.3.0.0 with full E-AC3 support. Here's the download with "delaycut.exe" and the full source code:
This is one of the great things of the open source code. Everybody can contribute.
jsoto
janger
17th October 2007, 01:07
Stupid question time ;)
I have a .AC3 file with -128ms delay, created in DGIndex...
In which box do I put the -128.....?
You have to write -128 in start (msec) box.
You can check or not "original length".
Is this right? I thought negative delay values as reported by DGIndex, Vobedit etc meant the audio comes before the video. But I just did a test with a demuxed vob that has no delay. I set the "start" value to -1000 and the audio definitely plays 1 second too early. So wouldn't that mean if I have a vob that Vobedit reports has a -80ms delay, entering that value in the "start" box would now make it (-80 + -80) = -160ms delay? Where is my thinking wrong?
tebasuna51
17th October 2007, 01:29
So wouldn't that mean if I have a vob that Vobedit reports has a -80ms delay, entering that value in the "start" box would now make it (-80 + -80) = -160ms delay? Where is my thinking wrong?
When you put -80 in "start" box, the ac3 fixed don't have the first 96 ms (always a 32 ms multiple) than original ac3, then can be muxed with the original video with +16 ms delay.
Ok?
janger
17th October 2007, 01:44
Yes but that sort of means it's removing the first frames and "pulling the rest of the audio to the beginning" doesn't it? So if the audio already has a negative delay, which I'm assuming means it comes before the video, then putting a negative value in the start box would make it come even more before the video, doing twice the damage. Won't it?
tebasuna51
17th October 2007, 03:28
@janger
A sample.
A gunshot image occurs at frame 5 and the gunshot sound at frame 7, 80 ms later (if 25 fps).
You need start to play the sound 80 ms before than video to synchronize audio and video. DGIndex inform a delay needed of -80 ms.
To obtain the sync you can also cut the first 80 ms and play audio and video at same time.
janger
17th October 2007, 05:34
tebasuna, are you saying that the values as reported by vobedit, DGindex etc, are the correction values, and not the actual delay?
What I mean is, in your example the audio has a delay (delay means "occur after") of 80ms, but you say DGIndex gives the negative of that, -80ms. This is where I'm getting confused. I always thought the values these programs reported was how much the audio was delayed compared to the video, not the amount needed for correcting it.
tebasuna51
17th October 2007, 12:53
tebasuna, are you saying that the values as reported by vobedit, DGindex etc, are the correction values, and not the actual delay?
Yep :)
If you load in BeLight-BeSweet a file from DGIndex:
VTS_01_6 T01 2_0ch 192Kbps DELAY -112ms.ac3
automatically the Delay box is filled with -112 ms, and the first 112 ms are cut.
digifruitella
13th April 2008, 21:09
i've got a track that plays about 4 seconds before people say anything, 4 seconds is 4000ms... how do I fix this?
tebasuna51
20th November 2008, 11:41
got a problem with converting a 2.0 ac3 track to .wavs: both outcoming wav files are slowed massively down, meaning all sounds and voices are played like ultra slowmotion.
can't say though if this is a specific problem of this single file or a general problem of 2.0 ac3 tracks. only had a 5.1 ac3 track to compare and that one played normaly after wave conversion.
edit: just noticed the track is from a mpeg2 cap and according to mpegrepair 5.1, while eac3to only recognizes it as 2.0
20mb sample of the ac3 track: http://www.sendspace.com/file/nbry8n
50mb sample of the .ts: http://www.sendspace.com/file/03nqcj
The ac3 track is a mix of 2.0 and 5.1 content (typical from a capture) and can't be managed correctly by many soft.
You need fix the track with DelayCut:
1) Open your sample se7ensplit.ac3 and PROCESS the file.
2) You have a log like this:
"Time 00:00:01.120; Frame#= 36. Some basic parameters changed between Frame #1 and this frame"
That means: the first 35 frames are 2.0 but at frame 36 you have other parameters.
3) Put -1120 at 'Delay -> Start' and PROCESS one more time. The first 35 frames are deleted.
4) Open se7ensplit_fixed.ac3 in DelayCut, now you have the first frame 5.1.
Now you can add a 'Delay -> Start' 1120 to compensate the deleted frames in order to maintain the sync.
In your sample the rest of frames are 5.1 but in the full track maybe there are more 2.0 frames (commercials adv.). You need fix the full track.
@To developers.
This is a very common issue, maybe we can add to Delaycut the option to manage the "Some basic parameters changed.." frames like CRC errors:
Ignore, Silence or Skip (we can't Fix, then if Fix is selected the frames must be Silenced).
tebasuna51
20th November 2008, 16:34
@jsoto, madshi
I think we need manage the frames with 'basic parameters changed' like wrong frames or with bad CRC.
Now these frames are 'Ignored' with the result of invalid streams.
With the changes we can obtain valid streams with 'Silence' or 'Skip' options (preserving or not the sync):
--- delayac3.cpp Thu Nov 20 14:53:02 2008
+++ delayac3_mod.cpp Thu Nov 20 14:49:02 2008
@@ -1519,17 +1519,14 @@
fscodn != fileinfo->fscod ||
bsmodn != fileinfo->bsmod || acmodn != fileinfo->acmod)
{
- fileinfo->fscod=fscodn;
- fileinfo->frmsizecod= iFrmsizecodn;
- fileinfo->bsmod=bsmodn;
- fileinfo->acmod= acmodn;
-
nuerrors++;
csAux.Format (_T("Time %s; Frame#= %I64d. Some basic parameters changed between Frame #%I64d and this frame"),
csTime, i64+1, fileinfo->i64frameinfo);
printlog(csAux);
- fileinfo->i64frameinfo=i64+1;
- }
+ bCRCError=true;
+ if (m_iCrc==CRC_SKIP) f_writeframe=WF_SKIP;
+ else if ((m_iCrc==CRC_SILENCE) || (m_iCrc==CRC_FIX)) f_writeframe=WF_SILENCE;
+ } else {
// CRC calculation and fixing.
@@ -1582,6 +1579,7 @@
}
else if (m_iCrc==CRC_SKIP) f_writeframe=WF_SKIP;
else if (m_iCrc==CRC_SILENCE) f_writeframe=WF_SILENCE;
+ }
}
}
Soft comments:
- Preserve the initial parameters from first frame (fileinfo->).
- Like framelength can vary we make bCRCError=true to force search new header inside the wrong frame.
- Ignore, Skip or Silence like CRC error (f_writeframe).
- We don't need CRC calculation in wrong frame (else).
madshi
23rd November 2008, 11:24
I'm not sure if such a logic would really solve all problems. Sure, if the movie itself is 5.1 and there are only very small and short switches to 2.0 (e.g. during ads) then this might work just fine. But what happens if larger parts of the movie switch to 2.0? Then larger parts of the audio track would be silent.
My preferred solution would be to decode 2.0 frames and reencode them to 5.1, while leaving 5.1 frames as they are. Not really sure if that would work, though. Maybe such a mixed track should be fully decoded and reencoded to clear up any problems? Of course decoding would then have to properly handle the 2.0 fragments. E.g. my eac3to tool currently doesn't do that.
73ChargerFan
23rd November 2008, 18:15
I watch my receiver when watching HDTV, or recordings of it, and the audio stream often switches from stereo to DD 5.1. Commercials, intros (i.e. mpaa ratings, network announcements, studio animations) and endings when someone talks over it, like to say what is on next.
Chumbo
7th February 2009, 00:20
I'd like to add another vote for updating the UI so when a file is added, the UI would automatically set the delay. This example is a file created with DGIndex, but I guess it can be smart enough to look at a format of "DELAY xxxms" in any file.Some.Movie_OAR_1080i_dd5.1 PID 014 T01 3_2ch 384Kbps DELAY -376ms.ac3Thanks for considering it. Btw, is the source available for 1.3.0.0? Thank you.
tebasuna51
7th February 2009, 00:42
Btw, is the source available for 1.3.0.0? Thank you.
Yep, the last version from madshi (http://forum.doom9.org/showthread.php?p=1044001#post1044001) is near here with source included
Chumbo
7th February 2009, 19:28
Yep, the last version from madshi (http://forum.doom9.org/showthread.php?p=1044001#post1044001) is near here with source included
Thank you, I looked for it and couldn't find it.
setarip_old
7th February 2009, 19:46
@Chumbo
In your "Quote" section, click on the RED words "the last version from madshi" - and then click on the RED words in the post by "Madshi"...
Chumbo
7th February 2009, 21:12
I just made some updates. I know they're not "official" but I thought I'd share them with you. I changed the version to 1.3.1.0. It's available here (http://www.mediafire.com/?mmzmzltzdzy) for any that want to test the changes.v1.3.1.0
Added: Chumbo UI Mod - 7 Feb 2009
Added UI mod that automatically inserts delay for files
that contain " DELAY xxxms" where xxx is the delay figure,
e.g., 378 or -378. There must be a space before and after
the word delay (not case sensitive) and the delay figure
must be immediately followed by the ms designation.
The input Browse button is now disabled during processing.
Also updated deprecated code to new versions of functions
like strcpy_s, fopen_s, sscanf_s, etc. Note that this
was compiled with Visual Studio 2008 and the solution is
inlcuded. You may find all my changes by searching on
"// ***************** Chumbo mod"
Any input on putting this project on CodePlex?
@setarip_old,
LOL, that cracked me up. You're too funny. I just meant I searched for it and didn't find it. I was just tired and skimmed over the part that mentions the source being available.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.