Cropping video to different parts with same bitrate in ffmpeg

1

I am trying to crop a video clip (originally 960 by 540) in two 4 parts (top-left, top-right, etc..) and I use this command below (with of course corrext x/y positions):

ffmpeg -i mov_a.m4v -vf "crop=480:270:480:270" mov_a_4.m4v

The problem is, the bit rate of each cropped clip is different. What I am trying to do is to put this 4 movie parts in 4 android tablets and start them at same time (to form a multi screen).

I am quite sure that the PLAY command reaches the android tablets at the same time (well a very little time difference). But then I have this 4 clips out of sync, and I guess its because different bit rates, the player has to do more work to load the higher parts with higher bit rate.

Even if you think this is not the problem, is it possible to force the output of FFMPEG to have exact same bit rate for all 4 parts of the movie? if so, what should I change in my command line above?

Thanks for your help!

Sean87

Posted 2013-11-04T14:39:18.883

Reputation: 464

I suspect the problem is a different one. Are the videos stored locally? – slhck – 2013-11-04T15:37:23.040

@slhck Yes each part of the video is stored locally. When I try with same file for all screens it is somehow much more in sync. – Sean87 – 2013-11-04T21:29:51.887

Answers

2

Force a bit rate using the -b:v option. This rate would depend on the input rate. Say ffprobe reports 1024 kbps for your uncut video. I would, assuming 1/4 frame size, pass a bitrate of 256 kbps or so.

ffmpeg -i mov_a.m4v -vf "crop=480:270:480:270" -b:v 256k mov_a_4.m4v

You should ideally also use a codec explicitly if you are forcing a bitrate:

ffmpeg -i mov_a.m4v -vf "crop=480:270:480:270" -vcodec libx264 -b:v 256k mov_a_4.m4v

But then do check the codec in the input file. Note that the playback not syncing may have nothing to do with bitrates- you could check each cropped video you have already with ffprobe or ffmpeg:

ffmpeg -i filename

Rajib

Posted 2013-11-04T14:39:18.883

Reputation: 2 406

You need to set minrate and maxrate as well – see https://ffmpeg.org/trac/ffmpeg/wiki/x264EncodingGuide

– slhck – 2013-11-04T15:38:51.013