user14588: When Panaconic videocameras are abruptly interrupted while recording, the video is on the SD card as .mdt.
It's supposedly a video stream without a header and a footer.
How can I convert this to be an MP4 which the camera normally produces?

user36362: I just ran into this myself. I had a bad file called: P1100020.mdt from my Panasonic LUMIX GX85. The solution is to record a video with the same exact settings, then copy both to a Debian/Ubuntu box under Videos and run:
sudo apt install git libavformat-dev libavcodec-dev libavutil-dev
git clone https://github.com/anthwlock/untrunc
cd untrunc
make
sudo cp untrunc /usr/local/bin
cd ~/Videos
untrunc -s  P1100021.MP4 P1100020.mdt

Keep in mind that P1100021.MP4 is my working .mp4 with the same settings. That should spit out a working MP4 for those GNU/Linux users out there with a name like P1100020.mdt_fixed-s1.MP4

14588: <p>When Panaconic videocameras are abruptly interrupted while recording, the video is on the SD card as <code>.mdt</code>.</p>
<p>It's supposedly a video stream without a header and a footer.</p>
<p>How can I convert this to be an MP4 which the camera normally produces?</p>
 36362: <p>I just ran into this myself. I had a bad file called: <code>P1100020.mdt</code> from my Panasonic LUMIX GX85. The solution is to record a video with the same exact settings, then copy both to a Debian/Ubuntu box under Videos and run:</p>
<pre><code>sudo apt install git libavformat-dev libavcodec-dev libavutil-dev
git clone https://github.com/anthwlock/untrunc
cd untrunc
make
sudo cp untrunc /usr/local/bin
cd ~/Videos
untrunc -s  P1100021.MP4 P1100020.mdt
</code></pre>
<p>Keep in mind that <code>P1100021.MP4</code> is my working .mp4 with the same settings. That should spit out a working MP4 for those GNU/Linux users out there with a name like <code>P1100020.mdt_fixed-s1.MP4</code></p>
