Recover broken kazam video file (.mux) History :

Here is some background of this long lasting problem : https://answers.launchpad.net/kazam/+question/218308

I am posting it to get some valuable suggestions from video gurus here.

About Kazam :

kazam is a screen recording tool which also records audio. Once the recording is finished, a popup comes and then we can save the video into a mp4 file.

Problem :

Sometimes, in particular when the screen recording time is large like, 2~3 hrs, in those cases, the pop up does not come up. so, basically we cannot save the recorded data into a file.

We find 2 residual files. with .movie and .mux


kazam_5e8ob247.movie.mux (~ 1.2 GB)
kazam_5e8ob247.movie (0 bytes)


.movie file is of 0 bytes. So, this is just a temporary file.

.mux contains the real data and is of ~1.2 gb.

How can I recover the .mux file?

Notes :

I see from kazam source code (https://github.com/sconts/kazam) that it is using Gstreamer internally.

So, can you please suggest an appropriate gst-pipeline that can convert .mux into a playable .mp4 file?

To provide more details, I tried to get some information about the recorded stream using gst-discoverer-1.0. But it fails saying it cannot read any details.

gst-discoverer-1.0 kazam_5e8ob247.movie.mux
Analyzing file:///home/sandeep/sw/samples/kazam_5e8ob247.movie.mux
Done discovering file:///home/sandeep/sw/samples/kazam_5e8ob247.movie.mux
An error was encountered while discovering the file
 Could not determine type of stream.


First 1 MB :

To analyze, the first 1 MB of the file can be found here
the answer to this question was posted by bukkojot as a comment to this question on 20171012

github.com/bookkojot/mp4fixer


This tool fixes exactly this problem. I tried it and it worked for me.
There are a few simple steps involved, instructions are enclosed. You need a short properly saved video on the same machine with the same kazam to use as input so it knows what the headers should look like. And you get the mp4 from the temporary movie.mux.