Opened 5 years ago

Closed 4 years ago

#2238 closed defect (fixed)

DVD Nav Stream Prevents Reading Other Streams

Reported by: ewilde Owned by: beastd
Priority: normal Component: undetermined
Version: HEAD Severity: blocker
Keywords: nav stream audio Cc:
Blocked By: Blocking:
Reproduced by developer: no Analyzed by developer: no


I have an ISO file that was extracted from a DVD by another program (which I have used for thousands of other DVDs, so that's not the problem, if that's what you're thinking). It contains three streams, one of which is a DVD Nav stream.

If I look at this file with mplayer, it claims that there isn't any audio stream. Actually, what I really care about is mencoder, which also doesn't handle the video stream too well but let's stick with mplayer because you care about that more. The following:

/usr/bin/mplayer -vo null -ao null -frames 0 -identify Test_DVDNavPacket.iso

Produces output that says:

MPEG-PS file format detected.
MPEG: No audio stream found -> no sound.
VIDEO: MPEG2 720x480 (aspect 2) 29.970 fps 9800.0 kbps (1225.0 kbyte/s)

It all goes downhill from there.

I have attached a sample ISO file which I made from the original by copying the first two megabytes with dd:

dd bs=512 count=1024 if=Orig.iso of=Test_DVDNavPacket.iso

This file is sufficient to test the behavior of mplayer when it encounters the DVD Nav stream in an input file. In fact, if you pass this file through a different compressor (e.g. ffmpeg) instead of mencoder, it is sufficient to produce a couple of seconds of compressed video. Also, vlc will play it for a couple of seconds, so it should represent a pretty good test.

And, speaking of the other guys, here's what ffprobe thinks about the file:

Input #0, mpeg, from 'Test_DVDNavPacket.iso':

Duration: 00:00:01.87, start: 0.192267, bitrate: 8978 kb/s

Stream #0:0[0x1bf]: Data: dvd_nav_packet
Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, smpte170m), 720x480 bla, bla, bla
Stream #0:2[0x80]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s

Unsupported codec with id 1145979222 for input stream 0

It doesn't exactly go screaming off into the weeds but it sort of misses the point about the codec for stream 0.

Anyway, if I blow the test file through ffmpeg, it is compressed fine because ffmpeg tosses video stream 0:0 and maps stream 0:1 to input video stream 0.

If I pass the real ISO file through mencoder, it produces compressed output that has no audio and more often than not is truncated after a few thousand frames. My contention is that mplayer/mencoder should work just like ffmpeg, in that it should ignore streams that are not audio/video streams and/or have bogus codecs. At the very least, I should be able to pick the streams that I want to use but it is broken to the point where I cannot give it stream IDs and have it work.

I'm not exactly how your version numbers work but mplayer reports:

MPlayer SVN-r37389-snapshot-4.8 (C) 2000-2015 MPlayer Team

This is from source that I downloaded and built from the export directory on 2015 Apr 23.

P.S. I'm really interested in getting mencoder to work, because it has performed flawlessly for me on literally thousands of input files of this type, up to now. For whatever reason, ffmpeg will compress this stream but the output looks like crap (edge artifacts, stuttering in the audio and video) on my player of choice. So, if there's anything I can do to help, please let me know. I'd be happy to build and test any fixes.


Attachments (1)

Test_DVDNavPacket.iso (2.0 MB) - added by ewilde 5 years ago.
Test ISO file with DVD Nav packet in stream 0

Download all attachments as: .zip

Change History (4)

Changed 5 years ago by ewilde

Test ISO file with DVD Nav packet in stream 0

comment:1 Changed 5 years ago by compn

what if you use mplayer dvd:///Test_DVDNavPacket.iso
(or mplayer dvd:// -dvd-device file.iso)

you could also select the stream using mplayer / mencoder -aid 128 or whatnot...
same with -vid 2 etc.

comment:2 Changed 5 years ago by ewilde

In answer to your first question, that produces even less results than just feeding mplayer the ISO file directly. Mplayer gives up immediately with:

No stream found to handle url dvd:///path/to/file/Test_DVDNavPacket.iso
Exiting... (End of file)

In answer to your second remark, you cannot select the stream using mplayer with -aid 128 or whatnot because mplayer does not ever tell you about the stream IDs, it having blown up or whatnot, because of the data stream.

The only way I even know what the stream IDs are is through ffmpeg, which doesn't blow up when given the ISO file.

Anyway, I sent you a sample file that perfectly recreates the problem so feel free to try it and you'll easily see what's wrong. Its not a user error. I have passed literally hundreds of ISO files through mplayer/mencoder in exactly the same manner as I am doing here and they all work fine.

The only problem is that mplayer/mencoder is encountering a data stream, which it is probably not meant to handle. My suggestion is that, streams of unknown type should simply be ignored. Maybe this isn't easy to do, I don't know. But, if you can make the change and want me to test it, I'd be happy to do whatever I can. I've got lots of data.

Incidentally, while we're on that subject, I have two ISO files that came from the same source, that have data streams in them, that mplayer/mencoder doesn't choke on. If you'd like samples of them, for comparison purposes, let me know.

comment:3 Changed 4 years ago by reimar

  • Resolution set to fixed
  • Status changed from new to closed

Works fine for me in MPlayer now.
As mencoder cannot handle streams appearing mid-stream you will need a large -psprobe value for it though.
As far as I can tell it's all fine with the latest fixes.
Reopen if you still have issues.

Note: See TracTickets for help on using tickets.