Video editing. Insert logo on many many video scenes?

Hello!

I have a small problem I would like to solve.

I have a bunch of about sixty videos edited using blender’s video sequence editor. They are all in one same project, and each edited video is on a different scene. Each scene is called video1, video2… videoN.

I should have started off by creating a startup file (or duplicating the very first scene) with the logo already inserted in the video sequence editor, but I have not. I now have sixty scenes with sixty videos, and they all are missing a logo that should be inserted using the logo’s alpha channel. I could go scene by scene inserting the logo. The thought of it makes me shiver!!

Is there a way I can insert the logo in all the scenes at once? Or maybe a quicker way than doing so one by one? My final intention is to batxh render the sixty videos from the command line over whatever time it takes.

Thanks!

I’m using 2.77a by the way on linux mint 17. Cheers!

import bpy


name_of_strip = "image"
path_to_image = "H:\Image.jpg"
channel = 2
start_frame = 0
duration = 40

for i in bpy.data.scenes:
    sed = i.sequence_editor.sequences
    if not name_of_strip in sed:
        sed.new_image(name_of_strip, path_to_image, channel, start_frame)
        sed.get(name_of_strip).frame_final_duration = duration

This script will insert image strips with defined parameters in to the every scene.

WOW! Now that is quite a bit beyond my current level of understanding.

I have googled how to run a python script. I have opened the text editor in blender, pasted your code and pressed alt+P, and it doesn’t work for some reason. I have replaced a couple things:

import bpy


name_of_strip = "image"
path_to_image = "/DATA/Desktop/STUFF/Imágenes/logoMOSCA.png"
channel = 2
start_frame = 1
duration = 30000

for i in bpy.data.scenes:
    sed = i.sequence_editor.sequences
    if not name_of_strip in sed:
        sed.new_image(name_of_strip, path_to_image, channel, start_frame)
        sed.get(name_of_strip).frame_final_duration = duration

I get a message saying “Python script fail, look in the console for now…”. I have seen nothing in the console.

I know nothing about python. Maybe a typo?

Thanks for you help anyhow.

Running blender from terminal gives me this:

sed = i.sequence_editor.sequences
AttributeError: 'NoneType' object has no attribute 'sequences'
Error: Falla en el script Python, mirar en la consola...

I am running blender in spanish, just in case that might be of interest…

this error occurs because in one or in several of the scenes there is nothing in the sequencer - do you got all the scenes to have a video strip in their sequencer?

To prevent this error from occurring (but still in an empty sequencer nothing will appear):

import bpy

name_of_strip = "image"
path_to_image = "H:\Documents and Settings\Vorobiov\Рабочий стол\Зима.jpg"
channel = 2
start_frame = 0
duration = 40

for i in bpy.data.scenes:
    if i.sequence_editor:
        sed = i.sequence_editor.sequences
        if not name_of_strip in sed:
            sed.new_image(name_of_strip, path_to_image, channel, start_frame)
            sed.get(name_of_strip).frame_final_duration = duration


Yep! That worked. You are fantastic! And you are correct, there are quite a few empty scenes still waiting for their corresponding video content.

I should learn python myself, it seems sooo powerful used together with blender.

I wouldn’t like to abuse but how hard would it be to create a script that also applies an “alpha over”? Every scene has one or two video tracks with various cuts. Does that sound tricky?

Thank you very much for the prompt reply. I am very grateful for your help.

import bpy

name_of_strip = "image"
path_to_image = "H:\Documents and Settings\Vorobiov\Рабочий стол\Зима.jpg"
channel = 2
start_frame = 0
duration = 40
alpha = 0.5

for i in bpy.data.scenes:
    if i.sequence_editor:
        sed = i.sequence_editor.sequences
        if not name_of_strip in sed:
            sed.new_image(name_of_strip, path_to_image, channel, start_frame)
            sed.get(name_of_strip).frame_final_duration = duration
            
            sed.get(name_of_strip).blend_type = 'ALPHA_OVER'
            sed.get(name_of_strip).blend_alpha = alpha

Not hard. Code was already posted but thought to mention that python tooltips can be enabled in user preferences -> interface and those help to figure out what values needs to be set. Info editor at the top also shows those if you do what you want one time and then copy needed lines from the info editor.


Thank you very very much Ko. You’re so fast you amaze me! That has worked first try.

Thank you JA12 too for your useful bit of info. I will look at the info toolbar as you say. I’ve never really looked at it at all, never knew what it was for.

Thank you veeeeery much indeed. :yes: