[FFmpeg-devel] [PATCH] WebVTT demuxer - save cue id and settings as side data

Clément Bœsch ubitux at gmail.com
Sat Jun 1 15:14:32 CEST 2013


On Fri, May 31, 2013 at 04:27:32PM -0700, Matthew Heaney wrote:
> Currently the WebVTT demuxer parses the cues but throws away
> the cue id (the optional first line of the cue) and cue
> settings (the optional rendering instructions that follow
> the timestamp).
> 
> However, in order to write inband text tracks (to WebM
> files), the entire cue payload from the WebVTT source must
> be preserved.
> 
> This commit makes no change to the data part of the output
> buffer packet (where the actual cue text is stored), but
> does add the cue id and settings as a side data items, if
> they're present in the cue. Existing code that cares only
> about the data part of the packet can continue to ignore the
> side data.
> 
> There are two new packet data type flags,
> AV_PKT_DATA_WEBVTT_IDENTIFIER and
> AV_PKT_DATA_WEBVTT_SETTINGS.
> ---
>  libavcodec/avcodec.h    | 11 ++++++++++
>  libavcodec/version.h    |  4 ++--
>  libavformat/webvttdec.c | 55 +++++++++++++++++++++++++++++++++++++++----------
>  3 files changed, 57 insertions(+), 13 deletions(-)
> 
[...]
> diff --git a/libavformat/webvttdec.c b/libavformat/webvttdec.c
> index 694a020..864c74f 100644
> --- a/libavformat/webvttdec.c
> +++ b/libavformat/webvttdec.c
> @@ -67,6 +67,8 @@ static int webvtt_read_header(AVFormatContext *s)
>      st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
>      st->codec->codec_id   = AV_CODEC_ID_WEBVTT;
>  
> +    s->flags |= AVFMT_FLAG_KEEP_SIDE_DATA;
> +

The associated bug is fixed, so this chunk is removed, and patch applied.

[...]

Thank you,

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130601/405e85f8/attachment.asc>


More information about the ffmpeg-devel mailing list