Answer the question
In order to leave comments, you need to log in
How to fix problems recording webcam video in Gstreamer?
Hello!
I use an old webcam to make video surveillance of the front door. The camera with a microphone is connected to the Raspberry Pi via USB, on which video is recorded with sound using the following Gstreamer pipeline:
gst-launch-1.0 -e v4l2src do-timestamp=true \
! video/x-raw,format=YV12,width=640,height=480,framerate=5/1 \
! videoconvert ! queue ! videorate ! videoflip method=clockwise \
! clockoverlay halignment=left valignment=bottom time-format="%Y/%m/%d %H:%M:%S" font-desc="Sans 24" \
! omxh264enc target-bitrate=400000 control-rate=variable \
! video/x-h264,stream-format=byte-stream,framerate=5/1 ! h264parse \
! queue ! mux. alsasrc device=plughw:0,0 do-timestamp=true \
! lamemp3enc target=0 bitrate=128 mono=true \
! queue leaky=2 max-size-buffers=0 max-size-time=0 max-size-bytes=0 \
! mux. matroskamux name=mux ! queue \
! filesink location=camera`date -Iseconds`.mkv >> recorder.log 2>&1
usb 1-1.5: 1:1: cannot get freq at ep 0x5
usb 1-1.5: 1:1: cannot set freq 48000 to ep 0x5
usb 1-1.5: 2:1: cannot get freq at ep 0x86
usb 1-1.5: 2:1: cannot set freq 48000 to ep 0x86
uvcvideo: Failed to resubmit video URB (-1).
Answer the question
In order to leave comments, you need to log in
How is the first frame green? Just a green field or a normal image, but with a strong admixture of greenery? If the second - then this camera does not have time to adjust, the first frames must be discarded. The container has nothing to do with it. raspistill with a built-in camera generally gives the camera 5 seconds to set up by default, and I experimented - in 3 seconds the camera really does not have time to set up in some conditions and gives just a green picture.
The error in dmesg is easy to google.
This is a known bug, unfortunately not fully resolved.
For more details and possible workarounds see
https://bugs.launchpad.net/ubuntu/+source/linux/+b...
https://bugs.launchpad.net/ubuntu/+source/linux/+b.. .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question