DVDPlayer

From XBMC4Xbox
Jump to: navigation, search
Attention.png Attention!
This Article is incomplete. Please add information or correct uncertain data which is marked with a ? .

DVDPlayer is XBMC's own in-house developed video-player. DVDPlayer is short for DVD-player but despite its name plays not only DVD-Video's but all video formats, it was only named "DVDPlayer" because it was originally designed to be a dedicated DVD-Video player, it has however grown to being a much more generic video-player and now plays back most known video containers and codec formats. DVDPlayer supports DVD-Video with menus, from CD/DVD-media, harddrive, network, ISO/IMG-images and RAR/ZIP archives (and even RARed ISO/IMG-images as long as they are in 'stored/archive' mode and not compressed).

Currently Supported Codecs


Known Issues

For every month that goes by, the native DVD-Player in XBMC is becoming more and more usable/stable for the average end-user. However, there is still a lot of work that can be done on it: For one thing there are still quite a few bugs left in it that should be found and fixed, something we really need your help with (see the "Bug Reporting" section below). Another thing is that not all features that you might expect from a normal DVD-player are implemented yet. Some of these features are listed below under "Unimplemented Features" and are not considered to be bugs, that does not mean that features not listed below under can be reported as bugs (something that happens too many times)!


Known Bugs

The official list/tracker of known bugs can be found trac

Note! A bug is only ever a bug if the DVDplayer was designed to do something and that thing does not work, for example; a DVD-movie crashes in the middle, produces garbled output, or you see different navigation-menu behaviour compared to a normal standalone DVD-player, or WinDVD/PowerDVD on a PC, or the original DVD-Player of the Xbox.

Bug Reporting

When reporting bugs or problems there are a few things to keep in mind before posting your bug report(s). Bug-reports should be reported at sourceforge.net, this way we are able to track all bugs on one tracker which makes our lifes a lot easier. However, before posting a bug-report there, make sure it is a valid bug-report and not a feature-request or something that is your own fault (ie. user-error). To do that you can start a new topic thread on the XBMC bug-discussion forum to verify this with others. But most importantly, use the search functions first here and here, to make sure you are not posting duplicate bug reports. Duplicate reports/posts of the same bug makes it much harder for us to keep track of all the bug-reports/posts, not doing so will also save you a lot of work.

When reporting a bug there are a few things we will need, if these things are not provided, it will be much harder (and many times impossible) to replicate the problem and find the bug. In the case of an invalid bug-report the report will be closed without us even looking at it.

Some things that should be in a bug report:

  • A clear description of the problem and what you did (step-by-step) to see it so that we can then replicate it if and when we have the same DVD-disc or a sample (see “Sample” below).
  • A log file (see “Log file” below)
  • The XBMC version you are using (exact build date)
  • Did you build XBMC yourself (from SVN) or...?
  • Audio output mode (analog stereo, passthrough, ...)
  • Video output mode (output resolution, PAL or NTSC...)
  • The amount of free memory! See the “log file” chapter below on how to enable free memory display!
    • Before playing the DVD
    • During the problem
    • After the problem (if XBMC did not crash and just went back to the normal GUI)
  • If it is a non-menu related problem
    • Can you play the .vob file correctly with the DVDPlayer? (select dvdplayer with the 'play with dialog')
    • Can you play the .vob file correctly with MPlayer? (select mplayer with the 'play with dialog')
  • Other information you think that might be relevant

Please have a look at HOW-TO Submit a Proper Bug Report for additional information.


Log File

XBMC is able to create a log file that provides us with a lot of useful information when trying to locate a bug. However, the normal log-file that XBMC creates everytime you run XBMC does not contain much information by default, therefore you must start XBMC in debug-mode so that a maximum amount of information is written to the log file. To start XBMC in debug-mode simply hold X+Y on startup of XBMC, you will know that XBMC is in debug-mode when you see a free memory indicator in the upper left corner of the screen when XBMC is running and if you look in the log-file you will see a lot of “DEBUG” items. The logfile can be found in the directory where XBMC is installed under the name "xbmc.log" or "xbmc_old.log", in general you only need the "xbmc.log" file but if you are running XBMC as dashboard and you have to restart your Xbox (because of a crash/hang) then you probably need to have "xbmc_old.log" instead. Make sure you have the correct logfile by looking at its contents, the information can be read in any text-editor (like Notepad in Micosoft Windows).

Note! Only log-files made in debug-mode are useful to Team-XBMC (developers and technical-support mods)!, see above.

The logfile can be found in the directory where XBMC is installed under the name 'xbmc.log' or 'xbmc_old.log'. In general you need xbmc.log, but if you are running xbmc as dash and you have to restart your xbox (because of a crash) you probably need to have xbmc_old.log. Make sure you have the correct logfile by looking at its contents!.

This log file can be made public in a few ways:

  • You zip it and upload it together with the bug-report to xbmc.org/trac.
  • Post parts of the logfile in the bug report itself on xbmc.org/trac or the XBMC Bug-Discussion Forum.
  • Use pastebin and provide the link in your bug-report.
  • You can post *parts* of the log on the forum as it might help developers pin-point the problem, (please read the log file and post only the parts you think are usefull. The first part is logging every setting which most of the time is not useful).

Sample

While it sometimes can be complicated to provide us with samples, it is usually worth the effort. With samples that show the problem we are able to fix bugs much easier and quicker, because with a sample we can very simply replicate the bug ourselves in our own debug enviroment, and most of the time these bugs can be fixed the same day if there is a developer with some free time available and willing. Without a sample, it will take much longer because we cannot replicate the bug ourselves and we will have to try a lot of things (which can break the current working version again).

Simplest is to just to snail-mail one of the developers a 1:1 copy of the DVD-disc (or the original DVD-disc if the bug has something todo with encryption problems), you can create a such 1:1 copy on your PC using softwares like “DVDDecrypter”. Another possibility is to compress (ZIP/RAR) the sample and send it over the internet, (since most DVDs are a bit to big to send over the internet you can try to strip unneeded data out of it (read the section below about “DVD-menu related problems”). If you have the possibility to either snail-mail the disc (shipping the actual disc) or send a sample over the internet please post so in your bug-repost. Note! Please understand that if you send in a DVD-disc (copy or original) we can not send it back!

For DVD-menu related problems, the next can be done:

strip all non-menu related vob files.
These files take up most of the space. What is needed are the ifo and bup files, together with all menu vobs. If you are lucky the DVD has a few 1GB big vob files (these are probably the main movie and thus not needed) and one or two small vob files. These small vob files are needed. RAR or ZIP those vobs together with the ifo and bug files and provide them to us. Upload them to a Upload Site maximum 25MB or find another way (like posting them on your own website or creating a torrent).

If the problem has something todo with the main movie, the only thing left todo is to take the problematic vob file and to strip it as much as is possible.

In all cases you must first test the sample yourself before you send it to the XBMC developer/team, the sample needs to have the same problem as the original DVD, (since it is not of much use otherwise).

Unimplemented Features

This is a list of some unsupported features which are not yet planned. If you can program in C/C++ then please feel free to develop a new feature/function or improve/enhance the existing code and submit a patch). Developers are always welcomed to ask question or request help/assistance in our forums (and on IRC) when programming for XBMC:

  • External subtitle support when playing DVD's (.SRT/.SUB text-based and. IDX/.SUB bitmap-based subtitles support for DVD-video)
    • including a option to manually browse for external subtitle (to select subtitle with different name and from any HDD/share location)
  • Embedded text-based subtitle support (.SRT/.SUB, etc. embedded in .AVI, .MKV, .MP4, .OGM containers)
    • including a option to manually browse for external subtitle (to select subtitle with different name and from any HDD/share location)
  • Cache/Buffer for unnoticeable layer skip (for dual-layer DVD's, a.k.a. DVD9 for originals, and DVD+R Dual-Layer 8.5GB for backups)
  • Automatic deinterlace for interlaced DVDs on progressive TVs, (possible port deinterlacer from YADIF, DScaler, or y4mscaler?)
  • Post-Processing filters to enhance visual quality and remove artifacts, etc. (port mainly from MPlayer and FFdshow?)
    • SSP (Statistical-Post-Proc.), DeBlocking, DeRinging, Sharpen, Soften, ReQuantization, Auto-Luminance, Blurring/DeNoising
  • 2:3 pull-down / ivtc (inverse telecine) for 24 progressive-frames on 30 FPS TV's (use DScaler or y4mscaler, or GPU pixel shader?)
  • NTSC => PAL, and PAL => NTSC frame-rate (FPS) adjust and reclock filter for NTSC <=> PAL conversion
    • NTSC <=> PAL frame-rate adjust FPS ratios?: 23.97 <=> 25, 24 <=> 25, 30 <=> 25, 25 <=> 30
  • Option to manually set a specific DVD region (so you can always in the future play those disc that can't be fooled by 'region masking')
  • Dual-subtitle-display (display two subtitles/languages at the same time, one at the bottom as normal plus one at the top of the screen)
  • Audio 44.1kHz/88.2kHz/96kHz/192kHz to 48kHz re-sampler (sample rate converter) (like SRC which already been ported to XBMC?)
  • DVD-Video tags/meta reading (collect and display IFO/MPEG/AC3/DTS tags)
  • DVD-Video codec-info reading (collect and display encoding-info like codecs, resolution, aspect, FPS, bitrate, sample-rate, channels)
  • Display current playback-time + total duration, title, chapter, subtitle, angle, aspect-ratio, audio-source, and DVD volume info
    • Plus under "advanced" also display: disc-region, resolution, frames-per-second, bitrate, sample-rate, and codecs/filters in use)
  • Timestamp-based seeking (jump to a given time)
  • Slow-motion, 1/8, 1/4, 1/2 speed (usually linked to the pause button)
  • Frame-by-frame skip (a.k.a. 'frame stepping'), usually a part of the 'slow-motion' function
  • Auto-resume support, if pressing 'pause' before 'stop' then the position is saved, like a hidden bookmark
    • When insert play the same DVD again check DISCID and give option to resume, (like PowerDVD)
  • Closed Captions pass-through (like DVDx2/xboxdash), and software-decoding (from 32 streams) for the deaf and hard-of-hearing
    • FYI, xine has support for SPU decoder for subpictures and Closed Captions software decoding, so does Ogle but not as good)
  • DVDDiscID, DVDUDFVolumeInfo and DVDISOVolumeInfo reading (and displaying) support
  • Use the DVDDiscID/DISCID to cache CSS-keys in libdvdcss (as supported by libdvdcss version 1.2.9 and later)
  • Option to 'bypass' PUO (Prohibited User Operations), (should be disabled by default as on a normal standalone DVD-player)
  • An option to skip FBI/copyright-warnings, ads and 'pre-menu' trailers and jump directly to the main title-menu
    • Plus an additional alternatively option to jump directly to main movie would be very nice as well
  • Parental control, set parental-level: G, Level-2, PG, PG-13, Level-5, R, NC-17, Level-8, Unlimited (default)

Development

See the DVDPlayer core/library topic thread in the XBMC development forum for now.

Help is always wanted, so if you can program C/C++, please feel free to code and submit a patch.


Technical Details

See the DVDPlayer core/library topic thread in the XBMC development forum for now.


Classes

  • InputStreams
    • FactoryInputStream, creates an inputstream based on the filename
    • File, general file access (hd, cdrom, samba)
    • Http
    • Navigator, for accessing dvd
  • Demuxers
    • FactoryDemuxer, creates a demuxer based on inputstream information
    • FFmpeg, ffmpeg demuxer wrapper (supports all ffmpeg demuxers)
    • Shoutcast, for demuxing shoutcast streams
  • Codecs
    • FactoryCodec, creates audio and video codecs based upon demuxer information
    • Audio
      • FFmpeg, ffmpeg audio decoder wrapper
      • Liba52, liba52 wrapper
      • LibDts, libdca wrapper
      • LibFaad, libfaad wrapper
      • LibMad, libmad wrapper (for mp1, mp2, mp3 decoding)
      • LPcm, lpcm decoding
      • Passthrough, for digital passthrough
    • Video
      • LibMpeg2
      • FFmpeg, ffmpeg video decoder wrapper
  • Subtitles


Modules

The player is divided up into a few modules


Main Module

Runs in a seperate thread Reads data from one of the input streams and sends it over to one of the other modules listed below Handle dvd events (such as audio / subtitle / video stream changes) Handle events from xbmc (such as audio / subtitle changes)


Audio Module

Runs in a seperate thread. Decodes audio data and outputs it to the xbox audio renderer


Video Module

Runs in a seperate thread. Decodes raw video data into video frames and outputs them to the xbox video renderer


Subtitle Module

Process subtitles

Building Libraries (Audio / Video Codecs)

The dvdplayer depends on other libraries to function. These libraries are included in SVN by default as dll's under the "XBMC/system/players/dvdplayer" subfolder. The full source code of these libraries can be found under the "/docs/sources/dvdplayer/" subfolder in the SVN. To build these dll's yourself you need to have the following installed, (the .dll's must be then be placed under the "[XBMCFOLDER]/system/players/dvdplayer" subfolder).


All dll's can be build the following way. Startup msys and browse to the extracted sources. make sure you are in the root of these sources (a directory xbox resides in it) and give the follwing commands.

  • xbox/configure.sh
  • xbox/compile.sh


configure.sh configures the library with its needed options. compile.sh issues a make command, strips the dll's of unnessecary information which makes them smaller and copies the DLL to the Xbox.