Retrieve metadata from a GOPRO mp4 video file

Started by eshuerta, October 17, 2023, 11:28:47 AM

Previous topic - Next topic

eshuerta

Hi, thanks for your library Phil, works like no other do... here is a question for you:
im uploading an mp4 gopro file into multiple chunks, and when I try to get the GPS metadata of each chunk I get an truncated mdat error... Is there any way of getting the information while the video is uploading? or can I upload certain piece of the video that has the info?

This is the command im running and works as expected on the videos im uploading
-api largefilesupport=1 -ee -n -p \"$timestamp,$gpslatitude,$gpslongitude\" \"{mp4FilePath}\"

I cant have access the full video for now... I tried uploading a smaller video into one piece and I can get the information I need but the actual videos the user be uploading could be more than 5gb so waiting for the upload is not an option and being a serverless server, I cant upload the entire video in one piece, it HAS to be splitted...

PLEASE HELP

Phil Harvey

It is possible that the first chunk contains the information.  Basically, you need all of the chunks except those containing only mdat data, and you would need to assemble a full file with dummy mdat to be able to parse it properly with ExifTool.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

eshuerta

Thanks for the response Phil... I have a following question then... how do I identify where the metadata is stored in a file? I have a 80mb file with GPS enabled that I was able to get the data but if the file is whole... when the file is being splitted (even in 50mb chunks) I still get the truncated mdat error.... is there a way to only extract the mdat chunk? or identify for example from the byte xxxx to the byte xxxxx is the mdat info


many thanks in advance to take the time to respond, where can I donate? this app is a life saver

StarGeek

Based upon this previous post by Phil, it's possible that the metadata can be at the end of the file.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

Try taking a look at one of your full GoPro files using the exiftool -v3 option.  This option shows the addresses of all information extracted in hex so you can see where it is coming from.  Also, the generated tags MediaDataOffset and MediaDataSize give the position and size of the mdat (media data) chunk.

There is a donate button on the ExifTool home page.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

eshuerta

I was able to see the mdat along with other data... I got this:

MediaDataSize = 5218410751
  MediaDataOffset = 36
  MediaData
  - Tag 'mdat' at offset 0x0024 (5218410751 bytes)


is there any way on just getting this? and nothing else? this means that the mdat piece starts on byte 36 and it goes to byte 5218410751 + 36 ??

Phil Harvey

Quote from: eshuerta on October 20, 2023, 09:51:52 AMis there any way on just getting this? and nothing else?

exiftool "-mediadata*" FILE

Quotethis means that the mdat piece starts on byte 36 and it goes to byte 5218410751 + 36 ??

Yes.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).