If you have a Debian-based Linux, you can use untrunc
. Open up a terminal window and run the following commands, one by one:
sudo apt-get install libavformat-dev libavcodec-dev libavutil-dev cd ~ wget https://github.com/ponchio/untrunc/archive/master.zip unzip master.zip cd untrunc-master g++ -o untrunc file.cpp main.cpp track.cpp atom.cpp mp4.cpp -L/usr/local/lib -lavformat -lavcodec -lavutil chmod +x untrunc
Now, you need:
- the broken file
- a correct file – you just need a working file that you obtained from the same device
Put both into the untrunc-master
directory. Then, run:
./untrunc correct.3gp broken.3gp
This will output a bunch of info, and it should give you a broken.3gp_fixed.mp4
output file.