First, get ffmpeg
.
Generally, you want to give YouTube the highest quality you can because it will re-encode anything you give it, but the formats used in MXF can be mental for uploading. So re-encoding to modern formats for a more manageable upload often makes sense.
Example
ffmpeg -i input.mxf \
-filter_complex "[0:a:0][0:a:1]amerge" \
-ac 2 -c:v libx264 -crf 18 -c:a libvorbis output.mkv
What these options do
-filter_complex "[0:a:0][0:a:1]amerge[a]"
– Take the two audio streams and combine them with amerge filter into one, multichannel stream.
- The
[0:a:1]
refers to [input file index:stream specifier:stream index]
, so [0:a:1]
is the second audio stream from the first input file (input.mxf
).
-ac 2
– Downmix audio to stereo.
-c:v libx264
– Encode video to H.264. See more info and examples.
-crf 18
– libx264 option to make output roughly "visually lossless".
-c:a libvorbis
– Encode audio to Vorbis.
output.mkv
– Output to Matroska container format. It will not be playable in WMP or QuickTime, but who cares. YouTube will, and YouTube is all that matters in this case. VLC, mpv, or MPC-HC will be able to play it.
Keeping it as MXF
If you want MXF for whatever reason:
ffmpeg -i input.mxf \
-filter_complex "[0:a:0][0:a:1]amerge[a]" \
-map 0:v -map "[a]" -ac 2 -c:v copy -c:a pcm_s16le output.mxf
The video will be stream copied (re-muxed). No re-encoding, so it will be fast and preserve quality.
MXF is picky, so the -map
option is used to arrange the output streams in a MXF friendly order.