After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 626300 - v4l2src: support capturing MPEG
v4l2src: support capturing MPEG
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 583685 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-08-07 11:02 UTC by Nicolas Mailhot
Modified: 2012-10-26 22:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
LANG=C G_DEBUG=fatal_warnings gdb --args gst-launch -v playbin uri="file:///dev/video0" (20.02 KB, text/plain)
2010-08-07 11:30 UTC, Nicolas Mailhot
Details
dmesg (87.16 KB, text/plain)
2010-08-07 11:31 UTC, Nicolas Mailhot
Details
lspci (196.35 KB, text/plain)
2010-08-07 11:33 UTC, Nicolas Mailhot
Details
Xorg.0.log (113.29 KB, text/plain)
2010-08-07 11:34 UTC, Nicolas Mailhot
Details
cat /proc/asound/*/pcm*p/sub*/* while playing (20.23 KB, text/plain)
2010-08-07 11:39 UTC, Nicolas Mailhot
Details
/proc/cpuinfo (1.49 KB, text/plain)
2010-08-07 12:05 UTC, Nicolas Mailhot
Details
LANG=C GST_DEBUG=v4l2*:5 gst-launch-0.10 v4l2src num-buffers=1 ! fakesink (40.89 KB, text/plain)
2010-08-07 17:09 UTC, Nicolas Mailhot
Details

Description Nicolas Mailhot 2010-08-07 11:02:52 UTC
gst-launch-0.10 playbin uri="file:///dev/video0"
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstPulseSinkClock
WARNING: from element /GstPlayBin:playbin0/GstBin:vbin/GstAutoVideoSink:videosink/GstXvImageSink:videosink-actual-sink-xvimage: A lot of buffers are being dropped.
Additional debug info:
gstbasesink.c(2686): gst_base_sink_is_too_late (): /GstPlayBin:playbin0/GstBin:vbin/GstAutoVideoSink:videosink/GstXvImageSink:videosink-actual-sink-xvimage:
There may be a timestamping problem, or this computer is too slow.
WARNING: from element /GstPlayBin:playbin0/GstBin:vbin/GstAutoVideoSink:videosink/GstXvImageSink:videosink-actual-sink-xvimage: A lot of buffers are being dropped.
Additional debug info:
gstbasesink.c(2686): gst_base_sink_is_too_late (): /GstPlayBin:playbin0/GstBin:vbin/GstAutoVideoSink:videosink/GstXvImageSink:videosink-actual-sink-xvimage:
There may be a timestamping problem, or this computer is too slow.
WARNING: from element /GstPlayBin:playbin0/GstBin:vbin/GstAutoVideoSink:videosink/GstXvImageSink:videosink-actual-sink-xvimage: A lot of buffers are being dropped.
Additional debug info:
gstbasesink.c(2686): gst_base_sink_is_too_late (): /GstPlayBin:playbin0/GstBin:vbin/GstAutoVideoSink:videosink/GstXvImageSink:videosink-actual-sink-xvimage:
There may be a timestamping problem, or this computer is too slow.
WARNING: from element /GstPlayBin:playbin0/GstBin:vbin/GstAutoVideoSink:videosink/GstXvImageSink:videosink-actual-sink-xvimage: A lot of buffers are being dropped.
Additional debug info:
gstbasesink.c(2686): gst_base_sink_is_too_late (): /GstPlayBin:playbin0/GstBin:vbin/GstAutoVideoSink:videosink/GstXvImageSink:videosink-actual-sink-xvimage:
There may be a timestamping problem, or this computer is too slow.
^CCaught interrupt -- handling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 30944172470 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

gstreamer-0.10.30-1.fc14.x86_64
gstreamer-ffmpeg-0.10.11-1.fc14.x86_64
gstreamer-java-1.4-2.fc14.noarch
gstreamer-plugins-bad-0.10.19-1.fc14.x86_64
gstreamer-plugins-bad-free-0.10.19-6.fc14.x86_64
gstreamer-plugins-base-0.10.30-2.fc14.x86_64
gstreamer-plugins-good-0.10.24-1.fc14.x86_64
gstreamer-plugins-ugly-0.10.15-2.fc14.x86_64
gstreamer-python-0.10.16-2.fc14.x86_64
gstreamer-rtsp-0.10.5-2.fc14.x86_64
gstreamer-tools-0.10.30-1.fc14.x86_64
PackageKit-gstreamer-plugin-0.6.6-3.fc14.x86_64
phonon-backend-gstreamer-4.4.2-1.fc14.x86_64
alsa-plugins-pulseaudio-1.0.22-1.fc13.x86_64
pulseaudio-0.9.21-6.fc13.x86_64
pulseaudio-gdm-hooks-0.9.21-6.fc13.x86_64
pulseaudio-libs-0.9.21-6.fc13.x86_64
pulseaudio-libs-glib2-0.9.21-6.fc13.x86_64
pulseaudio-libs-zeroconf-0.9.21-6.fc13.x86_64
pulseaudio-module-bluetooth-0.9.21-6.fc13.x86_64
pulseaudio-module-gconf-0.9.21-6.fc13.x86_64
pulseaudio-module-lirc-0.9.21-6.fc13.x86_64
pulseaudio-module-x11-0.9.21-6.fc13.x86_64
pulseaudio-utils-0.9.21-6.fc13.x86_64
kernel-2.6.35-3.fc14.x86_64
Comment 1 Nicolas Mailhot 2010-08-07 11:04:43 UTC
*** Bug 583685 has been marked as a duplicate of this bug. ***
Comment 2 Nicolas Mailhot 2010-08-07 11:30:30 UTC
Created attachment 167306 [details]
LANG=C G_DEBUG=fatal_warnings gdb --args gst-launch -v playbin uri="file:///dev/video0"

gdb trace
Comment 3 Nicolas Mailhot 2010-08-07 11:31:52 UTC
Created attachment 167307 [details]
dmesg
Comment 4 Nicolas Mailhot 2010-08-07 11:33:04 UTC
Created attachment 167308 [details]
lspci
Comment 5 Nicolas Mailhot 2010-08-07 11:34:55 UTC
Created attachment 167309 [details]
Xorg.0.log
Comment 6 Nicolas Mailhot 2010-08-07 11:36:39 UTC
gst-play does not handle mpeg2 v4l2src sources so there's no way to invoke it this way (unless someone can propose a pipeline)
Comment 7 Nicolas Mailhot 2010-08-07 11:39:35 UTC
Created attachment 167310 [details]
cat /proc/asound/*/pcm*p/sub*/* while playing
Comment 8 Nicolas Mailhot 2010-08-07 12:05:09 UTC
Created attachment 167315 [details]
/proc/cpuinfo
Comment 9 Sebastian Dröge (slomo) 2010-08-07 13:13:58 UTC
Does it work if you save some content from /dev/video0 to a file and try to play that?
Comment 10 Nicolas Mailhot 2010-08-07 14:11:36 UTC
(In reply to comment #9)
> Does it work if you save some content from /dev/video0 to a file and try to
> play that?

This part works perfectly (or the symptoms occur after a lot more time than when playing video live)
Comment 11 Nicolas Mailhot 2010-08-07 14:12:33 UTC
Drat, it's stuck in needinfo now :(
Comment 12 Tim-Philipp Müller 2010-08-07 15:27:33 UTC
Well, this is just not really how you're supposed to use /dev/videoN.

If the input is live, you should be using a source element that handles that properly, e.g. v4l2src. If v4l2src doesn't support your format of choice, you should add support for that.

Your problems stem from the fact that the source is live and there's a latency, but no element in the pipeline answers the latency query properly, so the sink doesn't know it needs to adjust for live input. You can work around that by using xvimagesink sync=false, e.g:

 gst-launch-0.10 playbin2 uri=file:///dev/video0 video-sink='xvimagesink sync=false'
Comment 13 Nicolas Mailhot 2010-08-07 15:51:53 UTC
(In reply to comment #12)
> Well, this is just not really how you're supposed to use /dev/videoN.

Why not? If I wanted static content, I'd be using a dvd not a capture card. It worked perfectly when the hardware was bought (before the software stack was "improved" by PA and other rewrites) 

> If the input is live, you should be using a source element that handles that
> properly, e.g. v4l2src. If v4l2src doesn't support your format of choice, you
> should add support for that.

It's an MPEG2 capture card. Is there anything more common or better supported by gstreamer (real video not timestamp-like webcams)? IIRC ivtv is the most complete v4l2 driver in the kernel tree
 
> Your problems stem from the fact that the source is live and there's a latency,
> but no element in the pipeline answers the latency query properly, so the sink
> doesn't know it needs to adjust for live input. You can work around that by
> using xvimagesink sync=false, e.g:
> 
>  gst-launch-0.10 playbin2 uri=file:///dev/video0 video-sink='xvimagesink
> sync=false'

That removes video stuttering completely, but the sound dies at about the same time video used to freeze, and it does not recover at all, so functionnally this is no better
Comment 14 Tim-Philipp Müller 2010-08-07 16:28:52 UTC
> > Well, this is just not really how you're supposed to use /dev/videoN.
> 
> Why not? If I wanted static content, I'd be using a dvd not a capture card. It
> worked perfectly when the hardware was bought (before the software stack was
> "improved" by PA and other rewrites) 

Because filesrc is not suited for live input.

When did what work exactly? With what versions? (Even if, it doesn't change the fact that this is not how you're supposed to use this kind of input with GStreamer.)


> > If the input is live, you should be using a source element that handles that
> > properly, e.g. v4l2src. If v4l2src doesn't support your format of choice, you
> > should add support for that.
> 
> It's an MPEG2 capture card. Is there anything more common or better supported
> by gstreamer (real video not timestamp-like webcams)? IIRC ivtv is the most
> complete v4l2 driver in the kernel tree

Have you tried v4l2src? Does it support the format or not? Can you attach the log from

 $ GST_DEBUG=v4l2*:5 gst-launch-0.10 v4l2src num-buffers=1 ! fakesink

?


> > Your problems stem from the fact that the source is live and there's a latency,
> > but no element in the pipeline answers the latency query properly, so the sink
> > doesn't know it needs to adjust for live input. You can work around that by
> > using xvimagesink sync=false, e.g:
> > 
> >  gst-launch-0.10 playbin2 uri=file:///dev/video0 video-sink='xvimagesink
> > sync=false'
> 
> That removes video stuttering completely, but the sound dies at about the same
> time video used to freeze, and it does not recover at all, so functionnally
> this is no better

Right, you'd need to do the same for the audio sink if there's sound. (Note however, that this is still not really the right way to do this, just a work-around to demonstrate the problem.)
Comment 15 Nicolas Mailhot 2010-08-07 17:08:31 UTC
(In reply to comment #14)
> > > Well, this is just not really how you're supposed to use /dev/videoN.
> > 
> > Why not? If I wanted static content, I'd be using a dvd not a capture card. It
> > worked perfectly when the hardware was bought (before the software stack was
> > "improved" by PA and other rewrites) 
> 
> Because filesrc is not suited for live input.
> 
> When did what work exactly? With what versions? (Even if, it doesn't change the
> fact that this is not how you're supposed to use this kind of input with
> GStreamer.)

Seems I already had the hardware in december 2005 (how time flies), so that would have been gstreamer 0.8.11. Tried to resist the system PA-isation as long as I could, but once it was done, gstreamer didn't seem to recover direct /dev/video streaming

> > > If the input is live, you should be using a source element that handles that
> > > properly, e.g. v4l2src. If v4l2src doesn't support your format of choice, you
> > > should add support for that.
> > 
> > It's an MPEG2 capture card. Is there anything more common or better supported
> > by gstreamer (real video not timestamp-like webcams)? IIRC ivtv is the most
> > complete v4l2 driver in the kernel tree
> 
> Have you tried v4l2src? Does it support the format or not? Can you attach the
> log from
> 
>  $ GST_DEBUG=v4l2*:5 gst-launch-0.10 v4l2src num-buffers=1 ! fakesink
> 
> ?

ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device '/dev/video0' cannot capture in the specified format
Additional debug info:
gstv4l2object.c(1958): gst_v4l2_object_set_format (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Tried to capture in BGR3, but device returned format MPEG

> > > Your problems stem from the fact that the source is live and there's a latency,
> > > but no element in the pipeline answers the latency query properly, so the sink
> > > doesn't know it needs to adjust for live input. You can work around that by
> > > using xvimagesink sync=false, e.g:
> > > 
> > >  gst-launch-0.10 playbin2 uri=file:///dev/video0 video-sink='xvimagesink
> > > sync=false'
> > 
> > That removes video stuttering completely, but the sound dies at about the same
> > time video used to freeze, and it does not recover at all, so functionnally
> > this is no better
> 
> Right, you'd need to do the same for the audio sink if there's sound. (Note
> however, that this is still not really the right way to do this, just a
> work-around to demonstrate the problem.)

Can you suggest a command to type? gst-launch-0.10 does not like the attempts I tried before
Comment 16 Nicolas Mailhot 2010-08-07 17:09:39 UTC
Created attachment 167328 [details]
LANG=C GST_DEBUG=v4l2*:5 gst-launch-0.10 v4l2src num-buffers=1 ! fakesink
Comment 17 Sjoerd Simons 2010-08-30 17:32:00 UTC
Seems like the pipeline causes you to capture BGR3 because libv4l claims it can emulate it, but it turns out it lies and just gives you back mpeg.. Making gstreamer somewhat unhappy. If you apply the patch from dcea1b2dfcdad92c381281aafd09786a7abe8a83 that should work around it. (The real bug is in libv4l though).
Comment 18 Tobias Mueller 2011-01-13 23:44:03 UTC
Reopening as I think the requested information has been provided.
Comment 19 Tim-Philipp Müller 2012-10-26 22:49:10 UTC
Not sure what to do with this. v4l2src advertises mpegts now, so I guess it supports it at least somewhat. The patch mentioned in comment #17 has been committed, which should workaround the last issue which is not a GNOME issue anyway as I understand it.

Let's  close this as OBSOLETE. I'm sure someone will file a new bug if there's still support for something missing.

Please re-open or file a new bug if this still doesn't work with GStreamer 1.x.