[FFmpeg-trac] #11462(undetermined:new): Cannot embed .scc file into .mp4 using -c:s copy
FFmpeg
trac at avcodec.org
Thu Feb 13 01:40:09 EET 2025
#11462: Cannot embed .scc file into .mp4 using -c:s copy
-------------------------------------+-------------------------------------
Reporter: Zach | Owner: (none)
Type: enhancement | Status: new
Priority: important | Component:
| undetermined
Version: git-master | Resolution:
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Comment (by Zach):
The catch is sometimes captions are muxed into the file like mxf 436m, and
sometimes they are embedded in the video frame data and ffmpeg needs to
support converting between the two regardless of whether the video track
gets re-encoded. For example an mxf file with AVC video, PCM audio and
436m captions should only need the audio re-encoded and captions combined
with the AVC video to go to mp4. This would use a very similar data chain
compared to extracting and embedding from a .mcc or .scc file, just with a
VANC/VBI encapsulation instead of user data encapsulation.
Video Copy + CC with audio transcode
{{{
┌──────────┬─────────────────────┐ ┌─────────┐
│ demuxer │ │ audio packets │ Audio │
Raw Audio
╞══════════╡ stream 0 (audio) ├──────────────────────────┤ Encoder
├─────────╮
│ │ │ │ (PCM) │
│
│INPUT.mxf ├─────────────────────┤ Elementry Stream └─────────┘
│
│ │ │ Packets
│
│ │ stream 1 (video) ├───────────────────────────────────────╮
│
│ │ │ │
│
│ ├─────────────────────┤ │
│
│ │ │ raw VANC ┌─────────┐ │
│
│ │ stream 2 (data) │ packets │ VANC │ Text Stream │
│
│ │ VBI_Vanc_smpte_436m ├────────────►│ decoder ├───────────╮ │
│
│ │ │ │ │ │ │
│
└──────────┴─────────────────────┘ └─────────┘ │ │
│
╭─────────────◄───────────╯ │
│
│ ╭───────────────◄───────────╯
│
│ │
┌────────────────────────┐ │
│ │ │ Embed CC
│ │
│ ╰──►│ in User Data
│ │
│ │
│ │
╰────►│
├───╮ │
│
│ │ │
└────────────────────────┘ │ │
▼ ▼
│ │
┌──────────┬─────────────────────┐
│ │
│ muxer │ │ Elementry Stream Packets
│ │
╞══════════╡ stream 0
│◄───────────────────────────────────────────╯ │
│ │ (video w/CC) │ with CC
│
│OUTPUT.mp4├─────────────────────┤ ┌─────────┐
│
│ │ │ │ Audio │
│
│ │ stream 1 (audio) │◄─────────┤ Encoder
├─────────────────────────╯
│ │ │ │ (aac) │
└──────────┴─────────────────────┘ └─────────┘
┌──────────┬─────────────────────┐
│ demuxer │ │ audio packets
╞══════════╡ stream 0 (audio)
├──────────────────────────────────────────────────╮
│ │ │
│
│INPUT.mp4 ├─────────────────────┤
│
│ │ │
│
│ │ stream 1 (video) ├───────────────────────────────────────╮
│
│ │ │ │
│
└──────────┴─────────────────────┘ │
│
│
│
╭───────────────◄───────────╯
│
│
┌──────────────────────────┐ │
│ │ Extract CC
│────╮ │
╰──►╞══════════════════════════╡ │ │
│
│ │ │
│ From User Data
│──╮ │ │
│
│ │ │ │
└──────────────────────────┘ │ │ │
▼ ▼ ▼
│ │ │
┌──────────┬──────────────────────┐
│ │ │
│ muxers │ │
│ │ │
╞══════════╡ stream 0 (video)
│◄───────────────────────────────────────────╯ │ │
│ OUT.m4v │ │
│ │
│ ├──────────────────────┤
│ │
│ │ │
│ │
│out.mcc │ stream 2 (Text (cc))
│◄─────────────────────────────────────────────╯ │
│ │ │
│
│ ├──────────────────────┤
│
│ │ │
│
│ out.aac │ stream 2 (Audio)
│◄────────────────────────────────────────────────╯
│ │ │
└──────────┴──────────────────────┘
}}}
Transcoding Example
{{{
┌──────────┬─────────────────────┐
│ demuxer │ │ audio packets
╞══════════╡ stream 0 (audio)
├──────────────────────────────────────────────╮
│ │ │
│
│INPUT.mxf ├─────────────────────┤ video ┌─────────┐ raw
│
│ │ │ packets │ video │ video frames
│
│ │ stream 1 (video) ├─────────►│ decoder ├──────────────────╮
│
│ │ │ │ │ │ │
│
│ ├─────────────────────┤ └─────────┘ │ │
│
│ │ │ raw Text ┌─────────┐ raw │ │
│
│ │ stream 2 (data) │ packets │ VANC │ text frames │ │
│
│ │ VBI_Vanc_smpte_436m ├─────────►│ decoder ├──────────────╮ │
│
│ │ │ │ │ │ │
│
└──────────┴─────────────────────┘ └─────────┘ │ │
│
╭─────────────◄───────────╯ │
│
│ ╭───────────────◄───────────╯
│
│ │
┌────────────────────────┐ │
│ │ │ Merge CC
│ │
│ ╰──►│
│ │
│ │
│ │
╰────►│
├───╮ │
│
│ │ │
└────────────────────────┘ │ │
▼ ▼
│ │
┌──────────┬─────────────────────┐ video ┌─────────┐
│ │
│ muxer │ │ packets │ video │ Raw Video Frames
│ │
╞══════════╡ stream 0 │◄─────────┤ encoder
├───────────────────────╯ │
│ │ (video w/CC) │ │(libx264)│ with CC
│
│OUTPUT.mp4├─────────────────────┤ └─────────┘
│
│ │ │
│
│ │ stream 1 (audio)
│◄─────────────────────────────────────────────╯
│ │ │
└──────────┴─────────────────────┘
┌──────────┬─────────────────────┐
│ demuxer │ │ audio packets
╞══════════╡ stream 0 (audio)
├──────────────────────────────────────────────────╮
│ │ │
│
│INPUT.mp4 ├─────────────────────┤ video ┌─────────┐ raw
│
│ │ │ packets │ video │ video frames w/CC
│
│ │ stream 1 (video) ├─────────►│ decoder ├──────────────────╮
│
│ │ │ │ │ │
│
└──────────┴─────────────────────┘ └─────────┘ │
│
│
│
╭───────────────◄───────────╯
│
│
┌──────────────────────────┐ │
│ │ Split CC
│────╮ │
╰──►╞══════════════════════════╡ │ │
│
│ │ │
│
│──╮ │ │
│
│ │ │ │
└──────────────────────────┘ │ │ │
▼ ▼ ▼
│ │ │
┌──────────┬──────────────────────┐ video ┌─────────┐
│ │ │
│ muxers │ │ packets │ video │
│ │ │
╞══════════╡ stream 0 (video) │◄─────────┤ encoder
├───────────────────────╯ │ │
│ OUT.m4v │ │ │(libx264)│
│ │
│ ├──────────────────────┤ └─────────┘
│ │
│ │ │
│ │
│out.aac │ stream 1 (audio)
│◄─────────────────────────────────────────────╯ │
│ │ │
│
│ ├──────────────────────┤
│
│ │ │
│
│ out.mcc │ stream 2 (Text (cc))
│◄────────────────────────────────────────────────╯
│ │ │
└──────────┴──────────────────────┘
}}}
Is there any way to condense the needed functions to less such that the
proposed EmbedCC and MergeCC can be the same function?
Stream Types:
VBI_VANC_smpte_436m
A/53 part 4 CC Data (text stream)
Video Elementary Stream with user data
Uncompressed Frame with user data CC
Any architectural change should support conversion between these 4 types.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/11462#comment:32>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list