Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DVD subtitle stream detection different if no title is specified #5

Open
dbpete opened this issue Mar 20, 2015 · 2 comments
Open

DVD subtitle stream detection different if no title is specified #5

dbpete opened this issue Mar 20, 2015 · 2 comments
Assignees

Comments

@dbpete
Copy link

dbpete commented Mar 20, 2015

If vgtmpeg is run on a dvd/VIDEO_TS and the title is specified the number of subtitles detected may be different then when vgtmpeg is run without specifying a title.

Might be easier to see with an example. Here's a DVD with 3 subtitles. When vgtmpeg is run separately on each of the 3 titles, the number of subtitle streams is as follows:

$ vgtmpeg -analyzeduration 500M -probesize 500M -i dvd://dvd/VIDEO_TS?title=1 2>&1 | egrep 'Input|Subtitle'
Input #0, mpeg, from 'dvd://dvd/VIDEO_TS?title=1':
    Stream #0:9[0x10022]: Subtitle: dvd_subtitle
    Stream #0:10[0x10028]: Subtitle: dvd_subtitle
    Stream #0:11[0x10025]: Subtitle: dvd_subtitle
    Stream #0:12[0x1002b]: Subtitle: dvd_subtitle
    Stream #0:13[0x10023]: Subtitle: dvd_subtitle
    Stream #0:14[0x10029]: Subtitle: dvd_subtitle
    Stream #0:15[0x10024]: Subtitle: dvd_subtitle
    Stream #0:16[0x1002a]: Subtitle: dvd_subtitle
    Stream #0:17[0x10021]: Subtitle: dvd_subtitle
    Stream #0:18[0x10027]: Subtitle: dvd_subtitle
    Stream #0:19[0x10020]: Subtitle: dvd_subtitle
    Stream #0:20[0x10026]: Subtitle: dvd_subtitle

$ vgtmpeg -analyzeduration 500M -probesize 500M -i dvd://dvd/VIDEO_TS?title=2 2>&1 | egrep 'Input|Subtitle'
Input #0, mpeg, from 'dvd://dvd/VIDEO_TS?title=2':
    Stream #0:9[0x20022]: Subtitle: dvd_subtitle
    Stream #0:10[0x20028]: Subtitle: dvd_subtitle
    Stream #0:11[0x20025]: Subtitle: dvd_subtitle
    Stream #0:12[0x2002b]: Subtitle: dvd_subtitle
    Stream #0:13[0x20023]: Subtitle: dvd_subtitle
    Stream #0:14[0x20029]: Subtitle: dvd_subtitle
    Stream #0:15[0x20024]: Subtitle: dvd_subtitle
    Stream #0:16[0x2002a]: Subtitle: dvd_subtitle
    Stream #0:17[0x20021]: Subtitle: dvd_subtitle
    Stream #0:18[0x20027]: Subtitle: dvd_subtitle
    Stream #0:19[0x20020]: Subtitle: dvd_subtitle
    Stream #0:20[0x20026]: Subtitle: dvd_subtitle

$ vgtmpeg -analyzeduration 500M -probesize 500M -i dvd://dvd/VIDEO_TS?title=3 2>&1 | egrep 'Input|Subtitle'
Input #0, mpeg, from 'dvd://dvd/VIDEO_TS?title=3':
    Stream #0:3[0x30020]: Subtitle: dvd_subtitle
    Stream #0:4[0x30021]: Subtitle: dvd_subtitle

vgtmpeg detects 12 subtitle streams for titles 1 and 2 and 2 subtitle streams for title 3.

If vgtmpeg is run without specifying a title:

$ vgtmpeg -analyzeduration 500M -probesize 500M -i dvd://dvd/VIDEO_TS 2>&1 | egrep 'Input|Subtitle'
Input #0, mpeg, from 'dvd://dvd/VIDEO_TS?title=1':
    Stream #0:9[0x10022]: Subtitle: dvd_subtitle
    Stream #0:10[0x10028]: Subtitle: dvd_subtitle
    Stream #0:11[0x10025]: Subtitle: dvd_subtitle
    Stream #0:12[0x1002b]: Subtitle: dvd_subtitle
    Stream #0:13[0x10023]: Subtitle: dvd_subtitle
    Stream #0:14[0x10029]: Subtitle: dvd_subtitle
    Stream #0:15[0x10024]: Subtitle: dvd_subtitle
    Stream #0:16[0x1002a]: Subtitle: dvd_subtitle
    Stream #0:17[0x10021]: Subtitle: dvd_subtitle
    Stream #0:18[0x10027]: Subtitle: dvd_subtitle
    Stream #0:19[0x10020]: Subtitle: dvd_subtitle
    Stream #0:20[0x10026]: Subtitle: dvd_subtitle
Input #1, mpeg, from 'dvd://dvd/VIDEO_TS?title=2':
    Stream #1:9[0x20022]: Subtitle: dvd_subtitle
    Stream #1:10[0x20028]: Subtitle: dvd_subtitle
    Stream #1:11[0x20025]: Subtitle: dvd_subtitle
    Stream #1:12[0x2002b]: Subtitle: dvd_subtitle
    Stream #1:13[0x20023]: Subtitle: dvd_subtitle
    Stream #1:14[0x20029]: Subtitle: dvd_subtitle
    Stream #1:15[0x20024]: Subtitle: dvd_subtitle
    Stream #1:16[0x2002a]: Subtitle: dvd_subtitle
Input #2, mpeg, from 'dvd://dvd/VIDEO_TS?title=3':
    Stream #2:3[0x30020]: Subtitle: dvd_subtitle
    Stream #2:4[0x30021]: Subtitle: dvd_subtitle

It detects 12 subtitle streams for title 1 (as expected) and 2 for title 3 (as expected), but only 8 for title 2.

For comparison, here's the output from lsdvd:

$ lsdvd -qs dvd/VIDEO_TS
Title: 01, Length: 01:46:31.100 Chapters: 31, Cells: 31, Audio streams: 07, Subpictures: 02
    Subtitle: 01, Language: en - English, Content: Normal, Stream id: 0x20,
    Subtitle: 02, Language: es - Espanol, Content: Normal, Stream id: 0x21,
Title: 02, Length: 01:46:31.100 Chapters: 31, Cells: 31, Audio streams: 07, Subpictures: 06
    Subtitle: 01, Language: en - English, Content: Normal, Stream id: 0x20,
    Subtitle: 02, Language: es - Espanol, Content: Normal, Stream id: 0x21,
    Subtitle: 03, Language: en - English, Content: Director, Stream id: 0x22,
    Subtitle: 04, Language: en - English, Content: Director, Stream id: 0x23,
    Subtitle: 05, Language: en - English, Content: Director, Stream id: 0x24,
    Subtitle: 06, Language: en - English, Content: Director, Stream id: 0x25,
Title: 03, Length: 00:02:53.500 Chapters: 02, Cells: 02, Audio streams: 01, Subpictures: 02
    Subtitle: 01, Language: en - English, Content: Normal, Stream id: 0x20,
    Subtitle: 02, Language: es - Espanol, Content: Normal, Stream id: 0x21,
Longest track: 01

A few things to note, although I don't know if these have anything to do with this issue:

  1. This particular DVD exhibits the same subtitle doubling behavior identified in issue #4. So where lsdvd shows 6 subtitle streams for title 2, that corresponds to the 12 detected by vgtmpeg if you discount the duplicates.

  2. lsdvd only shows 2 subtitle streams for title 1. The 4 subtitle streams missing are the 4 "Director" commentary streams and on this DVD, those streams are selected by going to the "Bonus" features.

  3. Titles 1 and 2 are exactly the same length and in fact are exactly the same. I used mplayer -dumpstream to extract both title 1 and 2 and they are exactly the same:

    $ sum -r title-1.vob title-2.vob
    45060 6048958 title-1.vob
    45060 6048958 title-2.vob

@vigata vigata self-assigned this Mar 20, 2015
@dbpete
Copy link
Author

dbpete commented Apr 16, 2015

In the above examples, -analyzeduration/-probesize are required to detect all the subtitle streams. If I re-run the commands on each title separately, but w/o the -analyzeduration/-probesize options, the result is only 8 subtitle streams for both title 1 and 2. That matches the result for title 2 when no title is specified.

Is it possible in the case where no title is specified (ie -i dvd://dvd/VIDEO_TS), the -analyzeduration/-probesize values are only getting applied to the first input (ie title=1)?

@dbpete
Copy link
Author

dbpete commented Apr 17, 2015

I think that might be it. Take a look at this output:

$ vgtmpeg -analyzeduration 100M -probesize 100M -loglevel debug -i dvd://dvd/VIDEO_TS 2>&1 | egrep 'opening title|max_analyze_duration'
dvd_open: opening title 1
[mpeg @ 0xaf784a0] max_analyze_duration 100000000 reached at 100000000 microseconds
dvd_open: opening title 2
[mpeg @ 0xb11e480] max_analyze_duration 5000000 reached at 5004556 microseconds
dvd_open: opening title 3
[mpeg @ 0xb3d4ba0] max_analyze_duration 5000000 reached at 5005000 microseconds

Notice only title 1 is using the correct -analyzeduration/-probesize values.

vigata pushed a commit that referenced this issue Mar 28, 2018
…-hls_segment_filename

previously, specifying -hls_segment_filename meant
s->base_output_dirname was never set, causing a segfault:

(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
* frame #0: 0x00007fffbf7d82d0 libsystem_platform.dylib`_platform_strcmp + 80
frame #1: 0x00000001005f4dcf libavformat.57.dylib`io_open_default(s=0x000000010481cc00, pb=0x0000000104806020, url=0x0000000000000000, flags=2, options=0x0000000000000000) at options.c:107
frame #2: 0x0000000100528968 libavformat.57.dylib`hls_mux_init(s=0x000000010481cc00) at hlsenc.c:595
frame #3: 0x00000001005273cb libavformat.57.dylib`hls_write_header(s=0x000000010481cc00) at hlsenc.c:1518
frame #4: 0x00000001005c08d0 libavformat.57.dylib`write_header_internal(s=0x000000010481cc00) at mux.c:486
frame #5: 0x00000001005c0774 libavformat.57.dylib`avformat_write_header(s=0x000000010481cc00, options=0x00000001029026e8) at mux.c:539
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants