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 344987 - [PATCH] [dvbsrc] [ts-tools] gstreamer 0.10 port
[PATCH] [dvbsrc] [ts-tools] gstreamer 0.10 port
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
0.10.x
Other All
: Normal enhancement
: 0.10.4
Assigned To: Zaheer Abbas Merali
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-06-15 12:51 UTC by Johannes Schmid
Modified: 2006-11-05 13:04 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Patch to port dvbsrc to 0.10, fixed dvb-t (113.14 KB, patch)
2006-06-15 12:52 UTC, Johannes Schmid
needs-work Details | Review
Patch to port ts-tools to 0.10 (77.94 KB, patch)
2006-06-15 12:53 UTC, Johannes Schmid
needs-work Details | Review
gst-plugins-bad/sys/dvb (117.90 KB, application/x-compressed-tar)
2006-07-10 20:59 UTC, Johannes Schmid
  Details
Patch for gst-plugins-bad (910 bytes, patch)
2006-07-10 21:00 UTC, Johannes Schmid
none Details | Review
diff to gst-plugins-bad for dvb (73.71 KB, patch)
2006-09-28 12:09 UTC, Zaheer Abbas Merali
committed Details | Review

Description Johannes Schmid 2006-06-15 12:51:57 UTC
Please describe the problem:
I ported dvbsrc und ts-tools to gstreamer-0.10 based on the code of http://webcvs.freedesktop.org/gstreamer/gst-sandbox/dvb-elements

Steps to reproduce:
It is not yet possible to run this as a live source because of clocking problems but you can see some jumping video using this command (this is for german ARD from a dvb-t device, the values may of course differ):

gst-launch-0.10 -v dvbsrc modulation="QAM 16" \
	trans-mode=8k bandwidth=7 freq=184500000 pids=513:514:32 \
	code-rate-lp=AUTO code-rate-hp=3/4 guard=4  hierarchy=0\
         ! ts2ps vpid=513 apid=514 ! decodebin name=decoder \
	decoder. ! ffmpegcolorspace ! xvimagesink sync=false \
	decoder. ! audioconvert ! audioresample ! alsasink sync=false

Actual results:


Expected results:
I would be cool if this could go to gst-plugins-bad (for dvbsrc) and gst-plugins-ugly/ffmpeg for ts-tools

Does this happen every time?


Other information:
Comment 1 Johannes Schmid 2006-06-15 12:52:55 UTC
Created attachment 67410 [details] [review]
Patch to port dvbsrc to 0.10, fixed dvb-t
Comment 2 Johannes Schmid 2006-06-15 12:53:35 UTC
Created attachment 67412 [details] [review]
Patch to port ts-tools to 0.10
Comment 3 Tim-Philipp Müller 2006-06-19 14:22:07 UTC
This is really cool, a lot of people have been waiting for this :)

Re-assigning to gst-plugins-bad (where new stuff gets added first).

What would be great is if you could make a new patch that applies against gst-plugins-bad CVS (don't bother though if autotools drive you into despair, but it would certainly make things easier for us).

Things without a library or system dependency should go into the gst/ subdir (like mpegstream), and things that are system-dependent go into the sys/ subdir (I presume that's where dvbsrc should go if it's linux-specific).



Comment 4 Johannes Schmid 2006-06-19 17:16:02 UTC
What do you mean with a patch to gst-plugins-bad? 

I could not find anything dvb related in gst-plugins-bad so I assume I would have to add new directories and files. Of course I can send you a tarball and a patch to link all this together. Anyway, my notebook hd crashed yesterday, so it will depend on the hp service when I can continue my work.

ts-tools has to go to gst-plugins-ugly/ffmpeg IMHO because it uses some mpeg code (seems it comes from ffmpeg or mpegtools) that may have copyright/patent issues.
Comment 5 Martin Eikermann 2006-06-19 18:19:02 UTC
Hi Johannes,

nice work. It's really cool that the dvbsrc will find its way out of gst-sandbox.

About the ts-tools: It makes use of some code from the Metzler Brothers, nothing taken from ffmpeg. They wrote the initial versions of the DVB kernel API. I took it from their website (http://www.metzlerbros.org/dvb/index.html). Its from the dvb-mpegtools iirc. The code is GPL and there was no chance getting it into gstreamer 0.8 repository bcs of this (LGPL is mandatory for 0.8).
Comment 6 Johannes Schmid 2006-07-10 20:59:18 UTC
Created attachment 68751 [details]
gst-plugins-bad/sys/dvb

This is the tarball of the dvb directory
Comment 7 Johannes Schmid 2006-07-10 21:00:18 UTC
Created attachment 68752 [details] [review]
Patch for gst-plugins-bad

Add some entries to configure.in and sys/Makefile.am, needs some work by the maintainers!
Comment 8 Johannes Schmid 2006-07-10 21:01:20 UTC
I contacted Markus Metzler who wrote the dvb-mpegtoos code. Unforntunately he pointed out that he wrote the code for a (no longer existing) company named convergence and that he is not sure if he may change the license now!
He also stated that the code does not create a proper ps stream so we will need a better solution. Maybe someone can patch the fluendo mpeg stuff to guess the pids correctly.

Anyway, I made a patch for gstreamer-plugins-bad which integrates the dvbsrc! There is a linking problem in the moment which I could not figure out yet because dvbsrc need gst-plugins-base!
Comment 9 Johannes Schmid 2006-09-20 11:51:13 UTC
Hi Zaheer!

I read on the planet that you are working on the DVB stuff for gstreamer, that's great. I don't have the time to continue the development on these patches here but I hope you can make use of some of the code.

There are some timing problem that make no smooth playback possible but I assume that this is no big deal if someone is familiar with gstreamer.

If there is now a lgpl'd ts-demuxer I hope that these things will hit gstreamer soon.

Johannnes
Comment 10 Zaheer Abbas Merali 2006-09-20 17:57:04 UTC
Hi Johannes,

It is correct, I have fixed up some of the dvbsrc code attached on this bug (eg memory leaks etc.) and plan to do quite a bit more cleanup and add interfaces.  My aim is to get this into -good.

I have a patch for fluendo's transport stream demuxer, meaning we do not have to use the convergence ts2ps stuff.  Fluendo's mpeg demuxers are licenced liberally so there should be no issue for them.

Live sources cannot play in sync yet directly due to bug #340842 but with a bit of hackery one can play dvb slightly delayed but in sync (outputting to filesink and a separate pipeline reading from filesrcf for example).

I will post more details on this bug and on my blog soon.
Comment 11 Frans van Berckel 2006-09-24 05:20:35 UTC
Hi Zaheer,

Do i need the licensed fluendo's transport stream demuxer if i want to playout DVB Radio?
Comment 12 Zaheer Abbas Merali 2006-09-24 16:28:43 UTC
Frans, yes.  However it is licenced under the MPL and is available from here:

https://core.fluendo.com/gstreamer/trac

You will need svn trunk of it as I have had to make changes for dvb.
Comment 13 Zaheer Abbas Merali 2006-09-28 12:09:34 UTC
Created attachment 73554 [details] [review]
diff to gst-plugins-bad for dvb

This is current status of the dvb plugin.  It requires SVN trunk of fluendo's transport stream demuxer which is licenced under the MPL.

I have tested it with a DVB-T card getting both a full transport stream and also filtering the transport stream by setting the pids to filter.
Comment 14 Alexander Macdonald 2006-10-05 15:42:23 UTC
(In reply to comment #13)
> Created an attachment (id=73554) [edit]
> diff to gst-plugins-bad for dvb
> 
> This is current status of the dvb plugin.  It requires SVN trunk of fluendo's
> transport stream demuxer which is licenced under the MPL.
> 
> I have tested it with a DVB-T card getting both a full transport stream and
> also filtering the transport stream by setting the pids to filter.
> 

Maybe you can help me, I'm trying to test out your dvb source by tunning to the following channel and saving it to a file:

BBC ONE:698000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_3_4:QAM_16:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:600:601:4166

The test pipeline I've tried using is this: 

gst-launch dvbsrc modulation="QAM 16" trans-mode=2k bandwidth=8 freq=698000000 code-rate-lp=3/4 code-rate-hp=3/4 guard=32  hierarchy=NONE inversion=AUTO  ! filesink location=dvbtest.out

Are those values correct? I can never remember which part in the channels.conf file means what...

Anyway the ouput it gives me is:


Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /pipeline0/dvbsrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(1569): gst_base_src_loop (): /pipeline0/dvbsrc0:
streaming task paused, reason error (-5)
Execution ended after 1808295000 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
FREEING pipeline ...

I can watch dvb streams in xine so i have a signal and the line in channels.conf is correct, what is causing gstreamer to fail?
Comment 15 Zaheer Abbas Merali 2006-10-05 16:22:39 UTC
Hi

At first glance it looks ok.

Firstly what card do you have?

Can you attach a debug log with GST_DEBUG=dvbsrc:5 gst-launch .....

Thanks

Zaheer
Comment 16 Alexander Macdonald 2006-10-05 17:56:13 UTC
I'm using a Freecom USB DVB-T stick which uses the dvb_usb_dtt200u module

dmesg output looks like this:

dvb-usb: found a 'WideView WT-220U PenType Receiver (Typhoon/Freecom)' in warm state.
[17258335.436000] dvb-usb: will use the device's hardware PID filter (table count: 15).
[17258335.436000] DVB: registering new adapter (WideView WT-220U PenType Receiver (Typhoon/Freecom)).
[17258335.436000] DVB: registering frontend 0 (WideView USB DVB-T)...
[17258335.436000] input: IR-receiver inside an USB DVB receiver as /class/input/input11
[17258335.436000] dvb-usb: schedule remote query interval to 300 msecs.
[17258335.436000] dvb-usb: WideView WT-220U PenType Receiver (Typhoon/Freecom) successfully initialized and connected.
[17258337.736000] dvb-usb: recv bulk message failed: -110

debug output looks like this:

GST_DEBUG=dvbsrc:5 gst-launch dvbsrc modulation="QAM 16" trans-mode=2k bandwidth=8 freq=698000000 code-rate-lp=3/4 code-rate-hp=3/4 guard=32  hierarchy=NONE inversion=AUTO  ! filesink location=foo.out
0:00:00.206658000 27338 0x8051a08 INFO                dvbsrc gstdvbsrc.c:434:gst_dvbsrc_init: gst_dvbsrc_init
0:00:00.206894000 27338 0x8051a08 INFO                dvbsrc gstdvbsrc.c:503:gst_dvbsrc_set_property: Set Property: ARG_DVBSRC_FREQ
Setting pipeline to PAUSED ...
0:00:00.209440000 27338 0x8051a08 INFO                dvbsrc gstdvbsrc.c:637:gst_dvbsrc_open_frontend: Using frontend: /dev/dvb/adapter0/frontend0
0:00:00.209487000 27338 0x8051a08 INFO                dvbsrc gstdvbsrc.c:638:gst_dvbsrc_open_frontend: Using dvr:  /dev/dvb/adapter0/dvr0
0:00:00.209864000 27338 0x8051a08 INFO                dvbsrc gstdvbsrc.c:674:gst_dvbsrc_open_frontend: DVB card: WideView USB DVB-T 
0:00:00.209906000 27338 0x8051a08 INFO                dvbsrc gstdvbsrc.c:1055:gst_dvbsrc_tune: gst_dvbsrc_tune
0:00:00.209945000 27338 0x8051a08 INFO                dvbsrc gstdvbsrc.c:1158:gst_dvbsrc_unset_pes_filters: clearing PES filter
0:00:00.209983000 27338 0x8051a08 INFO                dvbsrc gstdvbsrc.c:1125:gst_dvbsrc_tune: tuning DVB-T to 698000000 Hz

0:00:00.314553000 27338 0x8051a08 INFO                dvbsrc gstdvbsrc.c:1175:gst_dvbsrc_set_pes_filter: Setting PES filter
0:00:00.314671000 27338 0x8051a08 INFO                dvbsrc gstdvbsrc.c:1198:gst_dvbsrc_set_pes_filter: Setting pes-filter, pid = 8192, type = 20
0:00:00.330663000 27338 0x8051a08 INFO                dvbsrc gstdvbsrc.c:956:gst_dvbsrc_frontend_status: gst_dvbsrc_frontend_status

0:00:00.330710000 27338 0x8051a08 INFO                dvbsrc gstdvbsrc.c:962:gst_dvbsrc_frontend_status: fd-frontend: 6
0:00:01.334746000 27338 0x8051a08 INFO                dvbsrc gstdvbsrc.c:966:gst_dvbsrc_frontend_status: .
0:00:01.357478000 27338 0x8051a08 INFO                dvbsrc gstdvbsrc.c:686:gst_dvbsrc_open_dvr: Setting buffer size
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
0:00:01.701050000 27338 0x806bd38 DEBUG               dvbsrc gstdvbsrc.c:839:gst_dvbsrc_create: Reading from DVR device
0:00:01.886665000 27338 0x806bd38 INFO                dvbsrc gstdvbsrc.c:794:read_device: Reading from device /dev/dvb/adapter0/dvr0 timedout (1)
0:00:02.034682000 27338 0x806bd38 INFO                dvbsrc gstdvbsrc.c:794:read_device: Reading from device /dev/dvb/adapter0/dvr0 timedout (2)
0:00:02.226663000 27338 0x806bd38 INFO                dvbsrc gstdvbsrc.c:794:read_device: Reading from device /dev/dvb/adapter0/dvr0 timedout (3)
0:00:02.414673000 27338 0x806bd38 INFO                dvbsrc gstdvbsrc.c:794:read_device: Reading from device /dev/dvb/adapter0/dvr0 timedout (4)
0:00:02.606893000 27338 0x806bd38 INFO                dvbsrc gstdvbsrc.c:794:read_device: Reading from device /dev/dvb/adapter0/dvr0 timedout (5)
0:00:02.794707000 27338 0x806bd38 INFO                dvbsrc gstdvbsrc.c:794:read_device: Reading from device /dev/dvb/adapter0/dvr0 timedout (6)
0:00:02.986709000 27338 0x806bd38 INFO                dvbsrc gstdvbsrc.c:794:read_device: Reading from device /dev/dvb/adapter0/dvr0 timedout (7)
0:00:03.174732000 27338 0x806bd38 INFO                dvbsrc gstdvbsrc.c:794:read_device: Reading from device /dev/dvb/adapter0/dvr0 timedout (8)
0:00:03.366755000 27338 0x806bd38 INFO                dvbsrc gstdvbsrc.c:794:read_device: Reading from device /dev/dvb/adapter0/dvr0 timedout (9)
0:00:03.546746000 27338 0x806bd38 INFO                dvbsrc gstdvbsrc.c:794:read_device: Reading from device /dev/dvb/adapter0/dvr0 timedout (10)
0:00:03.546788000 27338 0x806bd38 WARN                dvbsrc gstdvbsrc.c:797:read_device: Unable to read from device: /dev/dvb/adapter0/dvr0 (0)
0:00:03.546813000 27338 0x806bd38 DEBUG               dvbsrc gstdvbsrc.c:872:gst_dvbsrc_create: Failed to read from device
ERROR: from element /pipeline0/dvbsrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(1569): gst_base_src_loop (): /pipeline0/dvbsrc0:
streaming task paused, reason error (-5)
Execution ended after 1846568000 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
0:00:03.547725000 27338 0x8051a08 INFO                dvbsrc gstdvbsrc.c:1158:gst_dvbsrc_unset_pes_filters: clearing PES filter
Setting pipeline to NULL ...
FREEING pipeline ...
Comment 17 Zaheer Abbas Merali 2006-10-06 04:07:27 UTC
Try GST_DEBUG=dvbsrc:5 gst-launch -m dvbsrc modulation="QAM 16" trans-mode=2k
bandwidth=8 freq=698000000 code-rate-lp=3/4 code-rate-hp=3/4 guard=32 
hierarchy=NONE inversion=AUTO pids=600:601 ! filesink location=foo.out

This card I believe from http://www.linuxtv.org/wiki/index.php/DVB_USB can only deliver a partial transport stream so the pids need to be specified.

Adding the -m is useful because it will tell you the signal quality bit error rate and whether the card has got a lock on the frequency, dvbsrc sends this information on the GStreamer bus.

To play the resulting file, you will need to do:

gst-launch-0.10 filesrc location=foo.out ! flutsdemux es-pids=600:601 name=d ! queue max-size-buffers=0 max-size-time=0 ! mpeg2dec ! xvimagesink d. !  queue max-size-buffers=0 max-size-time=0 ! mad ! alsasink
Comment 18 Alexander Macdonald 2006-10-06 08:23:15 UTC
Ahh ok that makes it work perfectly. I haven't tried playing the file using the fluendo demuxer because i dont have it installed yet but it plays fine in mplayer so the dvbsrc is working great.

Hope to see this in the next release of gst-plugins-bad !
Comment 19 Zaheer Abbas Merali 2006-11-05 13:04:03 UTC
This is now (as of a few weeks ago) in gst-plugins-bad