Giter Club home page Giter Club logo

gopro's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gopro's Issues

.gyro, .gps, .accl and .temp file are not created

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'

Cannot run GO BUILD commmands

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.