Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] avformat/matroska: Write WebVTT subtitles according to MKV specs
@ 2023-03-08 20:24 Gwyneth Morgan
  2023-03-14  3:25 ` [FFmpeg-devel] [PATCH v2] " Gwyneth Morgan
  0 siblings, 1 reply; 4+ messages in thread
From: Gwyneth Morgan @ 2023-03-08 20:24 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Gwyneth Morgan

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".

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [FFmpeg-devel] [PATCH v2] avformat/matroska: Write WebVTT subtitles according to MKV specs
  2023-03-08 20:24 [FFmpeg-devel] [PATCH] avformat/matroska: Write WebVTT subtitles according to MKV specs Gwyneth Morgan
@ 2023-03-14  3:25 ` Gwyneth Morgan
  2023-03-14  3:37   ` Andreas Rheinhardt
  0 siblings, 1 reply; 4+ messages in thread
From: Gwyneth Morgan @ 2023-03-14  3:25 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Gwyneth Morgan

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
---
v2: Rebase as later changes in ffmpeg.git conflicted with this patch.

 libavformat/matroska.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/libavformat/matroska.c b/libavformat/matroska.c
index 79b2d09..d9e5ff9 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},
@@ -78,6 +74,11 @@ const CodecTags ff_mkv_codec_tags[]={
     {"S_HDMV/TEXTST"    , AV_CODEC_ID_HDMV_TEXT_SUBTITLE},
     {"S_ARIBSUB"        , AV_CODEC_ID_ARIB_CAPTION},
 
+    {"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".

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2] avformat/matroska: Write WebVTT subtitles according to MKV specs
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Rheinhardt @ 2023-03-14  3:37 UTC (permalink / raw)
  To: ffmpeg-devel

Gwyneth Morgan:
> 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
> ---
> v2: Rebase as later changes in ffmpeg.git conflicted with this patch.
> 
>  libavformat/matroska.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/libavformat/matroska.c b/libavformat/matroska.c
> index 79b2d09..d9e5ff9 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},
> @@ -78,6 +74,11 @@ const CodecTags ff_mkv_codec_tags[]={
>      {"S_HDMV/TEXTST"    , AV_CODEC_ID_HDMV_TEXT_SUBTITLE},
>      {"S_ARIBSUB"        , AV_CODEC_ID_ARIB_CAPTION},
>  
> +    {"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},

The reason we write it the way we do is that webvtt is muxed differently
in Matroska than WebM. This needs to be fixed, too, before S_TEXT/WEBVTT
can be used for Matroska.

- Andreas

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2] avformat/matroska: Write WebVTT subtitles according to MKV specs
  2023-03-14  3:37   ` Andreas Rheinhardt
@ 2023-03-14 16:28     ` Gwyneth Morgan
  0 siblings, 0 replies; 4+ messages in thread
From: Gwyneth Morgan @ 2023-03-14 16:28 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On 2023-03-14 04:37:17+0100, Andreas Rheinhardt wrote:
> The reason we write it the way we do is that webvtt is muxed differently
> in Matroska than WebM. This needs to be fixed, too, before S_TEXT/WEBVTT
> can be used for Matroska.

Ah, I see. I wasn't aware of the differences in muxing. Thanks for the
info.
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-14 16:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-08 20:24 [FFmpeg-devel] [PATCH] avformat/matroska: Write WebVTT subtitles according to MKV specs Gwyneth Morgan
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

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