I made a recording with

ffmpeg -f alsa -ac 2 -i plughw:0,0  /tmp/audio.mp4

I then moved /tmp/audio.mp4 to another directory (/root/audio.mp4) without stopping ffmpeg leading to a broken .mp4 file:

ffplay /root/audio.mp4
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f3524000b80] moov atom not found
audio.mp4: Invalid data found when processing input

How to recover and read my .mp4 file?


You can try and use Untrunc to fix the file.

Restore a damaged (truncated) mp4, m4v, mov, 3gp video. Provided you have a similar not broken video.

you may need to compile it from source, but there is another option to use a Docker container and bind the folder with the file into the container and fix it that way.

You can use the included Dockerfile to build and execute the package as a container

docker build -t untrunc
docker run -v ~/Desktop/:/files untrunc /files/filea /files/fileb

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.