I've looked at AVISynth after being recommended in another post I made.
It looks really good.
I want to use AVISynth to take a video and cut it into 5 minute chuncks.
Not sure where to start with what I want to do.
I've looked at a few scripts: they look scary!
I was hopoing someone could start me off?
(Not sure how you handle a video that is 11 minutes long. i.e. you have 2 5 minute chuncks... but how do you then deal with the remaining 1 minute?)
ALSO: it would be brilliant if i could get a screen snapshot of the begining of every 5 minute chunk.
(Or is that asking for too much!? Or can I use any other application to give me this?)
I've also like to do chroma keying: cut out the background.
The video will be shot on a green screen with good lighting.
Is AVISynth a good application to use for this?
(And erm... I'd appreciate any help with starting off a script.)
ANY help with any of the above would be really appreciated.
Thanks.
OM
+ Reply to Thread
Results 1 to 15 of 15
-
-
Use the TRIM command.
For you, there are 25 frames per second. There are 60 seconds in a minute. You want 5 minutes of video. So this results in a video that is 7500 frames long.
So,
VID1=TRIM(0,7499)
gives you your first 5 minute clip named VID1. Repeat as needed.
For your screenshot of each video, load the .AVS script into VirtualDub and set the "framing bars" around your first image. Then FILE > IMAGE SEQUENCE will give you the first image.
As for chroma keying, you could use the LAYER/MASK/OVERLAY command. But here, the trick would be creating the mask. You would need a "Change Color" filter (don't know of one) that would give you black everywhere EXCEPT where there is green, where it would give you white. This filter doesn't seem like it would be too difficult to write. You might want to propose this filter over in the DOOM9 AVISynth Usage forum.ICBM target coordinates:
26° 14' 10.16"N -- 80° 16' 0.91"W -
Here's a doom9 thread on Chroma Key with script sample http://forum.doom9.org/showthread.php?p=991202
"Shut up Wesley!" -- Captain Jean-Luc Picard
Buy My Books -
thanks for the reply.
can i write a script that has a loop?
so that i can use it on any video?
AND: i'm still usure how to deal with the end, as i mentioned in my post.
if i had a video that was 6 minutes, then i assume i would need to have:
VID1=TRIM(0,7499)
VID2=TRIM(7500,8999)
but this is assuming i know exactly how long my video is??
what if don't know how long the video is exactly?
virtualdubmod??
ok... i'll give that a try.
i'll definitely try a post on doom9.
thanks. -
Encode the first 5 minutes of video:
Trim(0,7499)#25x60x5=7500
http://avisynth.org/index.php?page=Trim
To save every 5 minutes as a pic:
SelectEvery(7500,0)
ImageWriter(file="C:\Path\To\Saved\Images",type="j pg")#Save Folder and image type
http://avisynth.org/SelectEvery
http://avisynth.org/ImageWriter
I don't known how to cut out the background.
Edit: But gadgetguy does. -
hey... that is sooo kewl.
but... can you confirm that the script you gave would give me 2 avi files if i ran it on a film clip that was 6 minutes long (one 5 minute and one 1 minute)?
similarly for the screen snapshots: would i get 2 screen snapshots?
gadgetguy?
is he related to Inspector Gadget (cartoon).
i'll try sending him a PM.
thanks. -
can i write a script that has a loop?
so that i can use it on any video?
Not sure what you have in mind, but the Loop command sounds appropriate:
http://avisynth.org/index.php?page=Loop
Start reading:
http://avisynth.org/ -
but... can you confirm that the script you gave would give me 2 avi files if i ran it on a film clip that was 6 minutes long (one 5 minute and one 1 minute)?
I can confirm it won't. It'll give you the first 5 minutes. I think you'll have to set up different scripts for different 5 minute segments. Unless my peers come up with a way to do one save in VDub, but to create multiple videos.
similarly for the screen snapshots: would i get 2 screen snapshots?
Yes. -
guys... thanks for the help.
gadgetguy: i was trying to find ur username to send a pm... u got ur reply in too fast.
thanks.
ok... so from u guys say... i can't have a loop that will then allow me to use the script on any avi file?
and i would have to make sure i know the exact length to get the last section if the avi was an exact multiple of 7500 frames?
all of that is still ok.
but... surely there has to be something out there that will allow for the atuomation of what i want to do? -
erm actually... one more thing...
what i need to do after getting the 5 minute chunks is to turn the video into flv files.
is there anyway i can automate the whole thing and just have one script to do the lot?
thanks. -
You can use the TRIM command to cut your video anyway you want it. Each TRIM segment is basically another video. So (assuming a 20 minute video),
Code:AVISOURCE("YOURVIDEOPATH\YOURVIDEO.AVI") VID1=TRIM(0,7499) VID2=TRIM(7450,14999) VID3=TRIM(15000,22499) VID4=TRIM(22500,0) #A "0" at the end means go to the end. VID1+VID2+VID3+VID4
Code:V1=AVISOURCE("YOURVIDEOPATH\YOURVIDEO1.AVI") V2=AVISOURCE("YOURVIDEOPATH\YOURVIDEO2.AVI") VID1=TRIM(V1,0,7499) VID2=TRIM(V1,7450,14999) VID3=TRIM(V1,15000,22499) VID4=TRIM(V1,22500,0) VID5=TRIM(V2,200,7699) VID6=TRIM(V2,10000,17499) VID1+VID5+VID2+VID3+VID6+VID4
ICBM target coordinates:
26° 14' 10.16"N -- 80° 16' 0.91"W -
ok... so from u guys say... i can't have a loop that will then allow me to use the script on any avi file?
Not the same script, no. The above are just lines from larger scripts which, among other things, open individual videos by name:
AVISource("C:\Path\To\Video1.avi")#for example
Each video needs its own script as far as I know.
and i would have to make sure i know the exact length to get the last section if the avi was an exact multiple of 7500 frames?
No, if you have a Trim command of:
Trim(7500,14999)
but the video is only 10000 frames long, it'll stop at the last frame without expecting the remainder of the 7500 frames. It won't error out or refuse to encode.
but... surely there has to be something out there that will allow for the atuomation of what i want to do?
Maybe there is, but I don't know how to do it.
what i need to do after getting the 5 minute chunks is to turn the video into flv files.
is there anyway i can automate the whole thing and just have one script to do the lot?
Someone else can help with FLVs. Maybe there's an FLV encoder that accepts AviSynth script files. I don't know anything about FLVs or how to create them. Sorry. -
I don't understand your goal in splitting a video into 5 minute chunks, but a single script will not out put more than one 5 minute chunk. You could set up a script with variables for the start and end frames that can be called from a batch file that defines the source and start/end frames and output. I've never actually done it, but I've read that variables can be passed to called scripts. Since Avisynth is a frames server you just need to feed the script to a flv encoder to end up with flv files. (Again, something I don't work with).
"Shut up Wesley!" -- Captain Jean-Luc Picard
Buy My Books -
Originally Posted by gadgetguyICBM target coordinates:
26° 14' 10.16"N -- 80° 16' 0.91"W -
guys thanks for all the rep;ies: i've got a few golden nuggets of advice.
my need: i have a website for a client where they have lots and lots and lots of video of about 60 minutes in length for each video.
what i normally do is spli up the video into chunck of 5 minutes and play them in a video player i have programmed that allows you to choose which 5 minute chunk you want to see. (each 5 minute chunk has the image of the first fram on it - hence why i needed the images.)
i assumed that going for a proper streaming service would be too costly.
so... i'm just using flv files.
any advice on how i could run my operation better would be appreciated!
Similar Threads
-
chroma keying with wax
By snafubaby in forum Newbie / General discussionsReplies: 1Last Post: 8th Aug 2011, 00:47 -
Live Chroma-Keying
By madness.productions in forum Newbie / General discussionsReplies: 2Last Post: 14th Mar 2009, 21:16 -
Video Tutorial: Chroma Keying in FCP
By IceflowStudios in forum User guidesReplies: 0Last Post: 14th Dec 2007, 16:42 -
Need help chroma keying with Fusion (and other software) for Flash video.
By OM2 in forum Newbie / General discussionsReplies: 3Last Post: 28th Jul 2007, 20:07 -
Is There a Easy way to do Chroma Keying with Video?
By Datahead in forum Newbie / General discussionsReplies: 1Last Post: 24th May 2007, 20:13