diff --git a/configure b/configure
index 6e88c32223..b1a6eca3b3 100755
--- a/configure
+++ b/configure
@@ -4003,9 +4003,9 @@ find_filters_extern(){
 }
 
 FILTER_LIST=$(find_filters_extern libavfilter/allfilters.c)
-OUTDEV_LIST=$(find_things_extern muxer AVOutputFormat libavdevice/alldevices.c outdev)
+OUTDEV_LIST=$(find_things_extern muxer FFOutputFormat libavdevice/alldevices.c outdev)
 INDEV_LIST=$(find_things_extern demuxer AVInputFormat libavdevice/alldevices.c indev)
-MUXER_LIST=$(find_things_extern muxer AVOutputFormat libavformat/allformats.c)
+MUXER_LIST=$(find_things_extern muxer FFOutputFormat libavformat/allformats.c)
 DEMUXER_LIST=$(find_things_extern demuxer AVInputFormat libavformat/allformats.c)
 ENCODER_LIST=$(find_things_extern encoder FFCodec libavcodec/allcodecs.c)
 DECODER_LIST=$(find_things_extern decoder FFCodec libavcodec/allcodecs.c)
@@ -7951,9 +7951,9 @@ print_enabled_components libavcodec/codec_list.c FFCodec codec_list $CODEC_LIST
 print_enabled_components libavcodec/parser_list.c AVCodecParser parser_list $PARSER_LIST
 print_enabled_components libavcodec/bsf_list.c FFBitStreamFilter bitstream_filters $BSF_LIST
 print_enabled_components libavformat/demuxer_list.c AVInputFormat demuxer_list $DEMUXER_LIST
-print_enabled_components libavformat/muxer_list.c AVOutputFormat muxer_list $MUXER_LIST
+print_enabled_components libavformat/muxer_list.c FFOutputFormat muxer_list $MUXER_LIST
 print_enabled_components libavdevice/indev_list.c AVInputFormat indev_list $INDEV_LIST
-print_enabled_components libavdevice/outdev_list.c AVOutputFormat outdev_list $OUTDEV_LIST
+print_enabled_components libavdevice/outdev_list.c FFOutputFormat outdev_list $OUTDEV_LIST
 print_enabled_components libavformat/protocol_list.c URLProtocol url_protocols $PROTOCOL_LIST
 
 # Settings for pkg-config files
diff --git a/libavdevice/alldevices.c b/libavdevice/alldevices.c
index 22323a0a44..8a90fcb5d7 100644
--- a/libavdevice/alldevices.c
+++ b/libavdevice/alldevices.c
@@ -19,40 +19,41 @@
  */
 
 #include "libavformat/internal.h"
+#include "libavformat/mux.h"
 #include "avdevice.h"
 
 /* devices */
 extern const AVInputFormat  ff_alsa_demuxer;
-extern const AVOutputFormat ff_alsa_muxer;
+extern const FFOutputFormat ff_alsa_muxer;
 extern const AVInputFormat  ff_android_camera_demuxer;
-extern const AVOutputFormat ff_audiotoolbox_muxer;
+extern const FFOutputFormat ff_audiotoolbox_muxer;
 extern const AVInputFormat  ff_avfoundation_demuxer;
 extern const AVInputFormat  ff_bktr_demuxer;
-extern const AVOutputFormat ff_caca_muxer;
+extern const FFOutputFormat ff_caca_muxer;
 extern const AVInputFormat  ff_decklink_demuxer;
-extern const AVOutputFormat ff_decklink_muxer;
+extern const FFOutputFormat ff_decklink_muxer;
 extern const AVInputFormat  ff_dshow_demuxer;
 extern const AVInputFormat  ff_fbdev_demuxer;
-extern const AVOutputFormat ff_fbdev_muxer;
+extern const FFOutputFormat ff_fbdev_muxer;
 extern const AVInputFormat  ff_gdigrab_demuxer;
 extern const AVInputFormat  ff_iec61883_demuxer;
 extern const AVInputFormat  ff_jack_demuxer;
 extern const AVInputFormat  ff_kmsgrab_demuxer;
 extern const AVInputFormat  ff_lavfi_demuxer;
 extern const AVInputFormat  ff_openal_demuxer;
-extern const AVOutputFormat ff_opengl_muxer;
+extern const FFOutputFormat ff_opengl_muxer;
 extern const AVInputFormat  ff_oss_demuxer;
-extern const AVOutputFormat ff_oss_muxer;
+extern const FFOutputFormat ff_oss_muxer;
 extern const AVInputFormat  ff_pulse_demuxer;
-extern const AVOutputFormat ff_pulse_muxer;
-extern const AVOutputFormat ff_sdl2_muxer;
+extern const FFOutputFormat ff_pulse_muxer;
+extern const FFOutputFormat ff_sdl2_muxer;
 extern const AVInputFormat  ff_sndio_demuxer;
-extern const AVOutputFormat ff_sndio_muxer;
+extern const FFOutputFormat ff_sndio_muxer;
 extern const AVInputFormat  ff_v4l2_demuxer;
-extern const AVOutputFormat ff_v4l2_muxer;
+extern const FFOutputFormat ff_v4l2_muxer;
 extern const AVInputFormat  ff_vfwcap_demuxer;
 extern const AVInputFormat  ff_xcbgrab_demuxer;
-extern const AVOutputFormat ff_xv_muxer;
+extern const FFOutputFormat ff_xv_muxer;
 
 /* external libraries */
 extern const AVInputFormat  ff_libcdio_demuxer;
@@ -97,12 +98,12 @@ static const void *next_output(const AVOutputFormat *prev, AVClassCategory c2)
     const AVClass *pc;
     const AVClassCategory c1 = AV_CLASS_CATEGORY_DEVICE_OUTPUT;
     AVClassCategory category = AV_CLASS_CATEGORY_NA;
-    const AVOutputFormat *fmt = NULL;
+    const FFOutputFormat *fmt = NULL;
     int i = 0;
 
     while (prev && (fmt = outdev_list[i])) {
         i++;
-        if (prev == fmt)
+        if (prev == &fmt->p)
             break;
     }
 
@@ -110,7 +111,7 @@ static const void *next_output(const AVOutputFormat *prev, AVClassCategory c2)
         fmt = outdev_list[i++];
         if (!fmt)
             break;
-        pc = fmt->priv_class;
+        pc = fmt->p.priv_class;
         if (!pc)
             continue;
         category = pc->category;
diff --git a/libavdevice/alsa_enc.c b/libavdevice/alsa_enc.c
index e461829d03..62a20c7ba4 100644
--- a/libavdevice/alsa_enc.c
+++ b/libavdevice/alsa_enc.c
@@ -165,18 +165,18 @@ static const AVClass alsa_muxer_class = {
     .category       = AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT,
 };
 
-const AVOutputFormat ff_alsa_muxer = {
-    .name           = "alsa",
-    .long_name      = NULL_IF_CONFIG_SMALL("ALSA audio output"),
+const FFOutputFormat ff_alsa_muxer = {
+    .p.name         = "alsa",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("ALSA audio output"),
     .priv_data_size = sizeof(AlsaData),
-    .audio_codec    = DEFAULT_CODEC_ID,
-    .video_codec    = AV_CODEC_ID_NONE,
+    .p.audio_codec  = DEFAULT_CODEC_ID,
+    .p.video_codec  = AV_CODEC_ID_NONE,
     .write_header   = audio_write_header,
     .write_packet   = audio_write_packet,
     .write_trailer  = ff_alsa_close,
     .write_uncoded_frame = audio_write_frame,
     .get_device_list = audio_get_device_list,
     .get_output_timestamp = audio_get_output_timestamp,
-    .flags          = AVFMT_NOFILE,
-    .priv_class     = &alsa_muxer_class,
+    .p.flags        = AVFMT_NOFILE,
+    .p.priv_class   = &alsa_muxer_class,
 };
diff --git a/libavdevice/audiotoolbox.m b/libavdevice/audiotoolbox.m
index 27a1fd4a78..aa49e2c992 100644
--- a/libavdevice/audiotoolbox.m
+++ b/libavdevice/audiotoolbox.m
@@ -30,6 +30,7 @@
 
 #include "libavutil/opt.h"
 #include "libavformat/internal.h"
+#include "libavformat/mux.h"
 #include "libavutil/internal.h"
 #include "avdevice.h"
 
@@ -294,15 +295,15 @@ static const AVClass at_class = {
     .category   = AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT,
 };
 
-const AVOutputFormat ff_audiotoolbox_muxer = {
-    .name           = "audiotoolbox",
-    .long_name      = NULL_IF_CONFIG_SMALL("AudioToolbox output device"),
+const FFOutputFormat ff_audiotoolbox_muxer = {
+    .p.name         = "audiotoolbox",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("AudioToolbox output device"),
     .priv_data_size = sizeof(ATContext),
-    .audio_codec    = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
-    .video_codec    = AV_CODEC_ID_NONE,
+    .p.audio_codec  = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
+    .p.video_codec  = AV_CODEC_ID_NONE,
     .write_header   = at_write_header,
     .write_packet   = at_write_packet,
     .write_trailer  = at_write_trailer,
-    .flags          = AVFMT_NOFILE,
-    .priv_class     = &at_class,
+    .p.flags        = AVFMT_NOFILE,
+    .p.priv_class   = &at_class,
 };
diff --git a/libavdevice/avdevice.c b/libavdevice/avdevice.c
index f3c87a6777..38110ddfdb 100644
--- a/libavdevice/avdevice.c
+++ b/libavdevice/avdevice.c
@@ -19,13 +19,14 @@
 #include "libavutil/avassert.h"
 #include "avdevice.h"
 #include "internal.h"
+#include "libavformat/mux.h"
 
 int avdevice_app_to_dev_control_message(struct AVFormatContext *s, enum AVAppToDevMessageType type,
                                         void *data, size_t data_size)
 {
-    if (!s->oformat || !s->oformat->control_message)
+    if (!s->oformat || !ffofmt(s->oformat)->control_message)
         return AVERROR(ENOSYS);
-    return s->oformat->control_message(s, type, data, data_size);
+    return ffofmt(s->oformat)->control_message(s, type, data, data_size);
 }
 
 int avdevice_dev_to_app_control_message(struct AVFormatContext *s, enum AVDevToAppMessageType type,
@@ -42,7 +43,7 @@ int avdevice_list_devices(AVFormatContext *s, AVDeviceInfoList **device_list)
     av_assert0(s);
     av_assert0(device_list);
     av_assert0(s->oformat || s->iformat);
-    if ((s->oformat && !s->oformat->get_device_list) ||
+    if ((s->oformat && !ffofmt(s->oformat)->get_device_list) ||
         (s->iformat && !s->iformat->get_device_list)) {
         *device_list = NULL;
         return AVERROR(ENOSYS);
@@ -53,7 +54,7 @@ int avdevice_list_devices(AVFormatContext *s, AVDeviceInfoList **device_list)
     /* no default device by default */
     (*device_list)->default_device = -1;
     if (s->oformat)
-        ret = s->oformat->get_device_list(s, *device_list);
+        ret = ffofmt(s->oformat)->get_device_list(s, *device_list);
     else
         ret = s->iformat->get_device_list(s, *device_list);
     if (ret < 0) {
diff --git a/libavdevice/caca.c b/libavdevice/caca.c
index 5536fd036e..6af1649137 100644
--- a/libavdevice/caca.c
+++ b/libavdevice/caca.c
@@ -21,6 +21,7 @@
 #include <caca.h>
 #include "libavutil/opt.h"
 #include "libavutil/pixdesc.h"
+#include "libavformat/mux.h"
 #include "avdevice.h"
 
 typedef struct CACAContext {
@@ -220,15 +221,15 @@ static const AVClass caca_class = {
     .category   = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT,
 };
 
-const AVOutputFormat ff_caca_muxer = {
-    .name           = "caca",
-    .long_name      = NULL_IF_CONFIG_SMALL("caca (color ASCII art) output device"),
+const FFOutputFormat ff_caca_muxer = {
+    .p.name         = "caca",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("caca (color ASCII art) output device"),
     .priv_data_size = sizeof(CACAContext),
-    .audio_codec    = AV_CODEC_ID_NONE,
-    .video_codec    = AV_CODEC_ID_RAWVIDEO,
+    .p.audio_codec  = AV_CODEC_ID_NONE,
+    .p.video_codec  = AV_CODEC_ID_RAWVIDEO,
     .write_header   = caca_write_header,
     .write_packet   = caca_write_packet,
     .deinit         = caca_deinit,
-    .flags          = AVFMT_NOFILE,
-    .priv_class     = &caca_class,
+    .p.flags        = AVFMT_NOFILE,
+    .p.priv_class   = &caca_class,
 };
diff --git a/libavdevice/decklink_enc_c.c b/libavdevice/decklink_enc_c.c
index 990fbb8168..f7e315057f 100644
--- a/libavdevice/decklink_enc_c.c
+++ b/libavdevice/decklink_enc_c.c
@@ -20,6 +20,7 @@
  */
 
 #include "libavformat/avformat.h"
+#include "libavformat/mux.h"
 #include "libavutil/opt.h"
 
 #include "decklink_common_c.h"
@@ -71,15 +72,15 @@ static const AVClass decklink_muxer_class = {
     .category   = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT,
 };
 
-const AVOutputFormat ff_decklink_muxer = {
-    .name           = "decklink",
-    .long_name      = NULL_IF_CONFIG_SMALL("Blackmagic DeckLink output"),
-    .audio_codec    = AV_CODEC_ID_PCM_S16LE,
-    .video_codec    = AV_CODEC_ID_WRAPPED_AVFRAME,
-    .subtitle_codec = AV_CODEC_ID_NONE,
-    .flags          = AVFMT_NOFILE,
+const FFOutputFormat ff_decklink_muxer = {
+    .p.name           = "decklink",
+    .p.long_name      = NULL_IF_CONFIG_SMALL("Blackmagic DeckLink output"),
+    .p.audio_codec    = AV_CODEC_ID_PCM_S16LE,
+    .p.video_codec    = AV_CODEC_ID_WRAPPED_AVFRAME,
+    .p.subtitle_codec = AV_CODEC_ID_NONE,
+    .p.flags          = AVFMT_NOFILE,
+    .p.priv_class     = &decklink_muxer_class,
     .get_device_list = ff_decklink_list_output_devices,
-    .priv_class     = &decklink_muxer_class,
     .priv_data_size = sizeof(struct decklink_cctx),
     .write_header   = ff_decklink_write_header,
     .write_packet   = ff_decklink_write_packet,
diff --git a/libavdevice/fbdev_enc.c b/libavdevice/fbdev_enc.c
index 77233880e7..7f3e8e5935 100644
--- a/libavdevice/fbdev_enc.c
+++ b/libavdevice/fbdev_enc.c
@@ -28,6 +28,7 @@
 #include "libavutil/log.h"
 #include "libavutil/opt.h"
 #include "libavformat/avformat.h"
+#include "libavformat/mux.h"
 #include "fbdev_common.h"
 #include "avdevice.h"
 
@@ -206,16 +207,16 @@ static const AVClass fbdev_class = {
     .category   = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT,
 };
 
-const AVOutputFormat ff_fbdev_muxer = {
-    .name           = "fbdev",
-    .long_name      = NULL_IF_CONFIG_SMALL("Linux framebuffer"),
+const FFOutputFormat ff_fbdev_muxer = {
+    .p.name         = "fbdev",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("Linux framebuffer"),
     .priv_data_size = sizeof(FBDevContext),
-    .audio_codec    = AV_CODEC_ID_NONE,
-    .video_codec    = AV_CODEC_ID_RAWVIDEO,
+    .p.audio_codec  = AV_CODEC_ID_NONE,
+    .p.video_codec  = AV_CODEC_ID_RAWVIDEO,
     .write_header   = fbdev_write_header,
     .write_packet   = fbdev_write_packet,
     .write_trailer  = fbdev_write_trailer,
     .get_device_list = fbdev_get_device_list,
-    .flags          = AVFMT_NOFILE | AVFMT_VARIABLE_FPS | AVFMT_NOTIMESTAMPS,
-    .priv_class     = &fbdev_class,
+    .p.flags        = AVFMT_NOFILE | AVFMT_VARIABLE_FPS | AVFMT_NOTIMESTAMPS,
+    .p.priv_class   = &fbdev_class,
 };
diff --git a/libavdevice/opengl_enc.c b/libavdevice/opengl_enc.c
index b2140c80be..06750bbba1 100644
--- a/libavdevice/opengl_enc.c
+++ b/libavdevice/opengl_enc.c
@@ -1292,17 +1292,17 @@ static const AVClass opengl_class = {
     .category   = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT,
 };
 
-const AVOutputFormat ff_opengl_muxer = {
-    .name           = "opengl",
-    .long_name      = NULL_IF_CONFIG_SMALL("OpenGL output"),
+const FFOutputFormat ff_opengl_muxer = {
+    .p.name              = "opengl",
+    .p.long_name         = NULL_IF_CONFIG_SMALL("OpenGL output"),
+    .p.audio_codec       = AV_CODEC_ID_NONE,
+    .p.video_codec       = AV_CODEC_ID_WRAPPED_AVFRAME,
+    .p.flags             = AVFMT_NOFILE | AVFMT_VARIABLE_FPS | AVFMT_NOTIMESTAMPS,
+    .p.priv_class        = &opengl_class,
     .priv_data_size = sizeof(OpenGLContext),
-    .audio_codec    = AV_CODEC_ID_NONE,
-    .video_codec    = AV_CODEC_ID_WRAPPED_AVFRAME,
     .write_header   = opengl_write_header,
     .write_packet   = opengl_write_packet,
     .write_uncoded_frame = opengl_write_frame,
     .write_trailer  = opengl_write_trailer,
     .control_message = opengl_control_message,
-    .flags          = AVFMT_NOFILE | AVFMT_VARIABLE_FPS | AVFMT_NOTIMESTAMPS,
-    .priv_class     = &opengl_class,
 };
diff --git a/libavdevice/oss_enc.c b/libavdevice/oss_enc.c
index 704f434c53..c125e6c0e9 100644
--- a/libavdevice/oss_enc.c
+++ b/libavdevice/oss_enc.c
@@ -32,6 +32,7 @@
 
 #include "avdevice.h"
 #include "libavformat/internal.h"
+#include "libavformat/mux.h"
 
 #include "oss.h"
 
@@ -94,18 +95,18 @@ static const AVClass oss_muxer_class = {
     .category       = AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT,
 };
 
-const AVOutputFormat ff_oss_muxer = {
-    .name           = "oss",
-    .long_name      = NULL_IF_CONFIG_SMALL("OSS (Open Sound System) playback"),
+const FFOutputFormat ff_oss_muxer = {
+    .p.name         = "oss",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("OSS (Open Sound System) playback"),
     .priv_data_size = sizeof(OSSAudioData),
     /* XXX: we make the assumption that the soundcard accepts this format */
     /* XXX: find better solution with "preinit" method, needed also in
        other formats */
-    .audio_codec    = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
-    .video_codec    = AV_CODEC_ID_NONE,
+    .p.audio_codec  = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
+    .p.video_codec  = AV_CODEC_ID_NONE,
     .write_header   = audio_write_header,
     .write_packet   = audio_write_packet,
     .write_trailer  = audio_write_trailer,
-    .flags          = AVFMT_NOFILE,
-    .priv_class     = &oss_muxer_class,
+    .p.flags        = AVFMT_NOFILE,
+    .p.priv_class   = &oss_muxer_class,
 };
diff --git a/libavdevice/pulse_audio_enc.c b/libavdevice/pulse_audio_enc.c
index 038401c680..3d8323233f 100644
--- a/libavdevice/pulse_audio_enc.c
+++ b/libavdevice/pulse_audio_enc.c
@@ -788,12 +788,12 @@ static const AVClass pulse_muxer_class = {
     .category       = AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT,
 };
 
-const AVOutputFormat ff_pulse_muxer = {
-    .name                 = "pulse",
-    .long_name            = NULL_IF_CONFIG_SMALL("Pulse audio output"),
+const FFOutputFormat ff_pulse_muxer = {
+    .p.name               = "pulse",
+    .p.long_name          = NULL_IF_CONFIG_SMALL("Pulse audio output"),
     .priv_data_size       = sizeof(PulseData),
-    .audio_codec          = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
-    .video_codec          = AV_CODEC_ID_NONE,
+    .p.audio_codec        = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
+    .p.video_codec        = AV_CODEC_ID_NONE,
     .write_header         = pulse_write_header,
     .write_packet         = pulse_write_packet,
     .write_uncoded_frame  = pulse_write_frame,
@@ -801,6 +801,6 @@ const AVOutputFormat ff_pulse_muxer = {
     .get_output_timestamp = pulse_get_output_timestamp,
     .get_device_list      = pulse_get_device_list,
     .control_message      = pulse_control_message,
-    .flags                = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH,
-    .priv_class           = &pulse_muxer_class,
+    .p.flags              = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH,
+    .p.priv_class         = &pulse_muxer_class,
 };
diff --git a/libavdevice/sdl2.c b/libavdevice/sdl2.c
index a9023153f1..342a253dc0 100644
--- a/libavdevice/sdl2.c
+++ b/libavdevice/sdl2.c
@@ -33,6 +33,7 @@
 #include "libavutil/pixdesc.h"
 #include "libavutil/time.h"
 #include "avdevice.h"
+#include "libavformat/mux.h"
 
 typedef struct {
     AVClass *class;
@@ -355,15 +356,15 @@ static const AVClass sdl2_class = {
     .category   = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT,
 };
 
-const AVOutputFormat ff_sdl2_muxer = {
-    .name           = "sdl,sdl2",
-    .long_name      = NULL_IF_CONFIG_SMALL("SDL2 output device"),
+const FFOutputFormat ff_sdl2_muxer = {
+    .p.name         = "sdl,sdl2",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("SDL2 output device"),
     .priv_data_size = sizeof(SDLContext),
-    .audio_codec    = AV_CODEC_ID_NONE,
-    .video_codec    = AV_CODEC_ID_RAWVIDEO,
+    .p.audio_codec  = AV_CODEC_ID_NONE,
+    .p.video_codec  = AV_CODEC_ID_RAWVIDEO,
     .write_header   = sdl2_write_header,
     .write_packet   = sdl2_write_packet,
     .write_trailer  = sdl2_write_trailer,
-    .flags          = AVFMT_NOFILE | AVFMT_VARIABLE_FPS | AVFMT_NOTIMESTAMPS,
-    .priv_class     = &sdl2_class,
+    .p.flags        = AVFMT_NOFILE | AVFMT_VARIABLE_FPS | AVFMT_NOTIMESTAMPS,
+    .p.priv_class   = &sdl2_class,
 };
diff --git a/libavdevice/sndio_enc.c b/libavdevice/sndio_enc.c
index 0cf58fdc6a..578e287a41 100644
--- a/libavdevice/sndio_enc.c
+++ b/libavdevice/sndio_enc.c
@@ -24,6 +24,7 @@
 
 #include "libavutil/internal.h"
 
+#include "libavformat/mux.h"
 
 #include "libavdevice/avdevice.h"
 #include "libavdevice/sndio.h"
@@ -86,18 +87,18 @@ static const AVClass sndio_muxer_class = {
     .category       = AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT,
 };
 
-const AVOutputFormat ff_sndio_muxer = {
-    .name           = "sndio",
-    .long_name      = NULL_IF_CONFIG_SMALL("sndio audio playback"),
+const FFOutputFormat ff_sndio_muxer = {
+    .p.name         = "sndio",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("sndio audio playback"),
     .priv_data_size = sizeof(SndioData),
     /* XXX: we make the assumption that the soundcard accepts this format */
     /* XXX: find better solution with "preinit" method, needed also in
        other formats */
-    .audio_codec    = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
-    .video_codec    = AV_CODEC_ID_NONE,
+    .p.audio_codec  = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
+    .p.video_codec  = AV_CODEC_ID_NONE,
     .write_header   = audio_write_header,
     .write_packet   = audio_write_packet,
     .write_trailer  = audio_write_trailer,
-    .flags          = AVFMT_NOFILE,
-    .priv_class     = &sndio_muxer_class,
+    .p.flags        = AVFMT_NOFILE,
+    .p.priv_class   = &sndio_muxer_class,
 };
diff --git a/libavdevice/v4l2enc.c b/libavdevice/v4l2enc.c
index b1006461b7..8e8f911996 100644
--- a/libavdevice/v4l2enc.c
+++ b/libavdevice/v4l2enc.c
@@ -21,6 +21,7 @@
 #include "libavutil/imgutils.h"
 #include "libavutil/pixdesc.h"
 #include "libavformat/avformat.h"
+#include "libavformat/mux.h"
 #include "v4l2-common.h"
 
 typedef struct {
@@ -111,15 +112,15 @@ static const AVClass v4l2_class = {
     .category   = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT,
 };
 
-const AVOutputFormat ff_v4l2_muxer = {
-    .name           = "video4linux2,v4l2",
-    .long_name      = NULL_IF_CONFIG_SMALL("Video4Linux2 output device"),
+const FFOutputFormat ff_v4l2_muxer = {
+    .p.name         = "video4linux2,v4l2",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("Video4Linux2 output device"),
     .priv_data_size = sizeof(V4L2Context),
-    .audio_codec    = AV_CODEC_ID_NONE,
-    .video_codec    = AV_CODEC_ID_RAWVIDEO,
+    .p.audio_codec  = AV_CODEC_ID_NONE,
+    .p.video_codec  = AV_CODEC_ID_RAWVIDEO,
     .write_header   = write_header,
     .write_packet   = write_packet,
     .write_trailer  = write_trailer,
-    .flags          = AVFMT_NOFILE,
-    .priv_class     = &v4l2_class,
+    .p.flags        = AVFMT_NOFILE,
+    .p.priv_class   = &v4l2_class,
 };
diff --git a/libavdevice/xv.c b/libavdevice/xv.c
index 348c289bea..441f854121 100644
--- a/libavdevice/xv.c
+++ b/libavdevice/xv.c
@@ -376,17 +376,17 @@ static const AVClass xv_class = {
     .category   = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT,
 };
 
-const AVOutputFormat ff_xv_muxer = {
-    .name           = "xv",
-    .long_name      = NULL_IF_CONFIG_SMALL("XV (XVideo) output device"),
+const FFOutputFormat ff_xv_muxer = {
+    .p.name         = "xv",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("XV (XVideo) output device"),
+    .p.audio_codec   = AV_CODEC_ID_NONE,
+    .p.video_codec   = AV_CODEC_ID_WRAPPED_AVFRAME,
+    .p.flags         = AVFMT_NOFILE | AVFMT_VARIABLE_FPS | AVFMT_NOTIMESTAMPS,
+    .p.priv_class    = &xv_class,
     .priv_data_size = sizeof(XVContext),
-    .audio_codec    = AV_CODEC_ID_NONE,
-    .video_codec    = AV_CODEC_ID_WRAPPED_AVFRAME,
     .write_header   = xv_write_header,
     .write_packet   = xv_write_packet,
     .write_uncoded_frame = xv_write_frame,
     .write_trailer  = xv_write_trailer,
     .control_message = xv_control_message,
-    .flags          = AVFMT_NOFILE | AVFMT_VARIABLE_FPS | AVFMT_NOTIMESTAMPS,
-    .priv_class     = &xv_class,
 };
diff --git a/libavformat/a64.c b/libavformat/a64.c
index a66f2542b7..23b20fc8b7 100644
--- a/libavformat/a64.c
+++ b/libavformat/a64.c
@@ -23,6 +23,7 @@
 #include "libavcodec/codec_id.h"
 #include "libavcodec/codec_par.h"
 #include "avformat.h"
+#include "mux.h"
 #include "rawenc.h"
 
 static int a64_write_header(AVFormatContext *s)
@@ -59,11 +60,11 @@ static int a64_write_header(AVFormatContext *s)
     return 0;
 }
 
-const AVOutputFormat ff_a64_muxer = {
-    .name           = "a64",
-    .long_name      = NULL_IF_CONFIG_SMALL("a64 - video for Commodore 64"),
-    .extensions     = "a64, A64",
-    .video_codec    = AV_CODEC_ID_A64_MULTI,
+const FFOutputFormat ff_a64_muxer = {
+    .p.name         = "a64",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("a64 - video for Commodore 64"),
+    .p.extensions   = "a64, A64",
+    .p.video_codec  = AV_CODEC_ID_A64_MULTI,
     .write_header   = a64_write_header,
     .write_packet   = ff_raw_write_packet,
 };
diff --git a/libavformat/adtsenc.c b/libavformat/adtsenc.c
index 5f2461cc6c..b5e9640544 100644
--- a/libavformat/adtsenc.c
+++ b/libavformat/adtsenc.c
@@ -31,6 +31,7 @@
 #include "avformat.h"
 #include "apetag.h"
 #include "id3v2.h"
+#include "mux.h"
 
 #define ADTS_HEADER_SIZE 7
 
@@ -232,18 +233,18 @@ static const AVClass adts_muxer_class = {
     .version        = LIBAVUTIL_VERSION_INT,
 };
 
-const AVOutputFormat ff_adts_muxer = {
-    .name              = "adts",
-    .long_name         = NULL_IF_CONFIG_SMALL("ADTS AAC (Advanced Audio Coding)"),
-    .mime_type         = "audio/aac",
-    .extensions        = "aac,adts",
+const FFOutputFormat ff_adts_muxer = {
+    .p.name            = "adts",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("ADTS AAC (Advanced Audio Coding)"),
+    .p.mime_type       = "audio/aac",
+    .p.extensions      = "aac,adts",
     .priv_data_size    = sizeof(ADTSContext),
-    .audio_codec       = AV_CODEC_ID_AAC,
-    .video_codec       = AV_CODEC_ID_NONE,
+    .p.audio_codec     = AV_CODEC_ID_AAC,
+    .p.video_codec     = AV_CODEC_ID_NONE,
     .init              = adts_init,
     .write_header      = adts_write_header,
     .write_packet      = adts_write_packet,
     .write_trailer     = adts_write_trailer,
-    .priv_class        = &adts_muxer_class,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.priv_class      = &adts_muxer_class,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
diff --git a/libavformat/aiffenc.c b/libavformat/aiffenc.c
index bdaf5c2c3e..11a5b18d57 100644
--- a/libavformat/aiffenc.c
+++ b/libavformat/aiffenc.c
@@ -30,6 +30,7 @@
 #include "avio_internal.h"
 #include "isom.h"
 #include "id3v2.h"
+#include "mux.h"
 
 typedef struct AIFFOutputContext {
     const AVClass *class;
@@ -284,18 +285,18 @@ static const AVClass aiff_muxer_class = {
     .version        = LIBAVUTIL_VERSION_INT,
 };
 
-const AVOutputFormat ff_aiff_muxer = {
-    .name              = "aiff",
-    .long_name         = NULL_IF_CONFIG_SMALL("Audio IFF"),
-    .mime_type         = "audio/aiff",
-    .extensions        = "aif,aiff,afc,aifc",
+const FFOutputFormat ff_aiff_muxer = {
+    .p.name            = "aiff",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("Audio IFF"),
+    .p.mime_type       = "audio/aiff",
+    .p.extensions      = "aif,aiff,afc,aifc",
     .priv_data_size    = sizeof(AIFFOutputContext),
-    .audio_codec       = AV_CODEC_ID_PCM_S16BE,
-    .video_codec       = AV_CODEC_ID_PNG,
+    .p.audio_codec     = AV_CODEC_ID_PCM_S16BE,
+    .p.video_codec     = AV_CODEC_ID_PNG,
     .write_header      = aiff_write_header,
     .write_packet      = aiff_write_packet,
     .write_trailer     = aiff_write_trailer,
     .deinit            = aiff_deinit,
-    .codec_tag         = ff_aiff_codec_tags_list,
-    .priv_class        = &aiff_muxer_class,
+    .p.codec_tag       = ff_aiff_codec_tags_list,
+    .p.priv_class      = &aiff_muxer_class,
 };
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index bf8afe2078..756fe8e875 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -25,82 +25,83 @@
 
 #include "libavformat/internal.h"
 #include "avformat.h"
+#include "mux.h"
 
 /* (de)muxers */
-extern const AVOutputFormat ff_a64_muxer;
+extern const FFOutputFormat ff_a64_muxer;
 extern const AVInputFormat  ff_aa_demuxer;
 extern const AVInputFormat  ff_aac_demuxer;
 extern const AVInputFormat  ff_aax_demuxer;
 extern const AVInputFormat  ff_ac3_demuxer;
-extern const AVOutputFormat ff_ac3_muxer;
+extern const FFOutputFormat ff_ac3_muxer;
 extern const AVInputFormat  ff_ace_demuxer;
 extern const AVInputFormat  ff_acm_demuxer;
 extern const AVInputFormat  ff_act_demuxer;
 extern const AVInputFormat  ff_adf_demuxer;
 extern const AVInputFormat  ff_adp_demuxer;
 extern const AVInputFormat  ff_ads_demuxer;
-extern const AVOutputFormat ff_adts_muxer;
+extern const FFOutputFormat ff_adts_muxer;
 extern const AVInputFormat  ff_adx_demuxer;
-extern const AVOutputFormat ff_adx_muxer;
+extern const FFOutputFormat ff_adx_muxer;
 extern const AVInputFormat  ff_aea_demuxer;
 extern const AVInputFormat  ff_afc_demuxer;
 extern const AVInputFormat  ff_aiff_demuxer;
-extern const AVOutputFormat ff_aiff_muxer;
+extern const FFOutputFormat ff_aiff_muxer;
 extern const AVInputFormat  ff_aix_demuxer;
 extern const AVInputFormat  ff_alp_demuxer;
-extern const AVOutputFormat ff_alp_muxer;
+extern const FFOutputFormat ff_alp_muxer;
 extern const AVInputFormat  ff_amr_demuxer;
-extern const AVOutputFormat ff_amr_muxer;
+extern const FFOutputFormat ff_amr_muxer;
 extern const AVInputFormat  ff_amrnb_demuxer;
 extern const AVInputFormat  ff_amrwb_demuxer;
-extern const AVOutputFormat ff_amv_muxer;
+extern const FFOutputFormat ff_amv_muxer;
 extern const AVInputFormat  ff_anm_demuxer;
 extern const AVInputFormat  ff_apac_demuxer;
 extern const AVInputFormat  ff_apc_demuxer;
 extern const AVInputFormat  ff_ape_demuxer;
 extern const AVInputFormat  ff_apm_demuxer;
-extern const AVOutputFormat ff_apm_muxer;
+extern const FFOutputFormat ff_apm_muxer;
 extern const AVInputFormat  ff_apng_demuxer;
-extern const AVOutputFormat ff_apng_muxer;
+extern const FFOutputFormat ff_apng_muxer;
 extern const AVInputFormat  ff_aptx_demuxer;
-extern const AVOutputFormat ff_aptx_muxer;
+extern const FFOutputFormat ff_aptx_muxer;
 extern const AVInputFormat  ff_aptx_hd_demuxer;
-extern const AVOutputFormat ff_aptx_hd_muxer;
+extern const FFOutputFormat ff_aptx_hd_muxer;
 extern const AVInputFormat  ff_aqtitle_demuxer;
 extern const AVInputFormat  ff_argo_asf_demuxer;
-extern const AVOutputFormat ff_argo_asf_muxer;
+extern const FFOutputFormat ff_argo_asf_muxer;
 extern const AVInputFormat  ff_argo_brp_demuxer;
 extern const AVInputFormat  ff_argo_cvg_demuxer;
-extern const AVOutputFormat ff_argo_cvg_muxer;
+extern const FFOutputFormat ff_argo_cvg_muxer;
 extern const AVInputFormat  ff_asf_demuxer;
-extern const AVOutputFormat ff_asf_muxer;
+extern const FFOutputFormat ff_asf_muxer;
 extern const AVInputFormat  ff_asf_o_demuxer;
 extern const AVInputFormat  ff_ass_demuxer;
-extern const AVOutputFormat ff_ass_muxer;
+extern const FFOutputFormat ff_ass_muxer;
 extern const AVInputFormat  ff_ast_demuxer;
-extern const AVOutputFormat ff_ast_muxer;
-extern const AVOutputFormat ff_asf_stream_muxer;
+extern const FFOutputFormat ff_ast_muxer;
+extern const FFOutputFormat ff_asf_stream_muxer;
 extern const AVInputFormat  ff_au_demuxer;
-extern const AVOutputFormat ff_au_muxer;
+extern const FFOutputFormat ff_au_muxer;
 extern const AVInputFormat  ff_av1_demuxer;
 extern const AVInputFormat  ff_avi_demuxer;
-extern const AVOutputFormat ff_avi_muxer;
-extern const AVOutputFormat ff_avif_muxer;
+extern const FFOutputFormat ff_avi_muxer;
+extern const FFOutputFormat ff_avif_muxer;
 extern const AVInputFormat  ff_avisynth_demuxer;
-extern const AVOutputFormat ff_avm2_muxer;
+extern const FFOutputFormat ff_avm2_muxer;
 extern const AVInputFormat  ff_avr_demuxer;
 extern const AVInputFormat  ff_avs_demuxer;
 extern const AVInputFormat  ff_avs2_demuxer;
-extern const AVOutputFormat ff_avs2_muxer;
+extern const FFOutputFormat ff_avs2_muxer;
 extern const AVInputFormat  ff_avs3_demuxer;
-extern const AVOutputFormat ff_avs3_muxer;
+extern const FFOutputFormat ff_avs3_muxer;
 extern const AVInputFormat  ff_bethsoftvid_demuxer;
 extern const AVInputFormat  ff_bfi_demuxer;
 extern const AVInputFormat  ff_bintext_demuxer;
 extern const AVInputFormat  ff_bink_demuxer;
 extern const AVInputFormat  ff_binka_demuxer;
 extern const AVInputFormat  ff_bit_demuxer;
-extern const AVOutputFormat ff_bit_muxer;
+extern const FFOutputFormat ff_bit_muxer;
 extern const AVInputFormat  ff_bitpacked_demuxer;
 extern const AVInputFormat  ff_bmv_demuxer;
 extern const AVInputFormat  ff_bfstm_demuxer;
@@ -109,190 +110,190 @@ extern const AVInputFormat  ff_boa_demuxer;
 extern const AVInputFormat  ff_bonk_demuxer;
 extern const AVInputFormat  ff_c93_demuxer;
 extern const AVInputFormat  ff_caf_demuxer;
-extern const AVOutputFormat ff_caf_muxer;
+extern const FFOutputFormat ff_caf_muxer;
 extern const AVInputFormat  ff_cavsvideo_demuxer;
-extern const AVOutputFormat ff_cavsvideo_muxer;
+extern const FFOutputFormat ff_cavsvideo_muxer;
 extern const AVInputFormat  ff_cdg_demuxer;
 extern const AVInputFormat  ff_cdxl_demuxer;
 extern const AVInputFormat  ff_cine_demuxer;
 extern const AVInputFormat  ff_codec2_demuxer;
-extern const AVOutputFormat ff_codec2_muxer;
+extern const FFOutputFormat ff_codec2_muxer;
 extern const AVInputFormat  ff_codec2raw_demuxer;
-extern const AVOutputFormat ff_codec2raw_muxer;
+extern const FFOutputFormat ff_codec2raw_muxer;
 extern const AVInputFormat  ff_concat_demuxer;
-extern const AVOutputFormat ff_crc_muxer;
+extern const FFOutputFormat ff_crc_muxer;
 extern const AVInputFormat  ff_dash_demuxer;
-extern const AVOutputFormat ff_dash_muxer;
+extern const FFOutputFormat ff_dash_muxer;
 extern const AVInputFormat  ff_data_demuxer;
-extern const AVOutputFormat ff_data_muxer;
+extern const FFOutputFormat ff_data_muxer;
 extern const AVInputFormat  ff_daud_demuxer;
-extern const AVOutputFormat ff_daud_muxer;
+extern const FFOutputFormat ff_daud_muxer;
 extern const AVInputFormat  ff_dcstr_demuxer;
 extern const AVInputFormat  ff_derf_demuxer;
 extern const AVInputFormat  ff_dfa_demuxer;
 extern const AVInputFormat  ff_dfpwm_demuxer;
-extern const AVOutputFormat ff_dfpwm_muxer;
+extern const FFOutputFormat ff_dfpwm_muxer;
 extern const AVInputFormat  ff_dhav_demuxer;
 extern const AVInputFormat  ff_dirac_demuxer;
-extern const AVOutputFormat ff_dirac_muxer;
+extern const FFOutputFormat ff_dirac_muxer;
 extern const AVInputFormat  ff_dnxhd_demuxer;
-extern const AVOutputFormat ff_dnxhd_muxer;
+extern const FFOutputFormat ff_dnxhd_muxer;
 extern const AVInputFormat  ff_dsf_demuxer;
 extern const AVInputFormat  ff_dsicin_demuxer;
 extern const AVInputFormat  ff_dss_demuxer;
 extern const AVInputFormat  ff_dts_demuxer;
-extern const AVOutputFormat ff_dts_muxer;
+extern const FFOutputFormat ff_dts_muxer;
 extern const AVInputFormat  ff_dtshd_demuxer;
 extern const AVInputFormat  ff_dv_demuxer;
-extern const AVOutputFormat ff_dv_muxer;
+extern const FFOutputFormat ff_dv_muxer;
 extern const AVInputFormat  ff_dvbsub_demuxer;
 extern const AVInputFormat  ff_dvbtxt_demuxer;
 extern const AVInputFormat  ff_dxa_demuxer;
 extern const AVInputFormat  ff_ea_demuxer;
 extern const AVInputFormat  ff_ea_cdata_demuxer;
 extern const AVInputFormat  ff_eac3_demuxer;
-extern const AVOutputFormat ff_eac3_muxer;
+extern const FFOutputFormat ff_eac3_muxer;
 extern const AVInputFormat  ff_epaf_demuxer;
-extern const AVOutputFormat ff_f4v_muxer;
+extern const FFOutputFormat ff_f4v_muxer;
 extern const AVInputFormat  ff_ffmetadata_demuxer;
-extern const AVOutputFormat ff_ffmetadata_muxer;
-extern const AVOutputFormat ff_fifo_muxer;
-extern const AVOutputFormat ff_fifo_test_muxer;
+extern const FFOutputFormat ff_ffmetadata_muxer;
+extern const FFOutputFormat ff_fifo_muxer;
+extern const FFOutputFormat ff_fifo_test_muxer;
 extern const AVInputFormat  ff_filmstrip_demuxer;
-extern const AVOutputFormat ff_filmstrip_muxer;
+extern const FFOutputFormat ff_filmstrip_muxer;
 extern const AVInputFormat  ff_fits_demuxer;
-extern const AVOutputFormat ff_fits_muxer;
+extern const FFOutputFormat ff_fits_muxer;
 extern const AVInputFormat  ff_flac_demuxer;
-extern const AVOutputFormat ff_flac_muxer;
+extern const FFOutputFormat ff_flac_muxer;
 extern const AVInputFormat  ff_flic_demuxer;
 extern const AVInputFormat  ff_flv_demuxer;
-extern const AVOutputFormat ff_flv_muxer;
+extern const FFOutputFormat ff_flv_muxer;
 extern const AVInputFormat  ff_live_flv_demuxer;
 extern const AVInputFormat  ff_fourxm_demuxer;
-extern const AVOutputFormat ff_framecrc_muxer;
-extern const AVOutputFormat ff_framehash_muxer;
-extern const AVOutputFormat ff_framemd5_muxer;
+extern const FFOutputFormat ff_framecrc_muxer;
+extern const FFOutputFormat ff_framehash_muxer;
+extern const FFOutputFormat ff_framemd5_muxer;
 extern const AVInputFormat  ff_frm_demuxer;
 extern const AVInputFormat  ff_fsb_demuxer;
 extern const AVInputFormat  ff_fwse_demuxer;
 extern const AVInputFormat  ff_g722_demuxer;
-extern const AVOutputFormat ff_g722_muxer;
+extern const FFOutputFormat ff_g722_muxer;
 extern const AVInputFormat  ff_g723_1_demuxer;
-extern const AVOutputFormat ff_g723_1_muxer;
+extern const FFOutputFormat ff_g723_1_muxer;
 extern const AVInputFormat  ff_g726_demuxer;
-extern const AVOutputFormat ff_g726_muxer;
+extern const FFOutputFormat ff_g726_muxer;
 extern const AVInputFormat  ff_g726le_demuxer;
-extern const AVOutputFormat ff_g726le_muxer;
+extern const FFOutputFormat ff_g726le_muxer;
 extern const AVInputFormat  ff_g729_demuxer;
 extern const AVInputFormat  ff_gdv_demuxer;
 extern const AVInputFormat  ff_genh_demuxer;
 extern const AVInputFormat  ff_gif_demuxer;
-extern const AVOutputFormat ff_gif_muxer;
+extern const FFOutputFormat ff_gif_muxer;
 extern const AVInputFormat  ff_gsm_demuxer;
-extern const AVOutputFormat ff_gsm_muxer;
+extern const FFOutputFormat ff_gsm_muxer;
 extern const AVInputFormat  ff_gxf_demuxer;
-extern const AVOutputFormat ff_gxf_muxer;
+extern const FFOutputFormat ff_gxf_muxer;
 extern const AVInputFormat  ff_h261_demuxer;
-extern const AVOutputFormat ff_h261_muxer;
+extern const FFOutputFormat ff_h261_muxer;
 extern const AVInputFormat  ff_h263_demuxer;
-extern const AVOutputFormat ff_h263_muxer;
+extern const FFOutputFormat ff_h263_muxer;
 extern const AVInputFormat  ff_h264_demuxer;
-extern const AVOutputFormat ff_h264_muxer;
-extern const AVOutputFormat ff_hash_muxer;
+extern const FFOutputFormat ff_h264_muxer;
+extern const FFOutputFormat ff_hash_muxer;
 extern const AVInputFormat  ff_hca_demuxer;
 extern const AVInputFormat  ff_hcom_demuxer;
-extern const AVOutputFormat ff_hds_muxer;
+extern const FFOutputFormat ff_hds_muxer;
 extern const AVInputFormat  ff_hevc_demuxer;
-extern const AVOutputFormat ff_hevc_muxer;
+extern const FFOutputFormat ff_hevc_muxer;
 extern const AVInputFormat  ff_hls_demuxer;
-extern const AVOutputFormat ff_hls_muxer;
+extern const FFOutputFormat ff_hls_muxer;
 extern const AVInputFormat  ff_hnm_demuxer;
 extern const AVInputFormat  ff_ico_demuxer;
-extern const AVOutputFormat ff_ico_muxer;
+extern const FFOutputFormat ff_ico_muxer;
 extern const AVInputFormat  ff_idcin_demuxer;
 extern const AVInputFormat  ff_idf_demuxer;
 extern const AVInputFormat  ff_iff_demuxer;
 extern const AVInputFormat  ff_ifv_demuxer;
 extern const AVInputFormat  ff_ilbc_demuxer;
-extern const AVOutputFormat ff_ilbc_muxer;
+extern const FFOutputFormat ff_ilbc_muxer;
 extern const AVInputFormat  ff_image2_demuxer;
-extern const AVOutputFormat ff_image2_muxer;
+extern const FFOutputFormat ff_image2_muxer;
 extern const AVInputFormat  ff_image2pipe_demuxer;
-extern const AVOutputFormat ff_image2pipe_muxer;
+extern const FFOutputFormat ff_image2pipe_muxer;
 extern const AVInputFormat  ff_image2_alias_pix_demuxer;
 extern const AVInputFormat  ff_image2_brender_pix_demuxer;
 extern const AVInputFormat  ff_imf_demuxer;
 extern const AVInputFormat  ff_ingenient_demuxer;
 extern const AVInputFormat  ff_ipmovie_demuxer;
-extern const AVOutputFormat ff_ipod_muxer;
+extern const FFOutputFormat ff_ipod_muxer;
 extern const AVInputFormat  ff_ipu_demuxer;
 extern const AVInputFormat  ff_ircam_demuxer;
-extern const AVOutputFormat ff_ircam_muxer;
-extern const AVOutputFormat ff_ismv_muxer;
+extern const FFOutputFormat ff_ircam_muxer;
+extern const FFOutputFormat ff_ismv_muxer;
 extern const AVInputFormat  ff_iss_demuxer;
 extern const AVInputFormat  ff_iv8_demuxer;
 extern const AVInputFormat  ff_ivf_demuxer;
-extern const AVOutputFormat ff_ivf_muxer;
+extern const FFOutputFormat ff_ivf_muxer;
 extern const AVInputFormat  ff_ivr_demuxer;
 extern const AVInputFormat  ff_jacosub_demuxer;
-extern const AVOutputFormat ff_jacosub_muxer;
+extern const FFOutputFormat ff_jacosub_muxer;
 extern const AVInputFormat  ff_jv_demuxer;
 extern const AVInputFormat  ff_kux_demuxer;
 extern const AVInputFormat  ff_kvag_demuxer;
-extern const AVOutputFormat ff_kvag_muxer;
+extern const FFOutputFormat ff_kvag_muxer;
 extern const AVInputFormat  ff_laf_demuxer;
-extern const AVOutputFormat ff_latm_muxer;
+extern const FFOutputFormat ff_latm_muxer;
 extern const AVInputFormat  ff_lmlm4_demuxer;
 extern const AVInputFormat  ff_loas_demuxer;
 extern const AVInputFormat  ff_luodat_demuxer;
 extern const AVInputFormat  ff_lrc_demuxer;
-extern const AVOutputFormat ff_lrc_muxer;
+extern const FFOutputFormat ff_lrc_muxer;
 extern const AVInputFormat  ff_lvf_demuxer;
 extern const AVInputFormat  ff_lxf_demuxer;
 extern const AVInputFormat  ff_m4v_demuxer;
-extern const AVOutputFormat ff_m4v_muxer;
+extern const FFOutputFormat ff_m4v_muxer;
 extern const AVInputFormat  ff_mca_demuxer;
 extern const AVInputFormat  ff_mcc_demuxer;
-extern const AVOutputFormat ff_md5_muxer;
+extern const FFOutputFormat ff_md5_muxer;
 extern const AVInputFormat  ff_matroska_demuxer;
-extern const AVOutputFormat ff_matroska_muxer;
-extern const AVOutputFormat ff_matroska_audio_muxer;
+extern const FFOutputFormat ff_matroska_muxer;
+extern const FFOutputFormat ff_matroska_audio_muxer;
 extern const AVInputFormat  ff_mgsts_demuxer;
 extern const AVInputFormat  ff_microdvd_demuxer;
-extern const AVOutputFormat ff_microdvd_muxer;
+extern const FFOutputFormat ff_microdvd_muxer;
 extern const AVInputFormat  ff_mjpeg_demuxer;
-extern const AVOutputFormat ff_mjpeg_muxer;
+extern const FFOutputFormat ff_mjpeg_muxer;
 extern const AVInputFormat  ff_mjpeg_2000_demuxer;
 extern const AVInputFormat  ff_mlp_demuxer;
-extern const AVOutputFormat ff_mlp_muxer;
+extern const FFOutputFormat ff_mlp_muxer;
 extern const AVInputFormat  ff_mlv_demuxer;
 extern const AVInputFormat  ff_mm_demuxer;
 extern const AVInputFormat  ff_mmf_demuxer;
-extern const AVOutputFormat ff_mmf_muxer;
+extern const FFOutputFormat ff_mmf_muxer;
 extern const AVInputFormat  ff_mods_demuxer;
 extern const AVInputFormat  ff_moflex_demuxer;
 extern const AVInputFormat  ff_mov_demuxer;
-extern const AVOutputFormat ff_mov_muxer;
-extern const AVOutputFormat ff_mp2_muxer;
+extern const FFOutputFormat ff_mov_muxer;
+extern const FFOutputFormat ff_mp2_muxer;
 extern const AVInputFormat  ff_mp3_demuxer;
-extern const AVOutputFormat ff_mp3_muxer;
-extern const AVOutputFormat ff_mp4_muxer;
+extern const FFOutputFormat ff_mp3_muxer;
+extern const FFOutputFormat ff_mp4_muxer;
 extern const AVInputFormat  ff_mpc_demuxer;
 extern const AVInputFormat  ff_mpc8_demuxer;
-extern const AVOutputFormat ff_mpeg1system_muxer;
-extern const AVOutputFormat ff_mpeg1vcd_muxer;
-extern const AVOutputFormat ff_mpeg1video_muxer;
-extern const AVOutputFormat ff_mpeg2dvd_muxer;
-extern const AVOutputFormat ff_mpeg2svcd_muxer;
-extern const AVOutputFormat ff_mpeg2video_muxer;
-extern const AVOutputFormat ff_mpeg2vob_muxer;
+extern const FFOutputFormat ff_mpeg1system_muxer;
+extern const FFOutputFormat ff_mpeg1vcd_muxer;
+extern const FFOutputFormat ff_mpeg1video_muxer;
+extern const FFOutputFormat ff_mpeg2dvd_muxer;
+extern const FFOutputFormat ff_mpeg2svcd_muxer;
+extern const FFOutputFormat ff_mpeg2video_muxer;
+extern const FFOutputFormat ff_mpeg2vob_muxer;
 extern const AVInputFormat  ff_mpegps_demuxer;
 extern const AVInputFormat  ff_mpegts_demuxer;
-extern const AVOutputFormat ff_mpegts_muxer;
+extern const FFOutputFormat ff_mpegts_muxer;
 extern const AVInputFormat  ff_mpegtsraw_demuxer;
 extern const AVInputFormat  ff_mpegvideo_demuxer;
 extern const AVInputFormat  ff_mpjpeg_demuxer;
-extern const AVOutputFormat ff_mpjpeg_muxer;
+extern const FFOutputFormat ff_mpjpeg_muxer;
 extern const AVInputFormat  ff_mpl2_demuxer;
 extern const AVInputFormat  ff_mpsub_demuxer;
 extern const AVInputFormat  ff_msf_demuxer;
@@ -304,114 +305,114 @@ extern const AVInputFormat  ff_musx_demuxer;
 extern const AVInputFormat  ff_mv_demuxer;
 extern const AVInputFormat  ff_mvi_demuxer;
 extern const AVInputFormat  ff_mxf_demuxer;
-extern const AVOutputFormat ff_mxf_muxer;
-extern const AVOutputFormat ff_mxf_d10_muxer;
-extern const AVOutputFormat ff_mxf_opatom_muxer;
+extern const FFOutputFormat ff_mxf_muxer;
+extern const FFOutputFormat ff_mxf_d10_muxer;
+extern const FFOutputFormat ff_mxf_opatom_muxer;
 extern const AVInputFormat  ff_mxg_demuxer;
 extern const AVInputFormat  ff_nc_demuxer;
 extern const AVInputFormat  ff_nistsphere_demuxer;
 extern const AVInputFormat  ff_nsp_demuxer;
 extern const AVInputFormat  ff_nsv_demuxer;
-extern const AVOutputFormat ff_null_muxer;
+extern const FFOutputFormat ff_null_muxer;
 extern const AVInputFormat  ff_nut_demuxer;
-extern const AVOutputFormat ff_nut_muxer;
+extern const FFOutputFormat ff_nut_muxer;
 extern const AVInputFormat  ff_nuv_demuxer;
 extern const AVInputFormat  ff_obu_demuxer;
-extern const AVOutputFormat ff_obu_muxer;
-extern const AVOutputFormat ff_oga_muxer;
+extern const FFOutputFormat ff_obu_muxer;
+extern const FFOutputFormat ff_oga_muxer;
 extern const AVInputFormat  ff_ogg_demuxer;
-extern const AVOutputFormat ff_ogg_muxer;
-extern const AVOutputFormat ff_ogv_muxer;
+extern const FFOutputFormat ff_ogg_muxer;
+extern const FFOutputFormat ff_ogv_muxer;
 extern const AVInputFormat  ff_oma_demuxer;
-extern const AVOutputFormat ff_oma_muxer;
-extern const AVOutputFormat ff_opus_muxer;
+extern const FFOutputFormat ff_oma_muxer;
+extern const FFOutputFormat ff_opus_muxer;
 extern const AVInputFormat  ff_paf_demuxer;
 extern const AVInputFormat  ff_pcm_alaw_demuxer;
-extern const AVOutputFormat ff_pcm_alaw_muxer;
+extern const FFOutputFormat ff_pcm_alaw_muxer;
 extern const AVInputFormat  ff_pcm_mulaw_demuxer;
-extern const AVOutputFormat ff_pcm_mulaw_muxer;
+extern const FFOutputFormat ff_pcm_mulaw_muxer;
 extern const AVInputFormat  ff_pcm_vidc_demuxer;
-extern const AVOutputFormat ff_pcm_vidc_muxer;
+extern const FFOutputFormat ff_pcm_vidc_muxer;
 extern const AVInputFormat  ff_pcm_f64be_demuxer;
-extern const AVOutputFormat ff_pcm_f64be_muxer;
+extern const FFOutputFormat ff_pcm_f64be_muxer;
 extern const AVInputFormat  ff_pcm_f64le_demuxer;
-extern const AVOutputFormat ff_pcm_f64le_muxer;
+extern const FFOutputFormat ff_pcm_f64le_muxer;
 extern const AVInputFormat  ff_pcm_f32be_demuxer;
-extern const AVOutputFormat ff_pcm_f32be_muxer;
+extern const FFOutputFormat ff_pcm_f32be_muxer;
 extern const AVInputFormat  ff_pcm_f32le_demuxer;
-extern const AVOutputFormat ff_pcm_f32le_muxer;
+extern const FFOutputFormat ff_pcm_f32le_muxer;
 extern const AVInputFormat  ff_pcm_s32be_demuxer;
-extern const AVOutputFormat ff_pcm_s32be_muxer;
+extern const FFOutputFormat ff_pcm_s32be_muxer;
 extern const AVInputFormat  ff_pcm_s32le_demuxer;
-extern const AVOutputFormat ff_pcm_s32le_muxer;
+extern const FFOutputFormat ff_pcm_s32le_muxer;
 extern const AVInputFormat  ff_pcm_s24be_demuxer;
-extern const AVOutputFormat ff_pcm_s24be_muxer;
+extern const FFOutputFormat ff_pcm_s24be_muxer;
 extern const AVInputFormat  ff_pcm_s24le_demuxer;
-extern const AVOutputFormat ff_pcm_s24le_muxer;
+extern const FFOutputFormat ff_pcm_s24le_muxer;
 extern const AVInputFormat  ff_pcm_s16be_demuxer;
-extern const AVOutputFormat ff_pcm_s16be_muxer;
+extern const FFOutputFormat ff_pcm_s16be_muxer;
 extern const AVInputFormat  ff_pcm_s16le_demuxer;
-extern const AVOutputFormat ff_pcm_s16le_muxer;
+extern const FFOutputFormat ff_pcm_s16le_muxer;
 extern const AVInputFormat  ff_pcm_s8_demuxer;
-extern const AVOutputFormat ff_pcm_s8_muxer;
+extern const FFOutputFormat ff_pcm_s8_muxer;
 extern const AVInputFormat  ff_pcm_u32be_demuxer;
-extern const AVOutputFormat ff_pcm_u32be_muxer;
+extern const FFOutputFormat ff_pcm_u32be_muxer;
 extern const AVInputFormat  ff_pcm_u32le_demuxer;
-extern const AVOutputFormat ff_pcm_u32le_muxer;
+extern const FFOutputFormat ff_pcm_u32le_muxer;
 extern const AVInputFormat  ff_pcm_u24be_demuxer;
-extern const AVOutputFormat ff_pcm_u24be_muxer;
+extern const FFOutputFormat ff_pcm_u24be_muxer;
 extern const AVInputFormat  ff_pcm_u24le_demuxer;
-extern const AVOutputFormat ff_pcm_u24le_muxer;
+extern const FFOutputFormat ff_pcm_u24le_muxer;
 extern const AVInputFormat  ff_pcm_u16be_demuxer;
-extern const AVOutputFormat ff_pcm_u16be_muxer;
+extern const FFOutputFormat ff_pcm_u16be_muxer;
 extern const AVInputFormat  ff_pcm_u16le_demuxer;
-extern const AVOutputFormat ff_pcm_u16le_muxer;
+extern const FFOutputFormat ff_pcm_u16le_muxer;
 extern const AVInputFormat  ff_pcm_u8_demuxer;
-extern const AVOutputFormat ff_pcm_u8_muxer;
+extern const FFOutputFormat ff_pcm_u8_muxer;
 extern const AVInputFormat  ff_pjs_demuxer;
 extern const AVInputFormat  ff_pmp_demuxer;
 extern const AVInputFormat  ff_pp_bnk_demuxer;
-extern const AVOutputFormat ff_psp_muxer;
+extern const FFOutputFormat ff_psp_muxer;
 extern const AVInputFormat  ff_pva_demuxer;
 extern const AVInputFormat  ff_pvf_demuxer;
 extern const AVInputFormat  ff_qcp_demuxer;
 extern const AVInputFormat  ff_r3d_demuxer;
 extern const AVInputFormat  ff_rawvideo_demuxer;
-extern const AVOutputFormat ff_rawvideo_muxer;
+extern const FFOutputFormat ff_rawvideo_muxer;
 extern const AVInputFormat  ff_realtext_demuxer;
 extern const AVInputFormat  ff_redspark_demuxer;
 extern const AVInputFormat  ff_rl2_demuxer;
 extern const AVInputFormat  ff_rm_demuxer;
-extern const AVOutputFormat ff_rm_muxer;
+extern const FFOutputFormat ff_rm_muxer;
 extern const AVInputFormat  ff_roq_demuxer;
-extern const AVOutputFormat ff_roq_muxer;
+extern const FFOutputFormat ff_roq_muxer;
 extern const AVInputFormat  ff_rpl_demuxer;
 extern const AVInputFormat  ff_rsd_demuxer;
 extern const AVInputFormat  ff_rso_demuxer;
-extern const AVOutputFormat ff_rso_muxer;
+extern const FFOutputFormat ff_rso_muxer;
 extern const AVInputFormat  ff_rtp_demuxer;
-extern const AVOutputFormat ff_rtp_muxer;
-extern const AVOutputFormat ff_rtp_mpegts_muxer;
+extern const FFOutputFormat ff_rtp_muxer;
+extern const FFOutputFormat ff_rtp_mpegts_muxer;
 extern const AVInputFormat  ff_rtsp_demuxer;
-extern const AVOutputFormat ff_rtsp_muxer;
+extern const FFOutputFormat ff_rtsp_muxer;
 extern const AVInputFormat  ff_s337m_demuxer;
 extern const AVInputFormat  ff_sami_demuxer;
 extern const AVInputFormat  ff_sap_demuxer;
-extern const AVOutputFormat ff_sap_muxer;
+extern const FFOutputFormat ff_sap_muxer;
 extern const AVInputFormat  ff_sbc_demuxer;
-extern const AVOutputFormat ff_sbc_muxer;
+extern const FFOutputFormat ff_sbc_muxer;
 extern const AVInputFormat  ff_sbg_demuxer;
 extern const AVInputFormat  ff_scc_demuxer;
-extern const AVOutputFormat ff_scc_muxer;
+extern const FFOutputFormat ff_scc_muxer;
 extern const AVInputFormat  ff_scd_demuxer;
 extern const AVInputFormat  ff_sdp_demuxer;
 extern const AVInputFormat  ff_sdr2_demuxer;
 extern const AVInputFormat  ff_sds_demuxer;
 extern const AVInputFormat  ff_sdx_demuxer;
 extern const AVInputFormat  ff_segafilm_demuxer;
-extern const AVOutputFormat ff_segafilm_muxer;
-extern const AVOutputFormat ff_segment_muxer;
-extern const AVOutputFormat ff_stream_segment_muxer;
+extern const FFOutputFormat ff_segafilm_muxer;
+extern const FFOutputFormat ff_segment_muxer;
+extern const FFOutputFormat ff_stream_segment_muxer;
 extern const AVInputFormat  ff_ser_demuxer;
 extern const AVInputFormat  ff_sga_demuxer;
 extern const AVInputFormat  ff_shorten_demuxer;
@@ -420,85 +421,85 @@ extern const AVInputFormat  ff_simbiosis_imx_demuxer;
 extern const AVInputFormat  ff_sln_demuxer;
 extern const AVInputFormat  ff_smacker_demuxer;
 extern const AVInputFormat  ff_smjpeg_demuxer;
-extern const AVOutputFormat ff_smjpeg_muxer;
-extern const AVOutputFormat ff_smoothstreaming_muxer;
+extern const FFOutputFormat ff_smjpeg_muxer;
+extern const FFOutputFormat ff_smoothstreaming_muxer;
 extern const AVInputFormat  ff_smush_demuxer;
 extern const AVInputFormat  ff_sol_demuxer;
 extern const AVInputFormat  ff_sox_demuxer;
-extern const AVOutputFormat ff_sox_muxer;
-extern const AVOutputFormat ff_spx_muxer;
+extern const FFOutputFormat ff_sox_muxer;
+extern const FFOutputFormat ff_spx_muxer;
 extern const AVInputFormat  ff_spdif_demuxer;
-extern const AVOutputFormat ff_spdif_muxer;
+extern const FFOutputFormat ff_spdif_muxer;
 extern const AVInputFormat  ff_srt_demuxer;
-extern const AVOutputFormat ff_srt_muxer;
+extern const FFOutputFormat ff_srt_muxer;
 extern const AVInputFormat  ff_str_demuxer;
 extern const AVInputFormat  ff_stl_demuxer;
-extern const AVOutputFormat ff_streamhash_muxer;
+extern const FFOutputFormat ff_streamhash_muxer;
 extern const AVInputFormat  ff_subviewer1_demuxer;
 extern const AVInputFormat  ff_subviewer_demuxer;
 extern const AVInputFormat  ff_sup_demuxer;
-extern const AVOutputFormat ff_sup_muxer;
+extern const FFOutputFormat ff_sup_muxer;
 extern const AVInputFormat  ff_svag_demuxer;
 extern const AVInputFormat  ff_svs_demuxer;
 extern const AVInputFormat  ff_swf_demuxer;
-extern const AVOutputFormat ff_swf_muxer;
+extern const FFOutputFormat ff_swf_muxer;
 extern const AVInputFormat  ff_tak_demuxer;
-extern const AVOutputFormat ff_tee_muxer;
+extern const FFOutputFormat ff_tee_muxer;
 extern const AVInputFormat  ff_tedcaptions_demuxer;
-extern const AVOutputFormat ff_tg2_muxer;
-extern const AVOutputFormat ff_tgp_muxer;
+extern const FFOutputFormat ff_tg2_muxer;
+extern const FFOutputFormat ff_tgp_muxer;
 extern const AVInputFormat  ff_thp_demuxer;
 extern const AVInputFormat  ff_threedostr_demuxer;
 extern const AVInputFormat  ff_tiertexseq_demuxer;
-extern const AVOutputFormat ff_mkvtimestamp_v2_muxer;
+extern const FFOutputFormat ff_mkvtimestamp_v2_muxer;
 extern const AVInputFormat  ff_tmv_demuxer;
 extern const AVInputFormat  ff_truehd_demuxer;
-extern const AVOutputFormat ff_truehd_muxer;
+extern const FFOutputFormat ff_truehd_muxer;
 extern const AVInputFormat  ff_tta_demuxer;
-extern const AVOutputFormat ff_tta_muxer;
-extern const AVOutputFormat ff_ttml_muxer;
+extern const FFOutputFormat ff_tta_muxer;
+extern const FFOutputFormat ff_ttml_muxer;
 extern const AVInputFormat  ff_txd_demuxer;
 extern const AVInputFormat  ff_tty_demuxer;
 extern const AVInputFormat  ff_ty_demuxer;
-extern const AVOutputFormat ff_uncodedframecrc_muxer;
+extern const FFOutputFormat ff_uncodedframecrc_muxer;
 extern const AVInputFormat  ff_v210_demuxer;
 extern const AVInputFormat  ff_v210x_demuxer;
 extern const AVInputFormat  ff_vag_demuxer;
 extern const AVInputFormat  ff_vc1_demuxer;
-extern const AVOutputFormat ff_vc1_muxer;
+extern const FFOutputFormat ff_vc1_muxer;
 extern const AVInputFormat  ff_vc1t_demuxer;
-extern const AVOutputFormat ff_vc1t_muxer;
+extern const FFOutputFormat ff_vc1t_muxer;
 extern const AVInputFormat  ff_vividas_demuxer;
 extern const AVInputFormat  ff_vivo_demuxer;
 extern const AVInputFormat  ff_vmd_demuxer;
 extern const AVInputFormat  ff_vobsub_demuxer;
 extern const AVInputFormat  ff_voc_demuxer;
-extern const AVOutputFormat ff_voc_muxer;
+extern const FFOutputFormat ff_voc_muxer;
 extern const AVInputFormat  ff_vpk_demuxer;
 extern const AVInputFormat  ff_vplayer_demuxer;
 extern const AVInputFormat  ff_vqf_demuxer;
 extern const AVInputFormat  ff_w64_demuxer;
-extern const AVOutputFormat ff_w64_muxer;
+extern const FFOutputFormat ff_w64_muxer;
 extern const AVInputFormat  ff_wady_demuxer;
 extern const AVInputFormat  ff_wav_demuxer;
-extern const AVOutputFormat ff_wav_muxer;
+extern const FFOutputFormat ff_wav_muxer;
 extern const AVInputFormat  ff_wc3_demuxer;
-extern const AVOutputFormat ff_webm_muxer;
+extern const FFOutputFormat ff_webm_muxer;
 extern const AVInputFormat  ff_webm_dash_manifest_demuxer;
-extern const AVOutputFormat ff_webm_dash_manifest_muxer;
-extern const AVOutputFormat ff_webm_chunk_muxer;
-extern const AVOutputFormat ff_webp_muxer;
+extern const FFOutputFormat ff_webm_dash_manifest_muxer;
+extern const FFOutputFormat ff_webm_chunk_muxer;
+extern const FFOutputFormat ff_webp_muxer;
 extern const AVInputFormat  ff_webvtt_demuxer;
-extern const AVOutputFormat ff_webvtt_muxer;
+extern const FFOutputFormat ff_webvtt_muxer;
 extern const AVInputFormat  ff_wsaud_demuxer;
-extern const AVOutputFormat ff_wsaud_muxer;
+extern const FFOutputFormat ff_wsaud_muxer;
 extern const AVInputFormat  ff_wsd_demuxer;
 extern const AVInputFormat  ff_wsvqa_demuxer;
 extern const AVInputFormat  ff_wtv_demuxer;
-extern const AVOutputFormat ff_wtv_muxer;
+extern const FFOutputFormat ff_wtv_muxer;
 extern const AVInputFormat  ff_wve_demuxer;
 extern const AVInputFormat  ff_wv_demuxer;
-extern const AVOutputFormat ff_wv_muxer;
+extern const FFOutputFormat ff_wv_muxer;
 extern const AVInputFormat  ff_xa_demuxer;
 extern const AVInputFormat  ff_xbin_demuxer;
 extern const AVInputFormat  ff_xmv_demuxer;
@@ -506,7 +507,7 @@ extern const AVInputFormat  ff_xvag_demuxer;
 extern const AVInputFormat  ff_xwma_demuxer;
 extern const AVInputFormat  ff_yop_demuxer;
 extern const AVInputFormat  ff_yuv4mpegpipe_demuxer;
-extern const AVOutputFormat ff_yuv4mpegpipe_muxer;
+extern const FFOutputFormat ff_yuv4mpegpipe_muxer;
 /* image demuxers */
 extern const AVInputFormat  ff_image_bmp_pipe_demuxer;
 extern const AVInputFormat  ff_image_cri_pipe_demuxer;
@@ -546,7 +547,7 @@ extern const AVInputFormat  ff_image_xpm_pipe_demuxer;
 extern const AVInputFormat  ff_image_xwd_pipe_demuxer;
 
 /* external libraries */
-extern const AVOutputFormat ff_chromaprint_muxer;
+extern const FFOutputFormat ff_chromaprint_muxer;
 extern const AVInputFormat  ff_libgme_demuxer;
 extern const AVInputFormat  ff_libmodplug_demuxer;
 extern const AVInputFormat  ff_libopenmpt_demuxer;
@@ -562,19 +563,21 @@ const AVOutputFormat *av_muxer_iterate(void **opaque)
 {
     static const uintptr_t size = sizeof(muxer_list)/sizeof(muxer_list[0]) - 1;
     uintptr_t i = (uintptr_t)*opaque;
-    const AVOutputFormat *f = NULL;
+    const FFOutputFormat *f = NULL;
     uintptr_t tmp;
 
     if (i < size) {
         f = muxer_list[i];
     } else if (tmp = atomic_load_explicit(&outdev_list_intptr, memory_order_relaxed)) {
-        const AVOutputFormat *const *outdev_list = (const AVOutputFormat *const *)tmp;
+        const FFOutputFormat *const *outdev_list = (const FFOutputFormat *const *)tmp;
         f = outdev_list[i - size];
     }
 
-    if (f)
+    if (f) {
         *opaque = (void*)(i + 1);
-    return f;
+        return &f->p;
+    }
+    return NULL;
 }
 
 const AVInputFormat *av_demuxer_iterate(void **opaque)
@@ -596,7 +599,7 @@ const AVInputFormat *av_demuxer_iterate(void **opaque)
     return f;
 }
 
-void avpriv_register_devices(const AVOutputFormat * const o[], const AVInputFormat * const i[])
+void avpriv_register_devices(const FFOutputFormat * const o[], const AVInputFormat * const i[])
 {
     atomic_store_explicit(&outdev_list_intptr, (uintptr_t)o, memory_order_relaxed);
     atomic_store_explicit(&indev_list_intptr,  (uintptr_t)i, memory_order_relaxed);
diff --git a/libavformat/alp.c b/libavformat/alp.c
index 40e4890a38..8c6066a59c 100644
--- a/libavformat/alp.c
+++ b/libavformat/alp.c
@@ -25,6 +25,7 @@
 #include "libavutil/channel_layout.h"
 #include "avformat.h"
 #include "internal.h"
+#include "mux.h"
 #include "rawenc.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/internal.h"
@@ -290,16 +291,16 @@ static const AVClass alp_muxer_class = {
     .version    = LIBAVUTIL_VERSION_INT
 };
 
-const AVOutputFormat ff_alp_muxer = {
-    .name           = "alp",
-    .long_name      = NULL_IF_CONFIG_SMALL("LEGO Racers ALP"),
-    .extensions     = "tun,pcm",
-    .audio_codec    = AV_CODEC_ID_ADPCM_IMA_ALP,
-    .video_codec    = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_alp_muxer = {
+    .p.name         = "alp",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("LEGO Racers ALP"),
+    .p.extensions   = "tun,pcm",
+    .p.audio_codec  = AV_CODEC_ID_ADPCM_IMA_ALP,
+    .p.video_codec  = AV_CODEC_ID_NONE,
+    .p.priv_class   = &alp_muxer_class,
     .init           = alp_write_init,
     .write_header   = alp_write_header,
     .write_packet   = ff_raw_write_packet,
-    .priv_class     = &alp_muxer_class,
     .priv_data_size = sizeof(ALPMuxContext)
 };
 #endif
diff --git a/libavformat/amr.c b/libavformat/amr.c
index 88f07ce0ba..b6615d8295 100644
--- a/libavformat/amr.c
+++ b/libavformat/amr.c
@@ -30,6 +30,7 @@ Write and read amr data according to RFC3267, http://www.ietf.org/rfc/rfc3267.tx
 #include "avformat.h"
 #include "avio_internal.h"
 #include "internal.h"
+#include "mux.h"
 #include "rawdec.h"
 #include "rawenc.h"
 
@@ -266,15 +267,15 @@ const AVInputFormat ff_amrwb_demuxer = {
 #endif
 
 #if CONFIG_AMR_MUXER
-const AVOutputFormat ff_amr_muxer = {
-    .name              = "amr",
-    .long_name         = NULL_IF_CONFIG_SMALL("3GPP AMR"),
-    .mime_type         = "audio/amr",
-    .extensions        = "amr",
-    .audio_codec       = AV_CODEC_ID_AMR_NB,
-    .video_codec       = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_amr_muxer = {
+    .p.name            = "amr",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("3GPP AMR"),
+    .p.mime_type       = "audio/amr",
+    .p.extensions      = "amr",
+    .p.audio_codec     = AV_CODEC_ID_AMR_NB,
+    .p.video_codec     = AV_CODEC_ID_NONE,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
     .write_header      = amr_write_header,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
 };
 #endif
diff --git a/libavformat/amvenc.c b/libavformat/amvenc.c
index 28d4879b19..e1b1ffd42e 100644
--- a/libavformat/amvenc.c
+++ b/libavformat/amvenc.c
@@ -20,6 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include "avformat.h"
+#include "mux.h"
 #include "riff.h"
 #include "internal.h"
 #include "avio_internal.h"
@@ -401,14 +402,14 @@ static int amv_write_trailer(AVFormatContext *s)
     return 0;
 }
 
-const AVOutputFormat ff_amv_muxer = {
-    .name           = "amv",
-    .long_name      = NULL_IF_CONFIG_SMALL("AMV"),
-    .mime_type      = "video/amv",
-    .extensions     = "amv",
+const FFOutputFormat ff_amv_muxer = {
+    .p.name         = "amv",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("AMV"),
+    .p.mime_type    = "video/amv",
+    .p.extensions   = "amv",
     .priv_data_size = sizeof(AMVContext),
-    .audio_codec    = AV_CODEC_ID_ADPCM_IMA_AMV,
-    .video_codec    = AV_CODEC_ID_AMV,
+    .p.audio_codec  = AV_CODEC_ID_ADPCM_IMA_AMV,
+    .p.video_codec  = AV_CODEC_ID_AMV,
     .init           = amv_init,
     .deinit         = amv_deinit,
     .write_header   = amv_write_header,
diff --git a/libavformat/apm.c b/libavformat/apm.c
index a3ddc08e83..ccb8e22437 100644
--- a/libavformat/apm.c
+++ b/libavformat/apm.c
@@ -24,6 +24,7 @@
 
 #include "avformat.h"
 #include "internal.h"
+#include "mux.h"
 #include "rawenc.h"
 #include "libavutil/channel_layout.h"
 #include "libavutil/internal.h"
@@ -303,12 +304,12 @@ static int apm_write_trailer(AVFormatContext *s)
     return 0;
 }
 
-const AVOutputFormat ff_apm_muxer = {
-    .name           = "apm",
-    .long_name      = NULL_IF_CONFIG_SMALL("Ubisoft Rayman 2 APM"),
-    .extensions     = "apm",
-    .audio_codec    = AV_CODEC_ID_ADPCM_IMA_APM,
-    .video_codec    = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_apm_muxer = {
+    .p.name         = "apm",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("Ubisoft Rayman 2 APM"),
+    .p.extensions   = "apm",
+    .p.audio_codec  = AV_CODEC_ID_ADPCM_IMA_APM,
+    .p.video_codec  = AV_CODEC_ID_NONE,
     .init           = apm_write_init,
     .write_header   = apm_write_header,
     .write_packet   = ff_raw_write_packet,
diff --git a/libavformat/apngenc.c b/libavformat/apngenc.c
index cddb148d50..a0af916f14 100644
--- a/libavformat/apngenc.c
+++ b/libavformat/apngenc.c
@@ -22,6 +22,7 @@
  */
 
 #include "avformat.h"
+#include "mux.h"
 #include "libavutil/avassert.h"
 #include "libavutil/crc.h"
 #include "libavutil/intreadwrite.h"
@@ -306,18 +307,18 @@ static const AVClass apng_muxer_class = {
     .option     = options,
 };
 
-const AVOutputFormat ff_apng_muxer = {
-    .name           = "apng",
-    .long_name      = NULL_IF_CONFIG_SMALL("Animated Portable Network Graphics"),
-    .mime_type      = "image/png",
-    .extensions     = "apng",
+const FFOutputFormat ff_apng_muxer = {
+    .p.name         = "apng",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("Animated Portable Network Graphics"),
+    .p.mime_type    = "image/png",
+    .p.extensions   = "apng",
     .priv_data_size = sizeof(APNGMuxContext),
-    .audio_codec    = AV_CODEC_ID_NONE,
-    .video_codec    = AV_CODEC_ID_APNG,
+    .p.audio_codec  = AV_CODEC_ID_NONE,
+    .p.video_codec  = AV_CODEC_ID_APNG,
     .write_header   = apng_write_header,
     .write_packet   = apng_write_packet,
     .write_trailer  = apng_write_trailer,
     .deinit         = apng_deinit,
-    .priv_class     = &apng_muxer_class,
-    .flags          = AVFMT_VARIABLE_FPS,
+    .p.priv_class   = &apng_muxer_class,
+    .p.flags        = AVFMT_VARIABLE_FPS,
 };
diff --git a/libavformat/argo_asf.c b/libavformat/argo_asf.c
index 39a60a0dde..5f38b68b6a 100644
--- a/libavformat/argo_asf.c
+++ b/libavformat/argo_asf.c
@@ -25,6 +25,7 @@
 #include "libavutil/avstring.h"
 #include "avformat.h"
 #include "internal.h"
+#include "mux.h"
 #include "libavutil/channel_layout.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/avassert.h"
@@ -470,20 +471,20 @@ static const AVClass argo_asf_muxer_class = {
     .version    = LIBAVUTIL_VERSION_INT
 };
 
-const AVOutputFormat ff_argo_asf_muxer = {
-    .name           = "argo_asf",
-    .long_name      = NULL_IF_CONFIG_SMALL("Argonaut Games ASF"),
+const FFOutputFormat ff_argo_asf_muxer = {
+    .p.name         = "argo_asf",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("Argonaut Games ASF"),
     /*
      * NB: Can't do this as it conflicts with the actual ASF format.
-     * .extensions  = "asf",
+     * .p.extensions  = "asf",
      */
-    .audio_codec    = AV_CODEC_ID_ADPCM_ARGO,
-    .video_codec    = AV_CODEC_ID_NONE,
+    .p.audio_codec  = AV_CODEC_ID_ADPCM_ARGO,
+    .p.video_codec  = AV_CODEC_ID_NONE,
+    .p.priv_class   = &argo_asf_muxer_class,
     .init           = argo_asf_write_init,
     .write_header   = argo_asf_write_header,
     .write_packet   = argo_asf_write_packet,
     .write_trailer  = argo_asf_write_trailer,
-    .priv_class     = &argo_asf_muxer_class,
     .priv_data_size = sizeof(ArgoASFMuxContext)
 };
 #endif
diff --git a/libavformat/argo_cvg.c b/libavformat/argo_cvg.c
index aedc7c4a32..2c74200b7d 100644
--- a/libavformat/argo_cvg.c
+++ b/libavformat/argo_cvg.c
@@ -26,6 +26,7 @@
 #include "libavutil/channel_layout.h"
 #include "avformat.h"
 #include "internal.h"
+#include "mux.h"
 #include "libavutil/opt.h"
 #include "libavutil/intreadwrite.h"
 
@@ -400,17 +401,17 @@ static const AVClass argo_cvg_muxer_class = {
     .version    = LIBAVUTIL_VERSION_INT
 };
 
-const AVOutputFormat ff_argo_cvg_muxer = {
-    .name           = "argo_cvg",
-    .long_name      = NULL_IF_CONFIG_SMALL("Argonaut Games CVG"),
-    .extensions     = "cvg",
-    .audio_codec    = AV_CODEC_ID_ADPCM_PSX,
-    .video_codec    = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_argo_cvg_muxer = {
+    .p.name         = "argo_cvg",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("Argonaut Games CVG"),
+    .p.extensions   = "cvg",
+    .p.audio_codec  = AV_CODEC_ID_ADPCM_PSX,
+    .p.video_codec  = AV_CODEC_ID_NONE,
+    .p.priv_class   = &argo_cvg_muxer_class,
     .init           = argo_cvg_write_init,
     .write_header   = argo_cvg_write_header,
     .write_packet   = argo_cvg_write_packet,
     .write_trailer  = argo_cvg_write_trailer,
-    .priv_class     = &argo_cvg_muxer_class,
     .priv_data_size = sizeof(ArgoCVGMuxContext),
 };
 #endif
diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c
index 47240fc0a8..244c7e7a27 100644
--- a/libavformat/asfenc.c
+++ b/libavformat/asfenc.c
@@ -1129,39 +1129,39 @@ static const AVClass asf_muxer_class = {
 };
 
 #if CONFIG_ASF_MUXER
-const AVOutputFormat ff_asf_muxer = {
-    .name           = "asf",
-    .long_name      = NULL_IF_CONFIG_SMALL("ASF (Advanced / Active Streaming Format)"),
-    .mime_type      = "video/x-ms-asf",
-    .extensions     = "asf,wmv,wma",
+const FFOutputFormat ff_asf_muxer = {
+    .p.name         = "asf",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("ASF (Advanced / Active Streaming Format)"),
+    .p.mime_type    = "video/x-ms-asf",
+    .p.extensions   = "asf,wmv,wma",
+    .p.audio_codec  = AV_CODEC_ID_WMAV2,
+    .p.video_codec  = AV_CODEC_ID_MSMPEG4V3,
+    .p.flags        = AVFMT_GLOBALHEADER,
+    .p.codec_tag    = asf_codec_tags,
+    .p.priv_class   = &asf_muxer_class,
     .priv_data_size = sizeof(ASFContext),
-    .audio_codec    = AV_CODEC_ID_WMAV2,
-    .video_codec    = AV_CODEC_ID_MSMPEG4V3,
     .write_header   = asf_write_header,
     .write_packet   = asf_write_packet,
     .write_trailer  = asf_write_trailer,
-    .flags          = AVFMT_GLOBALHEADER,
-    .codec_tag      = asf_codec_tags,
-    .priv_class        = &asf_muxer_class,
     .deinit         = asf_deinit,
 };
 #endif /* CONFIG_ASF_MUXER */
 
 #if CONFIG_ASF_STREAM_MUXER
-const AVOutputFormat ff_asf_stream_muxer = {
-    .name           = "asf_stream",
-    .long_name      = NULL_IF_CONFIG_SMALL("ASF (Advanced / Active Streaming Format)"),
-    .mime_type      = "video/x-ms-asf",
-    .extensions     = "asf,wmv,wma",
+const FFOutputFormat ff_asf_stream_muxer = {
+    .p.name         = "asf_stream",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("ASF (Advanced / Active Streaming Format)"),
+    .p.mime_type    = "video/x-ms-asf",
+    .p.extensions   = "asf,wmv,wma",
     .priv_data_size = sizeof(ASFContext),
-    .audio_codec    = AV_CODEC_ID_WMAV2,
-    .video_codec    = AV_CODEC_ID_MSMPEG4V3,
+    .p.audio_codec  = AV_CODEC_ID_WMAV2,
+    .p.video_codec  = AV_CODEC_ID_MSMPEG4V3,
     .write_header   = asf_write_stream_header,
     .write_packet   = asf_write_packet,
     .write_trailer  = asf_write_trailer,
-    .flags          = AVFMT_GLOBALHEADER,
-    .codec_tag      = asf_codec_tags,
-    .priv_class     = &asf_muxer_class,
+    .p.flags        = AVFMT_GLOBALHEADER,
+    .p.codec_tag    = asf_codec_tags,
+    .p.priv_class   = &asf_muxer_class,
     .deinit         = asf_deinit,
 };
 #endif /* CONFIG_ASF_STREAM_MUXER */
diff --git a/libavformat/assenc.c b/libavformat/assenc.c
index 1600f0a02b..85a1e53371 100644
--- a/libavformat/assenc.c
+++ b/libavformat/assenc.c
@@ -22,6 +22,7 @@
 #include "libavutil/avstring.h"
 #include "avformat.h"
 #include "internal.h"
+#include "mux.h"
 
 #include "libavutil/opt.h"
 
@@ -226,16 +227,16 @@ static const AVClass ass_class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
-const AVOutputFormat ff_ass_muxer = {
-    .name           = "ass",
-    .long_name      = NULL_IF_CONFIG_SMALL("SSA (SubStation Alpha) subtitle"),
-    .mime_type      = "text/x-ass",
-    .extensions     = "ass,ssa",
+const FFOutputFormat ff_ass_muxer = {
+    .p.name           = "ass",
+    .p.long_name      = NULL_IF_CONFIG_SMALL("SSA (SubStation Alpha) subtitle"),
+    .p.mime_type      = "text/x-ass",
+    .p.extensions     = "ass,ssa",
+    .p.subtitle_codec = AV_CODEC_ID_ASS,
+    .p.flags          = AVFMT_GLOBALHEADER | AVFMT_NOTIMESTAMPS | AVFMT_TS_NONSTRICT,
+    .p.priv_class     = &ass_class,
     .priv_data_size = sizeof(ASSContext),
-    .subtitle_codec = AV_CODEC_ID_ASS,
     .write_header   = write_header,
     .write_packet   = write_packet,
     .write_trailer  = write_trailer,
-    .flags          = AVFMT_GLOBALHEADER | AVFMT_NOTIMESTAMPS | AVFMT_TS_NONSTRICT,
-    .priv_class     = &ass_class,
 };
diff --git a/libavformat/astenc.c b/libavformat/astenc.c
index b29cfc4aaf..9dd388040f 100644
--- a/libavformat/astenc.c
+++ b/libavformat/astenc.c
@@ -23,6 +23,7 @@
 #include "avio_internal.h"
 #include "internal.h"
 #include "ast.h"
+#include "mux.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/opt.h"
 
@@ -194,16 +195,16 @@ static const AVClass ast_muxer_class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
-const AVOutputFormat ff_ast_muxer = {
-    .name              = "ast",
-    .long_name         = NULL_IF_CONFIG_SMALL("AST (Audio Stream)"),
-    .extensions        = "ast",
+const FFOutputFormat ff_ast_muxer = {
+    .p.name            = "ast",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("AST (Audio Stream)"),
+    .p.extensions      = "ast",
     .priv_data_size    = sizeof(ASTMuxContext),
-    .audio_codec       = AV_CODEC_ID_PCM_S16BE_PLANAR,
-    .video_codec       = AV_CODEC_ID_NONE,
+    .p.audio_codec     = AV_CODEC_ID_PCM_S16BE_PLANAR,
+    .p.video_codec     = AV_CODEC_ID_NONE,
     .write_header      = ast_write_header,
     .write_packet      = ast_write_packet,
     .write_trailer     = ast_write_trailer,
-    .priv_class        = &ast_muxer_class,
-    .codec_tag         = ff_ast_codec_tags_list,
+    .p.priv_class      = &ast_muxer_class,
+    .p.codec_tag       = ff_ast_codec_tags_list,
 };
diff --git a/libavformat/au.c b/libavformat/au.c
index f7c47d5333..3bf2150258 100644
--- a/libavformat/au.c
+++ b/libavformat/au.c
@@ -33,6 +33,7 @@
 #include "avformat.h"
 #include "internal.h"
 #include "avio_internal.h"
+#include "mux.h"
 #include "pcm.h"
 #include "libavutil/avassert.h"
 
@@ -331,19 +332,19 @@ static int au_write_trailer(AVFormatContext *s)
     return 0;
 }
 
-const AVOutputFormat ff_au_muxer = {
-    .name          = "au",
-    .long_name     = NULL_IF_CONFIG_SMALL("Sun AU"),
-    .mime_type     = "audio/basic",
-    .extensions    = "au",
+const FFOutputFormat ff_au_muxer = {
+    .p.name         = "au",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("Sun AU"),
+    .p.mime_type    = "audio/basic",
+    .p.extensions   = "au",
+    .p.codec_tag    = au_codec_tags,
+    .p.audio_codec  = AV_CODEC_ID_PCM_S16BE,
+    .p.video_codec  = AV_CODEC_ID_NONE,
+    .p.flags        = AVFMT_NOTIMESTAMPS,
     .priv_data_size = sizeof(AUContext),
-    .audio_codec   = AV_CODEC_ID_PCM_S16BE,
-    .video_codec   = AV_CODEC_ID_NONE,
     .write_header  = au_write_header,
     .write_packet  = ff_raw_write_packet,
     .write_trailer = au_write_trailer,
-    .codec_tag     = au_codec_tags,
-    .flags         = AVFMT_NOTIMESTAMPS,
 };
 
 #endif /* CONFIG_AU_MUXER */
diff --git a/libavformat/avformat.c b/libavformat/avformat.c
index ecb2cc5311..a2767836b3 100644
--- a/libavformat/avformat.c
+++ b/libavformat/avformat.c
@@ -35,6 +35,7 @@
 #include "avformat.h"
 #include "avio.h"
 #include "demux.h"
+#include "mux.h"
 #include "internal.h"
 
 void ff_free_stream(AVStream **pst)
@@ -100,8 +101,8 @@ void avformat_free_context(AVFormatContext *s)
         return;
     si = ffformatcontext(s);
 
-    if (s->oformat && s->oformat->deinit && si->initialized)
-        s->oformat->deinit(s);
+    if (s->oformat && ffofmt(s->oformat)->deinit && si->initialized)
+        ffofmt(s->oformat)->deinit(s);
 
     av_opt_free(s);
     if (s->iformat && s->iformat->priv_class && s->priv_data)
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 38578a08e4..b986aacc78 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -328,10 +328,8 @@
 #endif
 
 struct AVFormatContext;
-struct AVStream;
 
 struct AVDeviceInfoList;
-struct AVDeviceCapabilitiesQuery;
 
 /**
  * @defgroup metadata_api Public Metadata API
@@ -536,113 +534,6 @@ typedef struct AVOutputFormat {
 
 
     const AVClass *priv_class; ///< AVClass for the private context
-
-    /*****************************************************************
-     * No fields below this line are part of the public API. They
-     * may not be used outside of libavformat and can be changed and
-     * removed at will.
-     * New public fields should be added right above.
-     *****************************************************************
-     */
-    /**
-     * size of private data so that it can be allocated in the wrapper
-     */
-    int priv_data_size;
-
-    /**
-     * Internal flags. See FF_FMT_FLAG_* in internal.h.
-     */
-    int flags_internal;
-
-    int (*write_header)(struct AVFormatContext *);
-    /**
-     * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags,
-     * pkt can be NULL in order to flush data buffered in the muxer.
-     * When flushing, return 0 if there still is more data to flush,
-     * or 1 if everything was flushed and there is no more buffered
-     * data.
-     */
-    int (*write_packet)(struct AVFormatContext *, AVPacket *pkt);
-    int (*write_trailer)(struct AVFormatContext *);
-    /**
-     * A format-specific function for interleavement.
-     * If unset, packets will be interleaved by dts.
-     *
-     * @param s           An AVFormatContext for output. pkt will be added to
-     *                    resp. taken from its packet buffer.
-     * @param[in,out] pkt A packet to be interleaved if has_packet is set;
-     *                    also used to return packets. If no packet is returned
-     *                    (e.g. on error), pkt is blank on return.
-     * @param flush       1 if no further packets are available as input and
-     *                    all remaining packets should be output.
-     * @param has_packet  If set, pkt contains a packet to be interleaved
-     *                    on input; otherwise pkt is blank on input.
-     * @return 1 if a packet was output, 0 if no packet could be output,
-     *         < 0 if an error occurred
-     */
-    int (*interleave_packet)(struct AVFormatContext *s, AVPacket *pkt,
-                             int flush, int has_packet);
-    /**
-     * Test if the given codec can be stored in this container.
-     *
-     * @return 1 if the codec is supported, 0 if it is not.
-     *         A negative number if unknown.
-     *         MKTAG('A', 'P', 'I', 'C') if the codec is only supported as AV_DISPOSITION_ATTACHED_PIC
-     */
-    int (*query_codec)(enum AVCodecID id, int std_compliance);
-
-    void (*get_output_timestamp)(struct AVFormatContext *s, int stream,
-                                 int64_t *dts, int64_t *wall);
-    /**
-     * Allows sending messages from application to device.
-     */
-    int (*control_message)(struct AVFormatContext *s, int type,
-                           void *data, size_t data_size);
-
-    /**
-     * Write an uncoded AVFrame.
-     *
-     * See av_write_uncoded_frame() for details.
-     *
-     * The library will free *frame afterwards, but the muxer can prevent it
-     * by setting the pointer to NULL.
-     */
-    int (*write_uncoded_frame)(struct AVFormatContext *, int stream_index,
-                               AVFrame **frame, unsigned flags);
-    /**
-     * Returns device list with it properties.
-     * @see avdevice_list_devices() for more details.
-     */
-    int (*get_device_list)(struct AVFormatContext *s, struct AVDeviceInfoList *device_list);
-    /**
-     * Initialize format. May allocate data here, and set any AVFormatContext or
-     * AVStream parameters that need to be set before packets are sent.
-     * This method must not write output.
-     *
-     * Return 0 if streams were fully configured, 1 if not, negative AVERROR on failure
-     *
-     * Any allocations made here must be freed in deinit().
-     */
-    int (*init)(struct AVFormatContext *);
-    /**
-     * Deinitialize format. If present, this is called whenever the muxer is being
-     * destroyed, regardless of whether or not the header has been written.
-     *
-     * If a trailer is being written, this is called after write_trailer().
-     *
-     * This is called if init() fails as well.
-     */
-    void (*deinit)(struct AVFormatContext *);
-    /**
-     * Set up any necessary bitstream filtering and extract any extra data needed
-     * for the global header.
-     *
-     * @note pkt might have been directly forwarded by a meta-muxer; therefore
-     *       pkt->stream_index as well as the pkt's timebase might be invalid.
-     * Return 0 if more packets from this stream must be checked; 1 if not.
-     */
-    int (*check_bitstream)(struct AVFormatContext *s, struct AVStream *st,
-                           const AVPacket *pkt);
 } AVOutputFormat;
 /**
  * @}
diff --git a/libavformat/avienc.c b/libavformat/avienc.c
index 14115b3e2b..a61e5c3109 100644
--- a/libavformat/avienc.c
+++ b/libavformat/avienc.c
@@ -28,6 +28,7 @@
 #include "config_components.h"
 #include "riff.h"
 #include "mpegts.h"
+#include "mux.h"
 #include "rawutils.h"
 #include "libavformat/avlanguage.h"
 #include "libavutil/avstring.h"
@@ -1003,19 +1004,19 @@ static const AVClass avi_muxer_class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
-const AVOutputFormat ff_avi_muxer = {
-    .name           = "avi",
-    .long_name      = NULL_IF_CONFIG_SMALL("AVI (Audio Video Interleaved)"),
-    .mime_type      = "video/x-msvideo",
-    .extensions     = "avi",
+const FFOutputFormat ff_avi_muxer = {
+    .p.name         = "avi",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("AVI (Audio Video Interleaved)"),
+    .p.mime_type    = "video/x-msvideo",
+    .p.extensions   = "avi",
     .priv_data_size = sizeof(AVIContext),
-    .audio_codec    = CONFIG_LIBMP3LAME ? AV_CODEC_ID_MP3 : AV_CODEC_ID_AC3,
-    .video_codec    = AV_CODEC_ID_MPEG4,
+    .p.audio_codec  = CONFIG_LIBMP3LAME ? AV_CODEC_ID_MP3 : AV_CODEC_ID_AC3,
+    .p.video_codec  = AV_CODEC_ID_MPEG4,
     .init           = avi_init,
     .deinit         = avi_deinit,
     .write_header   = avi_write_header,
     .write_packet   = avi_write_packet,
     .write_trailer  = avi_write_trailer,
-    .codec_tag      = ff_riff_codec_tags_list,
-    .priv_class     = &avi_muxer_class,
+    .p.codec_tag    = ff_riff_codec_tags_list,
+    .p.priv_class   = &avi_muxer_class,
 };
diff --git a/libavformat/bit.c b/libavformat/bit.c
index 9efb4ac070..c3b9cf4d3d 100644
--- a/libavformat/bit.c
+++ b/libavformat/bit.c
@@ -23,6 +23,7 @@
 
 #include "avformat.h"
 #include "internal.h"
+#include "mux.h"
 #include "libavcodec/get_bits.h"
 #include "libavcodec/put_bits.h"
 
@@ -158,13 +159,13 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
     return 0;
 }
 
-const AVOutputFormat ff_bit_muxer = {
-    .name         = "bit",
-    .long_name    = NULL_IF_CONFIG_SMALL("G.729 BIT file format"),
-    .mime_type    = "audio/bit",
-    .extensions   = "bit",
-    .audio_codec  = AV_CODEC_ID_G729,
-    .video_codec  = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_bit_muxer = {
+    .p.name         = "bit",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("G.729 BIT file format"),
+    .p.mime_type    = "audio/bit",
+    .p.extensions   = "bit",
+    .p.audio_codec  = AV_CODEC_ID_G729,
+    .p.video_codec  = AV_CODEC_ID_NONE,
     .write_header = write_header,
     .write_packet = write_packet,
 };
diff --git a/libavformat/cafenc.c b/libavformat/cafenc.c
index b8317cd5ed..67be59806c 100644
--- a/libavformat/cafenc.c
+++ b/libavformat/cafenc.c
@@ -276,16 +276,16 @@ static int caf_write_trailer(AVFormatContext *s)
     return 0;
 }
 
-const AVOutputFormat ff_caf_muxer = {
-    .name           = "caf",
-    .long_name      = NULL_IF_CONFIG_SMALL("Apple CAF (Core Audio Format)"),
-    .mime_type      = "audio/x-caf",
-    .extensions     = "caf",
+const FFOutputFormat ff_caf_muxer = {
+    .p.name         = "caf",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("Apple CAF (Core Audio Format)"),
+    .p.mime_type    = "audio/x-caf",
+    .p.extensions   = "caf",
     .priv_data_size = sizeof(CAFContext),
-    .audio_codec    = AV_CODEC_ID_PCM_S16BE,
-    .video_codec    = AV_CODEC_ID_NONE,
+    .p.audio_codec  = AV_CODEC_ID_PCM_S16BE,
+    .p.video_codec  = AV_CODEC_ID_NONE,
     .write_header   = caf_write_header,
     .write_packet   = caf_write_packet,
     .write_trailer  = caf_write_trailer,
-    .codec_tag      = ff_caf_codec_tags_list,
+    .p.codec_tag    = ff_caf_codec_tags_list,
 };
diff --git a/libavformat/chromaprint.c b/libavformat/chromaprint.c
index 3953a5ced3..9e5fd780c1 100644
--- a/libavformat/chromaprint.c
+++ b/libavformat/chromaprint.c
@@ -21,6 +21,7 @@
 
 #include "avformat.h"
 #include "internal.h"
+#include "mux.h"
 #include "libavutil/opt.h"
 #include <chromaprint.h>
 
@@ -176,15 +177,15 @@ static const AVClass chromaprint_class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
-const AVOutputFormat ff_chromaprint_muxer = {
-    .name              = "chromaprint",
-    .long_name         = NULL_IF_CONFIG_SMALL("Chromaprint"),
+const FFOutputFormat ff_chromaprint_muxer = {
+    .p.name            = "chromaprint",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("Chromaprint"),
     .priv_data_size    = sizeof(ChromaprintMuxContext),
-    .audio_codec       = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
+    .p.audio_codec     = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
     .write_header      = write_header,
     .write_packet      = write_packet,
     .write_trailer     = write_trailer,
     .deinit            = deinit,
-    .flags             = AVFMT_NOTIMESTAMPS,
-    .priv_class        = &chromaprint_class,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
+    .p.priv_class      = &chromaprint_class,
 };
diff --git a/libavformat/codec2.c b/libavformat/codec2.c
index 400c5acbdb..f0f7b89253 100644
--- a/libavformat/codec2.c
+++ b/libavformat/codec2.c
@@ -28,6 +28,7 @@
 #include "avio_internal.h"
 #include "avformat.h"
 #include "internal.h"
+#include "mux.h"
 #include "rawenc.h"
 #include "pcm.h"
 
@@ -309,16 +310,16 @@ const AVInputFormat ff_codec2_demuxer = {
 #endif
 
 #if CONFIG_CODEC2_MUXER
-const AVOutputFormat ff_codec2_muxer = {
-    .name           = "codec2",
-    .long_name      = NULL_IF_CONFIG_SMALL("codec2 .c2 muxer"),
+const FFOutputFormat ff_codec2_muxer = {
+    .p.name         = "codec2",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("codec2 .c2 muxer"),
+    .p.extensions   = "c2",
+    .p.audio_codec  = AV_CODEC_ID_CODEC2,
+    .p.video_codec  = AV_CODEC_ID_NONE,
+    .p.flags        = AVFMT_NOTIMESTAMPS,
     .priv_data_size = sizeof(Codec2Context),
-    .extensions     = "c2",
-    .audio_codec    = AV_CODEC_ID_CODEC2,
-    .video_codec    = AV_CODEC_ID_NONE,
     .write_header   = codec2_write_header,
     .write_packet   = ff_raw_write_packet,
-    .flags          = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
diff --git a/libavformat/crcenc.c b/libavformat/crcenc.c
index 9f40dd4ec0..1779bdd91c 100644
--- a/libavformat/crcenc.c
+++ b/libavformat/crcenc.c
@@ -23,6 +23,7 @@
 
 #include "libavutil/adler32.h"
 #include "avformat.h"
+#include "mux.h"
 
 typedef struct CRCState {
     uint32_t crcval;
@@ -54,14 +55,14 @@ static int crc_write_trailer(struct AVFormatContext *s)
     return 0;
 }
 
-const AVOutputFormat ff_crc_muxer = {
-    .name              = "crc",
-    .long_name         = NULL_IF_CONFIG_SMALL("CRC testing"),
+const FFOutputFormat ff_crc_muxer = {
+    .p.name            = "crc",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("CRC testing"),
     .priv_data_size    = sizeof(CRCState),
-    .audio_codec       = AV_CODEC_ID_PCM_S16LE,
-    .video_codec       = AV_CODEC_ID_RAWVIDEO,
+    .p.audio_codec     = AV_CODEC_ID_PCM_S16LE,
+    .p.video_codec     = AV_CODEC_ID_RAWVIDEO,
     .init              = crc_init,
     .write_packet      = crc_write_packet,
     .write_trailer     = crc_write_trailer,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 8e725a0d3f..52865eacb5 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -2346,10 +2346,10 @@ static int dash_check_bitstream(AVFormatContext *s, AVStream *st,
     DASHContext *c = s->priv_data;
     OutputStream *os = &c->streams[st->index];
     AVFormatContext *oc = os->ctx;
-    if (oc->oformat->check_bitstream) {
+    if (ffofmt(oc->oformat)->check_bitstream) {
         AVStream *const ost = oc->streams[0];
         int ret;
-        ret = oc->oformat->check_bitstream(oc, ost, avpkt);
+        ret = ffofmt(oc->oformat)->check_bitstream(oc, ost, avpkt);
         if (ret == 1) {
             FFStream *const  sti = ffstream(st);
             FFStream *const osti = ffstream(ost);
@@ -2419,19 +2419,19 @@ static const AVClass dash_class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
-const AVOutputFormat ff_dash_muxer = {
-    .name           = "dash",
-    .long_name      = NULL_IF_CONFIG_SMALL("DASH Muxer"),
-    .extensions     = "mpd",
+const FFOutputFormat ff_dash_muxer = {
+    .p.name          = "dash",
+    .p.long_name     = NULL_IF_CONFIG_SMALL("DASH Muxer"),
+    .p.extensions    = "mpd",
+    .p.audio_codec   = AV_CODEC_ID_AAC,
+    .p.video_codec   = AV_CODEC_ID_H264,
+    .p.flags         = AVFMT_GLOBALHEADER | AVFMT_NOFILE | AVFMT_TS_NEGATIVE,
+    .p.priv_class    = &dash_class,
     .priv_data_size = sizeof(DASHContext),
-    .audio_codec    = AV_CODEC_ID_AAC,
-    .video_codec    = AV_CODEC_ID_H264,
-    .flags          = AVFMT_GLOBALHEADER | AVFMT_NOFILE | AVFMT_TS_NEGATIVE,
     .init           = dash_init,
     .write_header   = dash_write_header,
     .write_packet   = dash_write_packet,
     .write_trailer  = dash_write_trailer,
     .deinit         = dash_free,
     .check_bitstream = dash_check_bitstream,
-    .priv_class     = &dash_class,
 };
diff --git a/libavformat/daudenc.c b/libavformat/daudenc.c
index 2e252449e9..2d84b16650 100644
--- a/libavformat/daudenc.c
+++ b/libavformat/daudenc.c
@@ -20,6 +20,7 @@
  */
 
 #include "avformat.h"
+#include "mux.h"
 
 static int daud_init(struct AVFormatContext *s)
 {
@@ -42,13 +43,13 @@ static int daud_write_packet(struct AVFormatContext *s, AVPacket *pkt)
     return 0;
 }
 
-const AVOutputFormat ff_daud_muxer = {
-    .name         = "daud",
-    .long_name    = NULL_IF_CONFIG_SMALL("D-Cinema audio"),
-    .extensions   = "302",
-    .audio_codec  = AV_CODEC_ID_PCM_S24DAUD,
-    .video_codec  = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_daud_muxer = {
+    .p.name        = "daud",
+    .p.long_name   = NULL_IF_CONFIG_SMALL("D-Cinema audio"),
+    .p.extensions  = "302",
+    .p.audio_codec = AV_CODEC_ID_PCM_S24DAUD,
+    .p.video_codec = AV_CODEC_ID_NONE,
+    .p.flags       = AVFMT_NOTIMESTAMPS,
     .init         = daud_init,
     .write_packet = daud_write_packet,
-    .flags        = AVFMT_NOTIMESTAMPS,
 };
diff --git a/libavformat/dvenc.c b/libavformat/dvenc.c
index 11947aa493..29d2dc47ac 100644
--- a/libavformat/dvenc.c
+++ b/libavformat/dvenc.c
@@ -442,13 +442,13 @@ static void dv_deinit(AVFormatContext *s)
         av_fifo_freep2(&c->audio_data[i]);
 }
 
-const AVOutputFormat ff_dv_muxer = {
-    .name              = "dv",
-    .long_name         = NULL_IF_CONFIG_SMALL("DV (Digital Video)"),
-    .extensions        = "dv",
+const FFOutputFormat ff_dv_muxer = {
+    .p.name            = "dv",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("DV (Digital Video)"),
+    .p.extensions      = "dv",
     .priv_data_size    = sizeof(DVMuxContext),
-    .audio_codec       = AV_CODEC_ID_PCM_S16LE,
-    .video_codec       = AV_CODEC_ID_DVVIDEO,
+    .p.audio_codec     = AV_CODEC_ID_PCM_S16LE,
+    .p.video_codec     = AV_CODEC_ID_DVVIDEO,
     .write_header      = dv_write_header,
     .write_packet      = dv_write_packet,
     .deinit            = dv_deinit,
diff --git a/libavformat/ffmetaenc.c b/libavformat/ffmetaenc.c
index f27ac1ac50..ef076407b5 100644
--- a/libavformat/ffmetaenc.c
+++ b/libavformat/ffmetaenc.c
@@ -23,6 +23,7 @@
 
 #include "avformat.h"
 #include "ffmeta.h"
+#include "mux.h"
 #include "libavutil/dict.h"
 
 
@@ -87,12 +88,12 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
     return 0;
 }
 
-const AVOutputFormat ff_ffmetadata_muxer = {
-    .name          = "ffmetadata",
-    .long_name     = NULL_IF_CONFIG_SMALL("FFmpeg metadata in text"),
-    .extensions    = "ffmeta",
+const FFOutputFormat ff_ffmetadata_muxer = {
+    .p.name        = "ffmetadata",
+    .p.long_name   = NULL_IF_CONFIG_SMALL("FFmpeg metadata in text"),
+    .p.extensions  = "ffmeta",
     .write_header  = write_header,
     .write_packet  = write_packet,
     .write_trailer = write_trailer,
-    .flags         = AVFMT_NOTIMESTAMPS | AVFMT_NOSTREAMS,
+    .p.flags       = AVFMT_NOTIMESTAMPS | AVFMT_NOSTREAMS,
 };
diff --git a/libavformat/fifo.c b/libavformat/fifo.c
index c125a97b0d..ebadeef645 100644
--- a/libavformat/fifo.c
+++ b/libavformat/fifo.c
@@ -707,15 +707,15 @@ static const AVClass fifo_muxer_class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
-const AVOutputFormat ff_fifo_muxer = {
-    .name           = "fifo",
-    .long_name      = NULL_IF_CONFIG_SMALL("FIFO queue pseudo-muxer"),
+const FFOutputFormat ff_fifo_muxer = {
+    .p.name         = "fifo",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("FIFO queue pseudo-muxer"),
+    .p.priv_class   = &fifo_muxer_class,
+    .p.flags        = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
     .priv_data_size = sizeof(FifoContext),
     .init           = fifo_init,
     .write_header   = fifo_write_header,
     .write_packet   = fifo_write_packet,
     .write_trailer  = fifo_write_trailer,
     .deinit         = fifo_deinit,
-    .priv_class     = &fifo_muxer_class,
-    .flags          = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
 };
diff --git a/libavformat/fifo_test.c b/libavformat/fifo_test.c
index 80c0c84612..0f12d88b0f 100644
--- a/libavformat/fifo_test.c
+++ b/libavformat/fifo_test.c
@@ -25,6 +25,7 @@
 #include "libavutil/time.h"
 
 #include "avformat.h"
+#include "mux.h"
 #include "url.h"
 
 /* Implementation of mock muxer to simulate real muxer failures */
@@ -137,15 +138,15 @@ static const AVClass failing_muxer_class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
-const AVOutputFormat ff_fifo_test_muxer = {
-    .name           = "fifo_test",
-    .long_name      = NULL_IF_CONFIG_SMALL("Fifo test muxer"),
+const FFOutputFormat ff_fifo_test_muxer = {
+    .p.name         = "fifo_test",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("Fifo test muxer"),
     .priv_data_size = sizeof(FailingMuxerContext),
     .write_header   = failing_write_header,
     .write_packet   = failing_write_packet,
     .write_trailer  = failing_write_trailer,
     .deinit         = failing_deinit,
-    .priv_class     = &failing_muxer_class,
-    .flags          = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH,
+    .p.priv_class   = &failing_muxer_class,
+    .p.flags        = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH,
 };
 
diff --git a/libavformat/filmstripenc.c b/libavformat/filmstripenc.c
index ebb7294175..9033dba692 100644
--- a/libavformat/filmstripenc.c
+++ b/libavformat/filmstripenc.c
@@ -27,6 +27,7 @@
 #include "libavutil/intreadwrite.h"
 #include "avformat.h"
 #include "avio_internal.h"
+#include "mux.h"
 #include "rawenc.h"
 
 #define RAND_TAG MKBETAG('R','a','n','d')
@@ -59,12 +60,12 @@ static int write_trailer(AVFormatContext *s)
     return 0;
 }
 
-const AVOutputFormat ff_filmstrip_muxer = {
-    .name              = "filmstrip",
-    .long_name         = NULL_IF_CONFIG_SMALL("Adobe Filmstrip"),
-    .extensions        = "flm",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_RAWVIDEO,
+const FFOutputFormat ff_filmstrip_muxer = {
+    .p.name            = "filmstrip",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("Adobe Filmstrip"),
+    .p.extensions      = "flm",
+    .p.audio_codec     = AV_CODEC_ID_NONE,
+    .p.video_codec     = AV_CODEC_ID_RAWVIDEO,
     .write_header      = write_header,
     .write_packet      = ff_raw_write_packet,
     .write_trailer     = write_trailer,
diff --git a/libavformat/fitsenc.c b/libavformat/fitsenc.c
index 37ee10bb13..1df7e2bcf2 100644
--- a/libavformat/fitsenc.c
+++ b/libavformat/fitsenc.c
@@ -26,6 +26,7 @@
 
 #include "avio_internal.h"
 #include "internal.h"
+#include "mux.h"
 
 typedef struct FITSContext {
     int first_image;
@@ -191,13 +192,13 @@ static int fits_write_packet(AVFormatContext *s, AVPacket *pkt)
     return 0;
 }
 
-const AVOutputFormat ff_fits_muxer = {
-    .name         = "fits",
-    .long_name    = NULL_IF_CONFIG_SMALL("Flexible Image Transport System"),
-    .extensions   = "fits",
+const FFOutputFormat ff_fits_muxer = {
+    .p.name         = "fits",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("Flexible Image Transport System"),
+    .p.extensions   = "fits",
+    .p.audio_codec  = AV_CODEC_ID_NONE,
+    .p.video_codec  = AV_CODEC_ID_FITS,
     .priv_data_size = sizeof(FITSContext),
-    .audio_codec  = AV_CODEC_ID_NONE,
-    .video_codec  = AV_CODEC_ID_FITS,
     .write_header = fits_write_header,
     .write_packet = fits_write_packet,
 };
diff --git a/libavformat/flacenc.c b/libavformat/flacenc.c
index d7930f4a6e..a8beec7750 100644
--- a/libavformat/flacenc.c
+++ b/libavformat/flacenc.c
@@ -30,6 +30,7 @@
 #include "flacenc.h"
 #include "id3v2.h"
 #include "internal.h"
+#include "mux.h"
 #include "version.h"
 #include "vorbiscomment.h"
 
@@ -413,19 +414,19 @@ static const AVClass flac_muxer_class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
-const AVOutputFormat ff_flac_muxer = {
-    .name              = "flac",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw FLAC"),
+const FFOutputFormat ff_flac_muxer = {
+    .p.name            = "flac",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw FLAC"),
     .priv_data_size    = sizeof(FlacMuxerContext),
-    .mime_type         = "audio/x-flac",
-    .extensions        = "flac",
-    .audio_codec       = AV_CODEC_ID_FLAC,
-    .video_codec       = AV_CODEC_ID_PNG,
+    .p.mime_type       = "audio/x-flac",
+    .p.extensions      = "flac",
+    .p.audio_codec     = AV_CODEC_ID_FLAC,
+    .p.video_codec     = AV_CODEC_ID_PNG,
     .init              = flac_init,
     .write_header      = flac_write_header,
     .write_packet      = flac_write_packet,
     .write_trailer     = flac_write_trailer,
     .deinit            = flac_deinit,
-    .flags             = AVFMT_NOTIMESTAMPS,
-    .priv_class        = &flac_muxer_class,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
+    .p.priv_class      = &flac_muxer_class,
 };
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index 128ae8ebc0..81d9b6100d 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -1060,24 +1060,24 @@ static const AVClass flv_muxer_class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
-const AVOutputFormat ff_flv_muxer = {
-    .name           = "flv",
-    .long_name      = NULL_IF_CONFIG_SMALL("FLV (Flash Video)"),
-    .mime_type      = "video/x-flv",
-    .extensions     = "flv",
+const FFOutputFormat ff_flv_muxer = {
+    .p.name         = "flv",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("FLV (Flash Video)"),
+    .p.mime_type    = "video/x-flv",
+    .p.extensions   = "flv",
     .priv_data_size = sizeof(FLVContext),
-    .audio_codec    = CONFIG_LIBMP3LAME ? AV_CODEC_ID_MP3 : AV_CODEC_ID_ADPCM_SWF,
-    .video_codec    = AV_CODEC_ID_FLV1,
+    .p.audio_codec  = CONFIG_LIBMP3LAME ? AV_CODEC_ID_MP3 : AV_CODEC_ID_ADPCM_SWF,
+    .p.video_codec  = AV_CODEC_ID_FLV1,
     .init           = flv_init,
     .write_header   = flv_write_header,
     .write_packet   = flv_write_packet,
     .write_trailer  = flv_write_trailer,
     .deinit         = flv_deinit,
     .check_bitstream= flv_check_bitstream,
-    .codec_tag      = (const AVCodecTag* const []) {
+    .p.codec_tag    = (const AVCodecTag* const []) {
                           flv_video_codec_ids, flv_audio_codec_ids, 0
                       },
-    .flags          = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
+    .p.flags        = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
                       AVFMT_TS_NONSTRICT,
-    .priv_class     = &flv_muxer_class,
+    .p.priv_class   = &flv_muxer_class,
 };
diff --git a/libavformat/framecrcenc.c b/libavformat/framecrcenc.c
index ab79903e31..ce306a6c49 100644
--- a/libavformat/framecrcenc.c
+++ b/libavformat/framecrcenc.c
@@ -30,6 +30,7 @@
 
 #include "avformat.h"
 #include "internal.h"
+#include "mux.h"
 
 static int framecrc_write_header(struct AVFormatContext *s)
 {
@@ -69,13 +70,13 @@ static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt)
     return 0;
 }
 
-const AVOutputFormat ff_framecrc_muxer = {
-    .name              = "framecrc",
-    .long_name         = NULL_IF_CONFIG_SMALL("framecrc testing"),
-    .audio_codec       = AV_CODEC_ID_PCM_S16LE,
-    .video_codec       = AV_CODEC_ID_RAWVIDEO,
+const FFOutputFormat ff_framecrc_muxer = {
+    .p.name            = "framecrc",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("framecrc testing"),
+    .p.audio_codec     = AV_CODEC_ID_PCM_S16LE,
+    .p.video_codec     = AV_CODEC_ID_RAWVIDEO,
     .write_header      = framecrc_write_header,
     .write_packet      = framecrc_write_packet,
-    .flags             = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
+    .p.flags           = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
                          AVFMT_TS_NEGATIVE,
 };
diff --git a/libavformat/gif.c b/libavformat/gif.c
index b52ff4dd39..bfa7deb598 100644
--- a/libavformat/gif.c
+++ b/libavformat/gif.c
@@ -23,6 +23,7 @@
 
 #include "avformat.h"
 #include "internal.h"
+#include "mux.h"
 #include "libavutil/imgutils.h"
 #include "libavutil/log.h"
 #include "libavutil/opt.h"
@@ -202,17 +203,17 @@ static const AVClass gif_muxer_class = {
     .option     = options,
 };
 
-const AVOutputFormat ff_gif_muxer = {
-    .name           = "gif",
-    .long_name      = NULL_IF_CONFIG_SMALL("CompuServe Graphics Interchange Format (GIF)"),
-    .mime_type      = "image/gif",
-    .extensions     = "gif",
+const FFOutputFormat ff_gif_muxer = {
+    .p.name         = "gif",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("CompuServe Graphics Interchange Format (GIF)"),
+    .p.mime_type    = "image/gif",
+    .p.extensions   = "gif",
     .priv_data_size = sizeof(GIFContext),
-    .audio_codec    = AV_CODEC_ID_NONE,
-    .video_codec    = AV_CODEC_ID_GIF,
+    .p.audio_codec  = AV_CODEC_ID_NONE,
+    .p.video_codec  = AV_CODEC_ID_GIF,
     .write_header   = gif_write_header,
     .write_packet   = gif_write_packet,
     .write_trailer  = gif_write_trailer,
-    .priv_class     = &gif_muxer_class,
-    .flags          = AVFMT_VARIABLE_FPS,
+    .p.priv_class   = &gif_muxer_class,
+    .p.flags        = AVFMT_VARIABLE_FPS,
 };
diff --git a/libavformat/gxfenc.c b/libavformat/gxfenc.c
index 0f971c039a..7495924722 100644
--- a/libavformat/gxfenc.c
+++ b/libavformat/gxfenc.c
@@ -1009,13 +1009,13 @@ static int gxf_interleave_packet(AVFormatContext *s, AVPacket *pkt,
     return ff_interleave_packet_per_dts(s, pkt, flush, 0);
 }
 
-const AVOutputFormat ff_gxf_muxer = {
-    .name              = "gxf",
-    .long_name         = NULL_IF_CONFIG_SMALL("GXF (General eXchange Format)"),
-    .extensions        = "gxf",
+const FFOutputFormat ff_gxf_muxer = {
+    .p.name            = "gxf",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("GXF (General eXchange Format)"),
+    .p.extensions      = "gxf",
     .priv_data_size    = sizeof(GXFContext),
-    .audio_codec       = AV_CODEC_ID_PCM_S16LE,
-    .video_codec       = AV_CODEC_ID_MPEG2VIDEO,
+    .p.audio_codec     = AV_CODEC_ID_PCM_S16LE,
+    .p.video_codec     = AV_CODEC_ID_MPEG2VIDEO,
     .write_header      = gxf_write_header,
     .write_packet      = gxf_write_packet,
     .write_trailer     = gxf_write_trailer,
diff --git a/libavformat/hashenc.c b/libavformat/hashenc.c
index 1aaba0b306..17ee2f7e9f 100644
--- a/libavformat/hashenc.c
+++ b/libavformat/hashenc.c
@@ -27,6 +27,7 @@
 #include "libavutil/opt.h"
 #include "avformat.h"
 #include "internal.h"
+#include "mux.h"
 
 struct HashContext {
     const AVClass *avclass;
@@ -172,19 +173,19 @@ static void hash_free(struct AVFormatContext *s)
 }
 
 #if CONFIG_HASH_MUXER
-const AVOutputFormat ff_hash_muxer = {
-    .name              = "hash",
-    .long_name         = NULL_IF_CONFIG_SMALL("Hash testing"),
+const FFOutputFormat ff_hash_muxer = {
+    .p.name            = "hash",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("Hash testing"),
     .priv_data_size    = sizeof(struct HashContext),
-    .audio_codec       = AV_CODEC_ID_PCM_S16LE,
-    .video_codec       = AV_CODEC_ID_RAWVIDEO,
+    .p.audio_codec     = AV_CODEC_ID_PCM_S16LE,
+    .p.video_codec     = AV_CODEC_ID_RAWVIDEO,
     .init              = hash_init,
     .write_packet      = hash_write_packet,
     .write_trailer     = hash_write_trailer,
     .deinit            = hash_free,
-    .flags             = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
+    .p.flags           = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
                          AVFMT_TS_NEGATIVE,
-    .priv_class        = &hash_streamhashenc_class,
+    .p.priv_class      = &hash_streamhashenc_class,
 };
 #endif
 
@@ -196,36 +197,36 @@ static const AVClass md5enc_class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
-const AVOutputFormat ff_md5_muxer = {
-    .name              = "md5",
-    .long_name         = NULL_IF_CONFIG_SMALL("MD5 testing"),
+const FFOutputFormat ff_md5_muxer = {
+    .p.name            = "md5",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("MD5 testing"),
     .priv_data_size    = sizeof(struct HashContext),
-    .audio_codec       = AV_CODEC_ID_PCM_S16LE,
-    .video_codec       = AV_CODEC_ID_RAWVIDEO,
+    .p.audio_codec     = AV_CODEC_ID_PCM_S16LE,
+    .p.video_codec     = AV_CODEC_ID_RAWVIDEO,
     .init              = hash_init,
     .write_packet      = hash_write_packet,
     .write_trailer     = hash_write_trailer,
     .deinit            = hash_free,
-    .flags             = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
+    .p.flags           = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
                          AVFMT_TS_NEGATIVE,
-    .priv_class        = &md5enc_class,
+    .p.priv_class      = &md5enc_class,
 };
 #endif
 
 #if CONFIG_STREAMHASH_MUXER
-const AVOutputFormat ff_streamhash_muxer = {
-    .name              = "streamhash",
-    .long_name         = NULL_IF_CONFIG_SMALL("Per-stream hash testing"),
+const FFOutputFormat ff_streamhash_muxer = {
+    .p.name            = "streamhash",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("Per-stream hash testing"),
     .priv_data_size    = sizeof(struct HashContext),
-    .audio_codec       = AV_CODEC_ID_PCM_S16LE,
-    .video_codec       = AV_CODEC_ID_RAWVIDEO,
+    .p.audio_codec     = AV_CODEC_ID_PCM_S16LE,
+    .p.video_codec     = AV_CODEC_ID_RAWVIDEO,
     .init              = streamhash_init,
     .write_packet      = hash_write_packet,
     .write_trailer     = hash_write_trailer,
     .deinit            = hash_free,
-    .flags             = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
+    .p.flags           = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
                          AVFMT_TS_NEGATIVE,
-    .priv_class        = &hash_streamhashenc_class,
+    .p.priv_class      = &hash_streamhashenc_class,
 };
 #endif
 
@@ -324,19 +325,19 @@ static const AVClass framehash_class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
-const AVOutputFormat ff_framehash_muxer = {
-    .name              = "framehash",
-    .long_name         = NULL_IF_CONFIG_SMALL("Per-frame hash testing"),
+const FFOutputFormat ff_framehash_muxer = {
+    .p.name            = "framehash",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("Per-frame hash testing"),
     .priv_data_size    = sizeof(struct HashContext),
-    .audio_codec       = AV_CODEC_ID_PCM_S16LE,
-    .video_codec       = AV_CODEC_ID_RAWVIDEO,
+    .p.audio_codec     = AV_CODEC_ID_PCM_S16LE,
+    .p.video_codec     = AV_CODEC_ID_RAWVIDEO,
     .init              = framehash_init,
     .write_header      = framehash_write_header,
     .write_packet      = framehash_write_packet,
     .deinit            = hash_free,
-    .flags             = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
+    .p.flags           = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
                          AVFMT_TS_NEGATIVE,
-    .priv_class        = &framehash_class,
+    .p.priv_class      = &framehash_class,
 };
 #endif
 
@@ -348,18 +349,18 @@ static const AVClass framemd5_class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
-const AVOutputFormat ff_framemd5_muxer = {
-    .name              = "framemd5",
-    .long_name         = NULL_IF_CONFIG_SMALL("Per-frame MD5 testing"),
+const FFOutputFormat ff_framemd5_muxer = {
+    .p.name            = "framemd5",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("Per-frame MD5 testing"),
     .priv_data_size    = sizeof(struct HashContext),
-    .audio_codec       = AV_CODEC_ID_PCM_S16LE,
-    .video_codec       = AV_CODEC_ID_RAWVIDEO,
+    .p.audio_codec     = AV_CODEC_ID_PCM_S16LE,
+    .p.video_codec     = AV_CODEC_ID_RAWVIDEO,
     .init              = framehash_init,
     .write_header      = framehash_write_header,
     .write_packet      = framehash_write_packet,
     .deinit            = hash_free,
-    .flags             = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
+    .p.flags           = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
                          AVFMT_TS_NEGATIVE,
-    .priv_class        = &framemd5_class,
+    .p.priv_class      = &framemd5_class,
 };
 #endif
diff --git a/libavformat/hdsenc.c b/libavformat/hdsenc.c
index a8f340ac46..080a873ee8 100644
--- a/libavformat/hdsenc.c
+++ b/libavformat/hdsenc.c
@@ -564,16 +564,16 @@ static const AVClass hds_class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
-const AVOutputFormat ff_hds_muxer = {
-    .name           = "hds",
-    .long_name      = NULL_IF_CONFIG_SMALL("HDS Muxer"),
+const FFOutputFormat ff_hds_muxer = {
+    .p.name         = "hds",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("HDS Muxer"),
+    .p.audio_codec  = AV_CODEC_ID_AAC,
+    .p.video_codec  = AV_CODEC_ID_H264,
+    .p.flags        = AVFMT_GLOBALHEADER | AVFMT_NOFILE,
+    .p.priv_class   = &hds_class,
     .priv_data_size = sizeof(HDSContext),
-    .audio_codec    = AV_CODEC_ID_AAC,
-    .video_codec    = AV_CODEC_ID_H264,
-    .flags          = AVFMT_GLOBALHEADER | AVFMT_NOFILE,
     .write_header   = hds_write_header,
     .write_packet   = hds_write_packet,
     .write_trailer  = hds_write_trailer,
     .deinit         = hds_free,
-    .priv_class     = &hds_class,
 };
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 32491b4534..dcc363b42e 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -3180,19 +3180,19 @@ static const AVClass hls_class = {
 };
 
 
-const AVOutputFormat ff_hls_muxer = {
-    .name           = "hls",
-    .long_name      = NULL_IF_CONFIG_SMALL("Apple HTTP Live Streaming"),
-    .extensions     = "m3u8",
+const FFOutputFormat ff_hls_muxer = {
+    .p.name           = "hls",
+    .p.long_name      = NULL_IF_CONFIG_SMALL("Apple HTTP Live Streaming"),
+    .p.extensions     = "m3u8",
+    .p.audio_codec    = AV_CODEC_ID_AAC,
+    .p.video_codec    = AV_CODEC_ID_H264,
+    .p.subtitle_codec = AV_CODEC_ID_WEBVTT,
+    .p.flags          = AVFMT_NOFILE | AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_NODIMENSIONS,
+    .p.priv_class     = &hls_class,
     .priv_data_size = sizeof(HLSContext),
-    .audio_codec    = AV_CODEC_ID_AAC,
-    .video_codec    = AV_CODEC_ID_H264,
-    .subtitle_codec = AV_CODEC_ID_WEBVTT,
-    .flags          = AVFMT_NOFILE | AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_NODIMENSIONS,
     .init           = hls_init,
     .write_header   = hls_write_header,
     .write_packet   = hls_write_packet,
     .write_trailer  = hls_write_trailer,
     .deinit         = hls_deinit,
-    .priv_class     = &hls_class,
 };
diff --git a/libavformat/icoenc.c b/libavformat/icoenc.c
index d684f67707..caa3ba4965 100644
--- a/libavformat/icoenc.c
+++ b/libavformat/icoenc.c
@@ -31,6 +31,7 @@
 
 #include "avformat.h"
 #include "avio_internal.h"
+#include "mux.h"
 
 typedef struct {
     int offset;
@@ -193,17 +194,17 @@ static void ico_deinit(AVFormatContext *s)
     av_freep(&ico->images);
 }
 
-const AVOutputFormat ff_ico_muxer = {
-    .name           = "ico",
-    .long_name      = NULL_IF_CONFIG_SMALL("Microsoft Windows ICO"),
+const FFOutputFormat ff_ico_muxer = {
+    .p.name         = "ico",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("Microsoft Windows ICO"),
     .priv_data_size = sizeof(IcoMuxContext),
-    .mime_type      = "image/vnd.microsoft.icon",
-    .extensions     = "ico",
-    .audio_codec    = AV_CODEC_ID_NONE,
-    .video_codec    = AV_CODEC_ID_BMP,
+    .p.mime_type    = "image/vnd.microsoft.icon",
+    .p.extensions   = "ico",
+    .p.audio_codec  = AV_CODEC_ID_NONE,
+    .p.video_codec  = AV_CODEC_ID_BMP,
     .write_header   = ico_write_header,
     .write_packet   = ico_write_packet,
     .write_trailer  = ico_write_trailer,
     .deinit         = ico_deinit,
-    .flags          = AVFMT_NOTIMESTAMPS,
+    .p.flags        = AVFMT_NOTIMESTAMPS,
 };
diff --git a/libavformat/idroqenc.c b/libavformat/idroqenc.c
index 57dd7f024e..9baf9ad1b1 100644
--- a/libavformat/idroqenc.c
+++ b/libavformat/idroqenc.c
@@ -20,6 +20,7 @@
  */
 
 #include "avformat.h"
+#include "mux.h"
 #include "rawenc.h"
 
 
@@ -59,12 +60,12 @@ static int roq_write_header(struct AVFormatContext *s)
     return 0;
 }
 
-const AVOutputFormat ff_roq_muxer = {
-    .name         = "roq",
-    .long_name    = NULL_IF_CONFIG_SMALL("raw id RoQ"),
-    .extensions   = "roq",
-    .audio_codec  = AV_CODEC_ID_ROQ_DPCM,
-    .video_codec  = AV_CODEC_ID_ROQ,
+const FFOutputFormat ff_roq_muxer = {
+    .p.name        = "roq",
+    .p.long_name   = NULL_IF_CONFIG_SMALL("raw id RoQ"),
+    .p.extensions  = "roq",
+    .p.audio_codec = AV_CODEC_ID_ROQ_DPCM,
+    .p.video_codec = AV_CODEC_ID_ROQ,
     .write_header = roq_write_header,
     .write_packet = ff_raw_write_packet,
 };
diff --git a/libavformat/ilbc.c b/libavformat/ilbc.c
index 26336ef2ac..6b5bb33b62 100644
--- a/libavformat/ilbc.c
+++ b/libavformat/ilbc.c
@@ -23,6 +23,7 @@
 
 #include "avformat.h"
 #include "internal.h"
+#include "mux.h"
 #include "rawenc.h"
 
 static const char mode20_header[] = "#!iLBC20\n";
@@ -120,14 +121,14 @@ const AVInputFormat ff_ilbc_demuxer = {
 };
 
 #if CONFIG_ILBC_MUXER
-const AVOutputFormat ff_ilbc_muxer = {
-    .name         = "ilbc",
-    .long_name    = NULL_IF_CONFIG_SMALL("iLBC storage"),
-    .mime_type    = "audio/iLBC",
-    .extensions   = "lbc",
-    .audio_codec  = AV_CODEC_ID_ILBC,
+const FFOutputFormat ff_ilbc_muxer = {
+    .p.name         = "ilbc",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("iLBC storage"),
+    .p.mime_type    = "audio/iLBC",
+    .p.extensions   = "lbc",
+    .p.audio_codec  = AV_CODEC_ID_ILBC,
+    .p.flags        = AVFMT_NOTIMESTAMPS,
     .write_header = ilbc_write_header,
     .write_packet = ff_raw_write_packet,
-    .flags        = AVFMT_NOTIMESTAMPS,
 };
 #endif
diff --git a/libavformat/img2enc.c b/libavformat/img2enc.c
index c05f37e22b..9b8ec06cea 100644
--- a/libavformat/img2enc.c
+++ b/libavformat/img2enc.c
@@ -33,6 +33,7 @@
 #include "avio_internal.h"
 #include "internal.h"
 #include "img2.h"
+#include "mux.h"
 
 typedef struct VideoMuxData {
     const AVClass *class;  /**< Class for private options. */
@@ -268,30 +269,30 @@ static const AVClass img2mux_class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
-const AVOutputFormat ff_image2_muxer = {
-    .name           = "image2",
-    .long_name      = NULL_IF_CONFIG_SMALL("image2 sequence"),
-    .extensions     = "bmp,dpx,exr,jls,jpeg,jpg,jxl,ljpg,pam,pbm,pcx,pfm,pgm,pgmyuv,phm,"
+const FFOutputFormat ff_image2_muxer = {
+    .p.name         = "image2",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("image2 sequence"),
+    .p.extensions   = "bmp,dpx,exr,jls,jpeg,jpg,jxl,ljpg,pam,pbm,pcx,pfm,pgm,pgmyuv,phm,"
                       "png,ppm,sgi,tga,tif,tiff,jp2,j2c,j2k,xwd,sun,ras,rs,im1,im8,"
                       "im24,sunras,vbn,xbm,xface,pix,y,avif,qoi,hdr,wbmp",
     .priv_data_size = sizeof(VideoMuxData),
-    .video_codec    = AV_CODEC_ID_MJPEG,
+    .p.video_codec  = AV_CODEC_ID_MJPEG,
     .write_header   = write_header,
     .write_packet   = write_packet,
     .query_codec    = query_codec,
-    .flags          = AVFMT_NOTIMESTAMPS | AVFMT_NODIMENSIONS | AVFMT_NOFILE,
-    .priv_class     = &img2mux_class,
+    .p.flags        = AVFMT_NOTIMESTAMPS | AVFMT_NODIMENSIONS | AVFMT_NOFILE,
+    .p.priv_class   = &img2mux_class,
 };
 #endif
 #if CONFIG_IMAGE2PIPE_MUXER
-const AVOutputFormat ff_image2pipe_muxer = {
-    .name           = "image2pipe",
-    .long_name      = NULL_IF_CONFIG_SMALL("piped image2 sequence"),
+const FFOutputFormat ff_image2pipe_muxer = {
+    .p.name         = "image2pipe",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("piped image2 sequence"),
     .priv_data_size = sizeof(VideoMuxData),
-    .video_codec    = AV_CODEC_ID_MJPEG,
+    .p.video_codec  = AV_CODEC_ID_MJPEG,
     .write_header   = write_header,
     .write_packet   = write_packet_pipe,
     .query_codec    = query_codec,
-    .flags          = AVFMT_NOTIMESTAMPS | AVFMT_NODIMENSIONS
+    .p.flags        = AVFMT_NOTIMESTAMPS | AVFMT_NODIMENSIONS
 };
 #endif
diff --git a/libavformat/internal.h b/libavformat/internal.h
index ce837fefc7..f575064e8f 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -705,6 +705,7 @@ int ff_unlock_avformat(void);
  */
 void ff_format_set_url(AVFormatContext *s, char *url);
 
-void avpriv_register_devices(const AVOutputFormat * const o[], const AVInputFormat * const i[]);
+struct FFOutputFormat;
+void avpriv_register_devices(const struct FFOutputFormat * const o[], const AVInputFormat * const i[]);
 
 #endif /* AVFORMAT_INTERNAL_H */
diff --git a/libavformat/ircamenc.c b/libavformat/ircamenc.c
index df1494b2b8..ceeab2b305 100644
--- a/libavformat/ircamenc.c
+++ b/libavformat/ircamenc.c
@@ -23,6 +23,7 @@
 #include "avformat.h"
 #include "avio_internal.h"
 #include "internal.h"
+#include "mux.h"
 #include "rawenc.h"
 #include "ircam.h"
 
@@ -50,13 +51,13 @@ static int ircam_write_header(AVFormatContext *s)
     return 0;
 }
 
-const AVOutputFormat ff_ircam_muxer = {
-    .name           = "ircam",
-    .extensions     = "sf,ircam",
-    .long_name      = NULL_IF_CONFIG_SMALL("Berkeley/IRCAM/CARL Sound Format"),
-    .audio_codec    = AV_CODEC_ID_PCM_S16LE,
-    .video_codec    = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_ircam_muxer = {
+    .p.name         = "ircam",
+    .p.extensions   = "sf,ircam",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("Berkeley/IRCAM/CARL Sound Format"),
+    .p.audio_codec  = AV_CODEC_ID_PCM_S16LE,
+    .p.video_codec  = AV_CODEC_ID_NONE,
     .write_header   = ircam_write_header,
     .write_packet   = ff_raw_write_packet,
-    .codec_tag      = (const AVCodecTag *const []){ ff_codec_ircam_le_tags, 0 },
+    .p.codec_tag    = (const AVCodecTag *const []){ ff_codec_ircam_le_tags, 0 },
 };
diff --git a/libavformat/ivfenc.c b/libavformat/ivfenc.c
index ed5ec90ce9..47b4efbcd1 100644
--- a/libavformat/ivfenc.c
+++ b/libavformat/ivfenc.c
@@ -122,16 +122,16 @@ static const AVCodecTag codec_ivf_tags[] = {
     { AV_CODEC_ID_NONE, 0 }
 };
 
-const AVOutputFormat ff_ivf_muxer = {
+const FFOutputFormat ff_ivf_muxer = {
+    .p.name         = "ivf",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("On2 IVF"),
+    .p.extensions   = "ivf",
+    .p.audio_codec  = AV_CODEC_ID_NONE,
+    .p.video_codec  = AV_CODEC_ID_VP8,
+    .p.codec_tag    = (const AVCodecTag* const []){ codec_ivf_tags, 0 },
     .priv_data_size = sizeof(IVFEncContext),
-    .name         = "ivf",
-    .long_name    = NULL_IF_CONFIG_SMALL("On2 IVF"),
-    .extensions   = "ivf",
-    .audio_codec  = AV_CODEC_ID_NONE,
-    .video_codec  = AV_CODEC_ID_VP8,
     .init         = ivf_init,
     .write_header = ivf_write_header,
     .write_packet = ivf_write_packet,
     .write_trailer = ivf_write_trailer,
-    .codec_tag    = (const AVCodecTag* const []){ codec_ivf_tags, 0 },
 };
diff --git a/libavformat/jacosubenc.c b/libavformat/jacosubenc.c
index f0548bb282..fa0f9fdaa2 100644
--- a/libavformat/jacosubenc.c
+++ b/libavformat/jacosubenc.c
@@ -17,6 +17,7 @@
  */
 
 #include "avformat.h"
+#include "mux.h"
 #include "rawenc.h"
 
 static int jacosub_write_header(AVFormatContext *s)
@@ -29,13 +30,13 @@ static int jacosub_write_header(AVFormatContext *s)
     return 0;
 }
 
-const AVOutputFormat ff_jacosub_muxer = {
-    .name           = "jacosub",
-    .long_name      = NULL_IF_CONFIG_SMALL("JACOsub subtitle format"),
-    .mime_type      = "text/x-jacosub",
-    .extensions     = "jss,js",
+const FFOutputFormat ff_jacosub_muxer = {
+    .p.name           = "jacosub",
+    .p.long_name      = NULL_IF_CONFIG_SMALL("JACOsub subtitle format"),
+    .p.mime_type      = "text/x-jacosub",
+    .p.extensions     = "jss,js",
+    .p.flags          = AVFMT_TS_NONSTRICT,
+    .p.subtitle_codec = AV_CODEC_ID_JACOSUB,
     .write_header   = jacosub_write_header,
     .write_packet   = ff_raw_write_packet,
-    .flags          = AVFMT_TS_NONSTRICT,
-    .subtitle_codec = AV_CODEC_ID_JACOSUB,
 };
diff --git a/libavformat/kvag.c b/libavformat/kvag.c
index 7c3816ab82..9487e7dd0e 100644
--- a/libavformat/kvag.c
+++ b/libavformat/kvag.c
@@ -26,6 +26,7 @@
 #include "avformat.h"
 #include "avio_internal.h"
 #include "internal.h"
+#include "mux.h"
 #include "rawenc.h"
 #include "libavutil/intreadwrite.h"
 
@@ -188,12 +189,12 @@ static int kvag_write_trailer(AVFormatContext *s)
     return 0;
 }
 
-const AVOutputFormat ff_kvag_muxer = {
-    .name           = "kvag",
-    .long_name      = NULL_IF_CONFIG_SMALL("Simon & Schuster Interactive VAG"),
-    .extensions     = "vag",
-    .audio_codec    = AV_CODEC_ID_ADPCM_IMA_SSI,
-    .video_codec    = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_kvag_muxer = {
+    .p.name         = "kvag",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("Simon & Schuster Interactive VAG"),
+    .p.extensions   = "vag",
+    .p.audio_codec  = AV_CODEC_ID_ADPCM_IMA_SSI,
+    .p.video_codec  = AV_CODEC_ID_NONE,
     .init           = kvag_write_init,
     .write_header   = kvag_write_header,
     .write_packet   = ff_raw_write_packet,
diff --git a/libavformat/latmenc.c b/libavformat/latmenc.c
index 6fd36d1484..8eec632c54 100644
--- a/libavformat/latmenc.c
+++ b/libavformat/latmenc.c
@@ -260,17 +260,17 @@ static int latm_check_bitstream(AVFormatContext *s, AVStream *st,
     return ret;
 }
 
-const AVOutputFormat ff_latm_muxer = {
-    .name           = "latm",
-    .long_name      = NULL_IF_CONFIG_SMALL("LOAS/LATM"),
-    .mime_type      = "audio/MP4A-LATM",
-    .extensions     = "latm,loas",
+const FFOutputFormat ff_latm_muxer = {
+    .p.name         = "latm",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("LOAS/LATM"),
+    .p.mime_type    = "audio/MP4A-LATM",
+    .p.extensions   = "latm,loas",
     .priv_data_size = sizeof(LATMContext),
-    .audio_codec    = AV_CODEC_ID_AAC,
-    .video_codec    = AV_CODEC_ID_NONE,
+    .p.audio_codec  = AV_CODEC_ID_AAC,
+    .p.video_codec  = AV_CODEC_ID_NONE,
     .write_header   = latm_write_header,
     .write_packet   = latm_write_packet,
-    .priv_class     = &latm_muxer_class,
+    .p.priv_class   = &latm_muxer_class,
     .check_bitstream= latm_check_bitstream,
-    .flags          = AVFMT_NOTIMESTAMPS,
+    .p.flags        = AVFMT_NOTIMESTAMPS,
 };
diff --git a/libavformat/lrcenc.c b/libavformat/lrcenc.c
index 2d6ca33e38..d66be9a8fa 100644
--- a/libavformat/lrcenc.c
+++ b/libavformat/lrcenc.c
@@ -125,14 +125,14 @@ static int lrc_write_packet(AVFormatContext *s, AVPacket *pkt)
     return 0;
 }
 
-const AVOutputFormat ff_lrc_muxer = {
-    .name           = "lrc",
-    .long_name      = NULL_IF_CONFIG_SMALL("LRC lyrics"),
-    .extensions     = "lrc",
+const FFOutputFormat ff_lrc_muxer = {
+    .p.name           = "lrc",
+    .p.long_name      = NULL_IF_CONFIG_SMALL("LRC lyrics"),
+    .p.extensions     = "lrc",
+    .p.flags          = AVFMT_VARIABLE_FPS | AVFMT_GLOBALHEADER |
+                        AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT,
+    .p.subtitle_codec = AV_CODEC_ID_SUBRIP,
     .priv_data_size = 0,
     .write_header   = lrc_write_header,
     .write_packet   = lrc_write_packet,
-    .flags          = AVFMT_VARIABLE_FPS | AVFMT_GLOBALHEADER |
-                      AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT,
-    .subtitle_codec = AV_CODEC_ID_SUBRIP
 };
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 2deb4284e8..113541bd9a 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -3321,31 +3321,31 @@ static int mkv_query_codec(enum AVCodecID codec_id, int std_compliance)
     return 0;
 }
 
-const AVOutputFormat ff_matroska_muxer = {
-    .name              = "matroska",
-    .long_name         = NULL_IF_CONFIG_SMALL("Matroska"),
-    .mime_type         = "video/x-matroska",
-    .extensions        = "mkv",
+const FFOutputFormat ff_matroska_muxer = {
+    .p.name            = "matroska",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("Matroska"),
+    .p.mime_type       = "video/x-matroska",
+    .p.extensions      = "mkv",
     .priv_data_size    = sizeof(MatroskaMuxContext),
-    .audio_codec       = CONFIG_LIBVORBIS_ENCODER ?
+    .p.audio_codec     = CONFIG_LIBVORBIS_ENCODER ?
                          AV_CODEC_ID_VORBIS : AV_CODEC_ID_AC3,
-    .video_codec       = CONFIG_LIBX264_ENCODER ?
+    .p.video_codec     = CONFIG_LIBX264_ENCODER ?
                          AV_CODEC_ID_H264 : AV_CODEC_ID_MPEG4,
     .init              = mkv_init,
     .deinit            = mkv_deinit,
     .write_header      = mkv_write_header,
     .write_packet      = mkv_write_flush_packet,
     .write_trailer     = mkv_write_trailer,
-    .flags             = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
+    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
                          AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
-    .codec_tag         = (const AVCodecTag* const []){
+    .p.codec_tag       = (const AVCodecTag* const []){
          ff_codec_bmp_tags, ff_codec_wav_tags,
          additional_audio_tags, additional_video_tags, additional_subtitle_tags, 0
     },
-    .subtitle_codec    = AV_CODEC_ID_ASS,
+    .p.subtitle_codec  = AV_CODEC_ID_ASS,
     .query_codec       = mkv_query_codec,
     .check_bitstream   = mkv_check_bitstream,
-    .priv_class        = &matroska_webm_class,
+    .p.priv_class      = &matroska_webm_class,
 };
 #endif
 
@@ -3359,15 +3359,15 @@ static int webm_query_codec(enum AVCodecID codec_id, int std_compliance)
     return 0;
 }
 
-const AVOutputFormat ff_webm_muxer = {
-    .name              = "webm",
-    .long_name         = NULL_IF_CONFIG_SMALL("WebM"),
-    .mime_type         = "video/webm",
-    .extensions        = "webm",
+const FFOutputFormat ff_webm_muxer = {
+    .p.name            = "webm",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("WebM"),
+    .p.mime_type       = "video/webm",
+    .p.extensions      = "webm",
     .priv_data_size    = sizeof(MatroskaMuxContext),
-    .audio_codec       = CONFIG_LIBOPUS_ENCODER ? AV_CODEC_ID_OPUS : AV_CODEC_ID_VORBIS,
-    .video_codec       = CONFIG_LIBVPX_VP9_ENCODER? AV_CODEC_ID_VP9 : AV_CODEC_ID_VP8,
-    .subtitle_codec    = AV_CODEC_ID_WEBVTT,
+    .p.audio_codec     = CONFIG_LIBOPUS_ENCODER ? AV_CODEC_ID_OPUS : AV_CODEC_ID_VORBIS,
+    .p.video_codec     = CONFIG_LIBVPX_VP9_ENCODER? AV_CODEC_ID_VP9 : AV_CODEC_ID_VP8,
+    .p.subtitle_codec  = AV_CODEC_ID_WEBVTT,
     .init              = mkv_init,
     .deinit            = mkv_deinit,
     .write_header      = mkv_write_header,
@@ -3375,33 +3375,33 @@ const AVOutputFormat ff_webm_muxer = {
     .write_trailer     = mkv_write_trailer,
     .query_codec       = webm_query_codec,
     .check_bitstream   = mkv_check_bitstream,
-    .flags             = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
+    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
                          AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
-    .priv_class        = &matroska_webm_class,
+    .p.priv_class      = &matroska_webm_class,
 };
 #endif
 
 #if CONFIG_MATROSKA_AUDIO_MUXER
-const AVOutputFormat ff_matroska_audio_muxer = {
-    .name              = "matroska",
-    .long_name         = NULL_IF_CONFIG_SMALL("Matroska Audio"),
-    .mime_type         = "audio/x-matroska",
-    .extensions        = "mka",
+const FFOutputFormat ff_matroska_audio_muxer = {
+    .p.name            = "matroska",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("Matroska Audio"),
+    .p.mime_type       = "audio/x-matroska",
+    .p.extensions      = "mka",
     .priv_data_size    = sizeof(MatroskaMuxContext),
-    .audio_codec       = CONFIG_LIBVORBIS_ENCODER ?
+    .p.audio_codec     = CONFIG_LIBVORBIS_ENCODER ?
                          AV_CODEC_ID_VORBIS : AV_CODEC_ID_AC3,
-    .video_codec       = AV_CODEC_ID_NONE,
+    .p.video_codec     = AV_CODEC_ID_NONE,
     .init              = mkv_init,
     .deinit            = mkv_deinit,
     .write_header      = mkv_write_header,
     .write_packet      = mkv_write_flush_packet,
     .write_trailer     = mkv_write_trailer,
     .check_bitstream   = mkv_check_bitstream,
-    .flags             = AVFMT_GLOBALHEADER | AVFMT_TS_NONSTRICT |
+    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_TS_NONSTRICT |
                          AVFMT_ALLOW_FLUSH,
-    .codec_tag         = (const AVCodecTag* const []){
+    .p.codec_tag       = (const AVCodecTag* const []){
         ff_codec_wav_tags, additional_audio_tags, 0
     },
-    .priv_class        = &matroska_webm_class,
+    .p.priv_class      = &matroska_webm_class,
 };
 #endif
diff --git a/libavformat/microdvdenc.c b/libavformat/microdvdenc.c
index 4db5e70161..950309981b 100644
--- a/libavformat/microdvdenc.c
+++ b/libavformat/microdvdenc.c
@@ -22,6 +22,7 @@
 #include <inttypes.h>
 #include "avformat.h"
 #include "internal.h"
+#include "mux.h"
 
 static int microdvd_write_header(struct AVFormatContext *s)
 {
@@ -55,13 +56,13 @@ static int microdvd_write_packet(AVFormatContext *avf, AVPacket *pkt)
     return 0;
 }
 
-const AVOutputFormat ff_microdvd_muxer = {
-    .name           = "microdvd",
-    .long_name      = NULL_IF_CONFIG_SMALL("MicroDVD subtitle format"),
-    .mime_type      = "text/x-microdvd",
-    .extensions     = "sub",
+const FFOutputFormat ff_microdvd_muxer = {
+    .p.name           = "microdvd",
+    .p.long_name      = NULL_IF_CONFIG_SMALL("MicroDVD subtitle format"),
+    .p.mime_type      = "text/x-microdvd",
+    .p.extensions     = "sub",
+    .p.flags          = AVFMT_NOTIMESTAMPS,
+    .p.subtitle_codec = AV_CODEC_ID_MICRODVD,
     .write_header   = microdvd_write_header,
     .write_packet   = microdvd_write_packet,
-    .flags          = AVFMT_NOTIMESTAMPS,
-    .subtitle_codec = AV_CODEC_ID_MICRODVD,
 };
diff --git a/libavformat/mkvtimestamp_v2.c b/libavformat/mkvtimestamp_v2.c
index 27c7d7a68b..dde431ab7d 100644
--- a/libavformat/mkvtimestamp_v2.c
+++ b/libavformat/mkvtimestamp_v2.c
@@ -21,6 +21,7 @@
 
 #include "avformat.h"
 #include "internal.h"
+#include "mux.h"
 
 static int write_header(AVFormatContext *s)
 {
@@ -40,11 +41,11 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
     return 0;
 }
 
-const AVOutputFormat ff_mkvtimestamp_v2_muxer = {
-    .name         = "mkvtimestamp_v2",
-    .long_name    = NULL_IF_CONFIG_SMALL("extract pts as timecode v2 format, as defined by mkvtoolnix"),
-    .audio_codec  = AV_CODEC_ID_NONE,
-    .video_codec  = AV_CODEC_ID_RAWVIDEO,
+const FFOutputFormat ff_mkvtimestamp_v2_muxer = {
+    .p.name        = "mkvtimestamp_v2",
+    .p.long_name   = NULL_IF_CONFIG_SMALL("extract pts as timecode v2 format, as defined by mkvtoolnix"),
+    .p.audio_codec = AV_CODEC_ID_NONE,
+    .p.video_codec = AV_CODEC_ID_RAWVIDEO,
     .write_header = write_header,
     .write_packet = write_packet,
 };
diff --git a/libavformat/mmf.c b/libavformat/mmf.c
index 3f20d5bc0b..5cac4381f4 100644
--- a/libavformat/mmf.c
+++ b/libavformat/mmf.c
@@ -25,6 +25,7 @@
 #include "avformat.h"
 #include "avio_internal.h"
 #include "internal.h"
+#include "mux.h"
 #include "pcm.h"
 #include "rawenc.h"
 #include "riff.h"
@@ -309,14 +310,14 @@ const AVInputFormat ff_mmf_demuxer = {
 #endif
 
 #if CONFIG_MMF_MUXER
-const AVOutputFormat ff_mmf_muxer = {
-    .name           = "mmf",
-    .long_name      = NULL_IF_CONFIG_SMALL("Yamaha SMAF"),
-    .mime_type      = "application/vnd.smaf",
-    .extensions     = "mmf",
+const FFOutputFormat ff_mmf_muxer = {
+    .p.name         = "mmf",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("Yamaha SMAF"),
+    .p.mime_type    = "application/vnd.smaf",
+    .p.extensions   = "mmf",
     .priv_data_size = sizeof(MMFContext),
-    .audio_codec    = AV_CODEC_ID_ADPCM_YAMAHA,
-    .video_codec    = AV_CODEC_ID_NONE,
+    .p.audio_codec  = AV_CODEC_ID_ADPCM_YAMAHA,
+    .p.video_codec  = AV_CODEC_ID_NONE,
     .write_header   = mmf_write_header,
     .write_packet   = ff_raw_write_packet,
     .write_trailer  = mmf_write_trailer,
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 8d31317838..87ee7a921f 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -7805,182 +7805,182 @@ static const AVClass mov_avif_muxer_class = {
 #endif
 
 #if CONFIG_MOV_MUXER
-const AVOutputFormat ff_mov_muxer = {
-    .name              = "mov",
-    .long_name         = NULL_IF_CONFIG_SMALL("QuickTime / MOV"),
-    .extensions        = "mov",
+const FFOutputFormat ff_mov_muxer = {
+    .p.name            = "mov",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("QuickTime / MOV"),
+    .p.extensions      = "mov",
     .priv_data_size    = sizeof(MOVMuxContext),
-    .audio_codec       = AV_CODEC_ID_AAC,
-    .video_codec       = CONFIG_LIBX264_ENCODER ?
+    .p.audio_codec     = AV_CODEC_ID_AAC,
+    .p.video_codec     = CONFIG_LIBX264_ENCODER ?
                          AV_CODEC_ID_H264 : AV_CODEC_ID_MPEG4,
     .init              = mov_init,
     .write_header      = mov_write_header,
     .write_packet      = mov_write_packet,
     .write_trailer     = mov_write_trailer,
     .deinit            = mov_free,
-    .flags             = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
-    .codec_tag         = (const AVCodecTag* const []){
+    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
+    .p.codec_tag       = (const AVCodecTag* const []){
         ff_codec_movvideo_tags, ff_codec_movaudio_tags, ff_codec_movsubtitle_tags, 0
     },
     .check_bitstream   = mov_check_bitstream,
-    .priv_class        = &mov_isobmff_muxer_class,
+    .p.priv_class      = &mov_isobmff_muxer_class,
 };
 #endif
 #if CONFIG_TGP_MUXER
-const AVOutputFormat ff_tgp_muxer = {
-    .name              = "3gp",
-    .long_name         = NULL_IF_CONFIG_SMALL("3GP (3GPP file format)"),
-    .extensions        = "3gp",
+const FFOutputFormat ff_tgp_muxer = {
+    .p.name            = "3gp",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("3GP (3GPP file format)"),
+    .p.extensions      = "3gp",
     .priv_data_size    = sizeof(MOVMuxContext),
-    .audio_codec       = AV_CODEC_ID_AMR_NB,
-    .video_codec       = AV_CODEC_ID_H263,
+    .p.audio_codec     = AV_CODEC_ID_AMR_NB,
+    .p.video_codec     = AV_CODEC_ID_H263,
     .init              = mov_init,
     .write_header      = mov_write_header,
     .write_packet      = mov_write_packet,
     .write_trailer     = mov_write_trailer,
     .deinit            = mov_free,
-    .flags             = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
-    .codec_tag         = codec_3gp_tags_list,
+    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
+    .p.codec_tag       = codec_3gp_tags_list,
     .check_bitstream   = mov_check_bitstream,
-    .priv_class        = &mov_isobmff_muxer_class,
+    .p.priv_class      = &mov_isobmff_muxer_class,
 };
 #endif
 #if CONFIG_MP4_MUXER
-const AVOutputFormat ff_mp4_muxer = {
-    .name              = "mp4",
-    .long_name         = NULL_IF_CONFIG_SMALL("MP4 (MPEG-4 Part 14)"),
-    .mime_type         = "video/mp4",
-    .extensions        = "mp4",
+const FFOutputFormat ff_mp4_muxer = {
+    .p.name            = "mp4",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("MP4 (MPEG-4 Part 14)"),
+    .p.mime_type       = "video/mp4",
+    .p.extensions      = "mp4",
     .priv_data_size    = sizeof(MOVMuxContext),
-    .audio_codec       = AV_CODEC_ID_AAC,
-    .video_codec       = CONFIG_LIBX264_ENCODER ?
+    .p.audio_codec     = AV_CODEC_ID_AAC,
+    .p.video_codec     = CONFIG_LIBX264_ENCODER ?
                          AV_CODEC_ID_H264 : AV_CODEC_ID_MPEG4,
     .init              = mov_init,
     .write_header      = mov_write_header,
     .write_packet      = mov_write_packet,
     .write_trailer     = mov_write_trailer,
     .deinit            = mov_free,
-    .flags             = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
-    .codec_tag         = mp4_codec_tags_list,
+    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
+    .p.codec_tag       = mp4_codec_tags_list,
     .check_bitstream   = mov_check_bitstream,
-    .priv_class        = &mov_isobmff_muxer_class,
+    .p.priv_class      = &mov_isobmff_muxer_class,
 };
 #endif
 #if CONFIG_PSP_MUXER
-const AVOutputFormat ff_psp_muxer = {
-    .name              = "psp",
-    .long_name         = NULL_IF_CONFIG_SMALL("PSP MP4 (MPEG-4 Part 14)"),
-    .extensions        = "mp4,psp",
+const FFOutputFormat ff_psp_muxer = {
+    .p.name            = "psp",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("PSP MP4 (MPEG-4 Part 14)"),
+    .p.extensions      = "mp4,psp",
     .priv_data_size    = sizeof(MOVMuxContext),
-    .audio_codec       = AV_CODEC_ID_AAC,
-    .video_codec       = CONFIG_LIBX264_ENCODER ?
+    .p.audio_codec     = AV_CODEC_ID_AAC,
+    .p.video_codec     = CONFIG_LIBX264_ENCODER ?
                          AV_CODEC_ID_H264 : AV_CODEC_ID_MPEG4,
     .init              = mov_init,
     .write_header      = mov_write_header,
     .write_packet      = mov_write_packet,
     .write_trailer     = mov_write_trailer,
     .deinit            = mov_free,
-    .flags             = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
-    .codec_tag         = mp4_codec_tags_list,
+    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
+    .p.codec_tag       = mp4_codec_tags_list,
     .check_bitstream   = mov_check_bitstream,
-    .priv_class        = &mov_isobmff_muxer_class,
+    .p.priv_class      = &mov_isobmff_muxer_class,
 };
 #endif
 #if CONFIG_TG2_MUXER
-const AVOutputFormat ff_tg2_muxer = {
-    .name              = "3g2",
-    .long_name         = NULL_IF_CONFIG_SMALL("3GP2 (3GPP2 file format)"),
-    .extensions        = "3g2",
+const FFOutputFormat ff_tg2_muxer = {
+    .p.name            = "3g2",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("3GP2 (3GPP2 file format)"),
+    .p.extensions      = "3g2",
     .priv_data_size    = sizeof(MOVMuxContext),
-    .audio_codec       = AV_CODEC_ID_AMR_NB,
-    .video_codec       = AV_CODEC_ID_H263,
+    .p.audio_codec     = AV_CODEC_ID_AMR_NB,
+    .p.video_codec     = AV_CODEC_ID_H263,
     .init              = mov_init,
     .write_header      = mov_write_header,
     .write_packet      = mov_write_packet,
     .write_trailer     = mov_write_trailer,
     .deinit            = mov_free,
-    .flags             = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
-    .codec_tag         = codec_3gp_tags_list,
+    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
+    .p.codec_tag       = codec_3gp_tags_list,
     .check_bitstream   = mov_check_bitstream,
-    .priv_class        = &mov_isobmff_muxer_class,
+    .p.priv_class      = &mov_isobmff_muxer_class,
 };
 #endif
 #if CONFIG_IPOD_MUXER
-const AVOutputFormat ff_ipod_muxer = {
-    .name              = "ipod",
-    .long_name         = NULL_IF_CONFIG_SMALL("iPod H.264 MP4 (MPEG-4 Part 14)"),
-    .mime_type         = "video/mp4",
-    .extensions        = "m4v,m4a,m4b",
+const FFOutputFormat ff_ipod_muxer = {
+    .p.name            = "ipod",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("iPod H.264 MP4 (MPEG-4 Part 14)"),
+    .p.mime_type       = "video/mp4",
+    .p.extensions      = "m4v,m4a,m4b",
     .priv_data_size    = sizeof(MOVMuxContext),
-    .audio_codec       = AV_CODEC_ID_AAC,
-    .video_codec       = AV_CODEC_ID_H264,
+    .p.audio_codec     = AV_CODEC_ID_AAC,
+    .p.video_codec     = AV_CODEC_ID_H264,
     .init              = mov_init,
     .write_header      = mov_write_header,
     .write_packet      = mov_write_packet,
     .write_trailer     = mov_write_trailer,
     .deinit            = mov_free,
-    .flags             = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
-    .codec_tag         = (const AVCodecTag* const []){ codec_ipod_tags, 0 },
+    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
+    .p.codec_tag       = (const AVCodecTag* const []){ codec_ipod_tags, 0 },
     .check_bitstream   = mov_check_bitstream,
-    .priv_class        = &mov_isobmff_muxer_class,
+    .p.priv_class      = &mov_isobmff_muxer_class,
 };
 #endif
 #if CONFIG_ISMV_MUXER
-const AVOutputFormat ff_ismv_muxer = {
-    .name              = "ismv",
-    .long_name         = NULL_IF_CONFIG_SMALL("ISMV/ISMA (Smooth Streaming)"),
-    .mime_type         = "video/mp4",
-    .extensions        = "ismv,isma",
+const FFOutputFormat ff_ismv_muxer = {
+    .p.name            = "ismv",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("ISMV/ISMA (Smooth Streaming)"),
+    .p.mime_type       = "video/mp4",
+    .p.extensions      = "ismv,isma",
     .priv_data_size    = sizeof(MOVMuxContext),
-    .audio_codec       = AV_CODEC_ID_AAC,
-    .video_codec       = AV_CODEC_ID_H264,
+    .p.audio_codec     = AV_CODEC_ID_AAC,
+    .p.video_codec     = AV_CODEC_ID_H264,
     .init              = mov_init,
     .write_header      = mov_write_header,
     .write_packet      = mov_write_packet,
     .write_trailer     = mov_write_trailer,
     .deinit            = mov_free,
-    .flags             = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
-    .codec_tag         = (const AVCodecTag* const []){
+    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
+    .p.codec_tag       = (const AVCodecTag* const []){
         codec_mp4_tags, codec_ism_tags, 0 },
     .check_bitstream   = mov_check_bitstream,
-    .priv_class        = &mov_isobmff_muxer_class,
+    .p.priv_class      = &mov_isobmff_muxer_class,
 };
 #endif
 #if CONFIG_F4V_MUXER
-const AVOutputFormat ff_f4v_muxer = {
-    .name              = "f4v",
-    .long_name         = NULL_IF_CONFIG_SMALL("F4V Adobe Flash Video"),
-    .mime_type         = "application/f4v",
-    .extensions        = "f4v",
+const FFOutputFormat ff_f4v_muxer = {
+    .p.name            = "f4v",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("F4V Adobe Flash Video"),
+    .p.mime_type       = "application/f4v",
+    .p.extensions      = "f4v",
     .priv_data_size    = sizeof(MOVMuxContext),
-    .audio_codec       = AV_CODEC_ID_AAC,
-    .video_codec       = AV_CODEC_ID_H264,
+    .p.audio_codec     = AV_CODEC_ID_AAC,
+    .p.video_codec     = AV_CODEC_ID_H264,
     .init              = mov_init,
     .write_header      = mov_write_header,
     .write_packet      = mov_write_packet,
     .write_trailer     = mov_write_trailer,
     .deinit            = mov_free,
-    .flags             = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH,
-    .codec_tag         = (const AVCodecTag* const []){ codec_f4v_tags, 0 },
+    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH,
+    .p.codec_tag       = (const AVCodecTag* const []){ codec_f4v_tags, 0 },
     .check_bitstream   = mov_check_bitstream,
-    .priv_class        = &mov_isobmff_muxer_class,
+    .p.priv_class      = &mov_isobmff_muxer_class,
 };
 #endif
 #if CONFIG_AVIF_MUXER
-const AVOutputFormat ff_avif_muxer = {
-    .name              = "avif",
-    .long_name         = NULL_IF_CONFIG_SMALL("AVIF"),
-    .mime_type         = "image/avif",
-    .extensions        = "avif",
+const FFOutputFormat ff_avif_muxer = {
+    .p.name            = "avif",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("AVIF"),
+    .p.mime_type       = "image/avif",
+    .p.extensions      = "avif",
     .priv_data_size    = sizeof(MOVMuxContext),
-    .video_codec       = AV_CODEC_ID_AV1,
+    .p.video_codec     = AV_CODEC_ID_AV1,
     .init              = mov_init,
     .write_header      = mov_write_header,
     .write_packet      = mov_write_packet,
     .write_trailer     = avif_write_trailer,
     .deinit            = mov_free,
-    .flags             = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH,
-    .codec_tag         = codec_avif_tags_list,
-    .priv_class        = &mov_avif_muxer_class,
+    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH,
+    .p.codec_tag       = codec_avif_tags_list,
+    .p.priv_class      = &mov_avif_muxer_class,
 };
 #endif
diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c
index 91874fa14e..5e81f72a59 100644
--- a/libavformat/mp3enc.c
+++ b/libavformat/mp3enc.c
@@ -23,6 +23,7 @@
 #include "avio_internal.h"
 #include "id3v1.h"
 #include "id3v2.h"
+#include "mux.h"
 #include "rawenc.h"
 #include "libavutil/avstring.h"
 #include "libavcodec/mpegaudio.h"
@@ -636,20 +637,20 @@ static void mp3_deinit(struct AVFormatContext *s)
     av_freep(&mp3->xing_frame);
 }
 
-const AVOutputFormat ff_mp3_muxer = {
-    .name              = "mp3",
-    .long_name         = NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"),
-    .mime_type         = "audio/mpeg",
-    .extensions        = "mp3",
+const FFOutputFormat ff_mp3_muxer = {
+    .p.name            = "mp3",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"),
+    .p.mime_type       = "audio/mpeg",
+    .p.extensions      = "mp3",
     .priv_data_size    = sizeof(MP3Context),
-    .audio_codec       = AV_CODEC_ID_MP3,
-    .video_codec       = AV_CODEC_ID_PNG,
+    .p.audio_codec     = AV_CODEC_ID_MP3,
+    .p.video_codec     = AV_CODEC_ID_PNG,
     .init              = mp3_init,
     .write_header      = mp3_write_header,
     .write_packet      = mp3_write_packet,
     .write_trailer     = mp3_write_trailer,
     .deinit            = mp3_deinit,
     .query_codec       = query_codec,
-    .flags             = AVFMT_NOTIMESTAMPS,
-    .priv_class        = &mp3_muxer_class,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
+    .p.priv_class      = &mp3_muxer_class,
 };
diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c
index 3ab4bd3f9b..c06e308296 100644
--- a/libavformat/mpegenc.c
+++ b/libavformat/mpegenc.c
@@ -35,6 +35,7 @@
 #include "avio_internal.h"
 #include "internal.h"
 #include "mpeg.h"
+#include "mux.h"
 
 #define MAX_PAYLOAD_SIZE 4096
 
@@ -86,10 +87,10 @@ typedef struct MpegMuxContext {
     int preload;
 } MpegMuxContext;
 
-extern const AVOutputFormat ff_mpeg1vcd_muxer;
-extern const AVOutputFormat ff_mpeg2dvd_muxer;
-extern const AVOutputFormat ff_mpeg2svcd_muxer;
-extern const AVOutputFormat ff_mpeg2vob_muxer;
+extern const FFOutputFormat ff_mpeg1vcd_muxer;
+extern const FFOutputFormat ff_mpeg2dvd_muxer;
+extern const FFOutputFormat ff_mpeg2svcd_muxer;
+extern const FFOutputFormat ff_mpeg2vob_muxer;
 
 static int put_pack_header(AVFormatContext *ctx, uint8_t *buf,
                            int64_t timestamp)
@@ -307,12 +308,12 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
     int video_bitrate;
 
     s->packet_number = 0;
-    s->is_vcd   =  (CONFIG_MPEG1VCD_MUXER  && ctx->oformat == &ff_mpeg1vcd_muxer);
-    s->is_svcd  =  (CONFIG_MPEG2SVCD_MUXER && ctx->oformat == &ff_mpeg2svcd_muxer);
-    s->is_mpeg2 = ((CONFIG_MPEG2VOB_MUXER  && ctx->oformat == &ff_mpeg2vob_muxer) ||
-                   (CONFIG_MPEG2DVD_MUXER  && ctx->oformat == &ff_mpeg2dvd_muxer) ||
-                   (CONFIG_MPEG2SVCD_MUXER && ctx->oformat == &ff_mpeg2svcd_muxer));
-    s->is_dvd   =  (CONFIG_MPEG2DVD_MUXER  && ctx->oformat == &ff_mpeg2dvd_muxer);
+    s->is_vcd   =  (CONFIG_MPEG1VCD_MUXER  && ctx->oformat == &ff_mpeg1vcd_muxer.p);
+    s->is_svcd  =  (CONFIG_MPEG2SVCD_MUXER && ctx->oformat == &ff_mpeg2svcd_muxer.p);
+    s->is_mpeg2 = ((CONFIG_MPEG2VOB_MUXER  && ctx->oformat == &ff_mpeg2vob_muxer.p) ||
+                   (CONFIG_MPEG2DVD_MUXER  && ctx->oformat == &ff_mpeg2dvd_muxer.p) ||
+                   (CONFIG_MPEG2SVCD_MUXER && ctx->oformat == &ff_mpeg2svcd_muxer.p));
+    s->is_dvd   =  (CONFIG_MPEG2DVD_MUXER  && ctx->oformat == &ff_mpeg2dvd_muxer.p);
 
     if (ctx->packet_size) {
         if (ctx->packet_size < 20 || ctx->packet_size > (1 << 23) + 10) {
@@ -1293,87 +1294,87 @@ static const AVClass mpeg_class = {
 };
 
 #if CONFIG_MPEG1SYSTEM_MUXER
-const AVOutputFormat ff_mpeg1system_muxer = {
-    .name              = "mpeg",
-    .long_name         = NULL_IF_CONFIG_SMALL("MPEG-1 Systems / MPEG program stream"),
-    .mime_type         = "video/mpeg",
-    .extensions        = "mpg,mpeg",
+const FFOutputFormat ff_mpeg1system_muxer = {
+    .p.name            = "mpeg",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("MPEG-1 Systems / MPEG program stream"),
+    .p.mime_type       = "video/mpeg",
+    .p.extensions      = "mpg,mpeg",
     .priv_data_size    = sizeof(MpegMuxContext),
-    .audio_codec       = AV_CODEC_ID_MP2,
-    .video_codec       = AV_CODEC_ID_MPEG1VIDEO,
+    .p.audio_codec     = AV_CODEC_ID_MP2,
+    .p.video_codec     = AV_CODEC_ID_MPEG1VIDEO,
     .write_header      = mpeg_mux_init,
     .write_packet      = mpeg_mux_write_packet,
     .write_trailer     = mpeg_mux_end,
     .deinit            = mpeg_mux_deinit,
-    .priv_class        = &mpeg_class,
+    .p.priv_class      = &mpeg_class,
 };
 #endif
 
 #if CONFIG_MPEG1VCD_MUXER
-const AVOutputFormat ff_mpeg1vcd_muxer = {
-    .name              = "vcd",
-    .long_name         = NULL_IF_CONFIG_SMALL("MPEG-1 Systems / MPEG program stream (VCD)"),
-    .mime_type         = "video/mpeg",
+const FFOutputFormat ff_mpeg1vcd_muxer = {
+    .p.name            = "vcd",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("MPEG-1 Systems / MPEG program stream (VCD)"),
+    .p.mime_type       = "video/mpeg",
     .priv_data_size    = sizeof(MpegMuxContext),
-    .audio_codec       = AV_CODEC_ID_MP2,
-    .video_codec       = AV_CODEC_ID_MPEG1VIDEO,
+    .p.audio_codec     = AV_CODEC_ID_MP2,
+    .p.video_codec     = AV_CODEC_ID_MPEG1VIDEO,
     .write_header      = mpeg_mux_init,
     .write_packet      = mpeg_mux_write_packet,
     .write_trailer     = mpeg_mux_end,
     .deinit            = mpeg_mux_deinit,
-    .priv_class        = &mpeg_class,
+    .p.priv_class      = &mpeg_class,
 };
 #endif
 
 #if CONFIG_MPEG2VOB_MUXER
-const AVOutputFormat ff_mpeg2vob_muxer = {
-    .name              = "vob",
-    .long_name         = NULL_IF_CONFIG_SMALL("MPEG-2 PS (VOB)"),
-    .mime_type         = "video/mpeg",
-    .extensions        = "vob",
+const FFOutputFormat ff_mpeg2vob_muxer = {
+    .p.name            = "vob",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("MPEG-2 PS (VOB)"),
+    .p.mime_type       = "video/mpeg",
+    .p.extensions      = "vob",
     .priv_data_size    = sizeof(MpegMuxContext),
-    .audio_codec       = AV_CODEC_ID_MP2,
-    .video_codec       = AV_CODEC_ID_MPEG2VIDEO,
+    .p.audio_codec     = AV_CODEC_ID_MP2,
+    .p.video_codec     = AV_CODEC_ID_MPEG2VIDEO,
     .write_header      = mpeg_mux_init,
     .write_packet      = mpeg_mux_write_packet,
     .write_trailer     = mpeg_mux_end,
     .deinit            = mpeg_mux_deinit,
-    .priv_class        = &mpeg_class,
+    .p.priv_class      = &mpeg_class,
 };
 #endif
 
 /* Same as mpeg2vob_mux except that the pack size is 2324 */
 #if CONFIG_MPEG2SVCD_MUXER
-const AVOutputFormat ff_mpeg2svcd_muxer = {
-    .name              = "svcd",
-    .long_name         = NULL_IF_CONFIG_SMALL("MPEG-2 PS (SVCD)"),
-    .mime_type         = "video/mpeg",
-    .extensions        = "vob",
+const FFOutputFormat ff_mpeg2svcd_muxer = {
+    .p.name            = "svcd",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("MPEG-2 PS (SVCD)"),
+    .p.mime_type       = "video/mpeg",
+    .p.extensions      = "vob",
     .priv_data_size    = sizeof(MpegMuxContext),
-    .audio_codec       = AV_CODEC_ID_MP2,
-    .video_codec       = AV_CODEC_ID_MPEG2VIDEO,
+    .p.audio_codec     = AV_CODEC_ID_MP2,
+    .p.video_codec     = AV_CODEC_ID_MPEG2VIDEO,
     .write_header      = mpeg_mux_init,
     .write_packet      = mpeg_mux_write_packet,
     .write_trailer     = mpeg_mux_end,
     .deinit            = mpeg_mux_deinit,
-    .priv_class        = &mpeg_class,
+    .p.priv_class      = &mpeg_class,
 };
 #endif
 
 /*  Same as mpeg2vob_mux except the 'is_dvd' flag is set to produce NAV pkts */
 #if CONFIG_MPEG2DVD_MUXER
-const AVOutputFormat ff_mpeg2dvd_muxer = {
-    .name              = "dvd",
-    .long_name         = NULL_IF_CONFIG_SMALL("MPEG-2 PS (DVD VOB)"),
-    .mime_type         = "video/mpeg",
-    .extensions        = "dvd",
+const FFOutputFormat ff_mpeg2dvd_muxer = {
+    .p.name            = "dvd",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("MPEG-2 PS (DVD VOB)"),
+    .p.mime_type       = "video/mpeg",
+    .p.extensions      = "dvd",
     .priv_data_size    = sizeof(MpegMuxContext),
-    .audio_codec       = AV_CODEC_ID_MP2,
-    .video_codec       = AV_CODEC_ID_MPEG2VIDEO,
+    .p.audio_codec     = AV_CODEC_ID_MP2,
+    .p.video_codec     = AV_CODEC_ID_MPEG2VIDEO,
     .write_header      = mpeg_mux_init,
     .write_packet      = mpeg_mux_write_packet,
     .write_trailer     = mpeg_mux_end,
     .deinit            = mpeg_mux_deinit,
-    .priv_class        = &mpeg_class,
+    .p.priv_class      = &mpeg_class,
 };
 #endif
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 48d39e6a7d..00ad426086 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -2308,19 +2308,19 @@ static const AVClass mpegts_muxer_class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
-const AVOutputFormat ff_mpegts_muxer = {
-    .name           = "mpegts",
-    .long_name      = NULL_IF_CONFIG_SMALL("MPEG-TS (MPEG-2 Transport Stream)"),
-    .mime_type      = "video/MP2T",
-    .extensions     = "ts,m2t,m2ts,mts",
+const FFOutputFormat ff_mpegts_muxer = {
+    .p.name         = "mpegts",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("MPEG-TS (MPEG-2 Transport Stream)"),
+    .p.mime_type    = "video/MP2T",
+    .p.extensions   = "ts,m2t,m2ts,mts",
     .priv_data_size = sizeof(MpegTSWrite),
-    .audio_codec    = AV_CODEC_ID_MP2,
-    .video_codec    = AV_CODEC_ID_MPEG2VIDEO,
+    .p.audio_codec  = AV_CODEC_ID_MP2,
+    .p.video_codec  = AV_CODEC_ID_MPEG2VIDEO,
     .init           = mpegts_init,
     .write_packet   = mpegts_write_packet,
     .write_trailer  = mpegts_write_end,
     .deinit         = mpegts_deinit,
     .check_bitstream = mpegts_check_bitstream,
-    .flags          = AVFMT_ALLOW_FLUSH | AVFMT_VARIABLE_FPS | AVFMT_NODIMENSIONS,
-    .priv_class     = &mpegts_muxer_class,
+    .p.flags        = AVFMT_ALLOW_FLUSH | AVFMT_VARIABLE_FPS | AVFMT_NODIMENSIONS,
+    .p.priv_class   = &mpegts_muxer_class,
 };
diff --git a/libavformat/mpjpeg.c b/libavformat/mpjpeg.c
index c5e5d1e286..81ace8e9ee 100644
--- a/libavformat/mpjpeg.c
+++ b/libavformat/mpjpeg.c
@@ -20,6 +20,7 @@
  */
 #include "libavutil/opt.h"
 #include "avformat.h"
+#include "mux.h"
 
 /* Multipart JPEG */
 
@@ -61,16 +62,16 @@ static const AVClass mpjpeg_muxer_class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
-const AVOutputFormat ff_mpjpeg_muxer = {
-    .name              = "mpjpeg",
-    .long_name         = NULL_IF_CONFIG_SMALL("MIME multipart JPEG"),
-    .mime_type         = "multipart/x-mixed-replace;boundary=" BOUNDARY_TAG,
-    .extensions        = "mjpg",
+const FFOutputFormat ff_mpjpeg_muxer = {
+    .p.name            = "mpjpeg",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("MIME multipart JPEG"),
+    .p.mime_type       = "multipart/x-mixed-replace;boundary=" BOUNDARY_TAG,
+    .p.extensions      = "mjpg",
     .priv_data_size    = sizeof(MPJPEGContext),
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_MJPEG,
+    .p.audio_codec     = AV_CODEC_ID_NONE,
+    .p.video_codec     = AV_CODEC_ID_MJPEG,
     .write_header      = mpjpeg_write_header,
     .write_packet      = mpjpeg_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
-    .priv_class        = &mpjpeg_muxer_class,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
+    .p.priv_class      = &mpjpeg_muxer_class,
 };
diff --git a/libavformat/mux.c b/libavformat/mux.c
index b2b5be63b4..04de05ec17 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -118,8 +118,8 @@ int avformat_alloc_output_context2(AVFormatContext **avctx, const AVOutputFormat
     }
 
     s->oformat = oformat;
-    if (s->oformat->priv_data_size > 0) {
-        s->priv_data = av_mallocz(s->oformat->priv_data_size);
+    if (ffofmt(s->oformat)->priv_data_size > 0) {
+        s->priv_data = av_mallocz(ffofmt(s->oformat)->priv_data_size);
         if (!s->priv_data)
             goto nomem;
         if (s->oformat->priv_class) {
@@ -182,7 +182,7 @@ static int init_muxer(AVFormatContext *s, AVDictionary **options)
 {
     FFFormatContext *const si = ffformatcontext(s);
     AVDictionary *tmp = NULL;
-    const AVOutputFormat *of = s->oformat;
+    const FFOutputFormat *of = ffofmt(s->oformat);
     AVDictionaryEntry *e;
     int ret = 0;
 
@@ -201,7 +201,7 @@ static int init_muxer(AVFormatContext *s, AVDictionary **options)
     }
 
     // some sanity checks
-    if (s->nb_streams == 0 && !(of->flags & AVFMT_NOSTREAMS)) {
+    if (s->nb_streams == 0 && !(of->p.flags & AVFMT_NOSTREAMS)) {
         av_log(s, AV_LOG_ERROR, "No streams to mux were specified\n");
         ret = AVERROR(EINVAL);
         goto fail;
@@ -251,7 +251,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
             break;
         case AVMEDIA_TYPE_VIDEO:
             if ((par->width <= 0 || par->height <= 0) &&
-                !(of->flags & AVFMT_NODIMENSIONS)) {
+                !(of->p.flags & AVFMT_NODIMENSIONS)) {
                 av_log(s, AV_LOG_ERROR, "dimensions not set\n");
                 ret = AVERROR(EINVAL);
                 goto fail;
@@ -281,11 +281,11 @@ FF_ENABLE_DEPRECATION_WARNINGS
 
         sti->is_intra_only = ff_is_intra_only(par->codec_id);
 
-        if (of->codec_tag) {
+        if (of->p.codec_tag) {
             if (   par->codec_tag
                 && par->codec_id == AV_CODEC_ID_RAWVIDEO
-                && (   av_codec_get_tag(of->codec_tag, par->codec_id) == 0
-                    || av_codec_get_tag(of->codec_tag, par->codec_id) == MKTAG('r', 'a', 'w', ' '))
+                && (   av_codec_get_tag(of->p.codec_tag, par->codec_id) == 0
+                    || av_codec_get_tag(of->p.codec_tag, par->codec_id) == MKTAG('r', 'a', 'w', ' '))
                 && !validate_codec_tag(s, st)) {
                 // the current rawvideo encoding system ends up setting
                 // the wrong codec_tag for avi/mov, we override it here
@@ -301,7 +301,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
                     goto fail;
                 }
             } else
-                par->codec_tag = av_codec_get_tag(of->codec_tag, par->codec_id);
+                par->codec_tag = av_codec_get_tag(of->p.codec_tag, par->codec_id);
         }
 
         if (par->codec_type != AVMEDIA_TYPE_ATTACHMENT)
@@ -319,8 +319,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
             ret = AVERROR(ENOMEM);
             goto fail;
         }
-        if (of->priv_class) {
-            *(const AVClass **)s->priv_data = of->priv_class;
+        if (of->p.priv_class) {
+            *(const AVClass **)s->priv_data = of->p.priv_class;
             av_opt_set_defaults(s->priv_data);
             if ((ret = av_opt_set_dict2(s->priv_data, &tmp, AV_OPT_SEARCH_CHILDREN)) < 0)
                 goto fail;
@@ -343,10 +343,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
          *options = tmp;
     }
 
-    if (s->oformat->init) {
-        if ((ret = s->oformat->init(s)) < 0) {
-            if (s->oformat->deinit)
-                s->oformat->deinit(s);
+    if (of->init) {
+        if ((ret = of->init(s)) < 0) {
+            if (of->deinit)
+                of->deinit(s);
             return ret;
         }
         return ret == 0;
@@ -420,8 +420,9 @@ static void flush_if_needed(AVFormatContext *s)
 static void deinit_muxer(AVFormatContext *s)
 {
     FFFormatContext *const si = ffformatcontext(s);
-    if (s->oformat && s->oformat->deinit && si->initialized)
-        s->oformat->deinit(s);
+    const FFOutputFormat *const of = ffofmt(s->oformat);
+    if (of && of->deinit && si->initialized)
+        of->deinit(s);
     si->initialized =
     si->streams_initialized = 0;
 }
@@ -437,7 +438,7 @@ int avformat_init_output(AVFormatContext *s, AVDictionary **options)
     si->initialized = 1;
     si->streams_initialized = ret;
 
-    if (s->oformat->init && ret) {
+    if (ffofmt(s->oformat)->init && ret) {
         if ((ret = init_pts(s)) < 0)
             return ret;
 
@@ -460,8 +461,8 @@ int avformat_write_header(AVFormatContext *s, AVDictionary **options)
 
     if (!(s->oformat->flags & AVFMT_NOFILE) && s->pb)
         avio_write_marker(s->pb, AV_NOPTS_VALUE, AVIO_DATA_MARKER_HEADER);
-    if (s->oformat->write_header) {
-        ret = s->oformat->write_header(s);
+    if (ffofmt(s->oformat)->write_header) {
+        ret = ffofmt(s->oformat)->write_header(s);
         if (ret >= 0 && s->pb && s->pb->error < 0)
             ret = s->pb->error;
         if (ret < 0)
@@ -724,9 +725,9 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
     if ((pkt->flags & AV_PKT_FLAG_UNCODED_FRAME)) {
         AVFrame **frame = (AVFrame **)pkt->data;
         av_assert0(pkt->size == sizeof(*frame));
-        ret = s->oformat->write_uncoded_frame(s, pkt->stream_index, frame, 0);
+        ret = ffofmt(s->oformat)->write_uncoded_frame(s, pkt->stream_index, frame, 0);
     } else {
-        ret = s->oformat->write_packet(s, pkt);
+        ret = ffofmt(s->oformat)->write_packet(s, pkt);
     }
 
     if (s->pb && ret >= 0) {
@@ -1078,9 +1079,9 @@ static int check_bitstream(AVFormatContext *s, FFStream *sti, AVPacket *pkt)
     if (!(s->flags & AVFMT_FLAG_AUTO_BSF))
         return 1;
 
-    if (s->oformat->check_bitstream) {
+    if (ffofmt(s->oformat)->check_bitstream) {
         if (!sti->bitstream_checked) {
-            if ((ret = s->oformat->check_bitstream(s, &sti->pub, pkt)) < 0)
+            if ((ret = ffofmt(s->oformat)->check_bitstream(s, &sti->pub, pkt)) < 0)
                 return ret;
             else if (ret == 1)
                 sti->bitstream_checked = 1;
@@ -1198,7 +1199,7 @@ int av_write_frame(AVFormatContext *s, AVPacket *in)
 
     if (!in) {
         if (s->oformat->flags & AVFMT_ALLOW_FLUSH) {
-            ret = s->oformat->write_packet(s, NULL);
+            ret = ffofmt(s->oformat)->write_packet(s, NULL);
             flush_if_needed(s);
             if (ret >= 0 && s->pb && s->pb->error < 0)
                 ret = s->pb->error;
@@ -1273,14 +1274,12 @@ int av_write_trailer(AVFormatContext *s)
     if (ret >= 0)
         ret = ret1;
 
-    if (s->oformat->write_trailer) {
+    if (ffofmt(s->oformat)->write_trailer) {
         if (!(s->oformat->flags & AVFMT_NOFILE) && s->pb)
             avio_write_marker(s->pb, AV_NOPTS_VALUE, AVIO_DATA_MARKER_TRAILER);
-        if (ret >= 0) {
-        ret = s->oformat->write_trailer(s);
-        } else {
-            s->oformat->write_trailer(s);
-        }
+        ret1 = ffofmt(s->oformat)->write_trailer(s);
+        if (ret >= 0)
+            ret = ret1;
     }
 
     deinit_muxer(s);
@@ -1303,9 +1302,10 @@ int av_write_trailer(AVFormatContext *s)
 int av_get_output_timestamp(struct AVFormatContext *s, int stream,
                             int64_t *dts, int64_t *wall)
 {
-    if (!s->oformat || !s->oformat->get_output_timestamp)
+    const FFOutputFormat *const of = ffofmt(s->oformat);
+    if (!of || !of->get_output_timestamp)
         return AVERROR(ENOSYS);
-    s->oformat->get_output_timestamp(s, stream, dts, wall);
+    of->get_output_timestamp(s, stream, dts, wall);
     return 0;
 }
 
@@ -1395,7 +1395,7 @@ static int write_uncoded_frame_internal(AVFormatContext *s, int stream_index,
     AVPacket *pkt = si->parse_pkt;
 
     av_assert0(s->oformat);
-    if (!s->oformat->write_uncoded_frame) {
+    if (!ffofmt(s->oformat)->write_uncoded_frame) {
         av_frame_free(&frame);
         return AVERROR(ENOSYS);
     }
@@ -1452,9 +1452,10 @@ int av_interleaved_write_uncoded_frame(AVFormatContext *s, int stream_index,
 
 int av_write_uncoded_frame_query(AVFormatContext *s, int stream_index)
 {
-    av_assert0(s->oformat);
-    if (!s->oformat->write_uncoded_frame)
+    const FFOutputFormat *const of = ffofmt(s->oformat);
+    av_assert0(of);
+    if (!of->write_uncoded_frame)
         return AVERROR(ENOSYS);
-    return s->oformat->write_uncoded_frame(s, stream_index, NULL,
-                                           AV_WRITE_UNCODED_FRAME_QUERY);
+    return of->write_uncoded_frame(s, stream_index, NULL,
+                                   AV_WRITE_UNCODED_FRAME_QUERY);
 }
diff --git a/libavformat/mux.h b/libavformat/mux.h
index 1bfcaf795f..c2de45400c 100644
--- a/libavformat/mux.h
+++ b/libavformat/mux.h
@@ -25,6 +25,119 @@
 #include "libavcodec/packet.h"
 #include "avformat.h"
 
+struct AVDeviceInfoList;
+
+typedef struct FFOutputFormat {
+    /**
+     * The public AVOutputFormat. See avformat.h for it.
+     */
+    AVOutputFormat p;
+    /**
+     * size of private data so that it can be allocated in the wrapper
+     */
+    int priv_data_size;
+
+    /**
+     * Internal flags. See FF_FMT_FLAG_* in internal.h.
+     */
+    int flags_internal;
+
+    int (*write_header)(AVFormatContext *);
+    /**
+     * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags,
+     * pkt can be NULL in order to flush data buffered in the muxer.
+     * When flushing, return 0 if there still is more data to flush,
+     * or 1 if everything was flushed and there is no more buffered
+     * data.
+     */
+    int (*write_packet)(AVFormatContext *, AVPacket *pkt);
+    int (*write_trailer)(AVFormatContext *);
+    /**
+     * A format-specific function for interleavement.
+     * If unset, packets will be interleaved by dts.
+     *
+     * @param s           An AVFormatContext for output. pkt will be added to
+     *                    resp. taken from its packet buffer.
+     * @param[in,out] pkt A packet to be interleaved if has_packet is set;
+     *                    also used to return packets. If no packet is returned
+     *                    (e.g. on error), pkt is blank on return.
+     * @param flush       1 if no further packets are available as input and
+     *                    all remaining packets should be output.
+     * @param has_packet  If set, pkt contains a packet to be interleaved
+     *                    on input; otherwise pkt is blank on input.
+     * @return 1 if a packet was output, 0 if no packet could be output,
+     *         < 0 if an error occurred
+     */
+    int (*interleave_packet)(AVFormatContext *s, AVPacket *pkt,
+                             int flush, int has_packet);
+    /**
+     * Test if the given codec can be stored in this container.
+     *
+     * @return 1 if the codec is supported, 0 if it is not.
+     *         A negative number if unknown.
+     *         MKTAG('A', 'P', 'I', 'C') if the codec is only supported as AV_DISPOSITION_ATTACHED_PIC
+     */
+    int (*query_codec)(enum AVCodecID id, int std_compliance);
+
+    void (*get_output_timestamp)(AVFormatContext *s, int stream,
+                                 int64_t *dts, int64_t *wall);
+    /**
+     * Allows sending messages from application to device.
+     */
+    int (*control_message)(AVFormatContext *s, int type,
+                           void *data, size_t data_size);
+
+    /**
+     * Write an uncoded AVFrame.
+     *
+     * See av_write_uncoded_frame() for details.
+     *
+     * The library will free *frame afterwards, but the muxer can prevent it
+     * by setting the pointer to NULL.
+     */
+    int (*write_uncoded_frame)(AVFormatContext *, int stream_index,
+                               AVFrame **frame, unsigned flags);
+    /**
+     * Returns device list with it properties.
+     * @see avdevice_list_devices() for more details.
+     */
+    int (*get_device_list)(AVFormatContext *s, struct AVDeviceInfoList *device_list);
+    /**
+     * Initialize format. May allocate data here, and set any AVFormatContext or
+     * AVStream parameters that need to be set before packets are sent.
+     * This method must not write output.
+     *
+     * Return 0 if streams were fully configured, 1 if not, negative AVERROR on failure
+     *
+     * Any allocations made here must be freed in deinit().
+     */
+    int (*init)(AVFormatContext *);
+    /**
+     * Deinitialize format. If present, this is called whenever the muxer is being
+     * destroyed, regardless of whether or not the header has been written.
+     *
+     * If a trailer is being written, this is called after write_trailer().
+     *
+     * This is called if init() fails as well.
+     */
+    void (*deinit)(AVFormatContext *);
+    /**
+     * Set up any necessary bitstream filtering and extract any extra data needed
+     * for the global header.
+     *
+     * @note pkt might have been directly forwarded by a meta-muxer; therefore
+     *       pkt->stream_index as well as the pkt's timebase might be invalid.
+     * Return 0 if more packets from this stream must be checked; 1 if not.
+     */
+    int (*check_bitstream)(AVFormatContext *s, AVStream *st,
+                           const AVPacket *pkt);
+} FFOutputFormat;
+
+static inline const FFOutputFormat *ffofmt(const AVOutputFormat *fmt)
+{
+    return (const FFOutputFormat*)fmt;
+}
+
 /**
  * Add packet to an AVFormatContext's packet_buffer list, determining its
  * interleaved position using compare() function argument.
diff --git a/libavformat/mux_utils.c b/libavformat/mux_utils.c
index 55e58ae9d6..3e63b8039a 100644
--- a/libavformat/mux_utils.c
+++ b/libavformat/mux_utils.c
@@ -45,8 +45,8 @@ int avformat_query_codec(const AVOutputFormat *ofmt, enum AVCodecID codec_id,
 {
     if (ofmt) {
         unsigned int codec_tag;
-        if (ofmt->query_codec)
-            return ofmt->query_codec(codec_id, std_compliance);
+        if (ffofmt(ofmt)->query_codec)
+            return ffofmt(ofmt)->query_codec(codec_id, std_compliance);
         else if (ofmt->codec_tag)
             return !!av_codec_get_tag2(ofmt->codec_tag, codec_id, &codec_tag);
         else if (codec_id == ofmt->video_codec ||
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 58c551c83c..a29d678098 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -61,8 +61,11 @@
 #include "config.h"
 #include "version.h"
 
-extern const AVOutputFormat ff_mxf_d10_muxer;
-extern const AVOutputFormat ff_mxf_opatom_muxer;
+extern const FFOutputFormat ff_mxf_d10_muxer;
+extern const FFOutputFormat ff_mxf_opatom_muxer;
+
+#define IS_D10(s)    ((s)->oformat == &ff_mxf_d10_muxer.p)
+#define IS_OPATOM(s) ((s)->oformat == &ff_mxf_opatom_muxer.p)
 
 #define EDIT_UNITS_PER_BODY 250
 #define KAG_SIZE 512
@@ -667,7 +670,7 @@ static void mxf_write_preface(AVFormatContext *s)
 
     // operational pattern
     mxf_write_local_tag(s, 16, 0x3B09);
-    if (s->oformat == &ff_mxf_opatom_muxer)
+    if (IS_OPATOM(s))
         avio_write(pb, opatom_ul, 16);
     else
         avio_write(pb, op1a_ul, 16);
@@ -765,7 +768,7 @@ static void mxf_write_identification(AVFormatContext *s)
     AVDictionaryEntry *product_entry = av_dict_get(s->metadata, "product_name", NULL, 0);
     AVDictionaryEntry *version_entry = av_dict_get(s->metadata, "product_version", NULL, 0);
     const char *company = com_entry ? com_entry->value : "FFmpeg";
-    const char *product = product_entry ? product_entry->value : s->oformat != &ff_mxf_opatom_muxer ? "OP1a Muxer" : "OPAtom Muxer";
+    const char *product = product_entry ? product_entry->value : !IS_OPATOM(s) ? "OP1a Muxer" : "OPAtom Muxer";
     const char *platform = s->flags & AVFMT_FLAG_BITEXACT ? "Lavf" : PLATFORM_IDENT;
     const char *version = version_entry ? version_entry->value :
                               s->flags & AVFMT_FLAG_BITEXACT ? "0.0.0" :
@@ -866,7 +869,7 @@ static void mxf_write_track(AVFormatContext *s, AVStream *st, MXFPackage *packag
     // write edit rate
     mxf_write_local_tag(s, 8, 0x4B01);
 
-    if (st == mxf->timecode_track && s->oformat == &ff_mxf_opatom_muxer) {
+    if (st == mxf->timecode_track && IS_OPATOM(s)) {
         avio_wb32(pb, mxf->tc.rate.num);
         avio_wb32(pb, mxf->tc.rate.den);
     } else {
@@ -902,7 +905,7 @@ static void mxf_write_common_fields(AVFormatContext *s, AVStream *st)
     // write duration
     mxf_write_local_tag(s, 8, 0x0202);
 
-    if (st != mxf->timecode_track && s->oformat == &ff_mxf_opatom_muxer && st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
+    if (st != mxf->timecode_track && IS_OPATOM(s) && st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
         avio_wb64(pb, mxf->body_offset / mxf->edit_unit_byte_count);
     } else {
         avio_wb64(pb, mxf->duration);
@@ -1066,7 +1069,7 @@ static int64_t mxf_write_generic_desc(AVFormatContext *s, AVStream *st, const UI
     avio_wb32(pb, st->index+2);
 
     mxf_write_local_tag(s, 8, 0x3001);
-    if (s->oformat == &ff_mxf_d10_muxer) {
+    if (IS_D10(s)) {
         avio_wb32(pb, mxf->time_base.den);
         avio_wb32(pb, mxf->time_base.num);
     } else {
@@ -1138,7 +1141,7 @@ static int64_t mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID
     mxf_write_local_tag(s, 4, 0x3202);
     avio_wb32(pb, stored_height>>sc->interlaced);
 
-    if (s->oformat == &ff_mxf_d10_muxer) {
+    if (IS_D10(s)) {
         //Stored F2 Offset
         mxf_write_local_tag(s, 4, 0x3216);
         avio_wb32(pb, 0);
@@ -1435,7 +1438,7 @@ static int64_t mxf_write_generic_sound_common(AVFormatContext *s, AVStream *st,
     int show_warnings = !mxf->footer_partition_offset;
     int64_t pos = mxf_write_generic_desc(s, st, key);
 
-    if (s->oformat == &ff_mxf_opatom_muxer) {
+    if (IS_OPATOM(s)) {
         mxf_write_local_tag(s, 8, 0x3002);
         avio_wb64(pb, mxf->body_offset / mxf->edit_unit_byte_count);
     }
@@ -1449,19 +1452,19 @@ static int64_t mxf_write_generic_sound_common(AVFormatContext *s, AVStream *st,
     avio_wb32(pb, st->codecpar->sample_rate);
     avio_wb32(pb, 1);
 
-    if (s->oformat == &ff_mxf_d10_muxer) {
+    if (IS_D10(s)) {
         mxf_write_local_tag(s, 1, 0x3D04);
         avio_w8(pb, 0);
     }
 
     mxf_write_local_tag(s, 4, 0x3D07);
     if (mxf->channel_count == -1) {
-        if (show_warnings && (s->oformat == &ff_mxf_d10_muxer) &&
+        if (show_warnings && IS_D10(s) &&
             (st->codecpar->ch_layout.nb_channels != 4) &&
             (st->codecpar->ch_layout.nb_channels != 8))
             av_log(s, AV_LOG_WARNING, "the number of audio channels shall be 4 or 8 : the output will not comply to MXF D-10 specs, use -d10_channelcount to fix this\n");
         avio_wb32(pb, st->codecpar->ch_layout.nb_channels);
-    } else if (s->oformat == &ff_mxf_d10_muxer) {
+    } else if (IS_D10(s)) {
         if (show_warnings && (mxf->channel_count < st->codecpar->ch_layout.nb_channels))
             av_log(s, AV_LOG_WARNING, "d10_channelcount < actual number of audio channels : some channels will be discarded\n");
         if (show_warnings && (mxf->channel_count != 4) && (mxf->channel_count != 8))
@@ -1961,7 +1964,7 @@ static int mxf_write_partition(AVFormatContext *s, int bodysid,
     avio_wb32(pb, index_byte_count ? indexsid : 0); // indexSID
 
     // BodyOffset
-    if (bodysid && mxf->edit_units_count && mxf->body_partitions_count && s->oformat != &ff_mxf_opatom_muxer)
+    if (bodysid && mxf->edit_units_count && mxf->body_partitions_count && !IS_OPATOM(s))
         avio_wb64(pb, mxf->body_offset);
     else
         avio_wb64(pb, 0);
@@ -1969,7 +1972,7 @@ static int mxf_write_partition(AVFormatContext *s, int bodysid,
     avio_wb32(pb, bodysid); // bodySID
 
     // operational pattern
-    if (s->oformat == &ff_mxf_opatom_muxer)
+    if (IS_OPATOM(s))
         avio_write(pb, opatom_ul, 16);
     else
         avio_write(pb, op1a_ul, 16);
@@ -2436,7 +2439,7 @@ static int mxf_parse_mpeg2_frame(AVFormatContext *s, AVStream *st,
             }
         }
     }
-    if (s->oformat != &ff_mxf_d10_muxer) {
+    if (!IS_D10(s)) {
         const UID *codec_ul = mxf_get_mpeg2_codec_ul(st->codecpar);
         if (!codec_ul)
             return 0;
@@ -2533,7 +2536,7 @@ static int mxf_init(AVFormatContext *s)
     uint8_t present[FF_ARRAY_ELEMS(mxf_essence_container_uls)] = {0};
     int64_t timestamp = 0;
 
-    if (s->oformat == &ff_mxf_opatom_muxer && s->nb_streams !=1) {
+    if (IS_OPATOM(s) && s->nb_streams != 1) {
         av_log(s, AV_LOG_ERROR, "there must be exactly one stream for mxf opatom\n");
         return -1;
     }
@@ -2549,7 +2552,7 @@ static int mxf_init(AVFormatContext *s)
         st->priv_data = sc;
         sc->index = -1;
 
-        if (((i == 0) ^ (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)) && s->oformat != &ff_mxf_opatom_muxer) {
+        if (((i == 0) ^ (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)) && !IS_OPATOM(s)) {
             av_log(s, AV_LOG_ERROR, "there must be exactly one video stream and it must be the first one\n");
             return -1;
         }
@@ -2593,12 +2596,12 @@ static int mxf_init(AVFormatContext *s)
 
             sc->video_bit_rate = st->codecpar->bit_rate;
 
-            if (s->oformat == &ff_mxf_d10_muxer ||
+            if (IS_D10(s) ||
                 st->codecpar->codec_id == AV_CODEC_ID_DNXHD ||
                 st->codecpar->codec_id == AV_CODEC_ID_DVVIDEO)
                 mxf->cbr_index = 1;
 
-            if (s->oformat == &ff_mxf_d10_muxer) {
+            if (IS_D10(s)) {
                 int ntsc = mxf->time_base.den != 25;
                 int ul_index;
 
@@ -2636,7 +2639,7 @@ static int mxf_init(AVFormatContext *s)
                 return -1;
             }
             avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);
-            if (s->oformat == &ff_mxf_d10_muxer) {
+            if (IS_D10(s)) {
                 if (st->index != 1) {
                     av_log(s, AV_LOG_ERROR, "MXF D-10 only support one audio track\n");
                     return -1;
@@ -2648,7 +2651,7 @@ static int mxf_init(AVFormatContext *s)
                 sc->index = INDEX_D10_AUDIO;
                 sc->container_ul = ((MXFStreamContext*)s->streams[0]->priv_data)->container_ul;
                 sc->frame_size = 4 + 8 * av_rescale_rnd(st->codecpar->sample_rate, mxf->time_base.num, mxf->time_base.den, AV_ROUND_UP) * 4;
-            } else if (s->oformat == &ff_mxf_opatom_muxer) {
+            } else if (IS_OPATOM(s)) {
                 AVRational tbc = av_inv_q(mxf->audio_edit_rate);
 
                 if (st->codecpar->codec_id != AV_CODEC_ID_PCM_S16LE &&
@@ -2707,7 +2710,7 @@ static int mxf_init(AVFormatContext *s)
 
         memcpy(sc->track_essence_element_key, mxf_essence_container_uls[sc->index].element_ul, 15);
         sc->track_essence_element_key[15] = present[sc->index];
-        if (s->oformat == &ff_mxf_opatom_muxer && st->codecpar->codec_id == AV_CODEC_ID_DNXHD) {
+        if (IS_OPATOM(s) && st->codecpar->codec_id == AV_CODEC_ID_DNXHD) {
             // clip-wrapping requires 0x0D per ST2019-4:2009 or 0x06 per previous version ST2019-4:2008
             // we choose to use 0x06 instead 0x0D to be compatible with AVID systems
             // and produce mxf files with the most relevant flavour for opatom
@@ -2720,7 +2723,7 @@ static int mxf_init(AVFormatContext *s)
         present[sc->index]++;
     }
 
-    if (s->oformat == &ff_mxf_d10_muxer || s->oformat == &ff_mxf_opatom_muxer) {
+    if (IS_D10(s) || IS_OPATOM(s)) {
         mxf->essence_container_count = 1;
     }
 
@@ -2889,7 +2892,7 @@ static void mxf_compute_edit_unit_byte_count(AVFormatContext *s)
     MXFContext *mxf = s->priv_data;
     int i;
 
-    if (s->oformat == &ff_mxf_opatom_muxer) {
+    if (IS_OPATOM(s)) {
         MXFStreamContext *sc = s->streams[0]->priv_data;
         mxf->edit_unit_byte_count = sc->frame_size;
         return;
@@ -2915,7 +2918,7 @@ static int mxf_write_packet(AVFormatContext *s, AVPacket *pkt)
     int err;
 
     if (!mxf->header_written && pkt->stream_index != 0 &&
-        s->oformat != &ff_mxf_opatom_muxer) {
+        !IS_OPATOM(s)) {
         av_log(s, AV_LOG_ERROR, "Received non-video packet before "
                                 "header has been written\n");
         return AVERROR_INVALIDDATA;
@@ -2967,7 +2970,7 @@ static int mxf_write_packet(AVFormatContext *s, AVPacket *pkt)
             mxf_compute_edit_unit_byte_count(s);
     }
 
-    if (s->oformat == &ff_mxf_opatom_muxer)
+    if (IS_OPATOM(s))
         return mxf_write_opatom_packet(s, pkt, &ie);
 
     if (!mxf->header_written) {
@@ -3015,8 +3018,7 @@ static int mxf_write_packet(AVFormatContext *s, AVPacket *pkt)
 
     mxf_write_klv_fill(s);
     avio_write(pb, sc->track_essence_element_key, 16); // write key
-    if (s->oformat == &ff_mxf_d10_muxer &&
-        st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
+    if (IS_D10(s) && st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
         mxf_write_d10_audio_packet(s, st, pkt);
     } else {
         klv_encode_ber4_length(pb, pkt->size); // write length
@@ -3037,7 +3039,7 @@ static void mxf_write_random_index_pack(AVFormatContext *s)
     avio_write(pb, ff_mxf_random_index_pack_key, 16);
     klv_encode_ber_length(pb, 28 + 12LL*mxf->body_partitions_count);
 
-    if (mxf->edit_unit_byte_count && s->oformat != &ff_mxf_opatom_muxer)
+    if (mxf->edit_unit_byte_count && !IS_OPATOM(s))
         avio_wb32(pb, 1); // BodySID of header partition
     else
         avio_wb32(pb, 0);
@@ -3061,7 +3063,7 @@ static int mxf_write_footer(AVFormatContext *s)
     int i, err;
 
     if (!mxf->header_written ||
-        (s->oformat == &ff_mxf_opatom_muxer && !mxf->body_partition_offset)) {
+        (IS_OPATOM(s) && !mxf->body_partition_offset)) {
         /* reason could be invalid options/not supported codec/out of memory */
         return AVERROR_UNKNOWN;
     }
@@ -3070,7 +3072,7 @@ static int mxf_write_footer(AVFormatContext *s)
 
     mxf_write_klv_fill(s);
     mxf->footer_partition_offset = avio_tell(pb);
-    if (mxf->edit_unit_byte_count && s->oformat != &ff_mxf_opatom_muxer) { // no need to repeat index
+    if (mxf->edit_unit_byte_count && !IS_OPATOM(s)) { // no need to repeat index
         if ((err = mxf_write_partition(s, 0, 0, footer_partition_key, 0)) < 0)
             return err;
     } else {
@@ -3084,7 +3086,7 @@ static int mxf_write_footer(AVFormatContext *s)
     mxf_write_random_index_pack(s);
 
     if (s->pb->seekable & AVIO_SEEKABLE_NORMAL) {
-        if (s->oformat == &ff_mxf_opatom_muxer) {
+        if (IS_OPATOM(s)) {
             /* rewrite body partition to update lengths */
             avio_seek(pb, mxf->body_partition_offset[0], SEEK_SET);
             if ((err = mxf_write_opatom_body_partition(s)) < 0)
@@ -3092,7 +3094,7 @@ static int mxf_write_footer(AVFormatContext *s)
         }
 
         avio_seek(pb, 0, SEEK_SET);
-        if (mxf->edit_unit_byte_count && s->oformat != &ff_mxf_opatom_muxer) {
+        if (mxf->edit_unit_byte_count && !IS_OPATOM(s)) {
             if ((err = mxf_write_partition(s, 1, 2, header_closed_partition_key, 1)) < 0)
                 return err;
             mxf_write_klv_fill(s);
@@ -3260,52 +3262,52 @@ static const AVClass mxf_opatom_muxer_class = {
     .version        = LIBAVUTIL_VERSION_INT,
 };
 
-const AVOutputFormat ff_mxf_muxer = {
-    .name              = "mxf",
-    .long_name         = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format)"),
-    .mime_type         = "application/mxf",
-    .extensions        = "mxf",
+const FFOutputFormat ff_mxf_muxer = {
+    .p.name            = "mxf",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format)"),
+    .p.mime_type       = "application/mxf",
+    .p.extensions      = "mxf",
     .priv_data_size    = sizeof(MXFContext),
-    .audio_codec       = AV_CODEC_ID_PCM_S16LE,
-    .video_codec       = AV_CODEC_ID_MPEG2VIDEO,
+    .p.audio_codec     = AV_CODEC_ID_PCM_S16LE,
+    .p.video_codec     = AV_CODEC_ID_MPEG2VIDEO,
     .init              = mxf_init,
     .write_packet      = mxf_write_packet,
     .write_trailer     = mxf_write_footer,
     .deinit            = mxf_deinit,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
     .interleave_packet = mxf_interleave,
-    .priv_class        = &mxf_muxer_class,
+    .p.priv_class      = &mxf_muxer_class,
 };
 
-const AVOutputFormat ff_mxf_d10_muxer = {
-    .name              = "mxf_d10",
-    .long_name         = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format) D-10 Mapping"),
-    .mime_type         = "application/mxf",
+const FFOutputFormat ff_mxf_d10_muxer = {
+    .p.name            = "mxf_d10",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format) D-10 Mapping"),
+    .p.mime_type       = "application/mxf",
     .priv_data_size    = sizeof(MXFContext),
-    .audio_codec       = AV_CODEC_ID_PCM_S16LE,
-    .video_codec       = AV_CODEC_ID_MPEG2VIDEO,
+    .p.audio_codec     = AV_CODEC_ID_PCM_S16LE,
+    .p.video_codec     = AV_CODEC_ID_MPEG2VIDEO,
     .init              = mxf_init,
     .write_packet      = mxf_write_packet,
     .write_trailer     = mxf_write_footer,
     .deinit            = mxf_deinit,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
     .interleave_packet = mxf_interleave,
-    .priv_class        = &mxf_d10_muxer_class,
+    .p.priv_class      = &mxf_d10_muxer_class,
 };
 
-const AVOutputFormat ff_mxf_opatom_muxer = {
-    .name              = "mxf_opatom",
-    .long_name         = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format) Operational Pattern Atom"),
-    .mime_type         = "application/mxf",
-    .extensions        = "mxf",
+const FFOutputFormat ff_mxf_opatom_muxer = {
+    .p.name            = "mxf_opatom",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format) Operational Pattern Atom"),
+    .p.mime_type       = "application/mxf",
+    .p.extensions      = "mxf",
     .priv_data_size    = sizeof(MXFContext),
-    .audio_codec       = AV_CODEC_ID_PCM_S16LE,
-    .video_codec       = AV_CODEC_ID_DNXHD,
+    .p.audio_codec     = AV_CODEC_ID_PCM_S16LE,
+    .p.video_codec     = AV_CODEC_ID_DNXHD,
     .init              = mxf_init,
     .write_packet      = mxf_write_packet,
     .write_trailer     = mxf_write_footer,
     .deinit            = mxf_deinit,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
     .interleave_packet = mxf_interleave,
-    .priv_class        = &mxf_opatom_muxer_class,
+    .p.priv_class      = &mxf_opatom_muxer_class,
 };
diff --git a/libavformat/nullenc.c b/libavformat/nullenc.c
index 3deca5a7ed..60bde2a069 100644
--- a/libavformat/nullenc.c
+++ b/libavformat/nullenc.c
@@ -27,12 +27,12 @@ static int null_write_packet(struct AVFormatContext *s, AVPacket *pkt)
     return 0;
 }
 
-const AVOutputFormat ff_null_muxer = {
-    .name              = "null",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw null video"),
-    .audio_codec       = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
-    .video_codec       = AV_CODEC_ID_WRAPPED_AVFRAME,
+const FFOutputFormat ff_null_muxer = {
+    .p.name            = "null",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw null video"),
+    .p.audio_codec     = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
+    .p.video_codec     = AV_CODEC_ID_WRAPPED_AVFRAME,
     .write_packet      = null_write_packet,
-    .flags             = AVFMT_VARIABLE_FPS | AVFMT_NOFILE | AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_VARIABLE_FPS | AVFMT_NOFILE | AVFMT_NOTIMESTAMPS,
     .interleave_packet = ff_interleave_packet_passthrough,
 };
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index ff81ee34aa..a5198c7ca9 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -1253,20 +1253,20 @@ static const AVClass class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
-const AVOutputFormat ff_nut_muxer = {
-    .name           = "nut",
-    .long_name      = NULL_IF_CONFIG_SMALL("NUT"),
-    .mime_type      = "video/x-nut",
-    .extensions     = "nut",
+const FFOutputFormat ff_nut_muxer = {
+    .p.name         = "nut",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("NUT"),
+    .p.mime_type    = "video/x-nut",
+    .p.extensions   = "nut",
     .priv_data_size = sizeof(NUTContext),
-    .audio_codec    = CONFIG_LIBVORBIS ? AV_CODEC_ID_VORBIS :
+    .p.audio_codec  = CONFIG_LIBVORBIS ? AV_CODEC_ID_VORBIS :
                       CONFIG_LIBMP3LAME ? AV_CODEC_ID_MP3 : AV_CODEC_ID_MP2,
-    .video_codec    = AV_CODEC_ID_MPEG4,
+    .p.video_codec  = AV_CODEC_ID_MPEG4,
     .write_header   = nut_write_header,
     .write_packet   = nut_write_packet,
     .write_trailer  = nut_write_trailer,
     .deinit         = nut_write_deinit,
-    .flags          = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS,
-    .codec_tag      = ff_nut_codec_tags,
-    .priv_class     = &class,
+    .p.flags        = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS,
+    .p.codec_tag    = ff_nut_codec_tags,
+    .p.priv_class   = &class,
 };
diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c
index 458b2a9bdc..2e582d0754 100644
--- a/libavformat/oggenc.c
+++ b/libavformat/oggenc.c
@@ -33,6 +33,7 @@
 #include "avformat.h"
 #include "avio_internal.h"
 #include "internal.h"
+#include "mux.h"
 #include "version.h"
 #include "vorbiscomment.h"
 
@@ -746,11 +747,11 @@ static void ogg_free(AVFormatContext *s)
 }
 
 #if CONFIG_OGG_MUXER
-const AVOutputFormat ff_ogg_muxer = {
-    .name              = "ogg",
-    .long_name         = NULL_IF_CONFIG_SMALL("Ogg"),
-    .mime_type         = "application/ogg",
-    .extensions        = "ogg"
+const FFOutputFormat ff_ogg_muxer = {
+    .p.name            = "ogg",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("Ogg"),
+    .p.mime_type       = "application/ogg",
+    .p.extensions      = "ogg"
 #if !CONFIG_OGV_MUXER
                          ",ogv"
 #endif
@@ -762,90 +763,90 @@ const AVOutputFormat ff_ogg_muxer = {
 #endif
                          ,
     .priv_data_size    = sizeof(OGGContext),
-    .audio_codec       = CONFIG_LIBVORBIS_ENCODER ?
+    .p.audio_codec     = CONFIG_LIBVORBIS_ENCODER ?
                          AV_CODEC_ID_VORBIS : AV_CODEC_ID_FLAC,
-    .video_codec       = AV_CODEC_ID_THEORA,
+    .p.video_codec     = AV_CODEC_ID_THEORA,
     .init              = ogg_init,
     .write_header      = ogg_write_header,
     .write_packet      = ogg_write_packet,
     .write_trailer     = ogg_write_trailer,
     .deinit            = ogg_free,
-    .flags             = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
-    .priv_class        = &ogg_muxer_class,
+    .p.flags           = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
+    .p.priv_class      = &ogg_muxer_class,
 };
 #endif
 
 #if CONFIG_OGA_MUXER
-const AVOutputFormat ff_oga_muxer = {
-    .name              = "oga",
-    .long_name         = NULL_IF_CONFIG_SMALL("Ogg Audio"),
-    .mime_type         = "audio/ogg",
-    .extensions        = "oga",
+const FFOutputFormat ff_oga_muxer = {
+    .p.name            = "oga",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("Ogg Audio"),
+    .p.mime_type       = "audio/ogg",
+    .p.extensions      = "oga",
     .priv_data_size    = sizeof(OGGContext),
-    .audio_codec       = AV_CODEC_ID_FLAC,
+    .p.audio_codec     = AV_CODEC_ID_FLAC,
     .init              = ogg_init,
     .write_header      = ogg_write_header,
     .write_packet      = ogg_write_packet,
     .write_trailer     = ogg_write_trailer,
     .deinit            = ogg_free,
-    .flags             = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,
-    .priv_class        = &ogg_muxer_class,
+    .p.flags           = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,
+    .p.priv_class      = &ogg_muxer_class,
 };
 #endif
 
 #if CONFIG_OGV_MUXER
-const AVOutputFormat ff_ogv_muxer = {
-    .name              = "ogv",
-    .long_name         = NULL_IF_CONFIG_SMALL("Ogg Video"),
-    .mime_type         = "video/ogg",
-    .extensions        = "ogv",
+const FFOutputFormat ff_ogv_muxer = {
+    .p.name            = "ogv",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("Ogg Video"),
+    .p.mime_type       = "video/ogg",
+    .p.extensions      = "ogv",
     .priv_data_size    = sizeof(OGGContext),
-    .audio_codec       = CONFIG_LIBVORBIS_ENCODER ?
+    .p.audio_codec     = CONFIG_LIBVORBIS_ENCODER ?
                          AV_CODEC_ID_VORBIS : AV_CODEC_ID_FLAC,
-    .video_codec       = CONFIG_LIBTHEORA_ENCODER ?
+    .p.video_codec     = CONFIG_LIBTHEORA_ENCODER ?
                          AV_CODEC_ID_THEORA : AV_CODEC_ID_VP8,
     .init              = ogg_init,
     .write_header      = ogg_write_header,
     .write_packet      = ogg_write_packet,
     .write_trailer     = ogg_write_trailer,
     .deinit            = ogg_free,
-    .flags             = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
-    .priv_class        = &ogg_muxer_class,
+    .p.flags           = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
+    .p.priv_class      = &ogg_muxer_class,
 };
 #endif
 
 #if CONFIG_SPX_MUXER
-const AVOutputFormat ff_spx_muxer = {
-    .name              = "spx",
-    .long_name         = NULL_IF_CONFIG_SMALL("Ogg Speex"),
-    .mime_type         = "audio/ogg",
-    .extensions        = "spx",
+const FFOutputFormat ff_spx_muxer = {
+    .p.name            = "spx",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("Ogg Speex"),
+    .p.mime_type       = "audio/ogg",
+    .p.extensions      = "spx",
     .priv_data_size    = sizeof(OGGContext),
-    .audio_codec       = AV_CODEC_ID_SPEEX,
+    .p.audio_codec     = AV_CODEC_ID_SPEEX,
     .init              = ogg_init,
     .write_header      = ogg_write_header,
     .write_packet      = ogg_write_packet,
     .write_trailer     = ogg_write_trailer,
     .deinit            = ogg_free,
-    .flags             = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,
-    .priv_class        = &ogg_muxer_class,
+    .p.flags           = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,
+    .p.priv_class      = &ogg_muxer_class,
 };
 #endif
 
 #if CONFIG_OPUS_MUXER
-const AVOutputFormat ff_opus_muxer = {
-    .name              = "opus",
-    .long_name         = NULL_IF_CONFIG_SMALL("Ogg Opus"),
-    .mime_type         = "audio/ogg",
-    .extensions        = "opus",
+const FFOutputFormat ff_opus_muxer = {
+    .p.name            = "opus",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("Ogg Opus"),
+    .p.mime_type       = "audio/ogg",
+    .p.extensions      = "opus",
     .priv_data_size    = sizeof(OGGContext),
-    .audio_codec       = AV_CODEC_ID_OPUS,
+    .p.audio_codec     = AV_CODEC_ID_OPUS,
     .init              = ogg_init,
     .write_header      = ogg_write_header,
     .write_packet      = ogg_write_packet,
     .write_trailer     = ogg_write_trailer,
     .deinit            = ogg_free,
-    .flags             = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,
-    .priv_class        = &ogg_muxer_class,
+    .p.flags           = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,
+    .p.priv_class      = &ogg_muxer_class,
 };
 #endif
diff --git a/libavformat/omaenc.c b/libavformat/omaenc.c
index 246f5195fb..6d0b47465d 100644
--- a/libavformat/omaenc.c
+++ b/libavformat/omaenc.c
@@ -24,6 +24,7 @@
 #include "avio_internal.h"
 #include "id3v2.h"
 #include "internal.h"
+#include "mux.h"
 #include "oma.h"
 #include "rawenc.h"
 
@@ -91,14 +92,14 @@ static av_cold int oma_write_header(AVFormatContext *s)
     return 0;
 }
 
-const AVOutputFormat ff_oma_muxer = {
-    .name              = "oma",
-    .long_name         = NULL_IF_CONFIG_SMALL("Sony OpenMG audio"),
-    .mime_type         = "audio/x-oma",
-    .extensions        = "oma",
-    .audio_codec       = AV_CODEC_ID_ATRAC3,
+const FFOutputFormat ff_oma_muxer = {
+    .p.name            = "oma",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("Sony OpenMG audio"),
+    .p.mime_type       = "audio/x-oma",
+    .p.extensions      = "oma",
+    .p.audio_codec     = AV_CODEC_ID_ATRAC3,
     .write_header      = oma_write_header,
     .write_packet      = ff_raw_write_packet,
-    .codec_tag         = ff_oma_codec_tags_list,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.codec_tag       = ff_oma_codec_tags_list,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
diff --git a/libavformat/pcmenc.c b/libavformat/pcmenc.c
index 0cf497989a..7f71644308 100644
--- a/libavformat/pcmenc.c
+++ b/libavformat/pcmenc.c
@@ -22,18 +22,19 @@
 #include "config_components.h"
 
 #include "avformat.h"
+#include "mux.h"
 #include "rawenc.h"
 
 #define PCMDEF_0(name_, long_name_, ext, codec)
 #define PCMDEF_1(name_, long_name_, ext, codec)             \
-const AVOutputFormat ff_pcm_ ## name_ ## _muxer = {         \
-    .name         = #name_,                                 \
-    .long_name    = NULL_IF_CONFIG_SMALL(long_name_),       \
-    .extensions   = ext,                                    \
-    .audio_codec  = codec,                                  \
-    .video_codec  = AV_CODEC_ID_NONE,                          \
+const FFOutputFormat ff_pcm_ ## name_ ## _muxer = {         \
+    .p.name        = #name_,                                \
+    .p.long_name   = NULL_IF_CONFIG_SMALL(long_name_),      \
+    .p.extensions  = ext,                                   \
+    .p.audio_codec = codec,                                 \
+    .p.video_codec = AV_CODEC_ID_NONE,                      \
+    .p.flags       = AVFMT_NOTIMESTAMPS,                    \
     .write_packet = ff_raw_write_packet,                    \
-    .flags        = AVFMT_NOTIMESTAMPS,                     \
 };
 #define PCMDEF_2(name, long_name, ext, codec, enabled)      \
     PCMDEF_ ## enabled(name, long_name, ext, codec)
diff --git a/libavformat/rawenc.c b/libavformat/rawenc.c
index 267fce252d..78fadda967 100644
--- a/libavformat/rawenc.c
+++ b/libavformat/rawenc.c
@@ -59,16 +59,16 @@ static int force_one_stream(AVFormatContext *s)
 /* Note: Do not forget to add new entries to the Makefile as well. */
 
 #if CONFIG_AC3_MUXER
-const AVOutputFormat ff_ac3_muxer = {
-    .name              = "ac3",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw AC-3"),
-    .mime_type         = "audio/x-ac3",
-    .extensions        = "ac3",
-    .audio_codec       = AV_CODEC_ID_AC3,
-    .video_codec       = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_ac3_muxer = {
+    .p.name            = "ac3",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw AC-3"),
+    .p.mime_type       = "audio/x-ac3",
+    .p.extensions      = "ac3",
+    .p.audio_codec     = AV_CODEC_ID_AC3,
+    .p.video_codec     = AV_CODEC_ID_NONE,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
@@ -92,266 +92,266 @@ static int adx_write_trailer(AVFormatContext *s)
     return 0;
 }
 
-const AVOutputFormat ff_adx_muxer = {
-    .name              = "adx",
-    .long_name         = NULL_IF_CONFIG_SMALL("CRI ADX"),
-    .extensions        = "adx",
-    .audio_codec       = AV_CODEC_ID_ADPCM_ADX,
-    .video_codec       = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_adx_muxer = {
+    .p.name            = "adx",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("CRI ADX"),
+    .p.extensions      = "adx",
+    .p.audio_codec     = AV_CODEC_ID_ADPCM_ADX,
+    .p.video_codec     = AV_CODEC_ID_NONE,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
     .write_trailer     = adx_write_trailer,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 #if CONFIG_APTX_MUXER
-const AVOutputFormat ff_aptx_muxer = {
-    .name              = "aptx",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw aptX (Audio Processing Technology for Bluetooth)"),
-    .extensions        = "aptx",
-    .audio_codec       = AV_CODEC_ID_APTX,
-    .video_codec       = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_aptx_muxer = {
+    .p.name            = "aptx",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw aptX (Audio Processing Technology for Bluetooth)"),
+    .p.extensions      = "aptx",
+    .p.audio_codec     = AV_CODEC_ID_APTX,
+    .p.video_codec     = AV_CODEC_ID_NONE,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 #if CONFIG_APTX_HD_MUXER
-const AVOutputFormat ff_aptx_hd_muxer = {
-    .name              = "aptx_hd",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw aptX HD (Audio Processing Technology for Bluetooth)"),
-    .extensions        = "aptxhd",
-    .audio_codec       = AV_CODEC_ID_APTX_HD,
-    .video_codec       = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_aptx_hd_muxer = {
+    .p.name            = "aptx_hd",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw aptX HD (Audio Processing Technology for Bluetooth)"),
+    .p.extensions      = "aptxhd",
+    .p.audio_codec     = AV_CODEC_ID_APTX_HD,
+    .p.video_codec     = AV_CODEC_ID_NONE,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 #if CONFIG_AVS2_MUXER
-const AVOutputFormat ff_avs2_muxer = {
-    .name              = "avs2",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw AVS2-P2/IEEE1857.4 video"),
-    .extensions        = "avs,avs2",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_AVS2,
+const FFOutputFormat ff_avs2_muxer = {
+    .p.name            = "avs2",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw AVS2-P2/IEEE1857.4 video"),
+    .p.extensions      = "avs,avs2",
+    .p.audio_codec     = AV_CODEC_ID_NONE,
+    .p.video_codec     = AV_CODEC_ID_AVS2,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 #if CONFIG_AVS3_MUXER
-const AVOutputFormat ff_avs3_muxer = {
-    .name              = "avs3",
-    .long_name         = NULL_IF_CONFIG_SMALL("AVS3-P2/IEEE1857.10"),
-    .extensions        = "avs3",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_AVS3,
+const FFOutputFormat ff_avs3_muxer = {
+    .p.name            = "avs3",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("AVS3-P2/IEEE1857.10"),
+    .p.extensions      = "avs3",
+    .p.audio_codec     = AV_CODEC_ID_NONE,
+    .p.video_codec     = AV_CODEC_ID_AVS3,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 
 #if CONFIG_CAVSVIDEO_MUXER
-const AVOutputFormat ff_cavsvideo_muxer = {
-    .name              = "cavsvideo",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw Chinese AVS (Audio Video Standard) video"),
-    .extensions        = "cavs",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_CAVS,
+const FFOutputFormat ff_cavsvideo_muxer = {
+    .p.name            = "cavsvideo",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw Chinese AVS (Audio Video Standard) video"),
+    .p.extensions      = "cavs",
+    .p.audio_codec     = AV_CODEC_ID_NONE,
+    .p.video_codec     = AV_CODEC_ID_CAVS,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 #if CONFIG_CODEC2RAW_MUXER
-const AVOutputFormat ff_codec2raw_muxer = {
-    .name              = "codec2raw",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw codec2 muxer"),
-    .audio_codec       = AV_CODEC_ID_CODEC2,
-    .video_codec       = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_codec2raw_muxer = {
+    .p.name            = "codec2raw",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw codec2 muxer"),
+    .p.audio_codec     = AV_CODEC_ID_CODEC2,
+    .p.video_codec     = AV_CODEC_ID_NONE,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 
 #if CONFIG_DATA_MUXER
-const AVOutputFormat ff_data_muxer = {
-    .name              = "data",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw data"),
+const FFOutputFormat ff_data_muxer = {
+    .p.name            = "data",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw data"),
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 #if CONFIG_DFPWM_MUXER
-const AVOutputFormat ff_dfpwm_muxer = {
-    .name              = "dfpwm",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw DFPWM1a"),
-    .extensions        = "dfpwm",
-    .audio_codec       = AV_CODEC_ID_DFPWM,
-    .video_codec       = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_dfpwm_muxer = {
+    .p.name            = "dfpwm",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw DFPWM1a"),
+    .p.extensions      = "dfpwm",
+    .p.audio_codec     = AV_CODEC_ID_DFPWM,
+    .p.video_codec     = AV_CODEC_ID_NONE,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 #if CONFIG_DIRAC_MUXER
-const AVOutputFormat ff_dirac_muxer = {
-    .name              = "dirac",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw Dirac"),
-    .extensions        = "drc,vc2",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_DIRAC,
+const FFOutputFormat ff_dirac_muxer = {
+    .p.name            = "dirac",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw Dirac"),
+    .p.extensions      = "drc,vc2",
+    .p.audio_codec     = AV_CODEC_ID_NONE,
+    .p.video_codec     = AV_CODEC_ID_DIRAC,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 #if CONFIG_DNXHD_MUXER
-const AVOutputFormat ff_dnxhd_muxer = {
-    .name              = "dnxhd",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"),
-    .extensions        = "dnxhd,dnxhr",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_DNXHD,
+const FFOutputFormat ff_dnxhd_muxer = {
+    .p.name            = "dnxhd",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"),
+    .p.extensions      = "dnxhd,dnxhr",
+    .p.audio_codec     = AV_CODEC_ID_NONE,
+    .p.video_codec     = AV_CODEC_ID_DNXHD,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 #if CONFIG_DTS_MUXER
-const AVOutputFormat ff_dts_muxer = {
-    .name              = "dts",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw DTS"),
-    .mime_type         = "audio/x-dca",
-    .extensions        = "dts",
-    .audio_codec       = AV_CODEC_ID_DTS,
-    .video_codec       = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_dts_muxer = {
+    .p.name            = "dts",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw DTS"),
+    .p.mime_type       = "audio/x-dca",
+    .p.extensions      = "dts",
+    .p.audio_codec     = AV_CODEC_ID_DTS,
+    .p.video_codec     = AV_CODEC_ID_NONE,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 #if CONFIG_EAC3_MUXER
-const AVOutputFormat ff_eac3_muxer = {
-    .name              = "eac3",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw E-AC-3"),
-    .mime_type         = "audio/x-eac3",
-    .extensions        = "eac3,ec3",
-    .audio_codec       = AV_CODEC_ID_EAC3,
-    .video_codec       = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_eac3_muxer = {
+    .p.name            = "eac3",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw E-AC-3"),
+    .p.mime_type       = "audio/x-eac3",
+    .p.extensions      = "eac3,ec3",
+    .p.audio_codec     = AV_CODEC_ID_EAC3,
+    .p.video_codec     = AV_CODEC_ID_NONE,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 #if CONFIG_G722_MUXER
-const AVOutputFormat ff_g722_muxer = {
-    .name              = "g722",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw G.722"),
-    .mime_type         = "audio/G722",
-    .extensions        = "g722",
-    .audio_codec       = AV_CODEC_ID_ADPCM_G722,
-    .video_codec       = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_g722_muxer = {
+    .p.name            = "g722",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw G.722"),
+    .p.mime_type       = "audio/G722",
+    .p.extensions      = "g722",
+    .p.audio_codec     = AV_CODEC_ID_ADPCM_G722,
+    .p.video_codec     = AV_CODEC_ID_NONE,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 #if CONFIG_G723_1_MUXER
-const AVOutputFormat ff_g723_1_muxer = {
-    .name              = "g723_1",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw G.723.1"),
-    .mime_type         = "audio/g723",
-    .extensions        = "tco,rco",
-    .audio_codec       = AV_CODEC_ID_G723_1,
-    .video_codec       = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_g723_1_muxer = {
+    .p.name            = "g723_1",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw G.723.1"),
+    .p.mime_type       = "audio/g723",
+    .p.extensions      = "tco,rco",
+    .p.audio_codec     = AV_CODEC_ID_G723_1,
+    .p.video_codec     = AV_CODEC_ID_NONE,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 #if CONFIG_G726_MUXER
-const AVOutputFormat ff_g726_muxer = {
-    .name              = "g726",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw big-endian G.726 (\"left-justified\")"),
-    .audio_codec       = AV_CODEC_ID_ADPCM_G726,
-    .video_codec       = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_g726_muxer = {
+    .p.name            = "g726",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw big-endian G.726 (\"left-justified\")"),
+    .p.audio_codec     = AV_CODEC_ID_ADPCM_G726,
+    .p.video_codec     = AV_CODEC_ID_NONE,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 #if CONFIG_G726LE_MUXER
-const AVOutputFormat ff_g726le_muxer = {
-    .name              = "g726le",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw little-endian G.726 (\"right-justified\")"),
-    .audio_codec       = AV_CODEC_ID_ADPCM_G726LE,
-    .video_codec       = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_g726le_muxer = {
+    .p.name            = "g726le",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw little-endian G.726 (\"right-justified\")"),
+    .p.audio_codec     = AV_CODEC_ID_ADPCM_G726LE,
+    .p.video_codec     = AV_CODEC_ID_NONE,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 #if CONFIG_GSM_MUXER
-const AVOutputFormat ff_gsm_muxer = {
-    .name              = "gsm",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw GSM"),
-    .mime_type         = "audio/x-gsm",
-    .extensions        = "gsm",
-    .audio_codec       = AV_CODEC_ID_GSM,
-    .video_codec       = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_gsm_muxer = {
+    .p.name            = "gsm",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw GSM"),
+    .p.mime_type       = "audio/x-gsm",
+    .p.extensions      = "gsm",
+    .p.audio_codec     = AV_CODEC_ID_GSM,
+    .p.video_codec     = AV_CODEC_ID_NONE,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 #if CONFIG_H261_MUXER
-const AVOutputFormat ff_h261_muxer = {
-    .name              = "h261",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw H.261"),
-    .mime_type         = "video/x-h261",
-    .extensions        = "h261",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_H261,
+const FFOutputFormat ff_h261_muxer = {
+    .p.name            = "h261",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw H.261"),
+    .p.mime_type       = "video/x-h261",
+    .p.extensions      = "h261",
+    .p.audio_codec     = AV_CODEC_ID_NONE,
+    .p.video_codec     = AV_CODEC_ID_H261,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 #if CONFIG_H263_MUXER
-const AVOutputFormat ff_h263_muxer = {
-    .name              = "h263",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw H.263"),
-    .mime_type         = "video/x-h263",
-    .extensions        = "h263",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_H263,
+const FFOutputFormat ff_h263_muxer = {
+    .p.name            = "h263",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw H.263"),
+    .p.mime_type       = "video/x-h263",
+    .p.extensions      = "h263",
+    .p.audio_codec     = AV_CODEC_ID_NONE,
+    .p.video_codec     = AV_CODEC_ID_H263,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
@@ -365,16 +365,16 @@ static int h264_check_bitstream(AVFormatContext *s, AVStream *st,
     return 1;
 }
 
-const AVOutputFormat ff_h264_muxer = {
-    .name              = "h264",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw H.264 video"),
-    .extensions        = "h264,264",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_H264,
+const FFOutputFormat ff_h264_muxer = {
+    .p.name            = "h264",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw H.264 video"),
+    .p.extensions      = "h264,264",
+    .p.audio_codec     = AV_CODEC_ID_NONE,
+    .p.video_codec     = AV_CODEC_ID_H264,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
     .check_bitstream   = h264_check_bitstream,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
@@ -388,97 +388,97 @@ static int hevc_check_bitstream(AVFormatContext *s, AVStream *st,
     return 1;
 }
 
-const AVOutputFormat ff_hevc_muxer = {
-    .name              = "hevc",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw HEVC video"),
-    .extensions        = "hevc,h265,265",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_HEVC,
+const FFOutputFormat ff_hevc_muxer = {
+    .p.name            = "hevc",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw HEVC video"),
+    .p.extensions      = "hevc,h265,265",
+    .p.audio_codec     = AV_CODEC_ID_NONE,
+    .p.video_codec     = AV_CODEC_ID_HEVC,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
     .check_bitstream   = hevc_check_bitstream,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 #if CONFIG_M4V_MUXER
-const AVOutputFormat ff_m4v_muxer = {
-    .name              = "m4v",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw MPEG-4 video"),
-    .extensions        = "m4v",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_MPEG4,
+const FFOutputFormat ff_m4v_muxer = {
+    .p.name            = "m4v",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw MPEG-4 video"),
+    .p.extensions      = "m4v",
+    .p.audio_codec     = AV_CODEC_ID_NONE,
+    .p.video_codec     = AV_CODEC_ID_MPEG4,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 #if CONFIG_MJPEG_MUXER
-const AVOutputFormat ff_mjpeg_muxer = {
-    .name              = "mjpeg",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw MJPEG video"),
-    .mime_type         = "video/x-mjpeg",
-    .extensions        = "mjpg,mjpeg",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_MJPEG,
+const FFOutputFormat ff_mjpeg_muxer = {
+    .p.name            = "mjpeg",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw MJPEG video"),
+    .p.mime_type       = "video/x-mjpeg",
+    .p.extensions      = "mjpg,mjpeg",
+    .p.audio_codec     = AV_CODEC_ID_NONE,
+    .p.video_codec     = AV_CODEC_ID_MJPEG,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 #if CONFIG_MLP_MUXER
-const AVOutputFormat ff_mlp_muxer = {
-    .name              = "mlp",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw MLP"),
-    .extensions        = "mlp",
-    .audio_codec       = AV_CODEC_ID_MLP,
-    .video_codec       = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_mlp_muxer = {
+    .p.name            = "mlp",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw MLP"),
+    .p.extensions      = "mlp",
+    .p.audio_codec     = AV_CODEC_ID_MLP,
+    .p.video_codec     = AV_CODEC_ID_NONE,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 #if CONFIG_MP2_MUXER
-const AVOutputFormat ff_mp2_muxer = {
-    .name              = "mp2",
-    .long_name         = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
-    .mime_type         = "audio/mpeg",
-    .extensions        = "mp2,m2a,mpa",
-    .audio_codec       = AV_CODEC_ID_MP2,
-    .video_codec       = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_mp2_muxer = {
+    .p.name            = "mp2",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
+    .p.mime_type       = "audio/mpeg",
+    .p.extensions      = "mp2,m2a,mpa",
+    .p.audio_codec     = AV_CODEC_ID_MP2,
+    .p.video_codec     = AV_CODEC_ID_NONE,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 #if CONFIG_MPEG1VIDEO_MUXER
-const AVOutputFormat ff_mpeg1video_muxer = {
-    .name              = "mpeg1video",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw MPEG-1 video"),
-    .mime_type         = "video/mpeg",
-    .extensions        = "mpg,mpeg,m1v",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_MPEG1VIDEO,
+const FFOutputFormat ff_mpeg1video_muxer = {
+    .p.name            = "mpeg1video",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw MPEG-1 video"),
+    .p.mime_type       = "video/mpeg",
+    .p.extensions      = "mpg,mpeg,m1v",
+    .p.audio_codec     = AV_CODEC_ID_NONE,
+    .p.video_codec     = AV_CODEC_ID_MPEG1VIDEO,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 #if CONFIG_MPEG2VIDEO_MUXER
-const AVOutputFormat ff_mpeg2video_muxer = {
-    .name              = "mpeg2video",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw MPEG-2 video"),
-    .extensions        = "m2v",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_MPEG2VIDEO,
+const FFOutputFormat ff_mpeg2video_muxer = {
+    .p.name            = "mpeg2video",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw MPEG-2 video"),
+    .p.extensions      = "m2v",
+    .p.audio_codec     = AV_CODEC_ID_NONE,
+    .p.video_codec     = AV_CODEC_ID_MPEG2VIDEO,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
@@ -489,66 +489,66 @@ static int obu_check_bitstream(AVFormatContext *s, AVStream *st,
     return ff_stream_add_bitstream_filter(st, "av1_metadata", "td=insert");
 }
 
-const AVOutputFormat ff_obu_muxer = {
-    .name              = "obu",
-    .long_name         = NULL_IF_CONFIG_SMALL("AV1 low overhead OBU"),
-    .extensions        = "obu",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_AV1,
+const FFOutputFormat ff_obu_muxer = {
+    .p.name            = "obu",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("AV1 low overhead OBU"),
+    .p.extensions      = "obu",
+    .p.audio_codec     = AV_CODEC_ID_NONE,
+    .p.video_codec     = AV_CODEC_ID_AV1,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
     .check_bitstream   = obu_check_bitstream,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 #if CONFIG_RAWVIDEO_MUXER
-const AVOutputFormat ff_rawvideo_muxer = {
-    .name              = "rawvideo",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw video"),
-    .extensions        = "yuv,rgb",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_RAWVIDEO,
+const FFOutputFormat ff_rawvideo_muxer = {
+    .p.name            = "rawvideo",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw video"),
+    .p.extensions      = "yuv,rgb",
+    .p.audio_codec     = AV_CODEC_ID_NONE,
+    .p.video_codec     = AV_CODEC_ID_RAWVIDEO,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 #if CONFIG_SBC_MUXER
-const AVOutputFormat ff_sbc_muxer = {
-    .name              = "sbc",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw SBC"),
-    .mime_type         = "audio/x-sbc",
-    .extensions        = "sbc,msbc",
-    .audio_codec       = AV_CODEC_ID_SBC,
+const FFOutputFormat ff_sbc_muxer = {
+    .p.name            = "sbc",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw SBC"),
+    .p.mime_type       = "audio/x-sbc",
+    .p.extensions      = "sbc,msbc",
+    .p.audio_codec     = AV_CODEC_ID_SBC,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 #if CONFIG_TRUEHD_MUXER
-const AVOutputFormat ff_truehd_muxer = {
-    .name              = "truehd",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw TrueHD"),
-    .extensions        = "thd",
-    .audio_codec       = AV_CODEC_ID_TRUEHD,
-    .video_codec       = AV_CODEC_ID_NONE,
+const FFOutputFormat ff_truehd_muxer = {
+    .p.name            = "truehd",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw TrueHD"),
+    .p.extensions      = "thd",
+    .p.audio_codec     = AV_CODEC_ID_TRUEHD,
+    .p.video_codec     = AV_CODEC_ID_NONE,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
 
 #if CONFIG_VC1_MUXER
-const AVOutputFormat ff_vc1_muxer = {
-    .name              = "vc1",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw VC-1 video"),
-    .extensions        = "vc1",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_VC1,
+const FFOutputFormat ff_vc1_muxer = {
+    .p.name            = "vc1",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw VC-1 video"),
+    .p.extensions      = "vc1",
+    .p.audio_codec     = AV_CODEC_ID_NONE,
+    .p.video_codec     = AV_CODEC_ID_VC1,
     .init              = force_one_stream,
     .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
 #endif
diff --git a/libavformat/rmenc.c b/libavformat/rmenc.c
index 1fba092b88..0d001224cb 100644
--- a/libavformat/rmenc.c
+++ b/libavformat/rmenc.c
@@ -20,6 +20,7 @@
  */
 #include "avformat.h"
 #include "avio_internal.h"
+#include "mux.h"
 #include "rm.h"
 #include "libavutil/dict.h"
 
@@ -465,16 +466,16 @@ static int rm_write_trailer(AVFormatContext *s)
 }
 
 
-const AVOutputFormat ff_rm_muxer = {
-    .name              = "rm",
-    .long_name         = NULL_IF_CONFIG_SMALL("RealMedia"),
-    .mime_type         = "application/vnd.rn-realmedia",
-    .extensions        = "rm,ra",
+const FFOutputFormat ff_rm_muxer = {
+    .p.name            = "rm",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("RealMedia"),
+    .p.mime_type       = "application/vnd.rn-realmedia",
+    .p.extensions      = "rm,ra",
     .priv_data_size    = sizeof(RMMuxContext),
-    .audio_codec       = AV_CODEC_ID_AC3,
-    .video_codec       = AV_CODEC_ID_RV10,
+    .p.audio_codec     = AV_CODEC_ID_AC3,
+    .p.video_codec     = AV_CODEC_ID_RV10,
     .write_header      = rm_write_header,
     .write_packet      = rm_write_packet,
     .write_trailer     = rm_write_trailer,
-    .codec_tag         = (const AVCodecTag* const []){ ff_rm_codec_tags, 0 },
+    .p.codec_tag       = (const AVCodecTag* const []){ ff_rm_codec_tags, 0 },
 };
diff --git a/libavformat/rsoenc.c b/libavformat/rsoenc.c
index 858b53f6c6..fe22e22812 100644
--- a/libavformat/rsoenc.c
+++ b/libavformat/rsoenc.c
@@ -22,6 +22,7 @@
 
 #include "avformat.h"
 #include "internal.h"
+#include "mux.h"
 #include "rawenc.h"
 #include "riff.h"
 #include "rso.h"
@@ -91,15 +92,15 @@ static int rso_write_trailer(AVFormatContext *s)
     return 0;
 }
 
-const AVOutputFormat ff_rso_muxer = {
-    .name           =   "rso",
-    .long_name      =   NULL_IF_CONFIG_SMALL("Lego Mindstorms RSO"),
-    .extensions     =   "rso",
-    .audio_codec    =   AV_CODEC_ID_PCM_U8,
-    .video_codec    =   AV_CODEC_ID_NONE,
+const FFOutputFormat ff_rso_muxer = {
+    .p.name         =   "rso",
+    .p.long_name    =   NULL_IF_CONFIG_SMALL("Lego Mindstorms RSO"),
+    .p.extensions   =   "rso",
+    .p.audio_codec  =   AV_CODEC_ID_PCM_U8,
+    .p.video_codec  =   AV_CODEC_ID_NONE,
     .write_header   =   rso_write_header,
     .write_packet   =   ff_raw_write_packet,
     .write_trailer  =   rso_write_trailer,
-    .codec_tag      =   ff_rso_codec_tags_list,
-    .flags          =   AVFMT_NOTIMESTAMPS,
+    .p.codec_tag    =   ff_rso_codec_tags_list,
+    .p.flags        =   AVFMT_NOTIMESTAMPS,
 };
diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c
index ce629a8095..a8d296a154 100644
--- a/libavformat/rtpenc.c
+++ b/libavformat/rtpenc.c
@@ -22,6 +22,7 @@
 #include "avformat.h"
 #include "mpegts.h"
 #include "internal.h"
+#include "mux.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/random_seed.h"
 #include "libavutil/opt.h"
@@ -659,15 +660,15 @@ static int rtp_write_trailer(AVFormatContext *s1)
     return 0;
 }
 
-const AVOutputFormat ff_rtp_muxer = {
-    .name              = "rtp",
-    .long_name         = NULL_IF_CONFIG_SMALL("RTP output"),
+const FFOutputFormat ff_rtp_muxer = {
+    .p.name            = "rtp",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("RTP output"),
     .priv_data_size    = sizeof(RTPMuxContext),
-    .audio_codec       = AV_CODEC_ID_PCM_MULAW,
-    .video_codec       = AV_CODEC_ID_MPEG4,
+    .p.audio_codec     = AV_CODEC_ID_PCM_MULAW,
+    .p.video_codec     = AV_CODEC_ID_MPEG4,
     .write_header      = rtp_write_header,
     .write_packet      = rtp_write_packet,
     .write_trailer     = rtp_write_trailer,
-    .priv_class        = &rtp_muxer_class,
-    .flags             = AVFMT_TS_NONSTRICT,
+    .p.priv_class      = &rtp_muxer_class,
+    .p.flags           = AVFMT_TS_NONSTRICT,
 };
diff --git a/libavformat/rtpenc_mpegts.c b/libavformat/rtpenc_mpegts.c
index fdc759c179..0d6403a048 100644
--- a/libavformat/rtpenc_mpegts.c
+++ b/libavformat/rtpenc_mpegts.c
@@ -23,6 +23,7 @@
 #include "libavutil/opt.h"
 #include "avformat.h"
 #include "avio_internal.h"
+#include "mux.h"
 
 typedef struct MuxChain {
     const AVClass *class;
@@ -187,14 +188,14 @@ static const AVClass rtp_mpegts_class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
-const AVOutputFormat ff_rtp_mpegts_muxer = {
-    .name              = "rtp_mpegts",
-    .long_name         = NULL_IF_CONFIG_SMALL("RTP/mpegts output format"),
+const FFOutputFormat ff_rtp_mpegts_muxer = {
+    .p.name            = "rtp_mpegts",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("RTP/mpegts output format"),
     .priv_data_size    = sizeof(MuxChain),
-    .audio_codec       = AV_CODEC_ID_AAC,
-    .video_codec       = AV_CODEC_ID_MPEG4,
+    .p.audio_codec     = AV_CODEC_ID_AAC,
+    .p.video_codec     = AV_CODEC_ID_MPEG4,
     .write_header      = rtp_mpegts_write_header,
     .write_packet      = rtp_mpegts_write_packet,
     .write_trailer     = rtp_mpegts_write_close,
-    .priv_class        = &rtp_mpegts_class,
+    .p.priv_class      = &rtp_mpegts_class,
 };
diff --git a/libavformat/rtspenc.c b/libavformat/rtspenc.c
index 21b204381b..3d444ccbfd 100644
--- a/libavformat/rtspenc.c
+++ b/libavformat/rtspenc.c
@@ -244,15 +244,15 @@ static int rtsp_write_close(AVFormatContext *s)
     return 0;
 }
 
-const AVOutputFormat ff_rtsp_muxer = {
-    .name              = "rtsp",
-    .long_name         = NULL_IF_CONFIG_SMALL("RTSP output"),
+const FFOutputFormat ff_rtsp_muxer = {
+    .p.name            = "rtsp",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("RTSP output"),
     .priv_data_size    = sizeof(RTSPState),
-    .audio_codec       = AV_CODEC_ID_AAC,
-    .video_codec       = AV_CODEC_ID_MPEG4,
+    .p.audio_codec     = AV_CODEC_ID_AAC,
+    .p.video_codec     = AV_CODEC_ID_MPEG4,
     .write_header      = rtsp_write_header,
     .write_packet      = rtsp_write_packet,
     .write_trailer     = rtsp_write_close,
-    .flags             = AVFMT_NOFILE | AVFMT_GLOBALHEADER,
-    .priv_class        = &rtsp_muxer_class,
+    .p.flags           = AVFMT_NOFILE | AVFMT_GLOBALHEADER,
+    .p.priv_class      = &rtsp_muxer_class,
 };
diff --git a/libavformat/sapenc.c b/libavformat/sapenc.c
index 8eb9d3b92a..28839b837f 100644
--- a/libavformat/sapenc.c
+++ b/libavformat/sapenc.c
@@ -268,14 +268,14 @@ static int sap_write_packet(AVFormatContext *s, AVPacket *pkt)
     return ff_write_chained(rtpctx, 0, pkt, s, 0);
 }
 
-const AVOutputFormat ff_sap_muxer = {
-    .name              = "sap",
-    .long_name         = NULL_IF_CONFIG_SMALL("SAP output"),
+const FFOutputFormat ff_sap_muxer = {
+    .p.name            = "sap",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("SAP output"),
     .priv_data_size    = sizeof(struct SAPState),
-    .audio_codec       = AV_CODEC_ID_AAC,
-    .video_codec       = AV_CODEC_ID_MPEG4,
+    .p.audio_codec     = AV_CODEC_ID_AAC,
+    .p.video_codec     = AV_CODEC_ID_MPEG4,
     .write_header      = sap_write_header,
     .write_packet      = sap_write_packet,
     .write_trailer     = sap_write_close,
-    .flags             = AVFMT_NOFILE | AVFMT_GLOBALHEADER,
+    .p.flags           = AVFMT_NOFILE | AVFMT_GLOBALHEADER,
 };
diff --git a/libavformat/sccenc.c b/libavformat/sccenc.c
index 2b924ba6e7..ea7865ecf2 100644
--- a/libavformat/sccenc.c
+++ b/libavformat/sccenc.c
@@ -21,6 +21,7 @@
 
 #include "avformat.h"
 #include "internal.h"
+#include "mux.h"
 #include "libavutil/log.h"
 #include "libavutil/intreadwrite.h"
 
@@ -111,13 +112,13 @@ static int scc_write_packet(AVFormatContext *avf, AVPacket *pkt)
     return 0;
 }
 
-const AVOutputFormat ff_scc_muxer = {
-    .name           = "scc",
-    .long_name      = NULL_IF_CONFIG_SMALL("Scenarist Closed Captions"),
-    .extensions     = "scc",
+const FFOutputFormat ff_scc_muxer = {
+    .p.name           = "scc",
+    .p.long_name      = NULL_IF_CONFIG_SMALL("Scenarist Closed Captions"),
+    .p.extensions     = "scc",
+    .p.flags          = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT,
+    .p.subtitle_codec = AV_CODEC_ID_EIA_608,
     .priv_data_size = sizeof(SCCContext),
     .write_header   = scc_write_header,
     .write_packet   = scc_write_packet,
-    .flags          = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT,
-    .subtitle_codec = AV_CODEC_ID_EIA_608,
 };
diff --git a/libavformat/segafilmenc.c b/libavformat/segafilmenc.c
index 42d56fccd6..ba06dc655d 100644
--- a/libavformat/segafilmenc.c
+++ b/libavformat/segafilmenc.c
@@ -280,13 +280,13 @@ static void film_deinit(AVFormatContext *format_context)
     ffio_free_dyn_buf(&film->header);
 }
 
-const AVOutputFormat ff_segafilm_muxer = {
-    .name           = "film_cpk",
-    .long_name      = NULL_IF_CONFIG_SMALL("Sega FILM / CPK"),
-    .extensions     = "cpk",
+const FFOutputFormat ff_segafilm_muxer = {
+    .p.name         = "film_cpk",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("Sega FILM / CPK"),
+    .p.extensions   = "cpk",
     .priv_data_size = sizeof(FILMOutputContext),
-    .audio_codec    = AV_CODEC_ID_PCM_S16BE_PLANAR,
-    .video_codec    = AV_CODEC_ID_CINEPAK,
+    .p.audio_codec  = AV_CODEC_ID_PCM_S16BE_PLANAR,
+    .p.video_codec  = AV_CODEC_ID_CINEPAK,
     .init           = film_init,
     .write_trailer  = film_write_header,
     .write_packet   = film_write_packet,
diff --git a/libavformat/segment.c b/libavformat/segment.c
index 80e4bf851c..eb629b342c 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -976,7 +976,8 @@ calc_times:
            av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &st->time_base));
 
     ret = ff_write_chained(seg->avf, pkt->stream_index, pkt, s,
-                           seg->initial_offset || seg->reset_timestamps || seg->avf->oformat->interleave_packet);
+                           seg->initial_offset || seg->reset_timestamps ||
+                           ffofmt(seg->avf->oformat)->interleave_packet);
 
 fail:
     /* Use st->index here as the packet returned from ff_write_chained()
@@ -1016,9 +1017,9 @@ static int seg_check_bitstream(AVFormatContext *s, AVStream *st,
 {
     SegmentContext *seg = s->priv_data;
     AVFormatContext *oc = seg->avf;
-    if (oc->oformat->check_bitstream) {
+    if (ffofmt(oc->oformat)->check_bitstream) {
         AVStream *const ost = oc->streams[st->index];
-        int ret = oc->oformat->check_bitstream(oc, ost, pkt);
+        int ret = ffofmt(oc->oformat)->check_bitstream(oc, ost, pkt);
         if (ret == 1) {
             FFStream *const  sti = ffstream(st);
             FFStream *const osti = ffstream(ost);
@@ -1085,33 +1086,33 @@ static const AVClass seg_class = {
 };
 
 #if CONFIG_SEGMENT_MUXER
-const AVOutputFormat ff_segment_muxer = {
-    .name           = "segment",
-    .long_name      = NULL_IF_CONFIG_SMALL("segment"),
+const FFOutputFormat ff_segment_muxer = {
+    .p.name          = "segment",
+    .p.long_name     = NULL_IF_CONFIG_SMALL("segment"),
+    .p.flags         = AVFMT_NOFILE|AVFMT_GLOBALHEADER,
+    .p.priv_class    = &seg_class,
     .priv_data_size = sizeof(SegmentContext),
-    .flags          = AVFMT_NOFILE|AVFMT_GLOBALHEADER,
     .init           = seg_init,
     .write_header   = seg_write_header,
     .write_packet   = seg_write_packet,
     .write_trailer  = seg_write_trailer,
     .deinit         = seg_free,
     .check_bitstream = seg_check_bitstream,
-    .priv_class     = &seg_class,
 };
 #endif
 
 #if CONFIG_STREAM_SEGMENT_MUXER
-const AVOutputFormat ff_stream_segment_muxer = {
-    .name           = "stream_segment,ssegment",
-    .long_name      = NULL_IF_CONFIG_SMALL("streaming segment muxer"),
-    .priv_data_size = sizeof(SegmentContext),
-    .flags          = AVFMT_NOFILE,
+const FFOutputFormat ff_stream_segment_muxer = {
+    .p.name          = "stream_segment,ssegment",
+    .p.long_name     = NULL_IF_CONFIG_SMALL("streaming segment muxer"),
+    .p.flags         = AVFMT_NOFILE,
+    .p.priv_class    = &seg_class,
+    .priv_data_size  = sizeof(SegmentContext),
     .init           = seg_init,
     .write_header   = seg_write_header,
     .write_packet   = seg_write_packet,
     .write_trailer  = seg_write_trailer,
     .deinit         = seg_free,
     .check_bitstream = seg_check_bitstream,
-    .priv_class     = &seg_class,
 };
 #endif
diff --git a/libavformat/smjpegenc.c b/libavformat/smjpegenc.c
index edba08cf9b..56907c96f7 100644
--- a/libavformat/smjpegenc.c
+++ b/libavformat/smjpegenc.c
@@ -133,15 +133,15 @@ static int smjpeg_write_trailer(AVFormatContext *s)
     return 0;
 }
 
-const AVOutputFormat ff_smjpeg_muxer = {
-    .name           = "smjpeg",
-    .long_name      = NULL_IF_CONFIG_SMALL("Loki SDL MJPEG"),
+const FFOutputFormat ff_smjpeg_muxer = {
+    .p.name         = "smjpeg",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("Loki SDL MJPEG"),
     .priv_data_size = sizeof(SMJPEGMuxContext),
-    .audio_codec    = AV_CODEC_ID_PCM_S16LE,
-    .video_codec    = AV_CODEC_ID_MJPEG,
+    .p.audio_codec  = AV_CODEC_ID_PCM_S16LE,
+    .p.video_codec  = AV_CODEC_ID_MJPEG,
     .write_header   = smjpeg_write_header,
     .write_packet   = smjpeg_write_packet,
     .write_trailer  = smjpeg_write_trailer,
-    .flags          = AVFMT_GLOBALHEADER | AVFMT_TS_NONSTRICT,
-    .codec_tag      = (const AVCodecTag *const []){ ff_codec_smjpeg_video_tags, ff_codec_smjpeg_audio_tags, 0 },
+    .p.flags        = AVFMT_GLOBALHEADER | AVFMT_TS_NONSTRICT,
+    .p.codec_tag    = (const AVCodecTag *const []){ ff_codec_smjpeg_video_tags, ff_codec_smjpeg_audio_tags, 0 },
 };
diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c
index ade6d5723b..66e6313934 100644
--- a/libavformat/smoothstreamingenc.c
+++ b/libavformat/smoothstreamingenc.c
@@ -637,16 +637,16 @@ static const AVClass ism_class = {
 };
 
 
-const AVOutputFormat ff_smoothstreaming_muxer = {
-    .name           = "smoothstreaming",
-    .long_name      = NULL_IF_CONFIG_SMALL("Smooth Streaming Muxer"),
+const FFOutputFormat ff_smoothstreaming_muxer = {
+    .p.name         = "smoothstreaming",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("Smooth Streaming Muxer"),
+    .p.audio_codec  = AV_CODEC_ID_AAC,
+    .p.video_codec  = AV_CODEC_ID_H264,
+    .p.flags        = AVFMT_GLOBALHEADER | AVFMT_NOFILE,
+    .p.priv_class   = &ism_class,
     .priv_data_size = sizeof(SmoothStreamingContext),
-    .audio_codec    = AV_CODEC_ID_AAC,
-    .video_codec    = AV_CODEC_ID_H264,
-    .flags          = AVFMT_GLOBALHEADER | AVFMT_NOFILE,
     .write_header   = ism_write_header,
     .write_packet   = ism_write_packet,
     .write_trailer  = ism_write_trailer,
     .deinit         = ism_free,
-    .priv_class     = &ism_class,
 };
diff --git a/libavformat/soxenc.c b/libavformat/soxenc.c
index ac01f97df5..062b4a3fae 100644
--- a/libavformat/soxenc.c
+++ b/libavformat/soxenc.c
@@ -34,6 +34,7 @@
 #include "libavutil/dict.h"
 #include "avformat.h"
 #include "avio_internal.h"
+#include "mux.h"
 #include "rawenc.h"
 #include "sox.h"
 
@@ -104,15 +105,15 @@ static int sox_write_trailer(AVFormatContext *s)
     return 0;
 }
 
-const AVOutputFormat ff_sox_muxer = {
-    .name              = "sox",
-    .long_name         = NULL_IF_CONFIG_SMALL("SoX native"),
-    .extensions        = "sox",
+const FFOutputFormat ff_sox_muxer = {
+    .p.name            = "sox",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("SoX native"),
+    .p.extensions      = "sox",
     .priv_data_size    = sizeof(SoXContext),
-    .audio_codec       = AV_CODEC_ID_PCM_S32LE,
-    .video_codec       = AV_CODEC_ID_NONE,
+    .p.audio_codec     = AV_CODEC_ID_PCM_S32LE,
+    .p.video_codec     = AV_CODEC_ID_NONE,
     .write_header      = sox_write_header,
     .write_packet      = ff_raw_write_packet,
     .write_trailer     = sox_write_trailer,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
diff --git a/libavformat/spdifenc.c b/libavformat/spdifenc.c
index 2861f828b4..ca38674626 100644
--- a/libavformat/spdifenc.c
+++ b/libavformat/spdifenc.c
@@ -48,6 +48,7 @@
 
 #include "avformat.h"
 #include "avio_internal.h"
+#include "mux.h"
 #include "spdif.h"
 #include "libavcodec/ac3defs.h"
 #include "libavcodec/adts_parser.h"
@@ -673,16 +674,16 @@ static int spdif_write_packet(struct AVFormatContext *s, AVPacket *pkt)
     return 0;
 }
 
-const AVOutputFormat ff_spdif_muxer = {
-    .name              = "spdif",
-    .long_name         = NULL_IF_CONFIG_SMALL("IEC 61937 (used on S/PDIF - IEC958)"),
-    .extensions        = "spdif",
+const FFOutputFormat ff_spdif_muxer = {
+    .p.name            = "spdif",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("IEC 61937 (used on S/PDIF - IEC958)"),
+    .p.extensions      = "spdif",
     .priv_data_size    = sizeof(IEC61937Context),
-    .audio_codec       = AV_CODEC_ID_AC3,
-    .video_codec       = AV_CODEC_ID_NONE,
+    .p.audio_codec     = AV_CODEC_ID_AC3,
+    .p.video_codec     = AV_CODEC_ID_NONE,
     .write_header      = spdif_write_header,
     .write_packet      = spdif_write_packet,
     .deinit            = spdif_deinit,
-    .flags             = AVFMT_NOTIMESTAMPS,
-    .priv_class        = &spdif_class,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
+    .p.priv_class      = &spdif_class,
 };
diff --git a/libavformat/srtenc.c b/libavformat/srtenc.c
index 7f6171edd3..30dc59e0f8 100644
--- a/libavformat/srtenc.c
+++ b/libavformat/srtenc.c
@@ -21,6 +21,7 @@
 
 #include "avformat.h"
 #include "internal.h"
+#include "mux.h"
 #include "libavutil/log.h"
 #include "libavutil/intreadwrite.h"
 
@@ -96,14 +97,14 @@ static int srt_write_packet(AVFormatContext *avf, AVPacket *pkt)
     return 0;
 }
 
-const AVOutputFormat ff_srt_muxer = {
-    .name           = "srt",
-    .long_name      = NULL_IF_CONFIG_SMALL("SubRip subtitle"),
-    .mime_type      = "application/x-subrip",
-    .extensions     = "srt",
+const FFOutputFormat ff_srt_muxer = {
+    .p.name           = "srt",
+    .p.long_name      = NULL_IF_CONFIG_SMALL("SubRip subtitle"),
+    .p.mime_type      = "application/x-subrip",
+    .p.extensions     = "srt",
+    .p.flags          = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT,
+    .p.subtitle_codec = AV_CODEC_ID_SUBRIP,
     .priv_data_size = sizeof(SRTContext),
     .write_header   = srt_write_header,
     .write_packet   = srt_write_packet,
-    .flags          = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT,
-    .subtitle_codec = AV_CODEC_ID_SUBRIP,
 };
diff --git a/libavformat/supenc.c b/libavformat/supenc.c
index c45d8a5321..4af92fefa2 100644
--- a/libavformat/supenc.c
+++ b/libavformat/supenc.c
@@ -21,6 +21,7 @@
 
 #include "avformat.h"
 #include "internal.h"
+#include "mux.h"
 #include "libavutil/intreadwrite.h"
 
 #define SUP_PGS_MAGIC 0x5047 /* "PG", big endian */
@@ -84,13 +85,13 @@ static int sup_write_header(AVFormatContext *s)
     return 0;
 }
 
-const AVOutputFormat ff_sup_muxer = {
-    .name           = "sup",
-    .long_name      = NULL_IF_CONFIG_SMALL("raw HDMV Presentation Graphic Stream subtitles"),
-    .extensions     = "sup",
-    .mime_type      = "application/x-pgs",
-    .subtitle_codec = AV_CODEC_ID_HDMV_PGS_SUBTITLE,
+const FFOutputFormat ff_sup_muxer = {
+    .p.name           = "sup",
+    .p.long_name      = NULL_IF_CONFIG_SMALL("raw HDMV Presentation Graphic Stream subtitles"),
+    .p.extensions     = "sup",
+    .p.mime_type      = "application/x-pgs",
+    .p.subtitle_codec = AV_CODEC_ID_HDMV_PGS_SUBTITLE,
+    .p.flags          = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT,
     .write_header   = sup_write_header,
     .write_packet   = sup_write_packet,
-    .flags          = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT,
 };
diff --git a/libavformat/swfenc.c b/libavformat/swfenc.c
index 75b892087f..f9ac69539b 100644
--- a/libavformat/swfenc.c
+++ b/libavformat/swfenc.c
@@ -27,6 +27,7 @@
 #include "libavutil/fifo.h"
 #include "avformat.h"
 #include "flv.h"
+#include "mux.h"
 #include "swf.h"
 
 #define AUDIO_FIFO_SIZE 65536
@@ -547,33 +548,33 @@ static void swf_deinit(AVFormatContext *s)
 }
 
 #if CONFIG_SWF_MUXER
-const AVOutputFormat ff_swf_muxer = {
-    .name              = "swf",
-    .long_name         = NULL_IF_CONFIG_SMALL("SWF (ShockWave Flash)"),
-    .mime_type         = "application/x-shockwave-flash",
-    .extensions        = "swf",
+const FFOutputFormat ff_swf_muxer = {
+    .p.name            = "swf",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("SWF (ShockWave Flash)"),
+    .p.mime_type       = "application/x-shockwave-flash",
+    .p.extensions      = "swf",
     .priv_data_size    = sizeof(SWFEncContext),
-    .audio_codec       = AV_CODEC_ID_MP3,
-    .video_codec       = AV_CODEC_ID_FLV1,
+    .p.audio_codec     = AV_CODEC_ID_MP3,
+    .p.video_codec     = AV_CODEC_ID_FLV1,
     .write_header      = swf_write_header,
     .write_packet      = swf_write_packet,
     .write_trailer     = swf_write_trailer,
     .deinit            = swf_deinit,
-    .flags             = AVFMT_TS_NONSTRICT,
+    .p.flags           = AVFMT_TS_NONSTRICT,
 };
 #endif
 #if CONFIG_AVM2_MUXER
-const AVOutputFormat ff_avm2_muxer = {
-    .name              = "avm2",
-    .long_name         = NULL_IF_CONFIG_SMALL("SWF (ShockWave Flash) (AVM2)"),
-    .mime_type         = "application/x-shockwave-flash",
+const FFOutputFormat ff_avm2_muxer = {
+    .p.name            = "avm2",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("SWF (ShockWave Flash) (AVM2)"),
+    .p.mime_type       = "application/x-shockwave-flash",
     .priv_data_size    = sizeof(SWFEncContext),
-    .audio_codec       = AV_CODEC_ID_MP3,
-    .video_codec       = AV_CODEC_ID_FLV1,
+    .p.audio_codec     = AV_CODEC_ID_MP3,
+    .p.video_codec     = AV_CODEC_ID_FLV1,
     .write_header      = swf_write_header,
     .write_packet      = swf_write_packet,
     .write_trailer     = swf_write_trailer,
     .deinit            = swf_deinit,
-    .flags             = AVFMT_TS_NONSTRICT,
+    .p.flags           = AVFMT_TS_NONSTRICT,
 };
 #endif
diff --git a/libavformat/tee.c b/libavformat/tee.c
index dd408dd096..960b2ea574 100644
--- a/libavformat/tee.c
+++ b/libavformat/tee.c
@@ -602,13 +602,13 @@ static int tee_write_packet(AVFormatContext *avf, AVPacket *pkt)
     return ret_all;
 }
 
-const AVOutputFormat ff_tee_muxer = {
-    .name              = "tee",
-    .long_name         = NULL_IF_CONFIG_SMALL("Multiple muxer tee"),
+const FFOutputFormat ff_tee_muxer = {
+    .p.name            = "tee",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("Multiple muxer tee"),
     .priv_data_size    = sizeof(TeeContext),
     .write_header      = tee_write_header,
     .write_trailer     = tee_write_trailer,
     .write_packet      = tee_write_packet,
-    .priv_class        = &tee_muxer_class,
-    .flags             = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
+    .p.priv_class      = &tee_muxer_class,
+    .p.flags           = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
 };
diff --git a/libavformat/ttaenc.c b/libavformat/ttaenc.c
index 1938582bb3..c7f7e065dc 100644
--- a/libavformat/ttaenc.c
+++ b/libavformat/ttaenc.c
@@ -27,6 +27,7 @@
 #include "avformat.h"
 #include "avio_internal.h"
 #include "internal.h"
+#include "mux.h"
 
 typedef struct TTAMuxContext {
     AVIOContext *seek_table;
@@ -165,14 +166,14 @@ static void tta_deinit(AVFormatContext *s)
     avpriv_packet_list_free(&tta->queue);
 }
 
-const AVOutputFormat ff_tta_muxer = {
-    .name              = "tta",
-    .long_name         = NULL_IF_CONFIG_SMALL("TTA (True Audio)"),
-    .mime_type         = "audio/x-tta",
-    .extensions        = "tta",
+const FFOutputFormat ff_tta_muxer = {
+    .p.name            = "tta",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("TTA (True Audio)"),
+    .p.mime_type       = "audio/x-tta",
+    .p.extensions      = "tta",
     .priv_data_size    = sizeof(TTAMuxContext),
-    .audio_codec       = AV_CODEC_ID_TTA,
-    .video_codec       = AV_CODEC_ID_NONE,
+    .p.audio_codec     = AV_CODEC_ID_TTA,
+    .p.video_codec     = AV_CODEC_ID_NONE,
     .init              = tta_init,
     .deinit            = tta_deinit,
     .write_header      = tta_write_header,
diff --git a/libavformat/ttmlenc.c b/libavformat/ttmlenc.c
index fc8069f7b5..212994be50 100644
--- a/libavformat/ttmlenc.c
+++ b/libavformat/ttmlenc.c
@@ -30,6 +30,7 @@
 #include "libavutil/avstring.h"
 #include "avformat.h"
 #include "internal.h"
+#include "mux.h"
 #include "ttmlenc.h"
 #include "libavcodec/ttmlenc.h"
 #include "libavutil/internal.h"
@@ -215,15 +216,15 @@ static int ttml_write_trailer(AVFormatContext *ctx)
     return 0;
 }
 
-const AVOutputFormat ff_ttml_muxer = {
-    .name              = "ttml",
-    .long_name         = NULL_IF_CONFIG_SMALL("TTML subtitle"),
-    .extensions        = "ttml",
-    .mime_type         = "text/ttml",
+const FFOutputFormat ff_ttml_muxer = {
+    .p.name            = "ttml",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("TTML subtitle"),
+    .p.extensions      = "ttml",
+    .p.mime_type       = "text/ttml",
     .priv_data_size    = sizeof(TTMLMuxContext),
-    .flags             = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
+    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
                          AVFMT_TS_NONSTRICT,
-    .subtitle_codec    = AV_CODEC_ID_TTML,
+    .p.subtitle_codec  = AV_CODEC_ID_TTML,
     .write_header      = ttml_write_header,
     .write_packet      = ttml_write_packet,
     .write_trailer     = ttml_write_trailer,
diff --git a/libavformat/uncodedframecrcenc.c b/libavformat/uncodedframecrcenc.c
index 99990616d3..4c37ef6e5b 100644
--- a/libavformat/uncodedframecrcenc.c
+++ b/libavformat/uncodedframecrcenc.c
@@ -165,14 +165,14 @@ static int write_packet(struct AVFormatContext *s, AVPacket *pkt)
     return AVERROR(ENOSYS);
 }
 
-const AVOutputFormat ff_uncodedframecrc_muxer = {
-    .name              = "uncodedframecrc",
-    .long_name         = NULL_IF_CONFIG_SMALL("uncoded framecrc testing"),
-    .audio_codec       = AV_CODEC_ID_PCM_S16LE,
-    .video_codec       = AV_CODEC_ID_RAWVIDEO,
+const FFOutputFormat ff_uncodedframecrc_muxer = {
+    .p.name              = "uncodedframecrc",
+    .p.long_name         = NULL_IF_CONFIG_SMALL("uncoded framecrc testing"),
+    .p.audio_codec       = AV_CODEC_ID_PCM_S16LE,
+    .p.video_codec       = AV_CODEC_ID_RAWVIDEO,
+    .p.flags             = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
+                           AVFMT_TS_NEGATIVE,
     .write_header      = write_header,
     .write_packet      = write_packet,
     .write_uncoded_frame = write_frame,
-    .flags             = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
-                         AVFMT_TS_NEGATIVE,
 };
diff --git a/libavformat/vc1testenc.c b/libavformat/vc1testenc.c
index 4bc95026f5..89b916deeb 100644
--- a/libavformat/vc1testenc.c
+++ b/libavformat/vc1testenc.c
@@ -20,6 +20,7 @@
  */
 #include "avformat.h"
 #include "internal.h"
+#include "mux.h"
 
 typedef struct RCVContext {
     int frames;
@@ -80,13 +81,13 @@ static int vc1test_write_trailer(AVFormatContext *s)
     return 0;
 }
 
-const AVOutputFormat ff_vc1t_muxer = {
-    .name              = "vc1test",
-    .long_name         = NULL_IF_CONFIG_SMALL("VC-1 test bitstream"),
-    .extensions        = "rcv",
+const FFOutputFormat ff_vc1t_muxer = {
+    .p.name            = "vc1test",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("VC-1 test bitstream"),
+    .p.extensions      = "rcv",
     .priv_data_size    = sizeof(RCVContext),
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_WMV3,
+    .p.audio_codec     = AV_CODEC_ID_NONE,
+    .p.video_codec     = AV_CODEC_ID_WMV3,
     .write_header      = vc1test_write_header,
     .write_packet      = vc1test_write_packet,
     .write_trailer     = vc1test_write_trailer,
diff --git a/libavformat/vocenc.c b/libavformat/vocenc.c
index 59c2bbba7b..8739a17715 100644
--- a/libavformat/vocenc.c
+++ b/libavformat/vocenc.c
@@ -21,6 +21,7 @@
 
 #include "voc.h"
 #include "internal.h"
+#include "mux.h"
 
 
 typedef struct voc_enc_context {
@@ -96,17 +97,17 @@ static int voc_write_trailer(AVFormatContext *s)
     return 0;
 }
 
-const AVOutputFormat ff_voc_muxer = {
-    .name              = "voc",
-    .long_name         = NULL_IF_CONFIG_SMALL("Creative Voice"),
-    .mime_type         = "audio/x-voc",
-    .extensions        = "voc",
+const FFOutputFormat ff_voc_muxer = {
+    .p.name            = "voc",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("Creative Voice"),
+    .p.mime_type       = "audio/x-voc",
+    .p.extensions      = "voc",
     .priv_data_size    = sizeof(VocEncContext),
-    .audio_codec       = AV_CODEC_ID_PCM_S16LE,
-    .video_codec       = AV_CODEC_ID_NONE,
+    .p.audio_codec     = AV_CODEC_ID_PCM_S16LE,
+    .p.video_codec     = AV_CODEC_ID_NONE,
     .write_header      = voc_write_header,
     .write_packet      = voc_write_packet,
     .write_trailer     = voc_write_trailer,
-    .codec_tag         = ff_voc_codec_tags_list,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.codec_tag       = ff_voc_codec_tags_list,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
diff --git a/libavformat/wavenc.c b/libavformat/wavenc.c
index 3531a8f909..c12c090934 100644
--- a/libavformat/wavenc.c
+++ b/libavformat/wavenc.c
@@ -46,6 +46,7 @@
 #include "avio.h"
 #include "avio_internal.h"
 #include "internal.h"
+#include "mux.h"
 #include "riff.h"
 
 #define RF64_AUTO   (-1)
@@ -506,21 +507,21 @@ static const AVClass wav_muxer_class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
-const AVOutputFormat ff_wav_muxer = {
-    .name              = "wav",
-    .long_name         = NULL_IF_CONFIG_SMALL("WAV / WAVE (Waveform Audio)"),
-    .mime_type         = "audio/x-wav",
-    .extensions        = "wav",
+const FFOutputFormat ff_wav_muxer = {
+    .p.name            = "wav",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("WAV / WAVE (Waveform Audio)"),
+    .p.mime_type       = "audio/x-wav",
+    .p.extensions      = "wav",
     .priv_data_size    = sizeof(WAVMuxContext),
-    .audio_codec       = AV_CODEC_ID_PCM_S16LE,
-    .video_codec       = AV_CODEC_ID_NONE,
+    .p.audio_codec     = AV_CODEC_ID_PCM_S16LE,
+    .p.video_codec     = AV_CODEC_ID_NONE,
     .write_header      = wav_write_header,
     .write_packet      = wav_write_packet,
     .write_trailer     = wav_write_trailer,
     .deinit            = wav_deinit,
-    .flags             = AVFMT_TS_NONSTRICT,
-    .codec_tag         = ff_wav_codec_tags_list,
-    .priv_class        = &wav_muxer_class,
+    .p.flags           = AVFMT_TS_NONSTRICT,
+    .p.codec_tag       = ff_wav_codec_tags_list,
+    .p.priv_class      = &wav_muxer_class,
 };
 #endif /* CONFIG_WAV_MUXER */
 
@@ -615,18 +616,18 @@ static int w64_write_trailer(AVFormatContext *s)
     return 0;
 }
 
-const AVOutputFormat ff_w64_muxer = {
-    .name              = "w64",
-    .long_name         = NULL_IF_CONFIG_SMALL("Sony Wave64"),
-    .extensions        = "w64",
+const FFOutputFormat ff_w64_muxer = {
+    .p.name            = "w64",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("Sony Wave64"),
+    .p.extensions      = "w64",
     .priv_data_size    = sizeof(WAVMuxContext),
-    .audio_codec       = AV_CODEC_ID_PCM_S16LE,
-    .video_codec       = AV_CODEC_ID_NONE,
+    .p.audio_codec     = AV_CODEC_ID_PCM_S16LE,
+    .p.video_codec     = AV_CODEC_ID_NONE,
     .init              = w64_init,
     .write_header      = w64_write_header,
     .write_packet      = wav_write_packet,
     .write_trailer     = w64_write_trailer,
-    .flags             = AVFMT_TS_NONSTRICT,
-    .codec_tag         = ff_wav_codec_tags_list,
+    .p.flags           = AVFMT_TS_NONSTRICT,
+    .p.codec_tag       = ff_wav_codec_tags_list,
 };
 #endif /* CONFIG_W64_MUXER */
diff --git a/libavformat/webm_chunk.c b/libavformat/webm_chunk.c
index 916ed0cbab..494a83f507 100644
--- a/libavformat/webm_chunk.c
+++ b/libavformat/webm_chunk.c
@@ -292,18 +292,18 @@ static const AVClass webm_chunk_class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
-const AVOutputFormat ff_webm_chunk_muxer = {
-    .name           = "webm_chunk",
-    .long_name      = NULL_IF_CONFIG_SMALL("WebM Chunk Muxer"),
-    .mime_type      = "video/webm",
-    .extensions     = "chk",
-    .flags          = AVFMT_NOFILE | AVFMT_GLOBALHEADER | AVFMT_NEEDNUMBER |
+const FFOutputFormat ff_webm_chunk_muxer = {
+    .p.name         = "webm_chunk",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("WebM Chunk Muxer"),
+    .p.mime_type    = "video/webm",
+    .p.extensions   = "chk",
+    .p.flags        = AVFMT_NOFILE | AVFMT_GLOBALHEADER | AVFMT_NEEDNUMBER |
                       AVFMT_TS_NONSTRICT,
+    .p.priv_class   = &webm_chunk_class,
     .priv_data_size = sizeof(WebMChunkContext),
     .init           = webm_chunk_init,
     .write_header   = webm_chunk_write_header,
     .write_packet   = webm_chunk_write_packet,
     .write_trailer  = webm_chunk_write_trailer,
     .deinit         = webm_chunk_deinit,
-    .priv_class     = &webm_chunk_class,
 };
diff --git a/libavformat/webmdashenc.c b/libavformat/webmdashenc.c
index f8f2274556..0d6c4a2072 100644
--- a/libavformat/webmdashenc.c
+++ b/libavformat/webmdashenc.c
@@ -32,6 +32,7 @@
 
 #include "avformat.h"
 #include "matroska.h"
+#include "mux.h"
 
 #include "libavutil/avstring.h"
 #include "libavutil/dict.h"
@@ -540,13 +541,13 @@ static const AVClass webm_dash_class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
-const AVOutputFormat ff_webm_dash_manifest_muxer = {
-    .name              = "webm_dash_manifest",
-    .long_name         = NULL_IF_CONFIG_SMALL("WebM DASH Manifest"),
-    .mime_type         = "application/xml",
-    .extensions        = "xml",
+const FFOutputFormat ff_webm_dash_manifest_muxer = {
+    .p.name            = "webm_dash_manifest",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("WebM DASH Manifest"),
+    .p.mime_type       = "application/xml",
+    .p.extensions      = "xml",
     .priv_data_size    = sizeof(WebMDashMuxContext),
     .write_header      = webm_dash_manifest_write_header,
     .write_packet      = webm_dash_manifest_write_packet,
-    .priv_class        = &webm_dash_class,
+    .p.priv_class      = &webm_dash_class,
 };
diff --git a/libavformat/webpenc.c b/libavformat/webpenc.c
index 8a5c29201a..b3f5bdc9b5 100644
--- a/libavformat/webpenc.c
+++ b/libavformat/webpenc.c
@@ -23,6 +23,7 @@
 #include "libavutil/opt.h"
 #include "avformat.h"
 #include "internal.h"
+#include "mux.h"
 
 typedef struct WebpContext{
     AVClass *class;
@@ -208,15 +209,15 @@ static const AVClass webp_muxer_class = {
     .version    = LIBAVUTIL_VERSION_INT,
     .option     = options,
 };
-const AVOutputFormat ff_webp_muxer = {
-    .name           = "webp",
-    .long_name      = NULL_IF_CONFIG_SMALL("WebP"),
-    .extensions     = "webp",
+const FFOutputFormat ff_webp_muxer = {
+    .p.name         = "webp",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("WebP"),
+    .p.extensions   = "webp",
     .priv_data_size = sizeof(WebpContext),
-    .video_codec    = AV_CODEC_ID_WEBP,
+    .p.video_codec  = AV_CODEC_ID_WEBP,
     .init           = webp_init,
     .write_packet   = webp_write_packet,
     .write_trailer  = webp_write_trailer,
-    .priv_class     = &webp_muxer_class,
-    .flags          = AVFMT_VARIABLE_FPS,
+    .p.priv_class   = &webp_muxer_class,
+    .p.flags        = AVFMT_VARIABLE_FPS,
 };
diff --git a/libavformat/webvttenc.c b/libavformat/webvttenc.c
index fcff80c4bf..1337045325 100644
--- a/libavformat/webvttenc.c
+++ b/libavformat/webvttenc.c
@@ -26,6 +26,7 @@
 
 #include "avformat.h"
 #include "internal.h"
+#include "mux.h"
 
 static void webvtt_write_time(AVIOContext *pb, int64_t millisec)
 {
@@ -102,13 +103,13 @@ static int webvtt_write_packet(AVFormatContext *ctx, AVPacket *pkt)
     return 0;
 }
 
-const AVOutputFormat ff_webvtt_muxer = {
-    .name              = "webvtt",
-    .long_name         = NULL_IF_CONFIG_SMALL("WebVTT subtitle"),
-    .extensions        = "vtt",
-    .mime_type         = "text/vtt",
-    .flags             = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT,
-    .subtitle_codec    = AV_CODEC_ID_WEBVTT,
+const FFOutputFormat ff_webvtt_muxer = {
+    .p.name            = "webvtt",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("WebVTT subtitle"),
+    .p.extensions      = "vtt",
+    .p.mime_type       = "text/vtt",
+    .p.flags           = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT,
+    .p.subtitle_codec  = AV_CODEC_ID_WEBVTT,
     .write_header      = webvtt_write_header,
     .write_packet      = webvtt_write_packet,
 };
diff --git a/libavformat/westwood_audenc.c b/libavformat/westwood_audenc.c
index a2401eff5a..84a871e478 100644
--- a/libavformat/westwood_audenc.c
+++ b/libavformat/westwood_audenc.c
@@ -31,6 +31,7 @@
 #include "avformat.h"
 #include "avio_internal.h"
 #include "internal.h"
+#include "mux.h"
 #include <stdint.h>
 
 #define AUD_CHUNK_SIGNATURE 0x0000DEAF
@@ -125,13 +126,13 @@ static int wsaud_write_trailer(AVFormatContext *ctx)
     return 0;
 }
 
-const AVOutputFormat ff_wsaud_muxer = {
-    .name              = "wsaud",
-    .long_name         = NULL_IF_CONFIG_SMALL("Westwood Studios audio"),
-    .extensions        = "aud",
+const FFOutputFormat ff_wsaud_muxer = {
+    .p.name            = "wsaud",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("Westwood Studios audio"),
+    .p.extensions      = "aud",
     .priv_data_size    = sizeof(AUDMuxContext),
-    .audio_codec       = AV_CODEC_ID_ADPCM_IMA_WS,
-    .video_codec       = AV_CODEC_ID_NONE,
+    .p.audio_codec     = AV_CODEC_ID_ADPCM_IMA_WS,
+    .p.video_codec     = AV_CODEC_ID_NONE,
     .init              = wsaud_write_init,
     .write_header      = wsaud_write_header,
     .write_packet      = wsaud_write_packet,
diff --git a/libavformat/wtvenc.c b/libavformat/wtvenc.c
index 62dca62b06..c0e5621646 100644
--- a/libavformat/wtvenc.c
+++ b/libavformat/wtvenc.c
@@ -829,15 +829,15 @@ static int write_trailer(AVFormatContext *s)
     return 0;
 }
 
-const AVOutputFormat ff_wtv_muxer = {
-    .name           = "wtv",
-    .long_name      = NULL_IF_CONFIG_SMALL("Windows Television (WTV)"),
-    .extensions     = "wtv",
+const FFOutputFormat ff_wtv_muxer = {
+    .p.name         = "wtv",
+    .p.long_name    = NULL_IF_CONFIG_SMALL("Windows Television (WTV)"),
+    .p.extensions   = "wtv",
     .priv_data_size = sizeof(WtvContext),
-    .audio_codec    = AV_CODEC_ID_AC3,
-    .video_codec    = AV_CODEC_ID_MPEG2VIDEO,
+    .p.audio_codec  = AV_CODEC_ID_AC3,
+    .p.video_codec  = AV_CODEC_ID_MPEG2VIDEO,
     .write_header   = write_header,
     .write_packet   = write_packet,
     .write_trailer  = write_trailer,
-    .codec_tag      = ff_riff_codec_tags_list,
+    .p.codec_tag    = ff_riff_codec_tags_list,
 };
diff --git a/libavformat/wvenc.c b/libavformat/wvenc.c
index 0dca2f7996..9d9190f252 100644
--- a/libavformat/wvenc.c
+++ b/libavformat/wvenc.c
@@ -24,6 +24,7 @@
 
 #include "apetag.h"
 #include "avformat.h"
+#include "mux.h"
 #include "wv.h"
 
 typedef struct WvMuxContext {
@@ -76,16 +77,16 @@ static av_cold int wv_write_trailer(AVFormatContext *ctx)
     return 0;
 }
 
-const AVOutputFormat ff_wv_muxer = {
-    .name              = "wv",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw WavPack"),
-    .mime_type         = "audio/x-wavpack",
-    .extensions        = "wv",
+const FFOutputFormat ff_wv_muxer = {
+    .p.name            = "wv",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("raw WavPack"),
+    .p.mime_type       = "audio/x-wavpack",
+    .p.extensions      = "wv",
     .priv_data_size    = sizeof(WvMuxContext),
-    .audio_codec       = AV_CODEC_ID_WAVPACK,
-    .video_codec       = AV_CODEC_ID_NONE,
+    .p.audio_codec     = AV_CODEC_ID_WAVPACK,
+    .p.video_codec     = AV_CODEC_ID_NONE,
     .init              = wv_init,
     .write_packet      = wv_write_packet,
     .write_trailer     = wv_write_trailer,
-    .flags             = AVFMT_NOTIMESTAMPS,
+    .p.flags           = AVFMT_NOTIMESTAMPS,
 };
diff --git a/libavformat/yuv4mpegenc.c b/libavformat/yuv4mpegenc.c
index fca0ee3120..fc6b08e0cd 100644
--- a/libavformat/yuv4mpegenc.c
+++ b/libavformat/yuv4mpegenc.c
@@ -22,6 +22,7 @@
 #include "libavutil/pixdesc.h"
 #include "avformat.h"
 #include "internal.h"
+#include "mux.h"
 #include "yuv4mpeg.h"
 
 static int yuv4_write_header(AVFormatContext *s)
@@ -282,12 +283,12 @@ static int yuv4_init(AVFormatContext *s)
     return 0;
 }
 
-const AVOutputFormat ff_yuv4mpegpipe_muxer = {
-    .name              = "yuv4mpegpipe",
-    .long_name         = NULL_IF_CONFIG_SMALL("YUV4MPEG pipe"),
-    .extensions        = "y4m",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_WRAPPED_AVFRAME,
+const FFOutputFormat ff_yuv4mpegpipe_muxer = {
+    .p.name            = "yuv4mpegpipe",
+    .p.long_name       = NULL_IF_CONFIG_SMALL("YUV4MPEG pipe"),
+    .p.extensions      = "y4m",
+    .p.audio_codec     = AV_CODEC_ID_NONE,
+    .p.video_codec     = AV_CODEC_ID_WRAPPED_AVFRAME,
     .init              = yuv4_init,
     .write_header      = yuv4_write_header,
     .write_packet      = yuv4_write_packet,
