-
Notifications
You must be signed in to change notification settings - Fork 20
MP4 ATOM is not found for some cameras #6
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
Comments
Yes, if you can, upload a problematic .mp4 somewhere and I'll see if I can figure something out. I'm no expert in mp4 also. My first encounter with mp4 internals was when I was writing for this project. |
https://drive.google.com/drive/folders/1sFGhRZLtbnE34xKENX3WsA2uaAirdPHg?usp=sharing I uploaded to my g drive a video (MIKE1049.MP4) I received from a user. Thank you |
@Cleric-K
|
Yes, I've just pushed a test gui_temp branch. Can you take a look? This is not a complete solution however. It should read 64bit |
The atom See https://developer.apple.com/standards/qtff-2001.pdf for info on the atoms. |
Just checked the output result on the test file from my g drive. The result is a black video without content. The header seems ok though because no error is reported. |
Oops. Looks like this is actually the case. This file uses |
You may change this in for stco in moov.find(b'co64'):
count = struct.unpack('>I', stco.data[4:8])[0]
offset_format = '>{}Q'.format(count)
offsets = struct.unpack(offset_format, stco.data[8:])
# translate offsets to new origin
offsets = [o + mdat_offset_diff for o in offsets]
stco.data[8:] = struct.pack(offset_format, *offsets) It's just the |
Yes. It works like that. |
Yeah, I can do it if you want. The generation of offsets for the GPMF should also be touched. |
I'd like that. I am sure the 3K facebook users would be grateful for it. |
I will gladly post your paypal.me address on the facebook group to raise some beer money for your work. Just let me know. |
I've just pushed. Haven't tested anything though. But it should be clear from the code what the goal is. |
Looks good. Thank you! |
Great! You can delete the temp branch when you merge it to yours. Good luck! |
@Cleric-K
There is a known problem, some cameras produce mp4 headers than are not handled properly by the script.
I tried to debug it but my mp4 knowledge is far from yours.
It's been a while when I tried to debug it, but I think it was this line return struct.unpack('>I4s', buf)
The SMO, InstaOne has this problem. Also people reported unsupported content exported from Premiere.
If/when you have some time and want to take a look I can send you some samples.
The text was updated successfully, but these errors were encountered: