-1

I have some video file. I need to re-encode this in this way: - result file bitrate is 2x lower than original - result file resolution is 2x lower (witdth and height) - audio codec - copied from source, video codec: h264

I know how to encode with hardcoded bitrate/resolution and audio copy. However, I have no idea how to make that values as half of input file parameters. Can I do this with ffmpeg?

user1209216
  • 7,404
  • 12
  • 60
  • 123
  • Why do you need bitrate to be exactly 50% smaller? How do you know that the original bitrate is "good"? Not all encoder implementations are equal. How do you know that whoever made the video knows what they were doing? I recommend either using [`-crf` to encode at a specific quality, or use two-pass ABR to achieve your desired output file size](https://trac.ffmpeg.org/wiki/Encode/H.264). – llogan Oct 03 '14 at 15:32
  • I need it for streaming. I have file with high quality, I need to create low quality file. Bitrate should be known, because player (flow player) should know bitrate to automatically choose quality based on network speed. – user1209216 Oct 03 '14 at 19:05

1 Answers1

1

To examine an input file

ffmpeg -i input

That should tell you about the input sizes.

To scale to just 50% (both width and height at the same time), you can use the scale filter.

ffmpeg -i input -vf scale=iw/2:-2 output

(more examples)

This should already reduce the bit rate (since you throw away 75% of the input pixels). If that's not enough, I'd first play with the quality parameters to reduce the bit rate.

If you really want to reduce the bit rate, then you have to parse the output of ffmpeg -i input, find the bit rate, calculate the new desired values, etc.

Community
  • 1
  • 1
Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820
  • I don't need any input sizes. Just decrease bitrate and resolution. So I can't decrease bitrate without getting and parsing value? I need exact resolution and bitrate to values 2x lower - both. – user1209216 Oct 03 '14 at 15:03