androidmedia encoder problems

stic at free.fr stic at free.fr
Sun Jan 19 12:35:24 PST 2014


MediaCodec.PARAMETER_KEY_REQUEST_SYNC_FRAME and setParameters are only available since Android 19 api :/
But if we have the data in first frame, would it be possible to resend it directly from gstreamer encoder element ?
To me it seems to be data put in codec headers with gst_video_encoder_set_headers.
I would like this to be resent ... or something similar to allow to get config at any moment during streaming (not only at startup ...)

----- Mail original -----
De: "Sebastian Dröge" <sebastian at centricular.com>
À: "Discussions about GStreamer on Android" <gstreamer-android at lists.freedesktop.org>
Envoyé: Dimanche 19 Janvier 2014 10:05:26
Objet: Re: androidmedia encoder problems

On Sa, 2014-01-18 at 23:55 +0100, stic at free.fr wrote:
> Hi all,
> 
> I'm still trying to use androidmedia encoder provided here by cee1: https://bugzilla.gnome.org/show_bug.cgi?id=705129
> I try h264 video encoder. One of the problem I have with the encoder is the following:
> it seems codec config data (sps pps) are sent only 1 time when the stream begins to send data ... so if a client tries to connect to the pipeline server later (not at the stream startup) then it doesn't have received such information and can't display anything.
> 
> I also tried to use h264parse interval-config=xxx to resend config at xxx interval but it does not work -> message saying: no SPS/PPS yet, will be dropped

That would either indicate a bug in h264parse, or there really was no
SPS/PPS yet... but then decoding would fail in general.

> There is probably a way to ask the encoder the resend config when needed, but how can this be done ?

Check
https://developer.android.com/reference/android/media/MediaCodec.html#PARAMETER_KEY_REQUEST_SYNC_FRAME
and
https://developer.android.com/reference/android/media/MediaCodec.html#setParameters%28android.os.Bundle%29

This would need to be called when a keyframe is requested for the
current frame, which is GST_VIDEO_CODEC_FRAME_FLAG_FORCE_KEYFRAME and
can be checked with GST_VIDEO_CODEC_FRAME_IS_FORCE_KEYFRAME(frame).

See some other encoders for the implementation.


However the API of MediaCodec and what exactly it expects as input and
what it outputs seems rather undefined to me. I'm not sure if it will be
simple to get something that works in general on all devices.

I hope to find some time to look at this patch myself in the near
future...

-- 
Sebastian Dröge, Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source

_______________________________________________
gstreamer-android mailing list
gstreamer-android at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/gstreamer-android


More information about the gstreamer-android mailing list