1
$\begingroup$

I added a movie to the sequencer with this code. filepath = /to/my/video/

mov = bpy.context.scene.sequence_editor.sequences.new_movie("Movie",filepath,1,1)

I can access its FPS,ColorSpace,Filepath,etc. But I am unable to get its Resolution using python.

mov.fps
mov.filepath
mov.colorspace_settings.name

enter image description here

$\endgroup$
5
  • $\begingroup$ x, y = mov.size? $\endgroup$
    – X Y
    Mar 31, 2023 at 7:55
  • $\begingroup$ mov.size object has no attribute 'size' $\endgroup$
    – Muzammil
    Mar 31, 2023 at 18:13
  • 1
    $\begingroup$ It's in the MovieSequence.elements... take the first one (index 0) and you'll find orig_width and orig_height $\endgroup$
    – lemon
    Apr 2, 2023 at 17:49
  • $\begingroup$ Got it. Thanks. $\endgroup$
    – Muzammil
    Apr 3, 2023 at 0:56
  • $\begingroup$ If you switch on Dev extras under Preferences/Interface, you can right-click on an UI element and select Edit Source. This will open the python script in the Text Editor, and here you can see what and how an operator is called to display a certain feature. On getting the resolution, the playhead needs to be on the strip to make the resolution display correct. $\endgroup$
    – tintwotin
    Apr 6, 2023 at 22:03

1 Answer 1

1
+50
$\begingroup$

Original video resolution is in the MovieSequence.elements. Take the first one (index 0) and you'll find orig_width and orig_height.

A link to the documentation here and here.

mov = bpy.context.scene.sequence_editor.sequences.new_movie("Movie",filepath,1,1)
 
element = mov.elements[0]

print(element.orig_width, element.orig_height)
$\endgroup$

You must log in to answer this question.

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