androidmedia encoder problems

cee1 fykcee1 at gmail.com
Thu Jan 23 04:01:56 PST 2014


2014/1/23 Sebastian Dröge <sebastian at centricular.com>:
> On Mi, 2014-01-22 at 23:39 +0100, stic at free.fr wrote:
>> i would be happy to do it, but it's not clear to me of how to retrieve csd-0 and csd-1 values.
>> Are they sent in the buffer, and with what kind of structure ??
>
> Here's the inverse of it (somewhat):
> http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/sys/androidmedia/gstamcvideodec.c#n1466
>
> You'll get such a field in the format returned by
> gst_amc_codec_get_output_format() too. Even two of them for h264, which
> then need to be reassembled like in the other code from the previous
> mail.

The current PPS/PPS handling logic in gstamcvideoenc is taking care of
BUFFER_FLAG_CODEC_CONFIG:
https://github.com/cee1/gst-plugins-bad/blob/master/sys/androidmedia/gstamcvideoenc.c#L803

When receives an output buffer with this flag, the h264 encoder will
1) add it to encoder_headers through gst_video_encoder_set_headers; 2)
send it downstream.

For retrieving csd-0 and csd-1, I couldn't get any returned
MediaFormat in my experiment(i.e. no INFO_OUTPUT_FORMAT_CHANGED), see
https://github.com/cee1/gst-plugins-bad/blob/master/sys/androidmedia/gstamcvideoenc.c#L908.
To stic at free.fr: you may enable related logs, and see whether it is
the case with you, if not, then you can handle the format in L917
(i.e. the gst_amc_codec_get_output_format() returned format)

BTW if no PPS/SPS generated by the h264 encoder, the client should
unable to play, right? I'm wondering what does a gst client say.



-- 
Regards,

- cee1


More information about the gstreamer-android mailing list