Skip to content

subtitle: add SubtitleFrame and subtitle codec contexts - #180

Merged
h4tr3d merged 3 commits into
masterfrom
subtitle_frame_support
Nov 12, 2026
Merged

h4tr3d merged 3 commits into
masterfrom
subtitle_frame_support

Conversation

@h4tr3d

@h4tr3d h4tr3d commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Add a move-only SubtitleFrame/SubtitleRect API with text, ASS, bitmap and palette support. Add SubtitleDecoderContext and SubtitleEncoderContext that use the legacy FFmpeg subtitle API, and reject the unsupported send/receive/flush operations.

Add subtitle decode/inspect and ASS generation examples, in-memory and fixture tests, and the avcpp-test-data fixtures integration. Fix Packet input padding required by the ASS muxer, and add av::wrap2sview, av::freep and av::strdup helpers.

Fix #170

Add a move-only SubtitleFrame/SubtitleRect API with text, ASS, bitmap and palette support. Add SubtitleDecoderContext and SubtitleEncoderContext that use the legacy FFmpeg subtitle API, and reject the unsupported send/receive/flush operations.

Add subtitle decode/inspect and ASS generation examples, in-memory and fixture tests, and the avcpp-test-data fixtures integration. Fix Packet input padding required by the ASS muxer, and add av::wrap2sview, av::freep and av::strdup helpers.
Before FFmpeg 5.1 subtitle encoders provide only the legacy encode_sub callback and have neither encode2 nor receive_packet. Codec::canEncode() ignored it, so every subtitle encoder looked like a decoding-only codec and SubtitleEncoderContext construction failed with CodecInvalidDirection on FFmpeg 4.x, including the Ubuntu 22.04 CI jobs.

Match the upstream av_codec_is_encoder() check and cover the direction of subtitle codecs with a version-independent test.
@h4tr3d
h4tr3d merged commit 4cbc36d into master Nov 12, 2026
15 checks passed
@h4tr3d
h4tr3d deleted the subtitle_frame_support branch November 12, 2026 02:13
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

Successfully merging this pull request may close these issues.

Subtitle frame support

1 participant