View Full Version : ac3/dts/mpa/wav delay+cut tool: v1.2.0.4
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, 06:35
@jsoto
Do you have any plans to include Dolby Digital Plus (EC3, DD+) cutting support?
madshi
11th September 2007, 20: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, 22: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, 22: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, 00: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, 00: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, 00: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, 02: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, 04: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, 11: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, 20: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.
ACook
29th March 2010, 03:39
Is there a way for this program to cut the ac3 using the cut-file megui produces? or by allowing you to put the start and end frame it shows below, as well as the framerate of course.
example file:
<?xml version="1.0"?>
<Cuts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Framerate>25</Framerate>
<Style>NO_TRANSITION</Style>
<AllCuts>
<CutSection>
<startFrame>284</startFrame>
<endFrame>88825</endFrame>
</CutSection>
</AllCuts>
</Cuts>
This is the result of the AVS Cutter tool in meGUI, which can cut/crop the video, so I'm not sure how the frames convert to ac3 ms.
this is the ac3 file in question. As you can see, the frames do not correspond.
Bitrate=384
Actual rate=384.000000
Sampling Frec=48000
TotalFrames=111150
Bytesperframe=1536.0000
Filesize=170727595
FrameDuration= 32.0000
Framespersecond= 31.2500
Duration=00:59:16.824
Channels mode=3/2: L+C+R+SL+SR
LFE=LFE: Present
The source is BBCHD .ts, and duration of the cut file should be 59m01s.
thanks for any help.
tebasuna51
29th March 2010, 03:58
Is there a way for this program to cut the ac3 using the cut-file megui produces? or by allowing you to put the start and end frame it shows below, as well as the framerate of course.
In MeGUI you have the Tool -> Audio cutter than read the .clt file and (using BeSplit) cut and join the parts.
Don't need DelayCut
this is the ac3 file in question. As you can see, the frames do not correspond.
Of course, each video frame in a 25 fps have a duration of 1/25 = 40 ms., and a frame (audio block) in an AC3 (48KHz) have a duration of 32 ms.
Without re-encode you can only split the AC3 file by 32 ms boundaries.
ACook
29th March 2010, 04:56
In MeGUI you have the Tool -> Audio cutter than read the .clt file and (using BeSplit) cut and join the parts.
Don't need DelayCut
When I use that, the result is a 0-sized file.
When I encode to mp3, it does get encoded right.
But whenever I use one of the ac3 encoders, I get a short burst of noise, and then silence, or constant high pitched squeekes in the audio. This has always been a problem in ac3, so I always avoid processing ac3 in megui.
Usually this isn't a problem, when editing the .ts the audio also gets edited. But this file I'm working with has a problem, so I can't edit it normally. So I decided to try editing with the avs-cutter option, hoping it would work well, and also would work in future, so I could even avoid editing the original .ts, as that's a time consuming and imprecise method (can't cut frame accurate in h264).
Of course, each video frame in a 25 fps have a duration of 1/25 = 40 ms., and a frame (audio block) in an AC3 (48KHz) have a duration of 32 ms.
Without re-encode you can only split the AC3 file by 32 ms boundaries.
I'm fine with those boundaries, 16ms +or- is unlikely to be heard by anyone not knowing there was a delay in the first place. Auditory pareidolia is something to be aware of when testing this yourself.
ACook
29th March 2010, 05:34
I suppose I could manually do a <startFrame>284 x 40 and put the results in the ms box, that would work right.
Just thought it could be useful if DelayCut could automatically read a cut-file if it was named the same as the ac3 perhaps?
Forgive me, I'm just getting frustrated with this particular file, and I haven't even tried one that works my usual way.
tebasuna51
29th March 2010, 10:15
Maybe is a invalid ac3 file, with some TV capture there are 5.1 (movie) and 2.0 (commercials) fix it with DelayCut and put here the log if show errors.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.