Capture video from android camera with gstreamer
alex_malishev
aron_stoun1996 at mail.ru
Wed Jul 6 14:18:13 UTC 2016
Hi! I'm working on the project which will be able to capture video from
smartphone's camera and send it to server. But now I'm trying to save it in
file and my question is:
Does anybody know how to capture video from android camera and save it to
file using gstreamer1.0? I have already tried camerabin plugin. I built
this pipeline:
gst-launch-1.0 camerabin mode=1
filename="/storage/sdcard0/Movies/camera.ogg"
but it doesn't work. I uderstand that I must set viewfinder-sink and
camera-src properties, but when I try to make pipeline by using gstreamer
functions like this
data->pipeline = gst_element_factory_make("camerabin", "camerabin");
g_object_set(data->pipeline, "mode", MODE_VIDEO, NULL);
sink = gst_element_factory_make ("filesink", NULL);
g_object_set(sink, "location","/storage/sdcard0/Movies/test.ogg");
g_object_set(data->pipeline, "viewfinder-sink", sink, NULL);
g_object_set(data->pipeline,
"filename","/storage/sdcard0/Movies/camera-record.ogg", NULL);
gst_element_set_state(data->pipeline, GST_STATE_READY);
the app crashes and gives me error:
A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x83127d5b in tid
27873 (als.tutorial_51) I add filesink element because when I build pipeline
like this:
data->pipeline = gst_parse_launch("camerabin mode=1
filename="/storage/sdcard0/Movies/camera.ogg")
file camera.ogg doesn't create in filesystem.
And I can't set camera-src property, because i don't know what value i
should use. In examples peoples use v4l2, but not all devices support this
plugin. Also they used ahcsrc, but it gives me error: no elements ahcsrc. I
tried to find this element and found out there is no such element in
gstreamer1.0, only in gstreamer-0.10 in androidcamera plugin.
Please, help me!
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Capture-video-from-android-camera-with-gstreamer-tp4678451.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list