How to automate blender video sequencer Is it possible to automate the sequencer so that each time I render an animation into image files in a folder, the newly rendered image files would be inputted into the sequencer in a specific arrangement or something like this?:


Load images 1-300 and place in sequencer
Load images 1-300, again, and place after first image sequence
Apply backwards effect to the second image sequence


If not an option in blender, is there a way to create a script to do this? Often I will rerender the same animation with a different setting or something, but every time I have to manually apply what was described above. I'm not necessarily asking for a solution specified to this example, but for all examples like this. Is there something that would work to automate this process?

Any help is appreciated. If what I am describing is unclear I can further describe it.
Yes, blenders sequencer has full Python API access so it can be used to do quite advanced video editing both from the UI or in background mode (headless).
import os

from bpy import context
scene = context.scene

path = &quot;/my_path/to/images&quot;
files = os.listdir(path)
files.sort()

# create the sequencer data
scene.sequence_editor_create()

seq = scene.sequence_editor.sequences.new_image(
        name=&quot;MyStrip&quot;,
        filepath=os.path.join(path, files[0]),
        channel=1, frame_start=1)

# add the rest of the images.
for f in files:
    seq.elements.append(f)

# reverse if you want
seq.use_reverse_frames = False

# You may want to render the result:
render = scene.render
scene.frame_start = 1
scene.frame_end = 1 + len(files)

render.resolution_x = 1280
render.resolution_y = 720
render.fps = 25

render.image_settings.file_format = 'FFMPEG'
render.ffmpeg.format = 'MPEG4'
render.ffmpeg.codec = 'H264'

render.ffmpeg.constant_rate_factor = 'HIGH'
render.ffmpeg.ffmpeg_preset = 'BEST'

bpy.ops.render.render(animation=True)

The rest I'm sure you can work out as you may want to tweak encoding, frame rate... etc.