jin-zhe / gopro Goto Github PK
View Code? Open in Web Editor NEWPython library for generating and processing GoPro telemetry
Python library for generating and processing GoPro telemetry
I am able to produce VIDEO_Name.MP4.json and .bin, however, the metadata on acceleration, gyro are not created by the command.
def extract_all(self):
self.extract_gpx()
self.extract_json()
self.extract_metadata()
def extract_gpx(self):
gpx_path = os.path.join(self.video_dir, self.filename + '.gpx')
# If reprocessing or gpx file does not yet exists
if self.reprocess or not os.path.isfile(gpx_path):
command = [
self.gopro2gpx_path,
'-i', self.telemetry_path,
'-o', gpx_path
]
GoProTelemetry.call_subprocess(command)
def extract_json(self):
json_path = os.path.join(self.video_dir, self.filename + '.json')
# If reprocessing or json file does not yet exists
if self.reprocess or not os.path.isfile(json_path):
command = [
self.gopro2json_path,
'-i', self.telemetry_path,
'-o', json_path
]
GoProTelemetry.call_subprocess(command)
def extract_metadata(self):
gps_path = os.path.join(self.video_dir, self.filename + '_gps.csv')
gyro_path = os.path.join(self.video_dir, self.filename + '_gyro.csv')
accl_path = os.path.join(self.video_dir, self.filename + '_accl.csv')
temp_path = os.path.join(self.video_dir, self.filename + '_temp.csv')
# If reprocessing or none of the metadata files yet exists
if self.reprocess or not (
os.path.isfile(gps_path) and
os.path.isfile(gyro_path) and
os.path.isfile(accl_path) and
os.path.isfile(temp_path)):
command = [
self.gpmdinfo_path,
'-i', self.telemetry_path
]
GoProTelemetry.call_subprocess(command)
# Rename and move files into video directory
print(self.gpmdinfo_path)
shutil.move('./gps.csv', gps_path)
shutil.move('./gyro.csv', gyro_path)
shutil.move('./accl.csv', accl_path)
shutil.move('./temp.csv', temp_path)```
Here is the error message:
/home/Nour/go/src/github.com/stilldavid/gopro-utils/bin/gpmdinfo/gpmdinfo
Traceback (most recent call last):
File "/usr/lib/python3.8/shutil.py", line 791, in move
os.rename(src, real_dst)
FileNotFoundError: [Errno 2] No such file or directory: './gps.csv' -> '/home/Nour//GH011561.MP4_gps.csv'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 5, in <module>
obj = gopro_telemetry.GoProTelemetry(video_path, reprocess=False, config_path='config.yml')
File "/home/Nour//gopro/gopro_telemetry.py", line 35, in __init__
self.extract_all()
File "/home/Nour//gopro/gopro_telemetry.py", line 92, in extract_all
self.extract_metadata()
File "/home/Nour//gopro/gopro_telemetry.py", line 139, in extract_metadata
shutil.move('./gps.csv', gps_path)
File "/usr/lib/python3.8/shutil.py", line 811, in move
copy_function(src, real_dst)
File "/usr/lib/python3.8/shutil.py", line 435, in copy2
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/usr/lib/python3.8/shutil.py", line 264, in copyfile
with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: './gps.csv'
When I run "go build" inside the folder $HOME/go/src/github.com/stilldavid/gopro-utils/bin/gpmdinfo/
I get the message
gpmdinfo.go:1:1: expected 'package', found '<'
Go version go1.17 darwin/arm64 and I'm using a Mac with M1 chip
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.