As a first time developer using libdvdnav, it is quite straight forward to work with, and hides most of the magic required to read DVDs. It is quite straight forward to enumerate the audio streams, and SPU sub channels. Pick the title I want to "play", ie; receive data for and start. But I feel the API is a bit lacking. It seems to always send me the full-stream when I play,for example, title 2. This forces me to delve rather deep into MPEG specifics after all. I expected to find API calls to be able to do this: dvdnav_title_play(dvdnav, 2); // play title 2 + dvdnav_set_audio_stream(dvdnav, 3); // select audio stream 3 + dvdnav_set_spu_stream(dvdnav, 1); // pick subs stream 1 while(dvdnav_get_next_cache_block) { case DVDNAV_BLOCK_OK: // we got blocks related to title 1, audio 3 and spu 1. I can understand most software using libdvdnav already have MPG demuxers so it makes little difference, most of them seems to have been forced to add demux code anyway. It really would have been nice if libdvdnav went the whole way. :) It didn't say I was shopping at IKEA... Anyway, anyone have a nice example to pull out only the video, audio and spu stream that I want? It seems I have lots to learn about MPEG packets. Lund -- Jorgen Lundman | <lundman@lundman.net> Unix Administrator | +81 (0)3 -5456-2687 ext 1017 (work) Shibuya-ku, Tokyo | +81 (0)90-5578-8500 (cell) Japan | +81 (0)3 -3375-1767 (home)
Jorgen Lundman wrote
Anyway, anyone have a nice example to pull out only the video, audio and spu stream that I want? It seems I have lots to learn about MPEG packets.
My first reaction was, just use libavformat.... Then I realized what a mess it is to get everything right when using a separate mpeg demuxer (atleast one that doesn't parse NAV packets). So I must admit, it would be quite a nice idea to have a very basic mpeg demuxer in libdvdnav that only caters to the specifics of the dvd mpeg format. Things like discontinuities in the mpeg stream could be handled, and flushes of the demux context on VTS changes would be a whole lot easier to handle. Currently you sort of have to make libdvdnav temporarily EOF, to get libavformat to flush out any buffered data, then handle the event, and restart libavformat. Joakim
participants (2)
-
elupus -
Jorgen Lundman