Hello

Please see my below patch for a raw stream muxer which is capable of mixing raw 
streams to files without any container. I find this useful when analysing 
unknown stream formats.

Regards Timothy

From: Timothy Crass <[email protected]>
Date: Sun, 8 Feb 2026 21:58:46 +0000
Subject: [PATCH] libavformat: Add raw stream muxer

This patch adds a raw stream muxer
which is capable of muxing raw streams into
a file with no container this is particularly
useful for extracting unknown streams from containers
for analysis
---
 doc/muxers.texi          | 3 +++
 libavformat/Makefile     | 1 +
 libavformat/allformats.c | 1 +
 libavformat/rawenc.c     | 9 +++++++++
 libavformat/version.h    | 4 ++--
 5 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/doc/muxers.texi b/doc/muxers.texi
index e1f737b1d9..a54d550b28 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -156,6 +156,9 @@ AV1 low overhead Open Bitstream Units muxer.
 Temporal delimiter OBUs will be inserted in all temporal units of the
 stream.
 
+@item rawstream @emph{video|audio}
+Mux any stream to a file verbatim with no container
+
 @item rawvideo @emph{video} (yuv, rgb)
 Raw uncompressed video.
 
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 5b8564bf54..1d548b26b7 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -509,6 +509,7 @@ OBJS-$(CONFIG_PVF_DEMUXER)               += pvfdec.o pcm.o
 OBJS-$(CONFIG_QCP_DEMUXER)               += qcp.o
 OBJS-$(CONFIG_QOA_DEMUXER)               += qoadec.o
 OBJS-$(CONFIG_R3D_DEMUXER)               += r3d.o
+OBJS-$(CONFIG_RAWSTREAM_MUXER)           += rawenc.o
 OBJS-$(CONFIG_RAWVIDEO_DEMUXER)          += rawvideodec.o
 OBJS-$(CONFIG_RAWVIDEO_MUXER)            += rawenc.o
 OBJS-$(CONFIG_RCWT_DEMUXER)              += rcwtdec.o subtitles.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 6ec361fb7b..15b86406a3 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -395,6 +395,7 @@ extern const FFInputFormat  ff_pvf_demuxer;
 extern const FFInputFormat  ff_qcp_demuxer;
 extern const FFInputFormat  ff_qoa_demuxer;
 extern const FFInputFormat  ff_r3d_demuxer;
+extern const FFOutputFormat ff_rawstream_muxer;
 extern const FFInputFormat  ff_rawvideo_demuxer;
 extern const FFOutputFormat ff_rawvideo_muxer;
 extern const FFInputFormat  ff_rcwt_demuxer;
diff --git a/libavformat/rawenc.c b/libavformat/rawenc.c
index cf298d223d..d022088ed7 100644
--- a/libavformat/rawenc.c
+++ b/libavformat/rawenc.c
@@ -587,6 +587,15 @@ const FFOutputFormat ff_obu_muxer = {
 };
 #endif
 
+#if CONFIG_RAWSTREAM_MUXER
+const FFOutputFormat ff_rawstream_muxer = {
+    .p.name            = "rawstream",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw stream"),
+    .write_packet      = ff_raw_write_packet,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
+};
+#endif
+
 #if CONFIG_RAWVIDEO_MUXER
 const FFOutputFormat ff_rawvideo_muxer = {
     .p.name            = "rawvideo",
diff --git a/libavformat/version.h b/libavformat/version.h
index 1d3a53875a..1b079ebce8 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -31,8 +31,8 @@
 
 #include "version_major.h"
 
-#define LIBAVFORMAT_VERSION_MINOR   8
-#define LIBAVFORMAT_VERSION_MICRO 102
+#define LIBAVFORMAT_VERSION_MINOR   9
+#define LIBAVFORMAT_VERSION_MICRO 100
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
                                                LIBAVFORMAT_VERSION_MINOR, \
-- 
2.51.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to