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 476149 - Fix and add needed features to dvdnavsrc
Fix and add needed features to dvdnavsrc
Product: GStreamer
Classification: Platform
Component: gst-plugins-ugly
git master
Other All
: Normal normal
: 0.10.9
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 502609
Reported: 2007-09-12 09:48 UTC by Simone Gotti
Modified: 2008-10-21 20:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20

Patch to fix and add needed features to dvdnavsrc. (28.73 KB, patch)
2007-09-12 09:50 UTC, Simone Gotti
none Details | Review

Description Simone Gotti 2007-09-12 09:48:10 UTC
Please describe the problem:

I worked in the past days to fix dvdnavsrc as it wasn't working (at
least for me) and missing some important features like seeking. I did an
initial patch that I'm attaching here and I'll really appreciate any

To test all I used this simple pipeline (hadn't tested subpicture

gst-launch dvdnavsrc ! dvddemux name=demux .current_video ! queue !  mpeg2dec ! xvimagesink  demux.current_audio ! queue ! a52dec ! audioconvert ! alsasink

Yesterday I also started testing it with dvdspu and it's working quite well! (I need to try to fix language and subtitle selection):

gst-launch -v dvdnavsrc ! dvddemux name=demux .current_video ! queue ! mpeg2dec ! ffmpegcolorspace ! dvdspu name=mix ! ffmpegcolorspace ! xvimagesink  demux.current_audio ! queue ! a52dec ! audioconvert ! alsasink demux.subpicture_00 ! mix.subpicture 

I'll try to list all the changes I did:

*) Add still frame management:
It uses gst_clock_new_single_shot_id on the system clock to wait. The
user operation works correctly during still frames.

*) Add query convert ability.
The functions converts between sectors, bytes and time.
The sector/bytes to time conversion and the opposite con be done in 2
using the DVD time maps if available (like dvdreadsrc does) or using
time/sector interpolation.
I based the use of tmaps on dvdreadsrc and changing it based on hints from bug #372797.

Looks like there a bug in dvdnav_get_position where the pos and length
values aren't correctly calculated. I did a patch that will fix it and
I'll submit it for discussion to the dvdnav developers. In the mean time
dvdnavsrc does a check and if the max sector reported by the tmaps is
less or equal that the one reported by dvdnav_get_position the tmaps
aren't used.

*) Add seeking ability.

*) Also the NAV packets needs to be sended to the demuxer as they
carries data.

*) Send application/x-gst-dvd as Out of Band events. As during the menus and
other functions there's no subpicture sent to the subpicture sink pad of the
spu decoder and they aren't received until the next subpicture comes.

*) Fix chapter number retrieve call (it was using
dvdnav_get_number_of_titles instead of dvdnav_get_number_of_parts).

*) In gst_dvd_nav_src_tca_seek rename program variable to chapter

*) Remove did_seek gboolean as it's not used anymore.

*) Handle seek on title chapter angle: easy to do, I'm waiting to look
if what I did until now is right or it simply sucks :D

Steps to reproduce:

Actual results:

Expected results:

Does this happen every time?

Other information:
Comment 1 Simone Gotti 2007-09-12 09:50:25 UTC
Created attachment 95418 [details] [review]
Patch to fix and add needed features to dvdnavsrc.
Comment 2 dcsmith 2007-10-10 17:42:00 UTC
I'm interested in this? Is there another patch for the required totem changes? I'd be more than willing to help test.
Comment 3 Mantas Kriaučiūnas 2007-11-10 13:14:01 UTC
There are lots of people, willing to help to implement better DVD playback in totem-gstreamer - look at
Comment 4 blewz 2007-11-19 02:35:16 UTC
waiting ... :) 
Comment 5 Adam Lofts 2007-12-27 18:05:21 UTC
I have tested dvdnavsrc in totem with this patch and it seems to work fine. Could someone comment on what needs to be done to make dvdnavsrc the default dvd provider and what the status of this patch is.
Comment 6 Peter Williams 2007-12-28 07:33:24 UTC
Um, yeah, if I install this and the dvdspu codec I get basic DVD menu functionality in Totem. Nice!

The last commit in the dvdnav plugin section of gst-plugins-ugly was more than 18 months ago by Tim-Philipp Muller. Probably he should be contacted (tim at centricular dot net) to get an OK to apply this patch.

The next step, it seems to me, would be to understand why the dvdspu plugin is in gstreamer-plugins-bad, and hopefully make whatever fixes are necessary to upgrade it to -good or -ugly.
Comment 7 Peter Williams 2007-12-28 09:19:30 UTC
I'm not sure if this was a good idea or not, but I tried putting together a page that tries to generally cover playing DVD's with Totem and GStreamer: . My hope is that it can provide a quick global view of what's going on in GStreamer-vs.-DVD land, so that people interested in solving the problem -- some of whom even might write code -- know where to start looking. Of course, I have no intention of writing any code myself, so it's basically pure wankage at this point. But if anyone wants to contribute knowledge, that'd be cool. 
Comment 8 Simone Gotti 2007-12-28 14:06:09 UTC
I did this initial patch due to some spare time. It's not really completed and on my local side I also tried to make it work correctly with time reporting (use correct gstSegments etc...) without much success.
I'm really sorry but now I won't any more time to work on it.

My hope is that someone really interested and with a greater knowledge of gstreamer should take care and start working on it.

I know that there is at least another project (on launchpad) that is a rewrite of the libdvdread (not libdvdnav) based plugins. I think that the libdvdnav features are needed for a real DVD experience and maybe unifying the manpower on a unique plugin should be a good way.
Comment 9 Adam Lofts 2008-01-20 15:47:51 UTC
I've spent some time looking at dvd playback in gstreamer (read: I've rewritten the dvdnav element a couple of times!) . Unfortunately I won't be able to carry on until late March. Here are some conclusions I have drawn which someone might find useful if they want to work on it before March.

* You should understand how dvd's are stored on disc before attempting an implementation (I made this mistake). 

* One must use libdvdnav (or rewrite the dvd vm) for proper dvd support. dvdnav is actually a pretty thin wrapper of the data coming off the disc. (E.g. nav packets remain in the stream).

* Timing details can get pretty tricky with still frames and such. Also seeking is tricky since we are limited to seeking by title / segment. It is best to merge the dvdsrc and demuxer into a magic element: dvdmagic.

* Multiple audio formats, subpictures and stillframes all require inter element communication. Best to keep the implementation hidden inside a dvdbin. 

I began to implement it at but there really isn't much there. Only use it as a guideline.

Comment 10 Jan Schmidt 2008-03-04 22:55:27 UTC
Thanks! As you noted, this patch doesn't make dvdnavsrc perfect, but it's a great step forward :)

Sorry it's taken so long to try it out, but it's committed now:

2008-03-04  Jan Schmidt  <>

        * ext/dvdnav/dvdnavsrc.c:
        * ext/dvdnav/dvdnavsrc.h:
        Apply patch that adds some seeking support to dvdnav, and fixes it
        in various other ways. This doesn't make dvdnavsrc fully functional,
        but moves it forward.

        Fixes: #476149
        Patch By: Simone Gotti <>

        * ext/dvdnav/gst-dvd:
        Update the simple dvdnavsrc gst-launch example to work for 0.10
Comment 11 amano 2008-04-16 16:08:36 UTC
Did these changes just landed on the trunk and will be featured on 2.23.1 for the first time? Or can they be seen in GNOME 2.22.1 already?
Comment 12 Richard Laager 2008-05-06 02:42:33 UTC
I filed bug #531649 and then found this. Is that a duplicate? I'm not sure from comment #10 here if this is done to the point that things are back in the Totem court.
Comment 13 amano 2008-06-17 17:20:55 UTC
Is this available in the current GNOME development releases?
Comment 14 Mike Rooney 2008-10-21 20:47:10 UTC
Yes, I too would appreciate a hint on where this commit landed. Thanks!