Does someone has an example of image and sound strip creation in VSE of blender 2.53 ?
I have directories with thousands of images and sounds, and i would like to automate some creation tasks in the VSE.
looking at the documentation, i can access already created data:
what do you mean by " i would like to automate some creation tasks in the VSE" ?
what is you dev plan for your project ? Do you want to create a script for advanced workflow or just playing with code ?
And to give even more details:
This is something i was doing with blender 2.49 with the following code:
scn=Blender.Scene.GetCurrent()
seq=scn.sequence
dir="toto"
currentPos=1
images = [i for i in sorted(set(os.listdir(dir)))]
seq_data=("//%s" % os.path.relpath(dir),images)
strip=seq.new(seq_data,currentPos,2)
Well it does make sense if you work with movie files.
But i use other piece of software that need images.
I have always found easier to work with images, and just create the movie file at the very end.
Sounds neat, would you also code a preset transition (with duration, cross or wipe) and perhaps run some audspace to pick out music beats to set the length of each clip. Thereby creating cuts to a beat.
Hi. I’m trying something similar in order to edit a short film into blender. But i want to create a lot of scenes (grouped into sequences) to node-grading each one and then compose in another timeline.
But still learning python basics…
Looking the documentation i found about bpy.ops.sequencer.image_strip_add()
and searching a lot in google i found a piece of code with something similar to this, and work for me:
so, in order to import a sequence into the editor first we need to create a file dictionary, in the form [“name”:“file1”,“name”:“file2”,etc]. I use listdir function to get files from a directory. I also found how to define proxy files.
import bpy, os
dir="your_full_path_to_sequences_directory" #not include files
dirproxy="full_path_to_proxy_file" #including proxy file
file=[]
for i in os.listdir(dir):
frame={"name":i}
file.append(frame)
bpy.ops.sequencer.image_strip_add( \
directory = dir, \
files = file, \
frame_start=0, \
channel=2, \
filemode=9)
editor=bpy.data.scenes[0].sequence_editor
seq=editor.sequences
stripname=file[0].get("name")
mystrip=seq[stripname]
mystrip.use_proxy=True
mystrip.use_proxy_custom_file=True
mystrip.proxy.filepath=dirproxy
Sure it’s a rought script but it works for me.
I’m actually creating jpeg sequences from canon5d files and 25% avi mjpeg proxy files with ffmpeg. Also you must set proxy to 25% in view settings.