diff --git a/tests/fate/mxf.mak b/tests/fate/mxf.mak
index f96f4a429b..58a697cd86 100644
--- a/tests/fate/mxf.mak
+++ b/tests/fate/mxf.mak
@@ -42,6 +42,21 @@ FATE_MXF_REMUX_PROBE-$(call ALLYES, PRORES_DECODER MXF_MUXER) \
                                     += fate-mxf-remux-applehdr10
 fate-mxf-remux-applehdr10: CMD = transcode mxf $(TARGET_SAMPLES)/mxf/Meridian-Apple_ProResProxy-HDR10.mxf mxf "-map 0 -c copy" "-c copy -t 0.3" "" "-show_entries format_tags:stream_side_data_list:stream=index,codec_name,codec_tag:stream_tags"
 
+# Tests muxing H.264, in particular automatic insertion of h264_mp4toannexb.
+# FIXME: The timestamps of the demuxed file are not properly reordered.
+# Furthermore the extradata is wrong: It is one of the AVC intra SPS/PPS;
+# decoding only works due to in-band extradata.
+FATE_MXF_REMUX-$(call ALLYES, MOV_DEMUXER H264_MP4TOANNEXB_BSF   \
+                              MXF_MUXER H264_PARSER H264_DECODER \
+                              RAWVIDEO_ENCODER) += fate-mxf-remux-h264
+fate-mxf-remux-h264: CMD = transcode mov $(TARGET_SAMPLES)/mov/spherical.mov mxf "-c copy" "-map 0 -map 0 -c:v:1 copy -frames:v 12"
+
+# Tests remuxing H.264 and data streams.
+# The same FIXME as for mxf-remux-h264 applies.
+FATE_MXF_REMUX-$(call ALLYES, MXF_MUXER H264_PARSER H264_DECODER) \
+                              += fate-mxf-remux-xavc
+fate-mxf-remux-xavc: CMD = transcode mxf $(TARGET_SAMPLES)/h264/SonyXAVC_LongGOP_green_pixelation_early_Frames.MXF mxf "-map 0 -c copy" "-map 0 -c copy"
+
 FATE_MXF_REEL_NAME-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, MXF) += fate-mxf-reel_name
 fate-mxf-reel_name: $(SAMPLES)/mxf/Sony-00001.mxf
 fate-mxf-reel_name: CMD = md5 -y -i $(TARGET_SAMPLES)/mxf/Sony-00001.mxf  -c copy -timecode 00:00:00:00 -metadata "reel_name=test_reel" -fflags +bitexact -f mxf
@@ -64,10 +79,13 @@ FATE_MXF-$(CONFIG_MXF_DEMUXER) += $(FATE_MXF)
 FATE_MXF_FFMPEG_FFPROBE-$(call ALLYES, FILE_PROTOCOL MXF_DEMUXER     \
                                        PIPE_PROTOCOL FRAMECRC_MUXER) \
                                        += $(FATE_MXF_REMUX_PROBE-yes)
+FATE_MXF_FFMPEG-$(call ALLYES, FILE_PROTOCOL MXF_DEMUXER     \
+                               PIPE_PROTOCOL FRAMECRC_MUXER) \
+                               += $(FATE_MXF_REMUX-yes)
 
-FATE_SAMPLES_AVCONV += $(FATE_MXF-yes) $(FATE_MXF_REEL_NAME-yes)
+FATE_SAMPLES_AVCONV += $(FATE_MXF-yes) $(FATE_MXF_REEL_NAME-yes) $(FATE_MXF_FFMPEG-yes)
 FATE_SAMPLES_AVCONV += $(FATE_MXF_USER_COMMENTS-yes) $(FATE_MXF_OPATOM_USER_COMMENTS-yes)
 FATE_SAMPLES_FFMPEG_FFPROBE += $(FATE_MXF_FFMPEG_FFPROBE-yes)
 FATE_SAMPLES_FFPROBE += $(FATE_MXF_PROBE-yes)
 
-fate-mxf: $(FATE_MXF-yes) $(FATE_MXF_PROBE-yes) $(FATE_MXF_REEL_NAME-yes) $(FATE_MXF_USER_COMMENTS-yes) $(FATE_MXF_FFMPEG_FFPROBE-yes) $(FATE_MXF_OPATOM_USER_COMMENTS-yes)
+fate-mxf: $(FATE_MXF-yes) $(FATE_MXF_PROBE-yes) $(FATE_MXF_REEL_NAME-yes) $(FATE_MXF_USER_COMMENTS-yes) $(FATE_MXF_FFMPEG-yes) $(FATE_MXF_FFMPEG_FFPROBE-yes) $(FATE_MXF_OPATOM_USER_COMMENTS-yes)
diff --git a/tests/ref/fate/mxf-remux-h264 b/tests/ref/fate/mxf-remux-h264
new file mode 100644
index 0000000000..49ce4324c4
--- /dev/null
+++ b/tests/ref/fate/mxf-remux-h264
@@ -0,0 +1,37 @@
+a06741f1a308fa0bd755b206d93639d2 *tests/data/fate/mxf-remux-h264.mxf
+201273 tests/data/fate/mxf-remux-h264.mxf
+#extradata 1:       81, 0x98411475
+#tb 0: 1/25
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 1920x1080
+#sar 0: 1/1
+#tb 1: 1/25
+#media_type 1: video
+#codec_id 1: h264
+#dimensions 1: 1920x1080
+#sar 1: 1/1
+0,          0,          0,        1,  6220800, 0x6a771857
+1,          0,          0,        1,    69157, 0xd6ff5c4d
+1,          1,          1,        1,     1103, 0xb8e00551, F=0x0
+1,          2,          2,        1,      141, 0x49232f95, F=0x0
+0,          3,          3,        1,  6220800, 0x92aa1963
+1,          3,          3,        1,      131, 0xe01928c0, F=0x0
+0,          4,          4,        1,  6220800, 0x906014d8
+1,          4,          4,        1,       69, 0xdf5506bc, F=0x0
+0,          5,          5,        1,  6220800, 0xa67a179e
+1,          5,          5,        1,      424, 0x408cb97b, F=0x0
+0,          6,          6,        1,  6220800, 0xcf7e1148
+1,          6,          6,        1,       83, 0x5aa5118a, F=0x0
+0,          7,          7,        1,  6220800, 0xd2b623ab
+1,          7,          7,        1,       70, 0x39ec0a38, F=0x0
+0,          8,          8,        1,  6220800, 0x97f51b81
+1,          8,          8,        1,       71, 0x55290a92, F=0x0
+0,          9,          9,        1,  6220800, 0x53e01e46
+1,          9,          9,        1,      149, 0x42683340, F=0x0
+0,         10,         10,        1,  6220800, 0xd4d0de99
+1,         10,         10,        1,       78, 0xad8a0c29, F=0x0
+0,         11,         11,        1,  6220800, 0x6f18e3e4
+1,         11,         11,        1,       72, 0x8c1c0caf, F=0x0
+0,         12,         12,        1,  6220800, 0xcfbbe357
+0,         13,         13,        1,  6220800, 0x70cfe436
diff --git a/tests/ref/fate/mxf-remux-xavc b/tests/ref/fate/mxf-remux-xavc
new file mode 100644
index 0000000000..7b221208e5
--- /dev/null
+++ b/tests/ref/fate/mxf-remux-xavc
@@ -0,0 +1,71 @@
+d0fea4450c0f7c51b0af3631025dfa90 *tests/data/fate/mxf-remux-xavc.mxf
+1436217 tests/data/fate/mxf-remux-xavc.mxf
+#extradata 0:       97, 0xe2f818c1
+#tb 0: 1/25
+#media_type 0: video
+#codec_id 0: h264
+#dimensions 0: 1920x1080
+#sar 0: 1/1
+#tb 1: 1/48000
+#media_type 1: audio
+#codec_id 1: pcm_s24le
+#sample_rate 1: 48000
+#channel_layout 1: 4
+#channel_layout_name 1: mono
+#tb 2: 1/48000
+#media_type 2: audio
+#codec_id 2: pcm_s24le
+#sample_rate 2: 48000
+#channel_layout 2: 4
+#channel_layout_name 2: mono
+#tb 3: 1/48000
+#media_type 3: audio
+#codec_id 3: pcm_s24le
+#sample_rate 3: 48000
+#channel_layout 3: 4
+#channel_layout_name 3: mono
+#tb 4: 1/48000
+#media_type 4: audio
+#codec_id 4: pcm_s24le
+#sample_rate 4: 48000
+#channel_layout 4: 4
+#channel_layout_name 4: mono
+#tb 5: 1/25
+#media_type 5: data
+#codec_id 5: none
+0,          0,          0,        1,   553248, 0xbda0217f
+1,          0,          0,     1920,     5760, 0xd5894ac8
+2,          0,          0,     1920,     5760, 0x86314faa
+3,          0,          0,     1920,     5760, 0x00000000
+4,          0,          0,     1920,     5760, 0x00000000
+5,          0,          0,        1,      150, 0xc6f20c7f
+0,          1,          1,        1,   119985, 0x6ba5546e, F=0x0
+1,       1920,       1920,     1920,     5760, 0x9f71829c
+2,       1920,       1920,     1920,     5760, 0x38049906
+3,       1920,       1920,     1920,     5760, 0x00000000
+4,       1920,       1920,     1920,     5760, 0x00000000
+5,          1,          1,        1,      150, 0xc6f20c7f
+0,          2,          2,        1,    98815, 0xe47762ff, F=0x0
+0,          2,          3,        1,   257022, 0xd0647527, F=0x0
+1,       3840,       3840,     1920,     5760, 0xf7245421
+2,       3840,       3840,     1920,     5760, 0x5cd058b0
+3,       3840,       3840,     1920,     5760, 0x00000000
+4,       3840,       3840,     1920,     5760, 0x00000000
+5,          2,          2,        1,      150, 0xc6f20c7f
+1,       5760,       5760,     1920,     5760, 0x3cef69d8
+2,       5760,       5760,     1920,     5760, 0x176daa39
+3,       5760,       5760,     1920,     5760, 0x00000000
+4,       5760,       5760,     1920,     5760, 0x00000000
+5,          3,          3,        1,      150, 0xc6f20c7f
+0,          4,          4,        1,   123833, 0xff7b324e, F=0x0
+1,       7680,       7680,     1920,     5760, 0x6b647758
+2,       7680,       7680,     1920,     5760, 0xbf6f69de
+3,       7680,       7680,     1920,     5760, 0x00000000
+4,       7680,       7680,     1920,     5760, 0x00000000
+5,          4,          4,        1,      150, 0xc6f20c7f
+0,          5,          5,        1,   117099, 0x7d6aac45, F=0x0
+1,       9600,       9600,     1920,     5760, 0x0958976a
+2,       9600,       9600,     1920,     5760, 0xe3957d5e
+3,       9600,       9600,     1920,     5760, 0x00000000
+4,       9600,       9600,     1920,     5760, 0x00000000
+5,          5,          5,        1,      150, 0xc6f20c7f
