anthwlock / untrunc

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

ffmpeg error while trying to crop a restored video ! #85

Open sahiltripathi2898 opened 3 years ago

sahiltripathi2898 commented 3 years ago

First I tried to restore the broken video and got the fixed video .

image

image

Then I tried to crop the first 3 mins of the fixed video using ffmpeg and got this error .

image

Does someone know how to solve this error ?

I want to restore a broken video (corrected reference video is provided) and then crop the fixed video for a time interval of what was the length of corrupted video before restoring .

anthwlock commented 3 years ago

Since untrunc is heuristic based, sometimes invalid samples are added to the resulting file. In these cases this often goes unnoticed, since video-players usually just ignore such invalid samples. However ffmpeg seems to not ignore these, and instead abort the transcoding process.

I currently don't have a suitable sample to test this, but maybe using -err_detect ignore_err is helpful here, link to docs.

If you send me your files I could try to adjust the heuristics a bit. Also if the transcoding should still fail, I could try to find out if there are other workarounds..

sahiltripathi2898 commented 3 years ago

https://drive.google.com/drive/folders/115Ym_f5zAbQvh2v-_67q8ecUXTtQmIKQ?usp=sharing Here are the 2 videos , 3.mp4 is the working video and 3-a.mp4 is the video to be restored . After restoring can you crop the restored video (or fixed video) to the length of 3-a.mp4 video (original corrupted video) .

clort81 commented 1 year ago

Just fyi you are trying to 'trim' a video, not 'crop' it. Trimming refers to a temporal outtake. Cropping refers to taking a sub-region of the video in 2D space.