stilldavid / gopro-utils Goto Github PK
View Code? Open in Web Editor NEWTools to parse metadata from GoPro Hero 5 & 6 cameras
License: BSD 2-Clause "Simplified" License
Tools to parse metadata from GoPro Hero 5 & 6 cameras
License: BSD 2-Clause "Simplified" License
Some files recorded on GH6/GH7 camera cannot be processed by gopro2gpx
utility.
Following error occurs:
Error reading telemetry file parsing time "5457900081260100": month out of range
In the same time GoPro Quick app successfully reads GPS data from these files.
May be it just ignores corrupted records.
I am trying to extract the UTC time from a Gopro fusion camera. I created the binary GPMD from its stream using ffmpeg. However, upon converting bin to json using telemetry I receive the following error:
**
Error reading telemetry file Could not find label in list: STMP (53544d50
exit status 1
**
this is the command I used to convert bin to json:
go run gopro-utils\gopro-utils\bin\gopro2json\gopro2json.go -i GS010805.bin -o GS010805.json
the script works on regular gorpro Hero 6 and Hero 7 videos, but not on the Fusion.
Any help is very much appreciated.
» ./gopro2json -i ~/Desktop/GOPR0005.bin -o GOPR0005.json zsh: permission denied: ./gopro2json
Could you provide a sample Gopro 5 Video? :)
After cloning the repo I can not figure out how to build and run on Mac. Please include build / run instructions assuming Go is installed.
go install github.com/stilldavid/gopro-utils/bin/gopro2json@latest
did not work
Thanks for the library
I had to add labels "UNIF" & "SROT" for the Hero 7
I haven't investigated what they are for, but my data requirement is very basic - just GPS.
Will look to ignore missing additional labels at some stage when I work out the best way to do it
Cheers
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?
Hi there,
firstly I want to thank you very much for this code. Saves me a lot of time!
Could you please explain to me what the variable 'track' in the json file from gopro2json exactly is?
Thank you very much,
Patrick
When I try to run the example command, I get:
$ ffmpeg -y -i GOPR1265.MP4 -codec copy -map 0:m:handler_name:" GoPro MET" -f rawvideo GOPR1265.bin
ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
built with Apple clang version 12.0.5 (clang-1205.0.22.9)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.4_2 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-avresample --enable-videotoolbox
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'GOPR1265.MP4':
Metadata:
major_brand : mp41
minor_version : 538120216
compatible_brands: mp41
creation_time : 2017-12-11T06:45:48.000000Z
location : +09.7930+123.3768/
location-eng : +09.7930+123.3768/
firmware : HD5.02.02.60.00
Duration: 00:08:41.36, start: 0.000000, bitrate: 30185 kb/s
Chapters:
Chapter #0:0: start 415.320000, end 521.360000
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 30000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc (default)
Metadata:
creation_time : 2017-12-11T06:45:48.000000Z
handler_name : GoPro AVC
vendor_id : [0][0][0][0]
encoder : GoPro AVC encoder
timecode : 06:45:49:05
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
creation_time : 2017-12-11T06:45:48.000000Z
handler_name : GoPro AAC
vendor_id : [0][0][0][0]
timecode : 06:45:49:05
Stream #0:2(eng): Data: none (tmcd / 0x64636D74) (default)
Metadata:
creation_time : 2017-12-11T06:45:48.000000Z
handler_name : GoPro TCD
timecode : 06:45:49:05
Stream #0:3(eng): Data: bin_data (gpmd / 0x646D7067), 38 kb/s (default)
Metadata:
creation_time : 2017-12-11T06:45:48.000000Z
handler_name : GoPro MET
Stream #0:4(eng): Data: none (fdsc / 0x63736466), 9 kb/s (default)
Metadata:
creation_time : 2017-12-11T06:45:48.000000Z
handler_name : GoPro SOS
Stream map '0:m:handler_name: GoPro MET' matches no streams.
To ignore this, add a trailing '?' to the map.
$
Any ideas?
Please help. How to extract data from Hero 6. What do I need to change for this?
Thanks.
Title sais it all - that is what I get as the ouput when I follow the instructions in the README.
Here is an example gpmf file: https://drive.google.com/open?id=1uJ1DWnIqkOmAMsKQQYM0nkeJmYzEjt5g
As someone new to GO, there doesn't seem to be a build file or instructions on how to build the project? Could you add a section on build instructions? Thank you!
Seems like ffmpeg does not create the correct bin file when using the parameters -ss (to start extraction at a specific second) and -t (the length of video to take from the start point).
Thus it would be interesting to be able to tell gopro2gpx to trim the GPX file with the same 2 parameters instead.
./gopro2gpx -i tmp.bin -ss 20 -t 10 -o tmp.gpx
would extract the GPS starting at second 00:20 for a length of 10 seconds
I am trying to export a GPX track from an MP4 video filmed on GoPro 6.
Somehow I'm getting invalid coordinates. I see several problems which appear on the exported GPX track - but which I don't see on the GPS gauge in Quik.
I will create a separate issue per problem.
First problem is that I'm getting completely off-the track coordinates. Here's a example:
The video is filmed in Germany (around 8.663, 50.232). A few first points on the exported GPX track lie north of Canada (-128.4998971, 80.8641778). Also the elevation for these points is exported as 20841.167
(in reality should be around 202
).
Quik seem to show this track correctly:
The complete video is ca. 3.4GB so I can't reasonably share it. I also don't know how can I cut it while keeping all the streams including GoPro MET
.
Below is the .bin
file I've exported from the video:
This is how I've exported it:
ffmpeg -y -i GX030039.MP4 -codec copy -map 0:3:handler_name:" GoPro MET" -f rawvideo GX030039.bin
Below is the (zipped due to GitHub) GPX track:
Exported using:
gopro2gpx -i GX030039.bin -o GX030039.gpx
Invalid points look like:
<trkpt lat="80.8641778" lon="-128.4998971">
<ele>20841.167</ele>
<time>2018-09-29T10:20:53Z</time>
</trkpt>
<trkpt lat="80.8641778" lon="-128.4998971">
<ele>20841.167</ele>
<time>2018-09-29T10:20:54Z</time>
</trkpt>
First valid point:
<trkpt lat="50.2319754" lon="8.6630605">
<ele>202.121</ele>
<time>2018-09-29T10:23:51Z</time>
</trkpt>
TS is always 0
Function is missing. Can some one help to add that ?
It seems that HERO 6 last firmware (v02.01) add new labels : MTRX, ORIN, ORIO
Error reading telemetry file Could not find label in list: MTRX (4d545258)
Is it possible to manage it ?
Thanks
About this comment
gopro-utils/telemetry/reader.go
Line 126 in 187488e
Here is the definition of DVID:
https://github.com/gopro/gpmf-parser
Based on a tweet, I think it's got camera data like EXIF including shutter speed and ISO.
Printing it out on screen as strings looks something like:
2.00.00LAE6091614106816
y�4z8�~�N�
��(�C3161325340567HERO5 Black
��Ey�4z8�~�N�
��(�VA�g
So�+40.0371-105.2213/���8
�8��d�cv�X�B
G� �
5'd*�4��"~\�
���������yq������
����E(�80
GPV
GP�i�GPUGP�
GPUGP@��GPVGP
CH�GPUGP�i�GP
UGP�GPVGP
�(�GPUGP�Z�GPU
GP���GPVGP��
�GPUGP���GPU
GP�k�GPVGP��
GPUGP�R�GPU
GP�/�GPVGP�6�GP
UGP�T�GPUGP
�d�GPVGP�=�GP
UGP���GPUGP�P
�GPVGP�8�GPU
... which I don't recognize off hand, but it does have the firmware version, serial and model number of the camera, and at least cursory GPS coordinates. The rest seems meaningful and I bet matches a well-known metadata format.
Will dig.
Hi,
Gopro Quik (desktop) allows edit only gopro files. (Compatible with footage captured using HERO5 Black with GPS activated.) Is there a way to create gopro video from another video? Can we create and insert some gopro data?
I think we need something similar like this:
https://support.google.com/jump/answer/7044297?hl=en
What do you think? Is it possible?
Hello there! Thank you for this great tool!
I'm trying to write a tool that read the telemetry track, process it and write it back in the input file.
Have you ever tried something like that?
Do you know if it's possible to mux the bin file in a mp4 video with ffmpeg?
Any suggestion would be greatly appreciated :)
Hi
I tested it on the gopro fusion and it gives out empty cvs files.
If you want I could send you short vids for testing?
Cheers
G
ps. thanks for the app. used it already on gopro 5!
Please see #27 for the background information.
A further problem I'm facing are coordinate which are completely off track.
BIN file:
This is the GPX track I'm getting:
The tracks looks "exploded" in a few places:
This part here is completely off the track. Quite sure I did not drive there:
Same here:
Check the "vertical" part here in the middle. Looks quite consistent. Except there's no road there and I did not drive there. Also consider the part in the upper right corner.
Also get severely inprecise coordinates along the track:
Quik shows a somewhat better looking track:
However Quik does not show almost the half of the drack I actually drove.
I don't think these "explosions" of the track can't be explained by the imprecision of GPS. Ok, I'm fine with a few meters, but I see jumps of several hundreds meters if not kilometers here. Also, this is not visible in Quik.
Hi, I am trying to add a hilight tag write out to the program, here is my progress. Hilight tags are time (in milliseconds) pinpoints in the video. I do not have a HERO5 to test the integration, I found this repo which reads HiLight tags and works with my HERO4 Black footage. To tag a new hilight tag press the side button during a recording or use the GoPro App.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.