Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add concurrent import support to GoPro Connect #36

Merged
merged 17 commits into from
Dec 22, 2022

Conversation

KonradIT
Copy link
Owner

@KonradIT KonradIT commented Dec 17, 2022

Adds concurrent import support to the GoPro Connect code.

image

The progress bars dynamically update, but there's some bug that makes a bunch of them at the start. Works pretty well aside from that on HERO11.

Todo:

  • Update number of files imported, get errors via channels
  • One progress bar per file
  • Limit number of active downloads via max-active param

@KonradIT KonradIT mentioned this pull request Dec 17, 2022
@KonradIT
Copy link
Owner Author

@daktak Wonder how this will work on a HERO5 session, given its over WiFi and the sessions had a slower server speed than black cameras, I tested this on HERO11 with USB and it works well.

@KonradIT KonradIT mentioned this pull request Dec 22, 2022
8 tasks
@KonradIT KonradIT merged commit a63d32c into development Dec 22, 2022
@daktak
Copy link
Contributor

daktak commented Dec 22, 2022

Trying on the HERO5, something is prematurely thinking the copy is finished. But process is sound.

[user@personal mmt-orig]$ ./mmt import -x connect -i 10.5.5.9 
Using config file: /home/user/.mmt.yaml
GOPR0078.MP4: 41.00 b / 41.00 b [==========================================================] ✔️
GP010078.MP4: 41.00 b / 41.00 b [==========================================================] ✔️
GOPR0079.MP4: 41.00 b / 41.00 b [==========================================================] ✔️
GP010079.MP4: 41.00 b / 41.00 b [==========================================================] ✔️
GP020079.MP4: 41.00 b / 41.00 b [==========================================================] ✔️
GP030079.MP4: 41.00 b / 41.00 b [==========================================================] ✔️

@KonradIT
Copy link
Owner Author

Hm, can you share the output of /gp/gpMediaList? Don't know why size units change between cameras.

@daktak
Copy link
Contributor

daktak commented Dec 22, 2022

{"id":"4558706600400230655","media":[{"d":"100GOPRO","fs":[{"n":"GOPR0078.MP4","mod":"1671475744","ls":"178163935","s":"4002411996"},{"n":"GP010078.MP4","mod":"1671476244","ls":"167112049","s":"3753732097"},{"n":"GOPR0079.MP4","mod":"1671476790","ls":"178149260","s":"4002206530"},{"n":"GP010079.MP4","mod":"1671477322","ls":"178181562","s":"4002429913"},{"n":"GP020079.MP4","mod":"1671477856","ls":"178175134","s":"4002407567"},{"n":"GP030079.MP4","mod":"1671478154","ls":"100005614","s":"2246503574"}]}]}

@KonradIT
Copy link
Owner Author

Weird, it's using the Content-Length reported by HTTP HEAD method on each file. https://github.com/KonradIT/mmt/blob/development/pkg/gopro/connect.go#L246

Maybe I'll switch to goprofile.S instead.

@daktak
Copy link
Contributor

daktak commented Dec 23, 2022

Ahh maybe the web server on a hero5 is streaming it 41bytes at a time , thus incorrect http head

@daktak
Copy link
Contributor

daktak commented Dec 23, 2022

ok, total, err := strconv.ParseInt(goprofile.S, 10, 64) seems to work

[user@personal mmt-orig]$ ./mmt import -x connect -i 10.5.5.9 -b 2560000
Using config file: /home/user/.mmt.yaml
GOPR0078.MP4: 23.65 MB / 4.00 GB [----------------------------------------------------------] 5h15m30s
GP010078.MP4: 19.74 MB / 3.75 GB [----------------------------------------------------------] 2h27m59s
GOPR0079.MP4: 18.12 MB / 4.00 GB [----------------------------------------------------------] 6h30m46s
GP010079.MP4: 16.23 MB / 4.00 GB [----------------------------------------------------------] 2h47m21s
GP020079.MP4: 15.68 MB / 4.00 GB [----------------------------------------------------------] 3h56m32s
GP030079.MP4: 14.67 MB / 2.25 GB [----------------------------------------------------------] 1h33m55s

@daktak
Copy link
Contributor

daktak commented Dec 23, 2022

progress bars are good ;-) no starting junk for me

@KonradIT
Copy link
Owner Author

Oh cool, maybe for cases Video+Photo it can use goprofile.S

Will need to investigate how this affects to multi shot/raw photo size Implementation, which relies also on HTTP HEAD.

@KonradIT KonradIT deleted the concurrent_import branch December 29, 2022 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants