3
$\begingroup$

I'm making a video with resolution 1920 x 1080 in the 16:9 ratio. I have a recorded a clip from my phone screen in portrait. I am using my version of the default Video Editor screen layout. My edit simply has an extra window for a File Explorer. The clip isn't 16:9 so I first tick Image Offset to stop Blender from stretching the clip, and then make the Blend field Alpha Over in the dropdown list so I can add a background that is 16:9. The problem I'm having is that the clip is not centered, but anchored to the left. I can change the X Offset value but I can't be certain of what value is exactly centered. Any help is much appreciated.

$\endgroup$
  • $\begingroup$ did my answer help you? $\endgroup$ – Samoth Aug 18 '16 at 10:46
3
$\begingroup$

Just do some math in the X offset field directly. Look at the Original Dimension of your Clip where you will find out its width x height. Then type into the X offset "1920/2-width/2" (replacing width with the actual one from its Dimensions) and hit Enter. Do the same with Y, typing "1080/2-height/2"...

Or with an Editor/View of the type Python Console opened and the Clip selected in the VSE you should be able to just run this line of code to center your Clip/ImageSequence:

seq = bpy.context.selected_editable_sequences[0]; seq.use_translation = True; seq.transform.offset_x = bpy.context.scene.render.resolution_x/2 - seq.strip_elem_from_frame(bpy.context.scene.frame_current).orig_width/2; seq.transform.offset_y = bpy.context.scene.render.resolution_y/2 - seq.strip_elem_from_frame(bpy.context.scene.frame_current).orig_height/2
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.