Log in

View Full Version : ac3/dts/mpa/wav delay+cut tool: v1.2.0.4


Pages : 1 [2] 3

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, 17: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, 18: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, 21: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, 02: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, 21: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, 07: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, 09: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, 08:36
Hi all,
Can anybody send AC3 Encoded File or link.

Regards
Ganesh

ganeshpetkar
12th October 2006, 09:22
Hi all,
Can anybody send AC3 Encoded File or link.

Regards
Ganesh

raquete
12th October 2006, 14: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......