Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: unable to find correct codec -> premature end (~0%) #51

Closed
xdli16 opened this issue Jun 2, 2020 · 10 comments
Closed

Error: unable to find correct codec -> premature end (~0%) #51

xdli16 opened this issue Jun 2, 2020 · 10 comments

Comments

@xdli16
Copy link

xdli16 commented Jun 2, 2020

Info: version '71d1a65' using ffmpeg '3.3.4'
Info: reading ok.mp4
Info: parsing healthy moov atom ...
Composition time offset atom found. Out of order samples possible.

Info: reading mdat from truncated file ...
Error: unable to find correct codec -> premature end (~0%)
try '-s' to skip unknown sequences

Warning: guessed frame durations of 'mp4a' will probably be wrong!
Warning: guessed frame durations of 'avc1' will probably be wrong!
Info: Found 0 packets ( mp4a: 0 avc1: 0 avc1-keyframes: 0 )
Info: Duration of mp4a: (0 ms)
Info: Duration of avc1: (0 ms)
Info: pruned empty 'mp4a' track
Info: pruned empty 'avc1' track
Info: saving no.mp4_fixed.mp4

@xdli16
Copy link
Author

xdli16 commented Jun 2, 2020

I repair videos on Windows 10

@anthwlock
Copy link
Owner

Make sure that no.mp4 actually contains some data (by using hexeditor).
If so, please send me the flies (healthy+broken).

How to upload

https://wetransfer.com/ offers hosting <2GB files for 7days, without registration.
If your files are larger, untrunc -sh file.mp4 lets you extract the first 200MB.
Either post the resulting link here, or send me an email.

@anthwlock
Copy link
Owner

What software did you used to create those files?
It looks like metadata got packed into avc1 samples..
Do you know something about Hi3518?

@anthwlock
Copy link
Owner

Btw, the download of the broken 2.1GB file stops at 1.1GB. I tried multiple times and with different browsers.
But 1.1GB is probably enough anyway.

@xdli16
Copy link
Author

xdli16 commented Jun 4, 2020

I use ffmpeg to record m3u8 live link,like
ffmpeg -i "http://xxx.m3u8" -vcodec copy -acodec copy -absf aac_adtstoasc "xxx.mp4"
I don't know HI3518.

@xdli16
Copy link
Author

xdli16 commented Jun 4, 2020

I uploaded the broken video files again. This time, I compressed them into multiple compressed packages. If you need, you can download them again
https://send.firefox.com/download/06a198da8e19ed01/#OeI7OW2oNO6ztQjEg8fBNg
https://send.firefox.com/download/69982cfa1afb86e3/#cJ2koXa_OI0OK_Y82uohDA
https://send.firefox.com/download/ed62abaeeb109128/#UUanGayDSUgYu8AySNbS_g

@anthwlock
Copy link
Owner

Just to make sure.. is the following md5sum correct?
a984f3ad141cccdaef5e850e6d96897c no.mp4

@xdli16
Copy link
Author

xdli16 commented Jun 5, 2020

a984f3ad141cccdaef5e850e6d96897c no.mp4

@anthwlock
Copy link
Owner

The metadata was packed in nal-units with nal_type=31, fixed with 907fbb5.

Additionally ffmpeg3.4+ failed to decode some mp4a samples, because internal decoder state was not reset after 'gaps' in the audio-stream. These gaps may be caused by network transmission errors. This got fixed with 56aee28.

Tip
When using ffmpeg you can avoid corrupt files by using -f mpegts.
This will create .ts instead of .mp4.
It also allows you to watch the stream while downloading.
Later you can use ffmpeg -i file.ts -c copy file.mp4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants