0

I am currently in a webcam streaming server project that requires the function of dynamically adjusting the stream's bitrate according to the client's settings (screen sizes, processing power...) or the network bandwidth. The encoder is ffmpeg, since it's free and open sourced, and the codec is MPEG-4 part 2. We use live555 for the server part.

How can I encode MBR MPEG-4 videos using ffmpeg to achieve this?

hoangbv15
  • 360
  • 2
  • 4
  • 14

1 Answers1

0

The multi-bitrate video you are describing is called "Scalable Video Codec". See this wiki link for basic understanding.

Basically, in a scalable video codec, a base layer stream itself has completely decodable; however, additional information is represented in the form of (one or many) enhancement streams. There are couple of techniques to be able to do this including lower/higher resolution, framerate and change in Quantization. The following papers explains in details of Scalable Video coding for MEPG4 and H.264 respectively. Here is another good paper that explains what you intend to do.

Unfortunately, this is broadly a research topic and till date no open source (ffmpeg and xvid) doesn't support such multi layer encoding. I guess even commercial encoders don't support this as well. This is significantly complex. Probably you can check out if Reference encoder for H.264 supports it.

The alternative (but CPU expensive) way could be transcode in real-time while transmitting the packets. In this case, you should start off with reasonably good quality to start with. If you are using FFMPEG as API, it should not be a problem. Generally multiple resolution could still be a messy but you can keep changing target encoding rate.

Dipan Mehta
  • 2,110
  • 1
  • 17
  • 31