24 Commits
Author SHA1 Message Date
Scott GarrettandClaude Code 57772086a5 Convert Matroska PGS tracks to VobSub and name flagged tracks SDH
A PGS track inside an MKV can now be muxed as a real subp track: the
muxer's bitmap-converter branch recognizes a PGS source with a VobSub
target (new MP42ConversionSettings subtitlesVobSubConversion) and uses
the new MP42PgsToVobSubConverter instead of MP42BitmapSubConverter.

The converter rebuilds the PGS elementary stream from the source
container up-front, because mkvmerge stores each PGS segment with its
13-byte "PG" envelope removed (type + 2-byte length + payload,
zlib-compressed) — a plain concatenation of demuxed blocks is not a
.sup. Each block is walked segment-by-segment and the envelope is
restored as PG + 90 kHz pts (from the block's nanosecond timestamp) +
four zero bytes + type + length, byte-identical to what mkvextract
writes; blocks that already carry envelopes pass through verbatim. The
rebuilt temp .sup then rides the existing MP42VobSubImporter wholesale
for palette, DVD geometry, and raw-SPU samples, which replay through
copyEncodedSample while the live muxing stream is discarded.

Subtitle type recognition now names any flagged track "SDH" (hearing
impaired, commentary, forced, lyrics, closed captions) instead of a
per-type name, and MKV container tracks get the same treatment on the
conversion path: the TrackEntry Name runs through the recognizer, or
the MKV's own filename when there is no Name element. tagsOnly mode
stays verbatim — that model is the tag writer's diff baseline.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-28 20:00:08 -05:00
Scott GarrettandClaude Code 30dd96ff79 Recognize subtitle language and type tokens in filenames
getFilenameLanguage now tokenizes the name and scans right-to-left the way mkvmerge's own heuristics do, so a language code survives behind a trailing flag token ("...eng.hearing_impaired.srt" was read as "und"). Three-char tokens try ISO 639-2/T and the library's B codes; the dash stays out of the separator set so region subtags ("pt-BR") are not split into a bogus ISO 639-1 hit.

getFilenameSubtitlesTrackName maps community type tokens (sdh / hearing_impaired / deaf, cc / closed caption, forced, commentary, lyrics) to a bare conventional track name ("SDH"); the language rides its own element. MP4 has no SDH flag and the name-keyword pass in MP42File organizeMediaCharacteristicsForMediaType: turns these names into the real QuickTime tags (public.subtitles.forced-only, public.accessibility.*).

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-28 18:17:53 -05:00
Damiano Galassi 027cb1f6ae Update copyright year. 2022-01-02 09:31:49 +01:00
Damiano Galassi 45552f45c0 Make MP4GetTrackMediaDataName aware of multiple sample descriptions. Only the first one is ready at the moment. 2021-12-09 12:03:28 +01:00
Damiano Galassi 799fdcc642 Update copyright year. 2021-02-02 10:55:04 +01:00
Damiano Galassi a190617dc4 Update major brand when saving a file. 2020-09-22 14:20:25 +02:00
Damiano Galassi b2394c7c3e Update copyright. 2020-09-22 11:38:15 +02:00
Damiano Galassi cfbf9bbf91 Refactor NSLinguisticTagger code. 2017-10-02 19:20:17 +02:00
Damiano Galassi a4b9d5bba9 Move esds code to format utilities. 2017-10-02 12:43:20 +02:00
Damiano Galassi fc6b9d8a4c Use NSTimeInterval to store a track start offset, rename alternate_group to alternateGroup. 2017-09-01 07:36:57 +02:00
Damiano Galassi 6f31037011 Made the error message localisable. 2016-11-23 12:09:15 +01:00
Damiano Galassi 384d30d00c Show localized track names in the document window. 2016-11-23 11:40:21 +01:00
Damiano Galassi d847082696 Use the iso639_2 to store the language in MP42Track. 2016-11-04 09:57:25 +01:00
Damiano Galassi aa760b301c Made more UI elements localisable. 2016-10-25 18:34:38 +02:00
Damiano Galassi 69cb3ea22c Guess a layout for PCM tracks if none is set. 2016-09-18 10:33:08 +02:00
Damiano Galassi 72c721db22 Remove unused code. 2016-09-18 10:12:04 +02:00
Damiano Galassi 8a2b4460ed Fix some more display names. 2016-08-19 09:34:52 +02:00
Damiano Galassi 1310202592 Implements the localised media names. 2016-08-13 13:40:09 +02:00
Damiano Galassi 1c562a65ea Switch to FourCC instead of NSStrings for media type and formats. 2016-08-10 18:51:53 +02:00
Damiano Galassi 78a5867492 Moved some magic cookies utility to a new file. 2015-11-18 09:35:20 +01:00
Damiano Galassi bda8ac4b37 Partial eac3 passthru. 2015-11-04 23:41:08 +01:00
galad87 f6b23874f6 More cosmetics 2015-08-27 18:28:54 +02:00
Damiano Galassi 7611af9ce4 Moved some functions to the public MP42Utilities. 2013-11-16 14:01:14 +01:00
Damiano Galassi 08e32323ce Renamed MP42Utilites to MP42PrivateUtilities, a public header will be committed soon. 2013-11-16 13:23:01 +01:00