gopro-utils
gopro-utils copied to clipboard
Stream handler_name has changed again on Hero6 files
So, apparently the stream handler_name has changed again in Hero6 files. And that makes automated data extraction difficult for those of us who use ffmpeg. If I'm not wrong, for Hero5 files up to 60 fps, it was something like
Stream #0:3(eng): Data: none (gpmd / 0x646D7067), 33 kb/s (default) Metadata: creation_time : 2017-11-25T15:46:16.000000Z handler_name : GoPro MET
Which could be extracted via
ffmpeg -y -i VIDEOFILE.MP4 -codec copy -map 0:3 -f rawvideo DATA.BIN
Then, over 60 fps the Stream was:
Stream #0:2(eng): Data: none (gpmd / 0x646D7067), 66 kb/s (default) Metadata: creation_time : 2017-11-25T15:46:48.000000Z handler_name : GoPro MET
So this call, despite the awkward tabulator character before "GoPro MET" would work for both:
ffmpeg -y -i VIDEOFILE.MP4 -codec copy -map 0:m:handler_name:" GoPro MET" -f rawvideo DATA.BIN
Now, Hero6 files don't have the tabulator character:
Stream #0:3(eng): Data: none (gpmd / 0x646D7067), 37 kb/s (default) Metadata: creation_time : 2017-11-21T22:25:40.000000Z handler_name : GoPro MET
So they can be retrieved with the 0:3 of the H5 sub 60fps command, but not with the previously universal 0:m:handler_name:" GoPro MET"
and 0:m:handler_name:"GoPro MET"
does not work either for some reason I don't comprehend.
Does anyone know how to solve this? Maybe using regular expressions or looking for the "(gpmd / 0x646D7067)" bit?
Proof of concept: https://github.com/KonradIT/gopro-utils/blob/master/bin/get_datastream_hero6.sh
@KonradIT Awesome.
I managed to do something similar for my Windows batch script: https://github.com/JuanIrache/gopro-utils/blob/master/GPMD2CSV/GPMD2CSV.bat Not as elegant as yours probably, but works for now. (it also extracts the data to .csv. That was the initial intention of the script)
Thanks
Strong work!
I wonder what the most cross-platform solution would be, perhaps a perl or python script rather than a bash or batch script? I don't run windows, does it ship with another cross-platform scripting language?