Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th January 2013, 20:39   #1  |  Link
BlockABoots
Registered User
 
Join Date: Dec 2012
Posts: 163
AvsPmod Removing Sections of Video??

I know in AvsPmod (Avisynth) you can remove a single frame at a time but if you wanted to remove say a whole 5-10min section from a video is there a command for this?. As the only way i can see doing it is removing ever single frame for the 5-10mins but this just wouldnt be realistic and would take forever to script.

So is there a command where you can specify a starting frame and end frame to remove a whole section of video?
BlockABoots is offline   Reply With Quote
Old 10th January 2013, 21:33   #2  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,173
Trim(clip clip, int first_frame, int last_frame [, bool "pad"])
IanB is offline   Reply With Quote
Old 10th January 2013, 21:34   #3  |  Link
mastrboy
Registered User
 
Join Date: Sep 2008
Posts: 297
You can do it the "other way around" with trim...

Lets say you want to remove frames 1000-2000, the command would be trim(0,999) ++ trim(2001,0)
(++ is short for alignedsplice)
__________________
(i have a tendency to drunk post)
mastrboy is offline   Reply With Quote
Old 10th January 2013, 22:36   #4  |  Link
BlockABoots
Registered User
 
Join Date: Dec 2012
Posts: 163
Hmmm doing that seems to cut the whole video and only leave me with those frames when viewing in the preview video in PvsPmod?
BlockABoots is offline   Reply With Quote
Old 2nd February 2013, 21:52   #5  |  Link
BlockABoots
Registered User
 
Join Date: Dec 2012
Posts: 163
Ok the command, trim(video,0,1000) ++ trim(video,9000,0) as mastrboy suggested works fine if you just have 1 section you want to remove from your video, but what command do i need to use if i have 2 sections or more i need to remove from a video, for example if i wanted frames 1000 to 9000, 12000 to 16000 and 16900 to 17900 removed. so 3 sections of a video.

What script do i need for such a thing?, would it be...

trim(0,1000) ++ trim(9000,1200) ++ trim(16000,16900) ++ trim(17900,0)

So basically im scritping the range of frame i want to keep and any frames that are not included in the range is removed?

Last edited by BlockABoots; 2nd February 2013 at 22:23.
BlockABoots is offline   Reply With Quote
Old 2nd February 2013, 22:03   #6  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 8,269
Code:
Trim(0,559)++Trim(1501,0) # drop frames 560 to 1500
Both previously suggested solutions are correct.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 2nd February 2013 at 22:05.
StainlessS is offline   Reply With Quote
Old 2nd February 2013, 22:13   #7  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 8,269
I see that you've altered/edited your requirements.
Code:
Trim(Video,1000,9000)++Trim(Video,12000,16000)
EDIT: I see that you've changed your requirements yet again. You specify the frames that
you want to keep, not the ones that you want to remove.
Quote:
Originally Posted by BlockABoots View Post
Ok the command, trim(video,0,1000) ++ trim(video,9000,0) as mastrboy suggested works fine if you just have 1 section you want to remove from your video, but what command do i need to use if i have 2 sections or more i need to remove from a video, for example if i wanted frames 1000 to 9000, 12000 to 16000 and 16900 to 17900 removed. so 3 sections of a video.

What script do i need for such a thing?, would it be...

trim(0,1000) ++ trim(9000,1200) ++ trim(16000,16900) ++ trim(17900,0)

So basically im scritping the range of frame i want to keep and any frames that are not included in the range is removed?
Nearly,
Code:
trim(0,999) ++ trim(9001,11999) ++ trim(16001,16899) ++ trim(17901,0)
You need to think in terms of what you want, not what you dont want, the other road leads to
confusion.

EDIT: If you have a LOT of sections that you wish to splice together, you might find Prune()
of use. Prune takes up to 256 source clips, and a command string or file, eg:

Code:
V0=AviSource("D:\avs\avi\1.avi")
V1=AviSource("D:\avs\avi\2.avi")

SCMD=" # Command string to select video sections to splice together
 0,1000,9000    # frames 1000 - 9000 from clip 0 ie V0
 0,12000,16000  # frames 12000-16000 from clip 0 ie V0
 1,10000,11000  # frames 10000-11000 from clip 1 ie V1
 0,20000,30000  # frames 20000-30000 from clip 0 ie V0
 # Etc
"
Result=Prune(V0,V1,scmd=SCMD)
Return Result
http://forum.doom9.org/showthread.ph...ighlight=prune
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 2nd February 2013 at 23:27.
StainlessS is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:30.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.