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.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Today's Posts Search

Reply
 
Thread Tools Search this Thread
Old 22nd April 2011, 11:20   #1  |  Link
mathmax
Registered User
 
Join Date: Mar 2010
Posts: 158
read a text file to select frames

Hi

I have two video clips and I would like to join them using some frames of the clip 1 and some frames of the clip 2.
In a text file, I have listed for each frame if it must be taken from the clip 1 or clip 2.
Now I would like to read the text file and create my clip on a loop (frame by frame) using avisynth. How would you do this?

Thank you in advance for any advice.

max
mathmax is offline   Reply With Quote
Old 22nd April 2011, 12:10   #2  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,444
See ConditionalReader and ConditionalFilter.
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 22nd April 2011, 12:16   #3  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 601
RemapFrame ?
http://avisynth.org/stickboy/
__________________
my repositories
Chikuzen is offline   Reply With Quote
Old 27th April 2011, 02:52   #4  |  Link
Mini-Me
Registered User
 
Join Date: Jan 2011
Posts: 121
Quote:
Originally Posted by mathmax View Post
Hi

I have two video clips and I would like to join them using some frames of the clip 1 and some frames of the clip 2.
In a text file, I have listed for each frame if it must be taken from the clip 1 or clip 2.
Now I would like to read the text file and create my clip on a loop (frame by frame) using avisynth. How would you do this?

Thank you in advance for any advice.

max
Chikuzen gives good advice about checking out stickboy's plugins. I use RemapFramesSimple all the time for this.

If you have clip A and clip B, you can use it like this:
Code:
final = RemapFramesSimple(A, B, mappings = "4 5 [7 10] 98")
This will use clip B for frames 4, 5, 7 through 10, and 98. That is, writing individual numbers replaces the frame from the first clip with the frame from the second, and writing two numbers between brackets replaces the inclusive range. It's dead useful. If there are a lot of mapped frames, you can supply a file as well. All of the instructions come with the plugin.

Keep in mind that the resulting clip will use the audio from the first clip parameter (in this case A). If you want to use the audio from B without switching up all the numbers, you can follow it up with:
Code:
final = Merge(B, final, 1.0)

Last edited by Mini-Me; 27th April 2011 at 02:54.
Mini-Me is offline   Reply With Quote
Old 27th April 2011, 09:55   #5  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,444
Quote:
Originally Posted by Mini-Me View Post
I use RemapFramesSimple all the time for this. If you have clip A and clip B, you can use it like this:
Code:
final = RemapFramesSimple(A, B, mappings = "4 5 [7 10] 98")
This will use clip B for frames 4, 5, 7 through 10, and 98.
You mean ReplaceFramesSimple here.
RemapFramesSimple takes only a single clip and simply selects frames or frame ranges from the input, eg
RemapFramesSimple(A, mappings = "4 5 [7 10] 98")
produces a clip consisting (solely) of frames 4, 5, 7 through 10, and 98 of A.

Quote:
Keep in mind that the resulting clip will use the audio from the first clip parameter (in this case A). If you want to use the audio from B without switching up all the numbers, you can follow it up with:
Code:
final = Merge(B, final, 1.0)
That's not wrong, but a more natural way of doing this would be:
final = final.AudioDub(B)
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Reply


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 01:56.


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