3

I have 3840 × 2160 videos where I want to cut out a moving person on stage (e.g. music video). The crop area is fixed (1080 x 1920). The problem is, the person is moving around. Not much, but in a 3min. video the crop area would move a couple of times.

Example: Frame 0-889, area(500,34,1080,1920) - Frame 950-1735, area (800,10,1080,1920) - Frame 1820-2530, area(600,40,1080,1920)

I gave some example numbers above. The solution should interpolate the crop area between Frame 889 and Frame 950; Frame 1735 and Frame 1820. Ideally I would like to define those areas in a visual editor which allows me to move a fixed size crop rectangle for the Frames and coordinates given above.

Optionally I could also figure out the crop areas without visual help and then use that data to crop the video in something like ffmpeg (although I don't know how to do this properly including the interpolation step).

I am on Linux and tried different video editors but their crop filters are not useful to solve my task. I have Windows available but no commercial editing software installed at the moment.

Thanks for the help!

1

I recommend AVISynth (a script based video editor for VirtualDub) and the DeShaker plugin.

You can learn a minimum amount about AVISynth and simply load DeShaker, have it stabilize on the person's body and it will follow them smoothly as they move.

You will have a finished product that is stabilized as a bonus.

You can also learn more about AVISynth, establish precise crops that are animated to follow the person, and get a perfect result (based on the quality of the input). You can set your moves with frame and pixel accuracy by typing numbers into the script and reloading the frame in VirtualDub.

It might be worth 5 mins. exploring those links to see if you want to try another video editor.

If one of the current video editors you've installed has image stabilization you can try it, but DeShaker is one of the better free ones (as of a year ago) that I've used.

  • Thanks Rob. I was hoping to preferably to get a solution for Linux as this is my much more powerful machine. My Windows PC is not really for video editing. Still, I will check AviSynth out if everything else fails. In the meanwhile please suggest more stuff! – user3185993 Dec 13 '17 at 16:03
  • OK, while there may be a port of AVISynth the deshaker plugin isn't available for Linux. Can you use stabilization in the Linux Video Editors that you have, choose the person and crop to the moving frame? – Rob Dec 13 '17 at 16:08
  • I did a bit of research. Basically image stabilization is technically what I need but the way it is done (for example in Blender: youtube.com/watch?v=DpIXqAepfxY) is more of an automated approach. As I said, I want to move a fixed crop window around manually to crop out a person. If the person does not move I just define the crop window position for the first frame of the video. – user3185993 Dec 20 '17 at 13:56
  • 1
    If the person moves a lot I have to define new crop window positions for several frames of the video and the cropping is interpolated between the specified crop window positions. It seems really simple and I can do it with A LOT of effort using only ffmpeg. The same job could be done in seconds having a GUI that supports defining a fixed crop window and moving it around. – user3185993 Dec 20 '17 at 13:56

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.