Converting MXG to MP4 – Solution for Mobotix Video Files

I recently became a very satisfied owner of a Mobotix One camera. The only problem was the somewhat cumbersome handling of MXG video files. Playback only really works with Mobotix’s own software; even VLC has issues. Exporting with MxMC (macOS) also doesn’t produce good results for me (image freezes). Converting via FFmpeg is not trivial, but after extensive trial and error, I found a solution that I’d like to share to maybe save other users time.

Problem: ffmpeg and other standard tools fail when converting Mobotix MXG files, showing “Duration: N/A” and aborting the process.

Solution using FFmpeg:

ffmpeg -f mxg -i input.mxg -c:v libx264 -preset medium -crf 23 -c:a aac -b:a 128k output.mp4

Why does this work?

The -f mxg parameter is crucial: it forces FFmpeg to use the correct MXG demuxer. Without this parameter, FFmpeg doesn’t automatically recognize the Mobotix format. The MXG format (MxPEG) uses Motion JPEG with differential frames – standard tools cannot read the video duration and fail during the scan phase.

Parameter explanation:

  • -f mxg – Forces MXG demuxer (most important parameter!)

  • -c:v libx264 – H.264 video codec

  • -preset medium – Balance between speed and file size

  • -crf 23 – Constant quality (range 18-28, where 23 = very good quality)

  • -c:a aac – AAC audio codec

  • -b:a 128k – Audio bitrate

1 Like

And here comes an updated, improved version in which seeking in the video finally works correctly, meaning there are no more timestamp problems with videos consisting of multiple sequences. The hardware acceleration setting must, of course, be adjusted to the respective device (here Intel N200).

ffmpeg -init_hw_device “vaapi=va:${VA_DEVICE}” -filter_hw_device va
-f mxg -i “$INPUTFILE”
-vf ‘setpts=N/FRAME_RATE/TB,format=nv12,hwupload’
-af ‘asetpts=N/SR/TB’
-c:v h264_vaapi
-profile:v high
-level 5.1
-g 30
-bf 0
-qp 18
-r 10
-c:a aac
-ar 8000
-b:a 128k
-shortest
-map_metadata -1
-movflags +faststart+omit_tfhd_offset+disable_chpl
-write_tmcd 0
-y “$OUTPATH” < /dev/null