GNOME Bugzilla – Bug 476149
Fix and add needed features to dvdnavsrc
Last modified: 2008-10-21 20:47:10 UTC
Please describe the problem: Hi! 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 comment. To test all I used this simple pipeline (hadn't tested subpicture again): 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 ways: 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 variable. *) Remove did_seek gboolean as it's not used anymore. TODO: *) 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:
Created attachment 95418 [details] [review] Patch to fix and add needed features to dvdnavsrc.
I'm interested in this? Is there another patch for the required totem changes? I'd be more than willing to help test.
There are lots of people, willing to help to implement better DVD playback in totem-gstreamer - look at https://launchpad.net/bugs/41335
waiting ... :)
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.
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.
I'm not sure if this was a good idea or not, but I tried putting together a live.gnome.org page that tries to generally cover playing DVD's with Totem and GStreamer: http://live.gnome.org/DvdPlaybackWithTotem . 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.
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.
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 http://www.alofts.co.uk/git/?p=dvd.git but there really isn't much there. Only use it as a guideline.
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 <jan.schmidt@sun.com> * 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 <simone.gotti@email.it> * ext/dvdnav/gst-dvd: Update the simple dvdnavsrc gst-launch example to work for 0.10
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?
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.
Is this available in the current GNOME development releases?
Yes, I too would appreciate a hint on where this commit landed. Thanks!