GNOME Bugzilla – Bug 606394
[v4l2] Add an adaptive resampling stage when reading from a v4l device
Last modified: 2011-05-23 14:33:07 UTC
Now that the audio stack has been converted to pulse-audio, it has become intolerant of clock drift. Therefore, direct reading from a v4l device in totem, that used to work fine, is now stuttering and freezing after just 30s (making it impossible to use) Pulseaudio people say gstreamer should add automatically a resampling stage to take into account the clock drift between the v4l source and the audio device used for playback, and that direct reading from v4l device was always broken due to the lack of this stage, even though it just worked before PA was generalized. See also https://bugzilla.redhat.com/show_bug.cgi?id=553043
pulseaudio does clock drift correctly. What you're probably seeing is a bug in mpegtsparse or something.
Looking at the redhat bug report, this can't really be fixed like that because it treats the video device as a regular file while it is in fact a live stream. Does this work with: gst-launch playbin uri=v4l2://
gst-launch playbin uri=v4l2:///dev/video0 --gst-debug-level=2 Setting pipeline to PAUSED ... 0:00:00.034035366 13835 0x1ece080 WARN v4l2 gstv4l2object.c:1939:gst_v4l2_object_set_format:<source> error: Device '/dev/video0' cannot capture in the specified format 0:00:00.034093609 13835 0x1ece080 WARN v4l2 gstv4l2object.c:1939:gst_v4l2_object_set_format:<source> error: Tried to capture in BGR3, but device returned format MPEG Pipeline is live and does not need PREROLL ... ERROR: from element /GstPlayBin:playbin0/GstV4l2Src:source: Device '/dev/video0' cannot capture in the specified format Additional debug info: gstv4l2object.c(1939): gst_v4l2_object_set_format (): /GstPlayBin:playbin0/GstV4l2Src:source: Tried to capture in BGR3, but device returned format MPEG ERROR: pipeline doesn't want to preroll. Setting pipeline to PAUSED ... Setting pipeline to READY ... Setting pipeline to NULL ... Freeing pipeline ...
ok, then the mpeg format needs to be added to v4l2src. what version of gst-plugins-base are you using?
Local gstreamer stack : gstreamer-0.10.26.4-1.fc13.x86_64 gstreamer-ffmpeg-0.10.9-1.fc12.x86_64 gstreamer-java-1.3-2.fc13.x86_64 gstreamer-plugins-bad-0.10.17-4.fc13.x86_64 gstreamer-plugins-bad-free-0.10.17-7.fc13.x86_64 gstreamer-plugins-base-0.10.26.4-1.fc13.x86_64 gstreamer-plugins-good-0.10.18-2.fc13.x86_64 gstreamer-plugins-ugly-0.10.13-2.fc13.x86_64 gstreamer-python-0.10.16-1.fc12.x86_64 gstreamer-tools-0.10.26.4-1.fc13.x86_64
And with gstreamer-plugins-base-0.10.27-1.fc13.x86_64.rpm $ gst-launch playbin uri=v4l2:///dev/video0 Setting pipeline to PAUSED ... Pipeline is live and does not need PREROLL ... ERROR: from element /GstPlayBin:playbin0/GstV4l2Src:source: Device '/dev/video0' cannot capture in the specified format Additional debug info: gstv4l2object.c(1939): gst_v4l2_object_set_format (): /GstPlayBin:playbin0/GstV4l2Src:source: Tried to capture in BGR3, but device returned format MPEG ERROR: pipeline doesn't want to preroll. Setting pipeline to PAUSED ... Setting pipeline to READY ... Setting pipeline to NULL ... Freeing pipeline ...
v4l2src now has support for mpeg since the last release.