0

First of all: forgive me for maybe asking a stupid or somewhat uninformed question. I'm totally new to post processing video, stabilization, etc..

I'm shooting 1920x1080 compressed movie files with my Canon 5D2, and afterwards crop then to cinematic 1920x800 (2.4:1). (With Magic Lantern I use an overlay bitmap when shooting. And yes, I know that with magic lantern I can shoot RAW, but my cards as well as computer are not fast enough to deal with that much data.)

Before doing any production, I convert the big .MOV files to smaller ones, simultaneously stabilizing the video a bit, and cropping it to 1920x800. I do this with ffmpeg roughly as follows:

ffmpeg -i f.MOV -vf vidstabdetect -f null -
ffmpeg -i f.MOV -c:v libx264 -profile:v high -crf 18 -vf "vidstabtransform, crop=in_w:in_h-280" -c:a aac -strict experimental f2.mp4

However, the fact that a great deal of the vertical resolution is being cropped is not being used to be able to handle the stabilizing transforms better. Often, the image is stretched/skewed vertically, when this is not really needed given the crop used.

Is it possible in any way to use the crop befenificially in the stabilizing transforms?

An example is the frame below. Here, I would rather have that the image is not stretched vertically at all, and just get away with a slight static zoom (crop), because the horizontal black border is the only problem in this frame.

enter image description here

Kelley van Evert
  • 1,063
  • 2
  • 9
  • 17
  • Oh, and my using `ffmpeg` is not a very informed decision either, so if better (easy!) alternatives exist I'd like to hear of them as well :) – Kelley van Evert Jul 16 '15 at 02:45
  • As long as you have a centered in-plane rotation without movement, you are going to loose the same percentile vertically and horizontally. With translations you might loose more on one of the edges. I am am saying that because I think you will not gain much from changing the aspect ratio, because you still need all horizontal pixels after cropping. Anyway, what I would do is to stabilize the video in full resolution (or maybe even into a higher resolution, detect the maximum cut-off for each shot and then crop/resize optimally. How to do that using ffmpeg only, I dont know. – P.R. Jul 22 '15 at 06:49

1 Answers1

0

Better is use this command:

# to get the video fps
fps="$(ffmpeg -i $VarIN 2>&1 | sed -n 's/.*, \(.*\) fp.*/\1/p')"

transcode -J stabilize -i vidIn.mp4 

transcode -J transform -i vidIn.mp4 -f $fps -y raw -o vidOut.avi
Lionel Bino
  • 131
  • 5