[FFmpeg-user] Issue with -analyzeduration and -probesize
Oliver Fromme
oliver at fromme.com
Sun Jul 27 17:40:00 CEST 2014
Hi,
I think I've already mentioned this issue some time ago,
but it's still bugging me. :-)
Every now and then I have MPEG-PS files (e.g. from mplayer's
-dumpstream function) that contain subtitle tracks beyond the
2 GB boundary. The problem is that the -probesize option
does not accept values beyond 2G. This limit was lifted for
the -analyzeduration option a few days ago (thanks!), but it
doesn help much because the -probesize option still has the
limit.
Here is an example. The ffmpeg version is a current snapshot
downloaded and built today. Yes, I have cut the output for
better readability.
$ OPTS="-vn -an -map "#0x21" -scodec dvdsub test-subs.mkv"
$ ls -lh *.mpg
-rw-r--r-- 1 olli wheel 5.5G Jul 27 17:14 dumpstream.mpg
$ ffmpeg -analyzeduration 6000M -probesize 2147M -i dumpstream.mpg $OPTS
Input #0, mpeg, from 'dumpstream.mpg':
Duration: 01:37:01.70, start: 0.287267, bitrate: 8115 kb/s
Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], max. 9800 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1[0x80]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Stream #0:2[0x81]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Stream #0:3[0x20]: Subtitle: dvd_subtitle
Stream map '#0x21' matches no streams.
$ ffmpeg -analyzeduration 6000M -probesize 6000M -i dumpstream.mpg $OPTS
[NULL @ 0x806885420] Value 6000000000.000000 for parameter 'probesize' out of range [32 - 2.14748e+09]
[NULL @ 0x806885420] Error setting option probesize to value 6000M.
dumpstream.mpg: Result too large
When I cut away the first 2GB from the file, it works:
$ tail -c +2146998273 dumpstream.mpg > dumptail.mpg
$ ls -lh dumptail.mpg
-rw-r--r-- 1 olli wheel 3.5G Jul 27 17:29 dumptail.mpg
$ ffmpeg -analyzeduration 6000M -probesize 2147M -i dumptail.mpg $OPTS
Input #0, mpeg, from 'dumptail.mpg':
Duration: 01:01:11.84, start: 2150.143267, bitrate: 8189 kb/s
Stream #0:0[0x81]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], max. 9800 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:2[0x80]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Stream #0:3[0x20]: Subtitle: dvd_subtitle
Stream #0:4[0x21]: Subtitle: dvd_subtitle
Output #0, matroska, to 'test-subs.mkv':
Metadata:
encoder : Lavf55.49.100
Stream #0:0: Subtitle: dvd_subtitle (dvdsub)
Metadata:
encoder : Lavc55.69.100 dvdsub
Stream mapping:
Stream #0:4 -> #0:0 (dvd_subtitle (dvdsub) -> dvd_subtitle (dvdsub))
Of course, the time stamps in the output are wrong because the
first ~ 30 minutes of the movie were cut off. I could correct
the time stamps manually, but that's cumbersome and annoying.
Actually I do not understand why there are two separate options
-analyzeduration and -probesize if they do basically the same
thing. One doesn't work without the other, as it seems. Either
one of them should be removed, or the docs should explain better
what the difference between them is, and in what cases it makes
sens to use one and not the other.
Anyway, I would appreciate very much if someone could look into
this issue, so that streams that begin beyond the 2 GB boundary
can be used with ffmpeg.
On a related note (but not as important), the "mediainfo" tool
detects all of the subtitle streams immediately, no matter
where they begin. ffmpeg and ffprobe take several seconds to
scan the first 2 GB of the file. I don't know how mediainfo
accomplishes that, though ... As MPEG-PS files do not have a
header or index, you basically *have* to scan through the entire
file, but still mediainfo manages to detect everything within
a fraction of a second. Just wondering ...
Best regards
Oliver
--
``We are all but compressed light'' (Albert Einstein)
More information about the ffmpeg-user
mailing list