digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth: Cut credits on 2 parts of movie? (start and end) (http://www.digitalfaq.com/archives/avisynth/9921-avisynth-cut-credits.html)

bman 05-27-2004 04:24 PM

Avisynth: Cut credits on 2 parts of movie? (start and end)
 
Hi all !
I need to cut credits with avisynt on 2 parts of AVI on beginning and on the end , during encoding to mpg stream .
Can u help me to get working script to get target ?
I tryied with trim but cant get two trimmed avi encoded together :oops: :oops: :oops:
It must be easy with avisynth . only problem is that I'm not familiar with scripting :oops:
bman

Roc 05-27-2004 04:35 PM

Quote:

but cant get two trimmed avi encoded together
you can get as much trimmed avis as you like together
simply by adding them just like this example:

Quote:

#get the sources ..you may use Avisource instead
clip=MPEG2Source("o:\24_2_15Uhr.d2v")
wav=MPASource("o:\24_2_15Uhr MPA T01 DELAY -564ms.mpa")
clip=AudioDub(clip,wav)

#cut out commercials ..here is the point you'll have to look :wink:

clip1=clip.trim(0,13672)+clip.trim(24046,36859)+cl ip.trim(37331,45804)+clip.trim(48497,61831)+clip.t rim(62432,74910)
clip=clip1

#Denoise ..ore what ever you like ..
clip=clip.Undot()
clip=clip.TemporalSoften(3,10,12,15,2)
clip=clip.Asharp(1,3)
return clip
if you got different sources you just have to give them different names..
eg:
Quote:

clip1=AVISource("your1stvideo.avi")
clip2=AVISource("your2ndvideo.avi")
...
#if you want them to be cutted softer use the fadein fadeout command
clip=clip1.trim(400,23456).fadeout(3)+clip2.trim(4 00,23456).fadein(3).fadeout(3)
....
return clip
good luck

incredible 05-27-2004 04:45 PM

Quote:

Originally Posted by Roc
#get the sources ..you may use Avisource instead
clip=MPEG2Source("o:\24_2_15Uhr.d2v")
wav=MPASource("o:\24_2_15Uhr MPA T01 DELAY -564ms.mpa")
clip=AudioDub(clip,wav)

#cut out commercials ..here is the point you'll have to look :wink:

clip1=clip.trim(0,13672)+clip.trim(24046,36859)+cl ip.trim(37331,45804)+clip.trim(48497,61831)+clip.t rim(62432,74910)
clip=clip1

#Denoise ..ore what ever you like ..
clip=clip.Undot()
clip=clip.TemporalSoften(3,10,12,15,2)
clip=clip.Asharp(1,3)
return clip

Roc you dont need to add everytime that clip=clip.xxxxx
As after Audiodub both streams will become "last"

so....
Quote:

#get the sources ..you may use Avisource instead
clip=MPEG2Source("o:\24_2_15Uhr.d2v")
wav=MPASource("o:\24_2_15Uhr MPA T01 DELAY -564ms.mpa")
AudioDub(clip,wav)

#cut out commercials ..here is the point you'll have to look :wink:

trim(0,13672)+trim(24046,36859)+trim(37331,45804)+ trim(48497,61831)+trim(62432,74910)


#Denoise ..ore what ever you like ..
Undot()
TemporalSoften(3,10,12,15,2)
Asharp(1,3)
You can VERY easy determine the comercial cuts using the folllowing way.

open VirtualdubMOD

Select "open file via avisynth" and choose your captured avi.

then use in vdub the cut options to cut the movie till all comercial are out.

then go above right under "tools/script editor" and you get into the avisynth editor :D

Now set the cursor right below the avisource line and select in the script editor "Edit" and "import framesets as trims.

"pong!" the right trim commands as needed will automatically generated at THAT line where you did put your cursor before .... based on all cut points you determined in VdubMod.

:wink:

bman 05-28-2004 12:56 AM

Thank's guys !
As always - U are here to help :D :D :D
@Incredible
Graet tip !
I'll try it when I'll get home ( sometimes we have to work u know :D )
@Roc
I've tryed some lines and separately each one worked but problem was to get chain of Trimmed avis . Now I see your script and still do not understand this trim chain and how clip variable is working ?!?!

Here's my script , please if u can explain to me how to get this work :

video=trim(avisource("part1.avi",audio=false),0,24 00)+trim(avisource("part2.avi",audio=false),2401,1 21176)

To be more specific : How I get this video clip assosiated with whole avisynth script ???
Do I have to write something like :

video.undot()
video.(bicubicresize(....))

and so on ..... ????

:oops: :oops: :oops:
bman

incredible 05-28-2004 02:56 AM

v=Avisource("xxxxx1.avi",false)++Avisource("xxxxx2 .avi",false)
undot(v)
trim(0,2400)+trim(2401,5000)+trim(5001,60000)
Bicubicresize(704,576,0,0.6,704,576)


.....

We do assign the videocontent to a variable "v", no matter what you choose, you also could choose "clip" or "video"
Then we do use a simple fast undot() which works on the v content (=your avisources) .... this will make the v content as "last", means that will be the videocontent where all following filters will work on.
Then as the "last" videocontent is acive (via v) the trimming and resizing and all following filters do affect your "last" content, means the avisources!

In Avisource, just put a ",false" which is the same as ",audio=false"

;-)

Dialhot 05-28-2004 03:36 AM

Quote:

Originally Posted by incredible
You can VERY easy determine the comercial cuts using the folllowing way.

open VirtualdubMOD

Select "open file via avisynth" and choose your captured avi.

then use in vdub the cut options to cut the movie till all comercial are out.

then go above right under "tools/script editor" and you get into the avisynth editor :D

Now set the cursor right below the avisource line and select in the script editor "Edit" and "import framesets as trims.

"pong!" the right trim commands as needed will automatically generated at THAT line where you did put your cursor before .... based on all cut points you determined in VdubMod.

:wink:

What a lot of step where you can do directly a 'cut selected part' in the video menu to cut ou each part you don't need and then save the avi in Direct stream mode for both video and audio.

This way you will have a new avi, without the credits, and you will be abble to encode the audio separetly and NOT in the script like your have to do with the trim method.

incredible 05-28-2004 04:09 AM

Phil, explain me one thing .....

whats more easy if you do "the way around" making a directstreamcopy to hd first :?:
(waiting for the saving process AND taking another amount of diskspace)

In the way above youre already in an avisynth script where you anyway will be in finally when applying filters and so on.

The "lot of steps" above are the same like yours .... but I do not choose directstreamcopy BUT entering the editor an posting the automatic generated trim commands.

Dialhot 05-28-2004 04:23 AM

Quote:

Originally Posted by incredible
whats more easy if you do "the way around" making a directstreamcopy to hd first :?:
(waiting for the saving process AND taking another amount of diskspace)

You will use the same script as you always use + you can encode the audio as you always encode it. But you need some diskspace, for sure.

Quote:

The "lot of steps" above are the same like yours ....
Correct. I didn't see that the trim line is generated in one operation for all edited part.

Roc 05-28-2004 04:47 AM

Quote:

I didn't see that the trim line is generated in one operation for all edited part.
I first set an Info() at the end of the skript..(just that the framenummer is better readeble)

open it with virtualdub..
search the start and end frames of the blocks and entered them into the trim line at once. ..
it realy dont take more time as if you mark the blocks :wink:

incredible 05-28-2004 04:51 AM

roc...

watch out! :wink:
Do the way I described above IF doing the trims in avisynth.
Because Avisynth count framenumbers DIFFERENT than Virtualdubs Cutting engine. Well its not that complicated as Avisynth starts counting at 0 and VirtualDub(MOD) at 1 ;-) So at least you have to integrate that in your calculation :)

bman 05-28-2004 05:38 AM

@ Incredible
OK ! I see the script above and now I think I'm getting this trim thing but ...
I want to make it more clear : I need 2400 frames from part1.avi and frames 2401..121700 from part2.avi .
The way that Dealhot sugested could be good for me but there is problem that this 2 avis are in different resolution too .
So now I'm making it really massy - I want to encode this 2 range of frames that are with diff resolution on one run . I hope i'm clear ...
I need script that could handle
1 . trim(part1.avi) ,
2. resize(part1.avi)
3. trim(part2.avi)
4. resize(part2.avi)
5. to combine trimmed part1 & part2 to get combined avi
6. to applay all needed filters before encoding
7. encoding resulted monster :roll:
I beleave it's possible to achive this target on one steap with avisynth :roll: :roll: :roll:
But how to script this all together ?????
Your script above is the way to right direction but no complited somehow , Am I right ??? :oops: :oops: :oops:
bman

Dialhot 05-28-2004 05:57 AM

Two cases :

If you have a script that perform all filters AFTER resizing, do simply that :
Code:

a=avisource("part1.avi").trim(0,2400).Bicubicresize(704,576,0,0.6,704,576)
b=avisource("part2.avi").trim(2401,121700).Bicubicresize(704,576,0,0.6,704,576)
a++b
[apply all the filters here]

If your script does filters BEFORE the resizing and other AFTER it, process as follow
Code:

function Work(clip c)
{
    c
    [apply filters before resize here]
    Bicubicresize(704,576,0,0.6,704,576)
    [apply filters after resize here]
    return last
}

a=avisource("part1.avi").trim(0,2400).Work()
b=avisource("part2.avi").trim(2401,121700).Work()
a++b


bman 05-28-2004 06:10 AM

Co-o-o-o-l !
Thank u Dialhot !
I'll try this script in few hours (as soon as will return to home )
I hope it will solve all my problems with this issue .
Thank u Dialhot , to Roc and to Incredible for help .
bman


All times are GMT -5. The time now is 02:24 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.