Encode RGB565 raw data using ffmpeg libx264 for android

1.2k views Asked by At

i have below questions regarding android implementation

  1. How various video codecs differ especially `which are stream based and which are frame based'

  2. Over many forums and questions everyone is talking SPS,PPS,etc., so where i can find enough details about codec(Please mention something other than RFC documents!!) to understand it and use ffmpeg relevantly?

  3. From this Is it possible to use in-built HW Decoders od android devices? If so, How? Do i need to use OpenMax-IL (or AL or DL , i mean which is for what?)

  4. Does ffmpeg supports H264 encoding of RGB (or RGBA) or RGB565(or RGB555) input data through libx264?

  5. If my requirement is only h264 encode & decode, can i use libx264 without ffmpeg?If so any sample/guide?

1

There are 1 answers

11
szatmary On

1) This is likely referring to the elementary stream format. Some codecs, like mp3, produce a 'stream' that does not require (but optionally can still be contained in) a separate container (such as mp4 ). Other codecs require a separate container. AVC does both. AVCC format requires a container (along with a sequence header containing the SPS/PPS). While annexB format dose not require a container. see more here: http://www.szatmary.org/blog/25

2) SPS and PPS are basically headers. They contain information that the h.264 decoder needs to be initialized (Such as compression options and video resolution)

3) It depends on the device, but yes. you can use the decoder. Please reference the Android documentation.

4) h.264 requires YUV420p (or in extreme cases YUV444). ffmpeg can do the colorspace conversion before passing the data to x264.

5) libx264 can not decode, nor can it do the RGB->YUV colorspace conversion.