Opened 5 years ago

Closed 5 years ago

Last modified 3 years ago

#8064 closed defect (invalid)

doesn't see full VOB track

Reported by: brianjmurrell Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

FFmpeg seems to only see a portion of a VOB file on a DVD.

How to reproduce:

$ ffprobe /var/run/media/brian/My\ DVD/VIDEO_TS/VTS_01_1.VOB 
ffprobe version 4.1.4 Copyright (c) 2007-2019 the FFmpeg developers
  built with gcc 9 (GCC)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' --extra-ldflags='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' --extra-cflags=' ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-indev=jack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzvbi --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
Input #0, mpeg, from '/var/run/media/brian/My DVD/VIDEO_TS/VTS_01_1.VOB':
  Duration: 00:54:29.73, start: 0.044400, bitrate: 2256 kb/s
    Stream #0:0[0x1bf]: Data: dvd_nav_packet
    Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, progressive), 720x480 [SAR 32:27 DAR 16:9], 29.83 fps, 59.94 tbr, 90k tbn, 59.94 tbc
    Stream #0:2[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Unsupported codec with id 100357 for input stream 0

Notice the duration of the video: 00:54:29.73

When I use ffmpeg to transcode that title, it indeed does only transcode 54 minutes and 29 seconds and cuts the end off of the video.

If I use vlc, on the same machine, to play the video it plays the full 57 minutes and 1 second of the video.

Change History (12)

comment:1 by Cigaes, 5 years ago

This is a FAQ. The VOB files in a DVD-Video structure are not self-contained video files. You need a tool that understands the structure.

comment:2 by mkver, 5 years ago

To make this a valid ticket, you need to provide a sample for us to reproduce this issue. But first you should test what Cigaes has said: Is there a VTS_01_2.VOB in this DVD? If so, then first test the "file" concat:/var/run/media/brian/My\ DVD/VIDEO_TS/VTS_01_1.VOB\|/var/run/media/brian/My\ DVD/VIDEO_TS/VTS_01_2.VOB

comment:3 by Cigaes, 5 years ago

Concatenating the VOB files is a step in the right direction but in no way a full solution. For starters, it may include menu junk in the video. A real DVD reading tool is necessary.

comment:4 by brianjmurrell, 5 years ago

I'm aware of the need to concatenate multiple VOBs but this disk does not have a VTS_01_2.VOB. Here are the list of files matching VTS_01*:

$ ls -l /var/run/media/brian/My\ DVD/VIDEO_TS/VTS_01*
-r--r--r--. 1 brian brian     53248 Jul 24  2013 '/var/run/media/brian/My DVD/VIDEO_TS/VTS_01_0.BUP'
-r--r--r--. 1 brian brian     53248 Jul 24  2013 '/var/run/media/brian/My DVD/VIDEO_TS/VTS_01_0.IFO'
-r--r--r--. 1 brian brian   6664192 Jul 24  2013 '/var/run/media/brian/My DVD/VIDEO_TS/VTS_01_0.VOB'
-r--r--r--. 1 brian brian 922195968 Jul 24  2013 '/var/run/media/brian/My DVD/VIDEO_TS/VTS_01_1.VOB'

VTS_01_0.VOB is the menu in front of the track to select chapters, etc.

comment:5 by brianjmurrell, 5 years ago

This is a FAQ.

https://ffmpeg.org/faq.html doesn't even seem to contain the word DVD and the only FAQ about VOBs is https://ffmpeg.org/faq.html#Why-does-FFmpeg-not-see-the-subtitles-in-my-VOB-file_003f

A real DVD reading tool is necessary.

What is the best known method/tool for doing this with ffmpeg then? Or do I need to abandon ffmpeg for something like handbrake?

comment:6 by mkver, 5 years ago

Here are some options for how to proceed with this ticket:

  1. You put the vob file in a folder where VLC can't see the other files and see whether it still shows the 57:01 duration.
  2. You could remux the DVD with ffmpeg to see if the output duration is actually 54:29.
  3. You could watch the vob file using ffplay and compare this to VLC. When doing so, you should also measure the duration and look if there is something that VLC has that ffplay is missing.
  4. You use another tool (e.g. MediaInfo) to inspect the file.
  5. You upload the file (or even the whole DVD) here (project FFmpeg, of course), so that it can be analyzed whether this is a bug in FFmpeg (notice that it could also be VLC that is wrong). This could be problematic because of copyright issues.
  6. We close this ticket due to lack of reproducibility on our part.

(1.-4. are only to decide whether this is an issue at all. If it is an issue, the sample will be needed anyway.)

comment:7 by Cigaes, 5 years ago

FFmpeg has a tool called dvd2concat, it will allow to access the full video stream but is quite incomplete beyond that.

comment:8 by brianjmurrell, 5 years ago

  1. Given that ffmpeg's idea that it's only 54:29 results in a transcode that chops off the last 1.5 minutes, I think VLC is the accurate one here.
  2. Is moot if we concede that the track really is 57:01 isn't it?
  3. Again, given #1, isn't this moot?
  4. Isn't this also moot if we accept #1?
  5. Yeah, not an option due to copyright issues.
  6. This would be a pity, as it does seem to be a problem in ffpmeg.

I did manage to use mplayer -dumpstream -dumpfile fifo along with ffmpeg to convert the track and that did yield a 57:01 resulting transcode. But boy that is hacky. Both mplayer and ffmpeg need to be backgrounded multiple times to get it to the point of transcoding and ffmpeg doesn't stop at the end of the fifo but needs to be SIGINTR'd.

Even though mplayer -dumpstream does manage to get ffmpeg the full file, it's got to be just about the worst tool for it, not backgrounding properly and not being able to pipe to stdout, etc. Isn't there a better tool to just extract a title properly from a DVD? My distribution doesn't seem to have dvd2concat.

That said, I do think that that one single VOB has the full 57 minutes in it. ffmpeg is just unable to extract it all.

comment:9 by mkver, 5 years ago

  1. Who says that VLC not simply uses another file without ever telling you?
  2. This point has been asked to distinguish between a bug in the part that estimates a file's duration and the actual demuxer (it is possible for remuxing with ffmpeg to yield a file with a different length than the initial estimate).
  3. If we accept this premise. Given that I already thought that you won't be able to upload the file I wanted to be sure that it is indeed a bug in ffmpeg.
  4. Indeed it would be.

in reply to:  9 comment:10 by brianjmurrell, 5 years ago

Replying to mkver:

  1. Who says that VLC not simply uses another file without ever telling you?

Like what other file? I think all of the evidence here is more than just suggesting that the track's real duration is ~57 minutes, not the ~54 (and a short transcode) that ffmpeg is reporting.

  1. This point has been asked to distinguish between a bug in the part that estimates a file's duration and the actual demuxer (it is possible for remuxing with ffmpeg to yield a file with a different length than the initial estimate).

Yes, but the resulting file is also truncated. To be honest, I couldn't really care any less what any tool says what the duration of the file is. What I care about is that ffmpeg is producing a truncated transcode. The durations are just being used as indicators that ffmpeg is not reading or calculating (or whatever) the duration properly and the end result is a truncated transcode.

So let's just forget about durations -- reported, calculated or otherwise. This bug is really about ffmpeg truncating a transcode when it is being given the only VOB file that exists for a track and yet if that track is given to ffmpeg via mplayer -dumpstream it transcodes it just fine.

I don't suppose this is going to go any further though without my violating a copyright and uploading a copy of the DVD.

I seem to have gotten mplayer -dumpstream to work so maybe that's the end result of this issue. Unfortunately.

comment:11 by Carl Eugen Hoyos, 5 years ago

Resolution: invalid
Status: newclosed

comment:12 by Balling, 3 years ago

And there is also a problem that while -c copy to mpegts works, vob does not and so is close captions timings, see https://github.com/CCExtractor/ccextractor/issues/1277

This is caused by vob chapters.

Note: See TracTickets for help on using tickets.