80 Commits
Author SHA1 Message Date
Scott GarrettandClaude Code 837aa1c098 Keep the PGS source resolution through the sup2vob conversion
VobSub conversions of PGS material were downscaled to the 720x480/576
DVD frame — a 1080p source came out of the mux at one quarter of its
authored size. The framework's sup2vob façade now always runs the
upstream CLI's `--full` mode: fullFramePassthrough keeps every frame's
object geometry verbatim, and the idx size line (which the VobSub
importer carries into track.width/height and the muxer writes into the
subpic track) is the PGS's own PCS canvas, e.g. 1920x1080. The
frame-rate-derived DVD frame stays as fallback for streams that define
no usable canvas. The conversion output is byte-identical to running
`sup2vob --full` on the same .sup.

The vendored upstream sources stay untouched apart from one comment —
the passthrough is enabled in the adaptation layer, same as the CLI
does with its flag. This applies to both PGS paths, which share the
conversion: .sup drag-import and PGS-from-MKV via
MP42PgsToVobSubConverter.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-28 21:13:57 -05:00
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 e7c7b80e8f Mux VobSub subpic tracks at the frame size declared by the idx
LoadVobSubSubtitles parsed the global `size:` line into locals and threw
it away, and the muxer hardcoded MP4AddSubpicTrack(640, 480), so the
saved display size always read back as 640x480 regardless of what the
subtitle declared. Store the declared size on SBVobSubTrack, carry it
into the model's width/height, and let the muxer pick the subpic display
size with a precedence chain: user-edited trackWidth/trackHeight first,
then the size declared by the subtitle file, then the old 640x480
default. The chosen size is mirrored back into the model, like the
3GText branch does, so the GUI matches what was muxed.

trackWidth/trackHeight are intentionally not set at import time: the
tx3g conversion path reads trackHeight as the default text box height
and then offsets the track by 0.85x, which would push full-frame values
off screen.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-27 02:40:58 -05:00
Damiano Galassi 57236970a3 Add two methods two return the supported UTIs 2026-09-22 18:50:05 +02:00
Damiano Galassi 9454c452b7 Update to newer libmp4v2, add support for VVC and AV1 Dolby Vision. 2024-06-27 11:08:55 +02:00
Damiano Galassi 027cb1f6ae Update copyright year. 2022-01-02 09:31:49 +01:00
Damiano Galassi 83f7b29e13 Add support for hvcE and avcE boxes. 2021-12-08 11:56:28 +01:00
Damiano Galassi ee26f9f46a Add support for muxing some kind of Dolby Vision tracks. 2021-12-07 19:03:12 +01:00
Damiano Galassi e42154278f Add experimental av1 support. 2021-05-31 12:09:29 +02:00
Damiano Galassi 799fdcc642 Update copyright year. 2021-02-02 10:55:04 +01:00
Damiano Galassi c8ff6a8a15 Fix some leaks. 2020-09-23 21:18:24 +02:00
Damiano Galassi b2394c7c3e Update copyright. 2020-09-22 11:38:15 +02:00
Damiano Galassi 86de20e308 Remove some superfluos MP42FileImporter methods. 2020-09-21 19:27:11 +02:00
Damiano Galassi 0e421a6eef Enable and fixes more warnings. 2020-09-19 14:39:02 +02:00
Damiano Galassi f63e23f878 Adopt objc direct attributes where possible. 2020-07-01 19:48:11 +02:00
Damiano Galassi ce4ee8e0f1 Reorganize headers. 2020-02-08 13:53:32 +01:00
Damiano Galassi bf0417c97d Refactor MP42Track private methods, removed NSUserDefaults usage. 2020-02-08 13:45:56 +01:00
Damiano Galassi 0e19dccbdf Fixes a crash in the eac3 header parser, add some preliminary work to read atmos in AVFoundation. 2018-09-05 15:26:31 +02:00
Damiano Galassi 40dd77c363 Fix some deadlocks. 2018-03-23 12:43:33 +01:00
Damiano Galassi 0cfc6e58ac Preserve sample dependencies. 2017-11-29 13:50:51 +01:00
Damiano Galassi e797c92de9 Break out of the loop when we receive a eof. 2017-10-28 08:39:24 +02:00
Damiano Galassi dd10b73a0f Fix multiple MP42SampleBufferFlagEndOfFile being sent on the same track. 2017-10-27 09:07:53 +02:00
Damiano Galassi f0f7a0704b Add __autoreleasing to NSError 2017-10-09 12:34:55 +02:00
Damiano Galassi 8d8aaa0be6 Rename SBSubSerializer to MP42SubSerializer, remove some casts, fix SSA timestamp parsing. 2017-10-03 08:52:48 +02:00
Damiano Galassi 0908670715 Add a new SSA -> Text converter. 2017-10-02 19:10:14 +02:00
Damiano Galassi 1f65513c84 Init the FIFOs only when needed. 2017-10-01 16:35:39 +02:00
Damiano Galassi 972ead6f0b Convert MP42FileImporter to ARC, and clean up some imports. 2017-09-30 11:11:31 +02:00
Damiano Galassi 646585be6f Port more classes to arc. 2017-09-29 18:10:59 +02:00
Damiano Galassi 7539ac68bd Add a preference to force the 'hvc1' fourCC. 2017-09-19 12:34:55 +02:00
Damiano Galassi 068c5b1cb9 Add a way to force the 'hvc1' fourCC until a better solution is developed. 2017-09-16 14:38:34 +02:00
Damiano Galassi a707918ce0 Improve AVFoundation demuxing speed. 2017-09-14 13:21:34 +02:00
Damiano Galassi 9f7089b831 Write the sgpd/sbgp only when importing tracks, do not write a guessed delay on save on every mp4.
Fixed another crash in avfoundation edit lists code.
2017-09-03 11:41:28 +02:00
Damiano Galassi e131e4ccf1 Remove some duplicated code. 2017-09-01 13:49:43 +02:00
Damiano Galassi 5fc438efcc Preserve the track matrix. 2017-09-01 12:20:02 +02:00
Damiano Galassi cca166eb8c Improve audio sync. 2017-08-31 17:33:27 +02:00
Damiano Galassi 4d1dc8cb92 Add a way to differentiate hvc1 and hev1 2017-08-03 14:17:19 +02:00
Damiano Galassi 88f4f94e1c Check if magicCookie is available. 2017-05-11 11:51:32 +02:00
Damiano Galassi 4d8b206f15 Set the dac3 atom content at the end when the magicCookie is available. Remove some duplicated code. 2017-05-11 11:45:23 +02:00
Brian Gerfort 5e821d87f6 * Support for DTS to AC3 + AAC conversion.
If you prefer to recompile FFmpeg from scratch, make sure you include the --enable-encoder=ac3 and --disable-iconv parameters. My config:

./configure --disable-programs --disable-filters --disable-everything --disable-avdevice --disable-swscale --enable-avresample --enable-decoder=dvdsub --enable-decoder=pgssub --enable-decoder=aac --enable-decoder=mp3 --enable-decoder=mp2 --enable-decoder=mp1 --enable-decoder=ac3 --enable-decoder=eac3 --enable-decoder=truehd --enable-decoder=alac --enable-decoder=opus --enable-decoder=vorbis --enable-decoder=flac --enable-decoder=mlp --enable-decoder=dca --enable-decoder=pcm --enable-filter=aresample --enable-parser=opus --enable-muxer=opus --prefix=/Users/damians/Desktop/iffmpeg --extra-cxxflags='-mmacosx-version-min=10.9' --extra-cflags='-mmacosx-version-min=10.9' --extra-ldflags='-mmacosx-version-min=10.9' --enable-decoder=pcm_f32be --enable-decoder=pcm_f32le --enable-decoder=pcm_f64be --enable-decoder=pcm_f64le --enable-decoder=pcm_s16be --enable-decoder=pcm_s16le --enable-decoder=pcm_s16le_planar --enable-decoder=pcm_s24be --enable-decoder=pcm_daud --enable-decoder=pcm_s24le --enable-decoder=pcm_s32be --enable-decoder=pcm_s32le --enable-decoder=pcm_s8 --enable-decoder=pcm_u8 --enable-decoder=pcm_u16be --enable-decoder=pcm_u16le --enable-decoder=pcm_u24be --enable-decoder=pcm_u24le --enable-encoder=ac3 --disable-iconv
2017-05-05 15:41:25 +02:00
Damiano Galassi dd036eacf8 Fix closed captions importer usage of architecture specific long size. 2016-12-12 13:38:42 +01:00
Damiano Galassi f47dbdb62e Fix setAutoFallback: 2016-09-27 10:02:43 +02:00
Damiano Galassi 05643e7bda Do not set the channels property for DTS. 2016-09-27 09:43:24 +02:00
Damiano Galassi d449f75d15 Fix raw h.264 frame rate. 2016-09-13 12:31:43 +02:00
Damiano Galassi 1d100a1db0 Clean up MP42Track a bit. 2016-09-13 12:05:40 +02:00
Damiano Galassi 5be581793d Rework the way conversion settings are stored. 2016-09-13 08:50:39 +02:00
Damiano Galassi 04c20bbc67 Downsample audio to 48000 Khz if the input has a bigger sample rate. 2016-08-29 16:00:28 +02:00
Damiano Galassi 2fcf67f7f6 Fix HEVC from mp4. 2016-08-16 09:49:28 +02:00
Damiano Galassi b54c8b747b Add hevc support. 2016-08-14 12:03:29 +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