Android camera access

Sebastian Dröge sebastian at centricular.com
Mon May 26 01:56:33 PDT 2014


On Mo, 2014-05-26 at 10:54 +0200, Lee Matthews wrote:
> Hi,
> 
> I wish to be able to access an external usb camera attached to an Android phone using gstreamer. I have already achieved this using the android version of gstreamer that uses the dynamic libraries from the command line, I was using the following pipeline :
> 
> gst-launch-1.0 v4l2src device=/dev/video4 ! video/x-raw, framerate=20/1,width=640, height=480 !  jpegenc ! multipartmux boundary=spionisto ! tcpclientsink host=10.1.5.21 port=9999
> 
> I have looked at the android static libraries and I cannot find the video4linux2 plugin. Having done a little research it would appear that I need to use JNI to access the android.hardware.Camera API. Why is this ? Why does the video4linux2 plugin exist in its dynamic version and not in its static version for the android platform ? I'm rather lost on this.
> 
> Can anyone enlighten me ?

v4l2 is not a public API on Android, and a device might support it for
camera access or not. I guess it would make sense to include it
nonetheless in the binaries :)

However the real solution will be to use the Java API via JNI, and with
a similar approach as is used in the androidmedia plugin for
android.media.MediaCodec usage this can be abstracted quite easily into
a new GStreamer element.

-- 
Sebastian Dröge, Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 966 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140526/1b6068e4/attachment.sig>


More information about the gstreamer-devel mailing list