From: Gwyneth Morgan <gwymor@tilde.club>
To: ffmpeg-devel@ffmpeg.org
Cc: Gwyneth Morgan <gwymor@tilde.club>
Subject: [FFmpeg-devel] [PATCH] avformat/matroska: Write WebVTT subtitles according to MKV specs
Date: Wed, 8 Mar 2023 20:24:33 +0000
Message-ID: <20230308202431.608732-1-gwymor@tilde.club> (raw)
When writing WebMs, FFmpeg muxes WebVTT subtitles with the D_WEBVTT/*
codec tags from the WebM specs [1]. However, it does the same when
muxing MKV files, and the Matroska specifications instead use
S_TEXT/WEBVTT tags for WebVTT subtitles [2], which FFmpeg currently
doesn't understand. Support reading MKVs using either tag, write regular
MKVs with S_TEXT/WEBVTT, and write WebMs with the D_WEBVTT/* tags we
already use.
[1]: https://www.webmproject.org/docs/container/
[2]: https://matroska.org/technical/codec_specs.html#s_textwebvtt
Signed-off-by: Gwyneth Morgan <gwymor@tilde.club>
Fixes: https://trac.ffmpeg.org/ticket/5641
---
libavformat/matroska.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/libavformat/matroska.c b/libavformat/matroska.c
index 90d94b6..07aeed2 100644
--- a/libavformat/matroska.c
+++ b/libavformat/matroska.c
@@ -60,16 +60,12 @@ const CodecTags ff_mkv_codec_tags[]={
{"A_VORBIS" , AV_CODEC_ID_VORBIS},
{"A_WAVPACK4" , AV_CODEC_ID_WAVPACK},
- {"D_WEBVTT/SUBTITLES" , AV_CODEC_ID_WEBVTT},
- {"D_WEBVTT/CAPTIONS" , AV_CODEC_ID_WEBVTT},
- {"D_WEBVTT/DESCRIPTIONS", AV_CODEC_ID_WEBVTT},
- {"D_WEBVTT/METADATA" , AV_CODEC_ID_WEBVTT},
-
{"S_TEXT/UTF8" , AV_CODEC_ID_SUBRIP},
{"S_TEXT/UTF8" , AV_CODEC_ID_TEXT},
{"S_TEXT/ASCII" , AV_CODEC_ID_TEXT},
{"S_TEXT/ASS" , AV_CODEC_ID_ASS},
{"S_TEXT/SSA" , AV_CODEC_ID_ASS},
+ {"S_TEXT/WEBVTT" , AV_CODEC_ID_WEBVTT},
{"S_ASS" , AV_CODEC_ID_ASS},
{"S_SSA" , AV_CODEC_ID_ASS},
{"S_VOBSUB" , AV_CODEC_ID_DVD_SUBTITLE},
@@ -77,6 +73,11 @@ const CodecTags ff_mkv_codec_tags[]={
{"S_HDMV/PGS" , AV_CODEC_ID_HDMV_PGS_SUBTITLE},
{"S_HDMV/TEXTST" , AV_CODEC_ID_HDMV_TEXT_SUBTITLE},
+ {"D_WEBVTT/SUBTITLES" , AV_CODEC_ID_WEBVTT},
+ {"D_WEBVTT/CAPTIONS" , AV_CODEC_ID_WEBVTT},
+ {"D_WEBVTT/DESCRIPTIONS", AV_CODEC_ID_WEBVTT},
+ {"D_WEBVTT/METADATA" , AV_CODEC_ID_WEBVTT},
+
{"V_AV1" , AV_CODEC_ID_AV1},
{"V_AVS2" , AV_CODEC_ID_AVS2},
{"V_AVS3" , AV_CODEC_ID_AVS3},
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next reply other threads:[~2023-03-08 20:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-08 20:24 Gwyneth Morgan [this message]
2023-03-14 3:25 ` [FFmpeg-devel] [PATCH v2] " Gwyneth Morgan
2023-03-14 3:37 ` Andreas Rheinhardt
2023-03-14 16:28 ` Gwyneth Morgan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230308202431.608732-1-gwymor@tilde.club \
--to=gwymor@tilde.club \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git