Log in

View Full Version : Audio Cut?


bxyhxyh
2nd March 2014, 15:47
How to cut ac3 audios using your avisynth trims?

I tried to copy frame numbers from my avisynth script into megui audio cutter, but it didn't cut properly :confused:
Function Trims(c, int start, int end, int sub)
{
sub=string(sub)
return c.trim(start, end).subtitle(sub, size=200, x=100, y=100)
}
DGDecode_mpeg2source("VTS_01_1.d2v", info=3)
a=NicAC3Source("F:\Re-Encodable\[DVD9 ENG ITA JAP] Princess Mononoke\VTS_01_1 T80 3_2ch eng 384Kbps DELAY 0ms.ac3")
vid=audiodub(last,a)
vid
p1=Trim(0,12784).crop(10,12,-8,-14).Spline36Resize(702,554)
p2=Trim(12785,0).crop(10,8,-8,-14)
p1++p2
p1a=Trim(0,680)
p2a=Trim(699,3837)
p3a=Trim(3838,0)

p2a
Trim(2,43)++Trim(68,92)++Trim(117,139)++\
Trim(164,175)++Trim(200,234)++Trim(259,273)++Trim(299,324)++\
Trims(349,379,1)++Trims(404,425,2)++Trims(450,473,3)++\
Trims(498,522,4)++Trims(547,570,5)++Trims(595,610,6)++\
Trims(635,660,7)++Trims(685,710,8)++Trims(735,760,9)++\
Trims(785,801,10)++Trims(825,855,11)++Trims(880,905,12)++\
Trims(930,950,13)++Trims(975,1000,14)++Trims(1025,1050,15)++\
Trims(1075,1100,16)++Trims(1125,1140,17)++Trims(1165,1190,18)++\
Trims(1215,1240,19)++Trims(1265,1278,20)++Trims(1304,1330,21)++\
Trims(1355,1380,22)++Trims(1405,1430,23)++Trims(1455,1480,24)++\
Trims(1505,1530,25)++Trims(1555,1570,26)++Trims(1595,1620,27)++\
Trims(1645,1670,28)++Trims(1695,1720,29)++Trims(1745,1770,30)++\
Trims(1795,1810,31)++Trims(1835,1860,32)++Trims(1885,1910,33)++\
Trims(1935,1950,34)++Trims(1975,2000,35)++Trims(2025,2050,36)++\
Trims(2078,2100,37)++Trims(2125,2150,38)++Trims(2175,2200,39)++\
Trims(2225,2250,40)++Trims(2275,2300,41)++Trims(2325,2350,42)++\
Trims(2375,2400,43)++Trims(2425,2440,44)++Trims(2465,2490,45)++\
Trims(2515,2540,46)++Trims(2565,2590,47)++Trims(2615,2640,48)++\
Trims(2665,2690,49)++Trims(2715,2742,50)++Trims(2775,2790,51)++\
Trims(2815,2840,52)++Trims(2865,2890,53)++Trims(2915,2948,54)++\
Trims(2985,3010,55)++Trims(3035,3050,56)++Trims(3076,3090,57)++Trims(3115,0,58)
p2a=last
p1a++p2a++p3a
of course I added 699 on numbers.

Overdrive80
2nd March 2014, 20:38
Maybe you should use Audiotrim http://avisynth.nl/index.php/Trim

raffriff42
2nd March 2014, 21:28
What does "it didn't cut properly" mean exactly?

Spot check your audio sync in clip vid: is it OK?
Check clips p1a, p2a and p3a individually: are they OK?
What is Trims supposed to do? Show a subtitle, yes, but what is the significance of the message?
You have probably made a typo somewhere. I know how easily it happens.
To check your edits, I suggest using ShowFrameNumber: (etc...)
p2a
Subtitle("p2a")
ShowFrameNumber
Trim(2,43)++Trim(68,92)++Trim(117,139)++\
(etc...) Also, I'm not sure of the frame accuracy of DGDecode_mpeg2source (or *any* source) when used with so many Trim statements. You might have to transcode your master video to a lossless, I-frame only format such as Lagarith or UTVideo.

bxyhxyh
3rd March 2014, 06:57
What does "it didn't cut properly" mean exactly?
I meant cut audios as avisynth script without re-encode.
What is Trims supposed to do? Show a subtitle, yes, but what is the significance of the message?
Trims() supposed to check if i trimming audios correct or wrong. It works like... If i hear something wrong with the audio when count changes, I change frame numbers.
It is ok with avisynth. But when cutting audios using megui audio cutter, it didn't work as avisynth script.
Also, I'm not sure of the frame accuracy of DGDecode_mpeg2source (or *any* source) when used with so many Trim statements. You might have to transcode your master video to a lossless, I-frame only format such as Lagarith or UTVideo.
Thanks I'll try it.

Gavino
3rd March 2014, 11:00
I meant cut audios as avisynth script without re-encode.
Using Avisynth always requires re-encoding, since it delivers uncompressed video and audio to its client application.

hello_hello
3rd March 2014, 12:42
Have you tried manually creating a "cuts file"? You may need to start by using MeGUI's AVS Cutter (under the Tools menu) to add cuts (trims) to a script first, and to also save a corresponding "cuts file" (just to become familiar with it). A cutlist file has a clt extension but it can be opened with Notepad. Once you're familiar with the format it's easy to create or modify cutlist files. This is an example of a clt file containing a single trim.

<?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>29</startFrame>
<endFrame>36662</endFrame>
</CutSection>
</AllCuts>
</Cuts>

If you don't want to re-encode, the Audio Cutter under the Tools menu uses a clt file in order to do it's thing. You may wish to read the section under "Inaccuracies" here: http://mewiki.project357.com/wiki/MeGUI/Audio_Cutter
The same cuts file can be loaded into MeGUI's audio section if you want to re-encode. I'm not sure I've ever used a script containing Trims to re-encode audio with MeGUI as I've always used a cuts file while loading the original audio rather than a script.
Because the cuts file is based on frame rate and frame numbers, it's vital to make sure the frame rate in the clt file is correct. If MeGUI's AVS Cutter creates the cuts file, it should be.

bxyhxyh
3rd March 2014, 15:48
@hello_hello
Yes, I did this way. It didn't work.

Thank guys. I cut the audio using delaycut. But it was pain in the ass to cut 65 part audios.