I've been learning how to use gstreamer. Whether in C, Python or even directly through the command line, there is an interface kind of like bash pipes that can be used to move data from the different gstreamer plugins.
For example, the following will launch a video test screen:
gst-launch-1.0 videotestsrc ! autovideosink
this other pipeline will access the webcam in my workstation and display it live in a video screen:
GST_V4L2_USE_LIBV4L2=1 gst-launch-1.0 v4l2src ! autovideosink
according to the documentation of the v4l2src plugin (Video For Linux)
https://gstreamer.freedesktop.org/docume...language=c
the environment variable GST_V4L2_USE_LIBV4L2 must be set to 1 in order to use libv4l2
When It comes to the Pinephone I've tried the same command specifying the video device and I had no luck
GST_V4L2_USE_LIBV4L2=1 gst-launch-1.0 -v -m v4l2src device=/dev/video3 ! autovideosink
Setting pipeline to PAUSED ...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device '/dev/video3' is not a capture device.
Additional debug info:
../sys/v4l2/v4l2_calls.c(629): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Capabilities: 0x4208000
ERROR: pipeline doesn't want to preroll.
Failed to set pipeline to PAUSED.
Setting pipeline to NULL ...
Freeing pipeline ...
I know the correct device is /dev/video3 because I've run Martijn Braam's camera.py script (https://git.sr.ht/~martijnbraam/python-p.../camera.py) that takes a picture using v4l2-ctl
I've also tried with video0, video1, and video2. All fail. With video2 the command stucks; if I ctrl+C that breaks v4l2 for the whole system, and so far the only way to fix it is by rebooting. I haven't figured out yet how to restart v4l underlying process, I just can't find a systemd service or v4l2-ctl kind of command to do that.
For example, the following will launch a video test screen:
gst-launch-1.0 videotestsrc ! autovideosink
this other pipeline will access the webcam in my workstation and display it live in a video screen:
GST_V4L2_USE_LIBV4L2=1 gst-launch-1.0 v4l2src ! autovideosink
according to the documentation of the v4l2src plugin (Video For Linux)
https://gstreamer.freedesktop.org/docume...language=c
the environment variable GST_V4L2_USE_LIBV4L2 must be set to 1 in order to use libv4l2
When It comes to the Pinephone I've tried the same command specifying the video device and I had no luck
GST_V4L2_USE_LIBV4L2=1 gst-launch-1.0 -v -m v4l2src device=/dev/video3 ! autovideosink
Setting pipeline to PAUSED ...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device '/dev/video3' is not a capture device.
Additional debug info:
../sys/v4l2/v4l2_calls.c(629): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Capabilities: 0x4208000
ERROR: pipeline doesn't want to preroll.
Failed to set pipeline to PAUSED.
Setting pipeline to NULL ...
Freeing pipeline ...
I know the correct device is /dev/video3 because I've run Martijn Braam's camera.py script (https://git.sr.ht/~martijnbraam/python-p.../camera.py) that takes a picture using v4l2-ctl
I've also tried with video0, video1, and video2. All fail. With video2 the command stucks; if I ctrl+C that breaks v4l2 for the whole system, and so far the only way to fix it is by rebooting. I haven't figured out yet how to restart v4l underlying process, I just can't find a systemd service or v4l2-ctl kind of command to do that.