View Full Version : read a text file to select frames
mathmax
22nd April 2011, 11:20
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
Gavino
22nd April 2011, 12:10
See ConditionalReader (http://avisynth.org/mediawiki/ConditionalReader) and ConditionalFilter (http://avisynth.org/mediawiki/ConditionalFilter).
Chikuzen
22nd April 2011, 12:16
RemapFrame ?
http://avisynth.org/stickboy/
Mini-Me
27th April 2011, 02:52
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:
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:
final = Merge(B, final, 1.0)
Gavino
27th April 2011, 09:55
I use RemapFramesSimple all the time for this. If you have clip A and clip B, you can use it like this:
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.
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:
final = Merge(B, final, 1.0)
That's not wrong, but a more natural way of doing this would be:
final = final.AudioDub(B)
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.