* [FFmpeg-devel] [PATCH v10 0/5] RCWT Closed Captions demuxer (v10)
@ 2024-03-28 20:11 Marth64
2024-03-28 20:11 ` [FFmpeg-devel] [PATCH v10 1/5] avformat/subtitles: extend ff_subtitles_queue_insert() to support not yet available events Marth64
` (5 more replies)
0 siblings, 6 replies; 16+ messages in thread
From: Marth64 @ 2024-03-28 20:11 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Marth64
Since v7/8:
* Addresses last known feedback (about av_assert call)
* Changelog entry removed, since v7.0 is cut and there is no "next" space yet
(will make patch once available)
Signed-off-by: Marth64 <marth64@proxyid.net>
--
2.34.1
_______________________________________________
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] 16+ messages in thread
* [FFmpeg-devel] [PATCH v10 1/5] avformat/subtitles: extend ff_subtitles_queue_insert() to support not yet available events
2024-03-28 20:11 [FFmpeg-devel] [PATCH v10 0/5] RCWT Closed Captions demuxer (v10) Marth64
@ 2024-03-28 20:11 ` Marth64
2024-03-28 20:11 ` [FFmpeg-devel] [PATCH v10 2/5] avformat/rcwtdec: add RCWT Closed Captions demuxer Marth64
` (4 subsequent siblings)
5 siblings, 0 replies; 16+ messages in thread
From: Marth64 @ 2024-03-28 20:11 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Marth64
If ff_subtitles_queue_insert() were given a NULL buffer
with 0 length, it would still attempt to grow the packet
or memcpy depending on if merge option is enabled.
In this commit, allow passing a NULL buffer with 0 length
without attempting to do such operations. This way, if a
subtitle demuxer happens to pass an empty cue or wants to
use av_get_packet() to read bytes, there are no unnecessary
operations on the packet after it is allocated.
Signed-off-by: Marth64 <marth64@proxyid.net>
---
libavformat/subtitles.c | 23 +++++++++++++++--------
libavformat/subtitles.h | 2 +-
2 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/libavformat/subtitles.c b/libavformat/subtitles.c
index 3413763c7b..1c9b229f5b 100644
--- a/libavformat/subtitles.c
+++ b/libavformat/subtitles.c
@@ -21,6 +21,7 @@
#include "avformat.h"
#include "subtitles.h"
#include "avio_internal.h"
+#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
void ff_text_init_avio(void *s, FFTextReader *r, AVIOContext *pb)
@@ -111,15 +112,19 @@ AVPacket *ff_subtitles_queue_insert(FFDemuxSubtitlesQueue *q,
{
AVPacket **subs, *sub;
+ av_assert1(event || len == 0);
+
if (merge && q->nb_subs > 0) {
/* merge with previous event */
int old_len;
sub = q->subs[q->nb_subs - 1];
old_len = sub->size;
- if (av_grow_packet(sub, len) < 0)
- return NULL;
- memcpy(sub->data + old_len, event, len);
+ if (event) {
+ if (av_grow_packet(sub, len) < 0)
+ return NULL;
+ memcpy(sub->data + old_len, event, len);
+ }
} else {
/* new event */
@@ -133,14 +138,16 @@ AVPacket *ff_subtitles_queue_insert(FFDemuxSubtitlesQueue *q,
sub = av_packet_alloc();
if (!sub)
return NULL;
- if (av_new_packet(sub, len) < 0) {
- av_packet_free(&sub);
- return NULL;
+ if (event) {
+ if (av_new_packet(sub, len) < 0) {
+ av_packet_free(&sub);
+ return NULL;
+ }
+ memcpy(sub->data, event, len);
}
- subs[q->nb_subs++] = sub;
sub->flags |= AV_PKT_FLAG_KEY;
sub->pts = sub->dts = 0;
- memcpy(sub->data, event, len);
+ subs[q->nb_subs++] = sub;
}
return sub;
}
diff --git a/libavformat/subtitles.h b/libavformat/subtitles.h
index 88665663c5..ad6b96ca6a 100644
--- a/libavformat/subtitles.h
+++ b/libavformat/subtitles.h
@@ -112,7 +112,7 @@ typedef struct {
/**
* Insert a new subtitle event.
*
- * @param event the subtitle line, may not be zero terminated
+ * @param event the subtitle line (not zero terminated) or NULL on not yet available event
* @param len the length of the event (in strlen() sense, so without '\0')
* @param merge set to 1 if the current event should be concatenated with the
* previous one instead of adding a new entry, 0 otherwise
--
2.34.1
_______________________________________________
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] 16+ messages in thread
* [FFmpeg-devel] [PATCH v10 2/5] avformat/rcwtdec: add RCWT Closed Captions demuxer
2024-03-28 20:11 [FFmpeg-devel] [PATCH v10 0/5] RCWT Closed Captions demuxer (v10) Marth64
2024-03-28 20:11 ` [FFmpeg-devel] [PATCH v10 1/5] avformat/subtitles: extend ff_subtitles_queue_insert() to support not yet available events Marth64
@ 2024-03-28 20:11 ` Marth64
2024-03-29 11:51 ` Tomas Härdin
2024-03-30 0:23 ` Michael Niedermayer
2024-03-28 20:11 ` [FFmpeg-devel] [PATCH v10 3/5] avformat/rcwtenc: remove repeated documentation Marth64
` (3 subsequent siblings)
5 siblings, 2 replies; 16+ messages in thread
From: Marth64 @ 2024-03-28 20:11 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Marth64
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@proxyid.net>
---
doc/demuxers.texi | 30 ++++++++++
libavformat/Makefile | 1 +
libavformat/allformats.c | 1 +
libavformat/rcwtdec.c | 123 +++++++++++++++++++++++++++++++++++++++
4 files changed, 155 insertions(+)
create mode 100644 libavformat/rcwtdec.c
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
+@anchor{rcwtdec}
+@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.
+
+@subsection Examples
+
+@itemize
+@item
+Render CC to ASS using the built-in decoder:
+@example
+ffmpeg -i CC.rcwt.bin CC.ass
+@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.
+
+@item
+Convert an RCWT backup to Scenarist (SCC) format:
+@example
+ffmpeg -i CC.rcwt.bin -c:s copy CC.scc
+@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).
+@end itemize
+
@section sbg
SBaGen script demuxer.
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 44aa485029..5d77cba7f1 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -493,6 +493,7 @@ OBJS-$(CONFIG_QOA_DEMUXER) += qoadec.o
OBJS-$(CONFIG_R3D_DEMUXER) += r3d.o
OBJS-$(CONFIG_RAWVIDEO_DEMUXER) += rawvideodec.o
OBJS-$(CONFIG_RAWVIDEO_MUXER) += rawenc.o
+OBJS-$(CONFIG_RCWT_DEMUXER) += rcwtdec.o subtitles.o
OBJS-$(CONFIG_RCWT_MUXER) += rcwtenc.o subtitles.o
OBJS-$(CONFIG_REALTEXT_DEMUXER) += realtextdec.o subtitles.o
OBJS-$(CONFIG_REDSPARK_DEMUXER) += redspark.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 9df42bb87a..ae925dcf60 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -391,6 +391,7 @@ extern const FFInputFormat ff_qoa_demuxer;
extern const FFInputFormat ff_r3d_demuxer;
extern const FFInputFormat ff_rawvideo_demuxer;
extern const FFOutputFormat ff_rawvideo_muxer;
+extern const FFInputFormat ff_rcwt_demuxer;
extern const FFOutputFormat ff_rcwt_muxer;
extern const FFInputFormat ff_realtext_demuxer;
extern const FFInputFormat ff_redspark_demuxer;
diff --git a/libavformat/rcwtdec.c b/libavformat/rcwtdec.c
new file mode 100644
index 0000000000..91f994c3ab
--- /dev/null
+++ b/libavformat/rcwtdec.c
@@ -0,0 +1,123 @@
+/*
+ * RCWT (Raw Captions With Time) demuxer
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * 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.
+ *
+ * This demuxer implements the specification as of March 2024, which has
+ * been stable and unchanged since April 2014.
+ *
+ * A free specification of RCWT can be found here:
+ * @url{https://github.com/CCExtractor/ccextractor/blob/master/docs/BINARY_FILE_FORMAT.TXT}
+ */
+
+#include "avformat.h"
+#include "demux.h"
+#include "internal.h"
+#include "subtitles.h"
+#include "libavutil/intreadwrite.h"
+
+#define RCWT_HEADER_SIZE 11
+
+typedef struct RCWTContext {
+ FFDemuxSubtitlesQueue q;
+} RCWTContext;
+
+static int rcwt_read_header(AVFormatContext *avf)
+{
+ RCWTContext *rcwt = avf->priv_data;
+
+ AVStream *st;
+ uint8_t header[RCWT_HEADER_SIZE];
+ int ret;
+
+ /* read header */
+ ret = ffio_read_size(avf->pb, header, RCWT_HEADER_SIZE);
+ if (ret < 0)
+ return ret;
+
+ if (AV_RB16(header + 6) != 0x0001) {
+ av_log(avf, AV_LOG_ERROR, "RCWT format version is not compatible "
+ "(only version 0.001 is known)\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ av_log(avf, AV_LOG_DEBUG, "RCWT writer application: %02X version: %02x\n",
+ header[3], header[5]);
+
+ /* setup stream */
+ st = avformat_new_stream(avf, NULL);
+ if (!st)
+ return AVERROR(ENOMEM);
+
+ st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE;
+ st->codecpar->codec_id = AV_CODEC_ID_EIA_608;
+
+ avpriv_set_pts_info(st, 64, 1, 1000);
+
+ /* demux */
+ while (!avio_feof(avf->pb)) {
+ AVPacket *sub;
+ int64_t cluster_pos = avio_tell(avf->pb);
+ int64_t cluster_pts = avio_rl64(avf->pb);
+ int cluster_nb_blocks = avio_rl16(avf->pb);
+
+ if (cluster_nb_blocks == 0)
+ continue;
+
+ sub = ff_subtitles_queue_insert(&rcwt->q, NULL, 0, 0);
+ if (!sub)
+ return AVERROR(ENOMEM);
+
+ ret = av_get_packet(avf->pb, sub, cluster_nb_blocks * 3);
+ if (ret < 0)
+ return ret;
+
+ sub->pos = cluster_pos;
+ sub->pts = cluster_pts;
+ }
+
+ ff_subtitles_queue_finalize(avf, &rcwt->q);
+
+ return 0;
+}
+
+static int rcwt_probe(const AVProbeData *p)
+{
+ return p->buf_size > RCWT_HEADER_SIZE &&
+ AV_RB16(p->buf) == 0xCCCC &&
+ AV_RB8(p->buf + 2) == 0xED &&
+ AV_RB16(p->buf + 6) == 0x0001 ? 50 : 0;
+}
+
+const FFInputFormat ff_rcwt_demuxer = {
+ .p.name = "rcwt",
+ .p.long_name = NULL_IF_CONFIG_SMALL("RCWT (Raw Captions With Time)"),
+ .p.extensions = "bin",
+ .p.flags = AVFMT_TS_DISCONT,
+ .priv_data_size = sizeof(RCWTContext),
+ .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
+ .read_probe = rcwt_probe,
+ .read_header = rcwt_read_header,
+ .read_packet = ff_subtitles_read_packet,
+ .read_seek2 = ff_subtitles_read_seek,
+ .read_close = ff_subtitles_read_close
+};
--
2.34.1
_______________________________________________
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] 16+ messages in thread
* [FFmpeg-devel] [PATCH v10 3/5] avformat/rcwtenc: remove repeated documentation
2024-03-28 20:11 [FFmpeg-devel] [PATCH v10 0/5] RCWT Closed Captions demuxer (v10) Marth64
2024-03-28 20:11 ` [FFmpeg-devel] [PATCH v10 1/5] avformat/subtitles: extend ff_subtitles_queue_insert() to support not yet available events Marth64
2024-03-28 20:11 ` [FFmpeg-devel] [PATCH v10 2/5] avformat/rcwtdec: add RCWT Closed Captions demuxer Marth64
@ 2024-03-28 20:11 ` Marth64
2024-03-28 20:11 ` [FFmpeg-devel] [PATCH v10 4/5] doc/muxers: refresh the RCWT muxer's doc to be consistent with the demuxer Marth64
` (2 subsequent siblings)
5 siblings, 0 replies; 16+ messages in thread
From: Marth64 @ 2024-03-28 20:11 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Marth64
The high level summary of RCWT can be delegated doc/muxers, which
makes it easier to maintain and more consistent with the documentation
of the demuxer.
Signed-off-by: Marth64 <marth64@proxyid.net>
---
libavformat/rcwtenc.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/libavformat/rcwtenc.c b/libavformat/rcwtenc.c
index f2459ef1d3..e06bc4b734 100644
--- a/libavformat/rcwtenc.c
+++ b/libavformat/rcwtenc.c
@@ -21,11 +21,6 @@
/*
* 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.
- * It can be used to archive the original, raw CC bitstream and to produce
- * a source file for later CC processing or conversion. As a result,
- * it also allows for interopability with ccextractor for processing CC data
- * extracted via ffmpeg. The format is simple to parse and can be used
- * to retain all lines and variants of CC.
*
* This muxer implements the specification as of March 2024, which has
* been stable and unchanged since April 2014.
--
2.34.1
_______________________________________________
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] 16+ messages in thread
* [FFmpeg-devel] [PATCH v10 4/5] doc/muxers: refresh the RCWT muxer's doc to be consistent with the demuxer
2024-03-28 20:11 [FFmpeg-devel] [PATCH v10 0/5] RCWT Closed Captions demuxer (v10) Marth64
` (2 preceding siblings ...)
2024-03-28 20:11 ` [FFmpeg-devel] [PATCH v10 3/5] avformat/rcwtenc: remove repeated documentation Marth64
@ 2024-03-28 20:11 ` Marth64
2024-03-28 20:11 ` [FFmpeg-devel] [PATCH v10 5/5] doc/indevs: update CC extraction example to use RCWT muxer Marth64
2024-03-29 9:58 ` [FFmpeg-devel] [PATCH v10 0/5] RCWT Closed Captions demuxer (v10) Stefano Sabatini
5 siblings, 0 replies; 16+ messages in thread
From: Marth64 @ 2024-03-28 20:11 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Marth64
Signed-off-by: Marth64 <marth64@proxyid.net>
---
doc/muxers.texi | 29 +++++++++++++++++++----------
1 file changed, 19 insertions(+), 10 deletions(-)
diff --git a/doc/muxers.texi b/doc/muxers.texi
index a10a8e216f..4161401059 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -3038,19 +3038,18 @@ ogg files can be safely chained.
@end table
-@anchor{rcwt}
+@anchor{rcwtenc}
@section rcwt
-Raw Captions With Time (RCWT) is a format native to ccextractor, a commonly
-used open source tool for processing 608/708 closed caption (CC) sources.
-It can be used to archive the original, raw CC bitstream and to produce
-a source file for later CC processing or conversion. As a result,
-it also allows for interopability with ccextractor for processing CC data
-extracted via ffmpeg. The format is simple to parse and can be used
-to retain all lines and variants of CC.
+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.
+It can be used to archive the original extracted CC bitstream and to produce
+a source file for later processing or conversion. The format allows
+for interoperability between ccextractor and FFmpeg, is simple to parse,
+and can be used to create a backup of the CC presentation.
-This muxer implements the specification as of 2024-01-05, which has
-been stable and unchanged for 10 years as of this writing.
+This muxer implements the specification as of March 2024, which has
+been stable and unchanged since April 2014.
This muxer will have some nuances from the way that ccextractor muxes RCWT.
No compatibility issues when processing the output with ccextractor
@@ -3060,6 +3059,16 @@ and outputs will not be a bit-exact match.
A free specification of RCWT can be found here:
@url{https://github.com/CCExtractor/ccextractor/blob/master/docs/BINARY_FILE_FORMAT.TXT}
+@subsection Examples
+
+@itemize
+@item
+Extract Closed Captions to RCWT using lavfi:
+@example
+ffmpeg -f lavfi -i "movie=INPUT.mkv[out+subcc]" -map 0:s:0 -c:s copy CC.rcwt.bin
+@end example
+@end itemize
+
@anchor{segment}
@section segment, stream_segment, ssegment
--
2.34.1
_______________________________________________
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] 16+ messages in thread
* [FFmpeg-devel] [PATCH v10 5/5] doc/indevs: update CC extraction example to use RCWT muxer
2024-03-28 20:11 [FFmpeg-devel] [PATCH v10 0/5] RCWT Closed Captions demuxer (v10) Marth64
` (3 preceding siblings ...)
2024-03-28 20:11 ` [FFmpeg-devel] [PATCH v10 4/5] doc/muxers: refresh the RCWT muxer's doc to be consistent with the demuxer Marth64
@ 2024-03-28 20:11 ` Marth64
2024-03-29 9:58 ` [FFmpeg-devel] [PATCH v10 0/5] RCWT Closed Captions demuxer (v10) Stefano Sabatini
5 siblings, 0 replies; 16+ messages in thread
From: Marth64 @ 2024-03-28 20:11 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Marth64
Signed-off-by: Marth64 <marth64@proxyid.net>
---
doc/indevs.texi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/doc/indevs.texi b/doc/indevs.texi
index d1b2bacf8b..fc14737181 100644
--- a/doc/indevs.texi
+++ b/doc/indevs.texi
@@ -1069,9 +1069,9 @@ ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]"
@end example
@item
-Dump decoded frames to images and closed captions to a file (experimental):
+Dump decoded frames to images and Closed Captions to an RCWT backup:
@example
-ffmpeg -f lavfi -i "movie=test.ts[out0+subcc]" -map v frame%08d.png -map s -c copy -f rawvideo subcc.bin
+ffmpeg -f lavfi -i "movie=test.ts[out0+subcc]" -map v frame%08d.png -map s -c copy subcc.bin
@end example
@end itemize
--
2.34.1
_______________________________________________
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] 16+ messages in thread
* Re: [FFmpeg-devel] [PATCH v10 0/5] RCWT Closed Captions demuxer (v10)
2024-03-28 20:11 [FFmpeg-devel] [PATCH v10 0/5] RCWT Closed Captions demuxer (v10) Marth64
` (4 preceding siblings ...)
2024-03-28 20:11 ` [FFmpeg-devel] [PATCH v10 5/5] doc/indevs: update CC extraction example to use RCWT muxer Marth64
@ 2024-03-29 9:58 ` Stefano Sabatini
5 siblings, 0 replies; 16+ messages in thread
From: Stefano Sabatini @ 2024-03-29 9:58 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Marth64
On date Thursday 2024-03-28 15:11:27 -0500, Marth64 wrote:
> Since v7/8:
> * Addresses last known feedback (about av_assert call)
> * Changelog entry removed, since v7.0 is cut and there is no "next" space yet
> (will make patch once available)
>
> Signed-off-by: Marth64 <marth64@proxyid.net>
Will apply soon if I see no more comments, thanks.
_______________________________________________
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] 16+ messages in thread
* Re: [FFmpeg-devel] [PATCH v10 2/5] avformat/rcwtdec: add RCWT Closed Captions demuxer
2024-03-28 20:11 ` [FFmpeg-devel] [PATCH v10 2/5] avformat/rcwtdec: add RCWT Closed Captions demuxer Marth64
@ 2024-03-29 11:51 ` Tomas Härdin
2024-03-29 14:28 ` Marth64
2024-03-30 0:23 ` Michael Niedermayer
1 sibling, 1 reply; 16+ messages in thread
From: Tomas Härdin @ 2024-03-29 11:51 UTC (permalink / raw)
To: FFmpeg development discussions and patches
> + /* demux */
> + while (!avio_feof(avf->pb)) {
Can we please get away from this way of reading subtitles? Every other
type of media (audio, video) are capable of being streamed, but not
subtitles, precisely because all of them do all parsing in the
read_header() call. We have a perfectly good generic index and seeking
functionality. My recent experiment with srt shows it's possible to
read packets in read_packet() like every other demuxer..
/Tomas
_______________________________________________
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] 16+ messages in thread
* Re: [FFmpeg-devel] [PATCH v10 2/5] avformat/rcwtdec: add RCWT Closed Captions demuxer
2024-03-29 11:51 ` Tomas Härdin
@ 2024-03-29 14:28 ` Marth64
2024-03-29 17:21 ` Tomas Härdin
0 siblings, 1 reply; 16+ messages in thread
From: Marth64 @ 2024-03-29 14:28 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Tomas Härdin:
> Can we please get away from this way of reading subtitles? Every other
> type of media (audio, video) are capable of being streamed, but not
> subtitles, precisely because all of them do all parsing in the
> read_header() call. We have a perfectly good generic index and seeking
> functionality. My recent experiment with srt shows it's possible to
> read packets in read_packet() like every other demuxer..
Is there an example I can follow? Is this something that can be fixed
in an enhancement patch or is it a deal-breaker to merge this?
_______________________________________________
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] 16+ messages in thread
* Re: [FFmpeg-devel] [PATCH v10 2/5] avformat/rcwtdec: add RCWT Closed Captions demuxer
2024-03-29 14:28 ` Marth64
@ 2024-03-29 17:21 ` Tomas Härdin
2024-03-29 18:03 ` Marth64
0 siblings, 1 reply; 16+ messages in thread
From: Tomas Härdin @ 2024-03-29 17:21 UTC (permalink / raw)
To: FFmpeg development discussions and patches
fre 2024-03-29 klockan 09:28 -0500 skrev Marth64:
> Tomas Härdin:
> > Can we please get away from this way of reading subtitles? Every
> > other
> > type of media (audio, video) are capable of being streamed, but not
> > subtitles, precisely because all of them do all parsing in the
> > read_header() call. We have a perfectly good generic index and
> > seeking
> > functionality. My recent experiment with srt shows it's possible to
> > read packets in read_packet() like every other demuxer..
>
> Is there an example I can follow?
Not yet, but perhaps once I get my srtdec patchset through there will
be something to follow. Might follow it up with a similar patch for
webvttdec
> Is this something that can be fixed
> in an enhancement patch or is it a deal-breaker to merge this?
Nah it can be done at a later point as an enhancement if you prefer
/Tomas
_______________________________________________
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] 16+ messages in thread
* Re: [FFmpeg-devel] [PATCH v10 2/5] avformat/rcwtdec: add RCWT Closed Captions demuxer
2024-03-29 17:21 ` Tomas Härdin
@ 2024-03-29 18:03 ` Marth64
0 siblings, 0 replies; 16+ messages in thread
From: Marth64 @ 2024-03-29 18:03 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Tomas Härdin :
> once I get my srtdec patchset through there will
> be something to follow.
I see the patch now. I agree, this looks like a good step. Thank you!
> Nah it can be done at a later point as an enhancement if you prefer
Yes, please. I am happy to do it, but I think will be
smoother to do after an example is there (since it introduces
a new pattern for subtitles). Thank you for understanding.
_______________________________________________
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] 16+ messages in thread
* Re: [FFmpeg-devel] [PATCH v10 2/5] avformat/rcwtdec: add RCWT Closed Captions demuxer
2024-03-28 20:11 ` [FFmpeg-devel] [PATCH v10 2/5] avformat/rcwtdec: add RCWT Closed Captions demuxer Marth64
2024-03-29 11:51 ` Tomas Härdin
@ 2024-03-30 0:23 ` Michael Niedermayer
2024-03-30 14:55 ` Stefano Sabatini
1 sibling, 1 reply; 16+ messages in thread
From: Michael Niedermayer @ 2024-03-30 0:23 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 986 bytes --]
On Thu, Mar 28, 2024 at 03:11:29PM -0500, Marth64 wrote:
[...]
> +static int rcwt_probe(const AVProbeData *p)
> +{
> + return p->buf_size > RCWT_HEADER_SIZE &&
> + AV_RB16(p->buf) == 0xCCCC &&
> + AV_RB8(p->buf + 2) == 0xED &&
> + AV_RB16(p->buf + 6) == 0x0001 ? 50 : 0;
> +}
> +
> +const FFInputFormat ff_rcwt_demuxer = {
> + .p.name = "rcwt",
> + .p.long_name = NULL_IF_CONFIG_SMALL("RCWT (Raw Captions With Time)"),
> + .p.extensions = "bin",
this causes a mp3 i have to be misdetected
~/videos/sbQ9.bin
(this is a actual file i had not a file crafted for this)
i think the entry for extensions should be removed (which fixes this)
having a ".bin" is not a strong indication that its rcwt
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
During times of universal deceit, telling the truth becomes a
revolutionary act. -- George Orwell
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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] 16+ messages in thread
* Re: [FFmpeg-devel] [PATCH v10 2/5] avformat/rcwtdec: add RCWT Closed Captions demuxer
2024-03-30 0:23 ` Michael Niedermayer
@ 2024-03-30 14:55 ` Stefano Sabatini
2024-03-30 17:12 ` Marth64
2024-03-31 15:07 ` Michael Niedermayer
0 siblings, 2 replies; 16+ messages in thread
From: Stefano Sabatini @ 2024-03-30 14:55 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On date Saturday 2024-03-30 01:23:53 +0100, Michael Niedermayer wrote:
> On Thu, Mar 28, 2024 at 03:11:29PM -0500, Marth64 wrote:
> [...]
>
> > +static int rcwt_probe(const AVProbeData *p)
> > +{
> > + return p->buf_size > RCWT_HEADER_SIZE &&
> > + AV_RB16(p->buf) == 0xCCCC &&
> > + AV_RB8(p->buf + 2) == 0xED &&
> > + AV_RB16(p->buf + 6) == 0x0001 ? 50 : 0;
> > +}
> > +
> > +const FFInputFormat ff_rcwt_demuxer = {
> > + .p.name = "rcwt",
> > + .p.long_name = NULL_IF_CONFIG_SMALL("RCWT (Raw Captions With Time)"),
> > + .p.extensions = "bin",
>
> this causes a mp3 i have to be misdetected
> ~/videos/sbQ9.bin
> (this is a actual file i had not a file crafted for this)
>
> i think the entry for extensions should be removed (which fixes this)
> having a ".bin" is not a strong indication that its rcwt
Is this blocking or can it be addressed later? Also, if this needs to
be modified the muxer should be as well.
_______________________________________________
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] 16+ messages in thread
* Re: [FFmpeg-devel] [PATCH v10 2/5] avformat/rcwtdec: add RCWT Closed Captions demuxer
2024-03-30 14:55 ` Stefano Sabatini
@ 2024-03-30 17:12 ` Marth64
2024-03-31 15:07 ` Michael Niedermayer
1 sibling, 0 replies; 16+ messages in thread
From: Marth64 @ 2024-03-30 17:12 UTC (permalink / raw)
To: FFmpeg development discussions and patches
> i think the entry for extensions should be removed (which fixes this)
> having a ".bin" is not a strong indication that its rcwt
> Is this blocking or can it be addressed later? Also, if this needs to
> be modified the muxer should be as well.
I can address both today in a new set. .bin is pretty generic
(although it is what ccextractor uses), so I get it. Thanks.
_______________________________________________
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] 16+ messages in thread
* Re: [FFmpeg-devel] [PATCH v10 2/5] avformat/rcwtdec: add RCWT Closed Captions demuxer
2024-03-30 14:55 ` Stefano Sabatini
2024-03-30 17:12 ` Marth64
@ 2024-03-31 15:07 ` Michael Niedermayer
2024-04-02 5:15 ` Marth64
1 sibling, 1 reply; 16+ messages in thread
From: Michael Niedermayer @ 2024-03-31 15:07 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 1503 bytes --]
On Sat, Mar 30, 2024 at 03:55:13PM +0100, Stefano Sabatini wrote:
> On date Saturday 2024-03-30 01:23:53 +0100, Michael Niedermayer wrote:
> > On Thu, Mar 28, 2024 at 03:11:29PM -0500, Marth64 wrote:
> > [...]
> >
> > > +static int rcwt_probe(const AVProbeData *p)
> > > +{
> > > + return p->buf_size > RCWT_HEADER_SIZE &&
> > > + AV_RB16(p->buf) == 0xCCCC &&
> > > + AV_RB8(p->buf + 2) == 0xED &&
> > > + AV_RB16(p->buf + 6) == 0x0001 ? 50 : 0;
> > > +}
> > > +
> > > +const FFInputFormat ff_rcwt_demuxer = {
> > > + .p.name = "rcwt",
> > > + .p.long_name = NULL_IF_CONFIG_SMALL("RCWT (Raw Captions With Time)"),
> > > + .p.extensions = "bin",
> >
>
> > this causes a mp3 i have to be misdetected
> > ~/videos/sbQ9.bin
> > (this is a actual file i had not a file crafted for this)
> >
> > i think the entry for extensions should be removed (which fixes this)
> > having a ".bin" is not a strong indication that its rcwt
>
> Is this blocking or can it be addressed later? Also, if this needs to
droping the "bin" from the demuxer should be trivial to do, the extension
is IIRC used mainly for probing and its wrong for probing to associate bin with
any specific format.
> be modified the muxer should be as well.
maybe, yes
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
What does censorship reveal? It reveals fear. -- Julian Assange
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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] 16+ messages in thread
* Re: [FFmpeg-devel] [PATCH v10 2/5] avformat/rcwtdec: add RCWT Closed Captions demuxer
2024-03-31 15:07 ` Michael Niedermayer
@ 2024-04-02 5:15 ` Marth64
0 siblings, 0 replies; 16+ messages in thread
From: Marth64 @ 2024-04-02 5:15 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Sorry for the delay, v11 coming shortly with the fix.
_______________________________________________
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] 16+ messages in thread
end of thread, other threads:[~2024-04-02 5:16 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-28 20:11 [FFmpeg-devel] [PATCH v10 0/5] RCWT Closed Captions demuxer (v10) Marth64
2024-03-28 20:11 ` [FFmpeg-devel] [PATCH v10 1/5] avformat/subtitles: extend ff_subtitles_queue_insert() to support not yet available events Marth64
2024-03-28 20:11 ` [FFmpeg-devel] [PATCH v10 2/5] avformat/rcwtdec: add RCWT Closed Captions demuxer Marth64
2024-03-29 11:51 ` Tomas Härdin
2024-03-29 14:28 ` Marth64
2024-03-29 17:21 ` Tomas Härdin
2024-03-29 18:03 ` Marth64
2024-03-30 0:23 ` Michael Niedermayer
2024-03-30 14:55 ` Stefano Sabatini
2024-03-30 17:12 ` Marth64
2024-03-31 15:07 ` Michael Niedermayer
2024-04-02 5:15 ` Marth64
2024-03-28 20:11 ` [FFmpeg-devel] [PATCH v10 3/5] avformat/rcwtenc: remove repeated documentation Marth64
2024-03-28 20:11 ` [FFmpeg-devel] [PATCH v10 4/5] doc/muxers: refresh the RCWT muxer's doc to be consistent with the demuxer Marth64
2024-03-28 20:11 ` [FFmpeg-devel] [PATCH v10 5/5] doc/indevs: update CC extraction example to use RCWT muxer Marth64
2024-03-29 9:58 ` [FFmpeg-devel] [PATCH v10 0/5] RCWT Closed Captions demuxer (v10) Stefano Sabatini
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