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

recover mp4.part file #10347

Closed
diga76 opened this issue Aug 14, 2016 · 16 comments
Closed

recover mp4.part file #10347

diga76 opened this issue Aug 14, 2016 · 16 comments

Comments

@diga76
Copy link

@diga76 diga76 commented Aug 14, 2016

Hello,
sometimes the download don't finish after the end of streaming and I have to break it with ctrl-c.
So I have a mp4.part file and I cannot open it with any media player.
Is there a way to fix this file to have a working mp4 file?
Thank you and congratulations for your great and very usefull software.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Aug 14, 2016

Rename xxx.mp4.part to xxx.mp4. If it does not work, run the following command:

ffmpeg -i xxx.mp4.part -c copy xxx_fixed.mp4
@yan12125 yan12125 closed this Aug 14, 2016
@diga76
Copy link
Author

@diga76 diga76 commented Aug 14, 2016

I tried the command, but I receive the error:
[mov,mp4,m4a,3gp,3g2,mj2 @ 03289ae0] moov atom not found
xxx.mp4.part: Invalid data found when processing input
Have you other suggestions?
Thanks

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Aug 14, 2016

How about adding more options to ffmpeg: -movflags empty_moov

@diga76
Copy link
Author

@diga76 diga76 commented Aug 14, 2016

With the command
ffmpeg -movflags empty_moov -i xxx.mp4.part -c copy xxx_fixed.mp4
I receive the same error.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Aug 14, 2016

Which URL are you downloading?

@diga76
Copy link
Author

@diga76 diga76 commented Aug 14, 2016

It was an old periscope link, now is disappeared.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Aug 14, 2016

Sorry, that's all I know. I found lots of "solutions" on Google with "moov atom not found" as the keyword. I didn't try them, though.
For future videos, add --hls-prefer-native or --hls-use-mpegts to youtube-dl. With these two options, it's less likely to get broken videos. The downside of these two optoins is that the whole download process is longer and the generated file may not play on all media players.

@diga76
Copy link
Author

@diga76 diga76 commented Aug 14, 2016

Thank you very much for your support.
This thread will remain closed or is better to set it open ?

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Aug 14, 2016

I'll keep it closed. There are already some options to prevent incomplete files broken, and recovering a MP4 file is beyond the scope of youtube-dl. This thread can be left for discussions only.

@diga76
Copy link
Author

@diga76 diga76 commented Aug 14, 2016

Ok, if, in the future, you need to replicate the problem I think it appears, sometimes, on periscope live when the user delete the streaming immediately after the end.
Thank you very much

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Aug 14, 2016

--hls-prefer-native does not support live streams (yet). Could you try ---hls-use-mpegts in the future?

@diga76
Copy link
Author

@diga76 diga76 commented Aug 14, 2016

Ok, if I will need future download, I will try with this option.
Thanks

@sixem
Copy link

@sixem sixem commented Oct 16, 2016

I encountered this issue too and i can confirm that running youtube-dl with --hls-use-mpegts and --prefer-ffmpeg fixes the issue.

To repair the file after it has been interrupted or whatever you can do ffmpeg -i "file.mp4.part" -codec copy "file.mp4"

@diga76
Copy link
Author

@diga76 diga76 commented Oct 22, 2016

In these days I made some test but the streaming isn't blocked so I can't test if the parameters and the recover procedure works fine. If happen in the future I will test its.
Thank you very much for your suggestions.

@rezaarifandee
Copy link

@rezaarifandee rezaarifandee commented Jul 15, 2019

I experienced the same problem as you and been able to recover the livestream videos with untrunc. However, you need to have a "similar video" to be used as reference for recovering the moov tags.

sorry for necroing btw.

@diga76
Copy link
Author

@diga76 diga76 commented Jul 15, 2019

Thank you for you reply, I tried untrunc some months ago, sometimes it works but many times no.

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

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.