v4l2src and mpeg4 plugins on Android

Francesco Argese kekko84 at gmail.com
Wed Oct 2 08:04:40 PDT 2013


Hello,

I have tried to read raw frames using android java api and send them to
gstreamer pipelines using appsrc.

I have implemented it starting from Tutorial3 for Android and I have done
the required changes. I have tried two solutions:
1) call a native Android function from Java code to push the buffer in
appsrc
2) using callbacks related to appsrc to retrieve frame when data are needed

I have the following problems:
1) The pipeline with appsrc works and I'm able to use image frame in
GStreamer but the buffer is filled too fast and is cleared too slow so
after some time I obtain an out of memory error.
2) This way could resolve problem of out of memory but when I call
"g_idle_add ((GSourceFunc) read_data, data);" in "need-data" callback the
code doesn't enter never in idle function (read_data). I have investigated
on forums what could generate this problem and I have found something
related to launching main_loop in an external thread; I have tried to add
g_thread_init(NULL) but it doesn't resolve the problem.

What could be the problem?

Thanks in advance,
Francesco Argese

P.S.: Are there any changes in more recent versions of GStreamer that could
simplify my work to take camera on Android?


2013/5/13 Mailing List SVR <lists at svrinformatica.it>

>  Il 13/05/2013 11:51, Sebastian Dröge ha scritto:
>
> On Mo, 2013-05-13 at 11:35 +0200, Francesco Argese wrote:
>
>  2013/5/13 Sebastian Dröge <sebastian.droege at collabora.co.uk> <sebastian.droege at collabora.co.uk>
>
>
>
>         v4l2 is no public API on Android and not available on many
>         devices.
>
>         You can get the MPEG4 encoder when listing the ffmpeg plugin
>         in your
>         Android.mk
>
>
> I have tried to follow your suggestion regarding fffenc_mpeg4 and I
> have created the Android.mk below but, when I compile with ndk-build I
> obtain the error below.
>
>
> I have seen that for every plugin available a related library exists
> with name libgst$(plugin_name).a in directory
> $(GST_ANDROID_ROOT)/lib/gstreamer-0.10/static but, for ffenc_mpeg4, it
> doesn't exist and it seems that it was not compiled.
>
> Am I wrong somewhere?
>
>  The plugin is just called "ffmpeg"
>
>
>  Regarding vrl2src does exist another plugin to read frames from an
> Android camera device?
>
>
>
> you can read raw frames using android java api and send them to gstreamer
> pipelines using appsrc,
>
> Nicola
>
>
>   Not yet, but it would be possible to create something around the Android
> camera Java API.
>
>
>
> _______________________________________________
> gstreamer-android mailing listgstreamer-android at lists.freedesktop.orghttp://lists.freedesktop.org/mailman/listinfo/gstreamer-android
>
>
>
> _______________________________________________
> gstreamer-android mailing list
> gstreamer-android at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-android
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-android/attachments/20131002/d234557d/attachment.html>


More information about the gstreamer-android mailing list