Here is the context : I call blender by the command line like so : blender -b -P myscript.py

In the python script i am doing something simple, i add a movie strip with no sound and then print orignal size of the video:

bpy.ops.sequencer.movie_strip_add({'area': area},filepath='/tmp/file.mp4',frame_start=1, channel=1)

active_strip = bpy.context.scene.sequence_editor.active_strip



The problem is that i always get 0 for both height and width which is not the original dimension of the video.

When i execute this inside blender python console i get the right original dimensions.

Any ideas why it does'nt work by the command line?



1 Answer 1


I've found that you have to show strip in the VSE viewport to get dimesions to work. Since there's no viewports in background mode, Blender can't update information about a strip you added. So you're getting zeros.

  • $\begingroup$ Pity we can't get it from blender in the background. Thanks. Finally I just used moviepy to gett hese data and then send it to blender through the command line. $\endgroup$
    – johnconnor
    Commented Jul 1, 2017 at 21:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .