[FFmpeg-devel] [PATCH v9 2/5] avformat/rcwtdec: add RCWT Closed Captions demuxer

Stefano Sabatini stefasab at gmail.com
Tue Mar 26 18:04:20 EET 2024


On date Saturday 2024-03-23 21:25:01 -0500, Marth64 wrote:
> RCWT (Raw Captions With Time) is a format native to ccextractor,
> a commonly used OSS tool for processing 608/708 Closed Captions (CC).
> RCWT can be used to archive the original extracted CC bitstream.
> The muxer was added in January 2024. In this commit, add the demuxer.
> 
> One can now demux RCWT files for rendering in ccaption_dec or interop
> with ccextractor (which produces RCWT). Using the muxer/demuxer combo,
> the CC bits can be kept for processing or rendering with either tool.
> This can be an effective way to backup an original CC stream, including
> format extensions like EIA-708 and overall original presentation.
> 
> Signed-off-by: Marth64 <marth64 at proxyid.net>
> ---
>  Changelog                |   2 +-
>  doc/demuxers.texi        |  30 ++++++++++
>  libavformat/Makefile     |   1 +
>  libavformat/allformats.c |   1 +
>  libavformat/rcwtdec.c    | 123 +++++++++++++++++++++++++++++++++++++++
>  5 files changed, 156 insertions(+), 1 deletion(-)
>  create mode 100644 libavformat/rcwtdec.c
> 
> diff --git a/Changelog b/Changelog
> index 934241a965..4587d0d511 100644
> --- a/Changelog
> +++ b/Changelog
> @@ -19,7 +19,7 @@ version <next>:
>  - lavu/eval: introduce randomi() function in expressions
>  - VVC decoder
>  - fsync filter
> -- Raw Captions with Time (RCWT) closed caption muxer
> +- RCWT (Raw Captions with Time) Closed Captions muxer and demuxer
>  - ffmpeg CLI -bsf option may now be used for input as well as output
>  - ffmpeg CLI options may now be used as -/opt <path>, which is equivalent
>    to -opt <contents of file <path>>
> diff --git a/doc/demuxers.texi b/doc/demuxers.texi
> index b70f3a38d7..04293c4813 100644
> --- a/doc/demuxers.texi
> +++ b/doc/demuxers.texi
> @@ -1038,6 +1038,36 @@ the command:
>  ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
>  @end example
>  
> + at anchor{rcwtdec}
> + at section rcwt
> +
> +RCWT (Raw Captions With Time) is a format native to ccextractor, a commonly
> +used open source tool for processing 608/708 Closed Captions (CC) sources.
> +For more information on the format, see @ref{rcwtenc,,,ffmpeg-formats}.
> +
> +This demuxer implements the specification as of March 2024, which has
> +been stable and unchanged since April 2014.
> +
> + at subsection Examples
> +
> + at itemize
> + at item
> +Render CC to ASS using the built-in decoder:
> + at example
> +ffmpeg -i CC.rcwt.bin CC.ass
> + at end example
> +Note that if your output appears to be empty, you may have to manually
> +set the decoder's @option{data_field} option to pick the desired CC substream.

this options is for the cc_dec decoder, while this is assuming EIA_608,
am I confused?

> +
> + at item
> +Convert an RCWT backup to Scenarist (SCC) format:
> + at example
> +ffmpeg -i CC.rcwt.bin -c:s copy CC.scc
> + at end example
> +Note that the SCC format does not support all of the possible CC extensions
> +that can be stored in RCWT (such as EIA-708).
> + at end itemize
> +
>  @section sbg
>  
[...]

LGTM otherwise, thanks.


More information about the ffmpeg-devel mailing list