Skip to content

Instantly share code, notes, and snippets.

@zivagolee
Created March 29, 2018 22:44
Show Gist options
  • Select an option

  • Save zivagolee/f0b0ddd7b9c91e0f6ade729eedd67240 to your computer and use it in GitHub Desktop.

Select an option

Save zivagolee/f0b0ddd7b9c91e0f6ade729eedd67240 to your computer and use it in GitHub Desktop.
Extract GoPro metadata (specifically geodata)
https://github.com/stilldavid/gopro-utils
$ brew install ffmpeg
$ brew install go
$ brew install jq
$ go get github.com/stilldavid/gopro-utils/bin/gopro2json/gopro2json.go
$ go get github.com/stilldavid/gopro-utils/bin/gopro2gpx/gopro2gpx.go
$ ffprobe GOPR0001.MP4
- find the stream
Stream #0:3(eng): Data: none (gpmd / 0x646D7067), 37 kb/s (default)
Metadata:
creation_time : 2018-03-27T11:20:52.000000Z
handler_name : GoPro MET
Show JSON format
$ ffprobe -v quiet -print_format json -show_format -show_streams GOPR0001.MP4
Extract the stream from JSON format
$ ffprobe -v quiet -print_format json -show_format -show_streams GOPR0001.MP4 | jq '.streams[] | select (.tags.handler_name | contains("GoPro MET")) | .index'
m = 3 from above
ffmpeg -y -i GOPR0001.MP4 -codec copy -map 0:m:handler_name:" GoPro MET" -f rawvideo GOPR0001.bin
gopro2json -i GOPR0001.bin -o GOPR0001.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment