Search code examples
audioffmpegwav

How do I convert wav into an mxf file with timecode?


I'm looking for a way to convert wav(16bit, 48kHz, LPCM) into an mxf file with timecode.

Since ffmpeg supports mxf, I'm trying, but I don't know the command.

ffmpeg -i ./input.wav [hh:mm:ss.ff, name1] [hh:mm:ss.ff, name2]... ./output.mxf

I'm expecting the above command, but does anyone know?


Solution

  • MXF is a pain

    • The default MXF muxer requires video.
    • The -timecode option with MXF requires video.
    • The mxf_opatom muxer allows just audio, but only mono with 48000 MHz sample rate, so each channel will need to be in its own MXF file.

    Workaround 1: Pipe

    ffmpeg -i input.wav -ar 48000 -c:a pcm_s16le -timecode 01:02:03:04 -f nut - | ffmpeg -i - -c:a pcm_s16le -f mxf_opatom output.mxf
    
    • I'm assuming your audio is mono (you didn't say what it is). If your input is multichannel then output each channel into its own file.

    • Use 01:02:03:04 for non-drop timecode, and 01:02:03.04 or 01:02:03;04 for drop.

    Workaround 2: Dummy/blank video

    Just ignore the video.

    Non-drop timecode:

    ffmpeg -f lavfi -i color=r=25 -i input.wav -timecode 01:02:03:04 -c:a copy -shortest output.mxf
    

    Drop timecode:

    ffmpeg -f lavfi -i color=r=30000/1001 -i input.wav -timecode 01:02:03.04 -c:a copy -shortest output.mxf