Opened 10 years ago

Last modified 7 years ago

#2035 open defect

DVD subtitle from VOB does not contain CodecPrivate data

Reported by: Daniel Pielmeier Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: dvdsub
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


Summary of the bug:

When copying DVD subtitles from vob files into the matroska container the subtitles do not contain CodecPrivate data.

The subtitles play fine in vlc but mkvtoolnix has problems with editing the file. The header editor recognizes all tracks but mkvextract fails to extract the subtitles because of the missing data (Error: Track 5 with the CodecID 'S_VOBSUB' is missing the "codec private" element and cannot be extracted.). Also editing the file with mmg/mkvmerge does not work because the existing subtitles are ignored and not written to the output file because of the same reason (Warning: matroska_reader: The CodecID for track 5 is 'S_VOBSUB', but there was no private data found).

While I understand that the CodecPrivate data is not direct available when reading from VOB files as this information normally comes from the IDX part of extracted subtitles in vobsub format. However it would be nice if this information could be acquired somehow and written to the codec initialization part for the files to be editable by mkvtoolnix. This would save the additional step of extracting the subtitles to IDX/SUB. I guess that the ultimate solution would be to add a DVD reader who understands the dvd structure as I this information is stored in the IFO file.

How to reproduce:

% ffmpeg -i concat:VTS_01_1.VOB\|VTS_01_2.VOB\|VTS_01_3.VOB\|VTS_01_4.VOB \
-map 0:0 -map 0:1 -map 0:2 -map 0:6 -map 0:5 -map 0:4 \
-c:v libx264 -preset fast -crf 18 \
-c:a copy -metadata:s:a:0 language=ger \
-c:a copy -metadata:s:a:1 language=eng \
-c:s copy -metadata:s:s:0 language=eng \
-c:s copy -metadata:s:s:1 language=ger \
-c:s copy -metadata:s:s:2 language=ger \
-f matroska movie.mkv

ffmpeg version N-47903-gde89dff
built on Dec 16 2012 15:51:01

Change History (6)

comment:1 by Cigaes, 10 years ago

I believe the messages from the Matroska tools are misleading. The extradata is not mandatory to read DVD subtitles. The problem with the subtitles is that they do not have the duration set, and therefore the resulting Matroska packets are considered invalid.

I have submitted a patch to set the duration when doing stream copy (the duration is correctly set when transcoding), it is still awaiting review.

in reply to:  1 comment:2 by Carl Eugen Hoyos, 10 years ago

Replying to Cigaes:

I have submitted a patch to set the duration when doing stream copy (the duration is correctly set when transcoding), it is still awaiting review.

Was this committed? Could you point to the patch?

comment:3 by Cigaes, 10 years ago

It was never reviewved nor pushed. The patch is there:

comment:4 by Carl Eugen Hoyos, 10 years ago

Component: undeterminedavcodec
Keywords: dvdsub added
Status: newopen

comment:5 by Lycanthropist, 8 years ago

The issue still persists.
Why has the patch not been reviewed and pushed?

comment:6 by Elon Musk, 7 years ago

I tried patch and even if it does set pkt duration it get lost afterwards anyway.

Note: See TracTickets for help on using tickets.