anthwlock / untrunc

Restore a truncated mp4/mov. Improved version of ponchio/untrunc
GNU General Public License v2.0
2k stars 191 forks source link

Changes produce broken video #1

Closed davitf closed 6 years ago

davitf commented 6 years ago

Hi! As you requested in my pull request, I've uploaded a sample video which is fixed correctly by ponchio's master, but when I run it on your master, the output is a broken video. Here are the files.

Running: ./untrunc ok.mp4 broken_sample.mp4

The original code produces the file I've renamed output_original.mp4, and this version produces output_corrupted.mp4.

Let me know if I can help!

anthwlock commented 6 years ago

The problem is that the SPS Unit needs to be decoded before the slices are. I added default values for the SpsInfo but this is only a quick fix. Please try if it works for you now.

davitf commented 6 years ago

It worked! It seemed that the output file was larger than the one generated by ponchio's original code, but I haven't really stopped to analyze.