Quantcast Avisynth: Cut Credits on 2 Parts of Movie? (Start and End) - digitalFAQ.com Forums [Archives]
  #1  
05-27-2004, 04:24 PM
bman bman is offline
Free Member
 
Join Date: Apr 2002
Posts: 356
Thanks: 0
Thanked 0 Times in 0 Posts
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
It must be easy with avisynth . only problem is that I'm not familiar with scripting
bman
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
05-27-2004, 04:35 PM
Roc Roc is offline
Free Member
 
Join Date: Mar 2003
Location: Germany
Posts: 86
Thanks: 0
Thanked 0 Times in 0 Posts
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

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
Reply With Quote
  #3  
05-27-2004, 04:45 PM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
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

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

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

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.

Reply With Quote
  #4  
05-28-2004, 12:56 AM
bman bman is offline
Free Member
 
Join Date: Apr 2002
Posts: 356
Thanks: 0
Thanked 0 Times in 0 Posts
Thank's guys !
As always - U are here to help
@Incredible
Graet tip !
I'll try it when I'll get home ( sometimes we have to work u know )
@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 ..... ????


bman
Reply With Quote
  #5  
05-28-2004, 02:56 AM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
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"

Reply With Quote
  #6  
05-28-2004, 03:36 AM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
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

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.

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.
Reply With Quote
  #7  
05-28-2004, 04:09 AM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
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.
Reply With Quote
  #8  
05-28-2004, 04:23 AM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Reply With Quote
  #9  
05-28-2004, 04:47 AM
Roc Roc is offline
Free Member
 
Join Date: Mar 2003
Location: Germany
Posts: 86
Thanks: 0
Thanked 0 Times in 0 Posts
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
Reply With Quote
  #10  
05-28-2004, 04:51 AM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
roc...

watch out!
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
Reply With Quote
  #11  
05-28-2004, 05:38 AM
bman bman is offline
Free Member
 
Join Date: Apr 2002
Posts: 356
Thanks: 0
Thanked 0 Times in 0 Posts
@ 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
I beleave it's possible to achive this target on one steap with avisynth
But how to script this all together ?????
Your script above is the way to right direction but no complited somehow , Am I right ???
bman
Reply With Quote
  #12  
05-28-2004, 05:57 AM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
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
Reply With Quote
  #13  
05-28-2004, 06:10 AM
bman bman is offline
Free Member
 
Join Date: Apr 2002
Posts: 356
Thanks: 0
Thanked 0 Times in 0 Posts
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
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove credits from movie and re-author new DVD? black prince Authoring VCD, DVD, Blu-ray 3 05-17-2006 12:10 AM
Avisynth: opening credits of movie blink? Jimblob Avisynth Scripting 11 05-01-2004 03:28 PM
How to put several parts of a movie together on KVCD? jshew Video Encoding and Conversion 12 06-23-2003 01:47 PM
KVCD: Special processing for start and end credits ? girv Video Encoding and Conversion 1 05-02-2003 11:02 AM
KVCD: Joining movie and credits into m1v files? black prince Video Encoding and Conversion 5 08-31-2002 09:08 PM

Thread Tools



 
All times are GMT -5. The time now is 11:37 AM  —  vBulletin © Jelsoft Enterprises Ltd