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

Selective files (JPG only) #17

Open
mikapietrus opened this issue Mar 14, 2020 · 4 comments
Open

Selective files (JPG only) #17

mikapietrus opened this issue Mar 14, 2020 · 4 comments

Comments

@mikapietrus
Copy link

Hi Buddy,

I finally figure how to make all up and running. However I have one question. Is there an option how do transfer only JPG files? I Wass looking for such option in gphoto2, but it's not so easy. Do you have any ideas maybe?

@falk0069
Copy link
Owner

I took a look at the options and I unfortunately don't see any filter options. One thing you could try is removing the '-P' option from the command and using '--new' instead. This only works on some camera models and will only download items that haven't been downloaded previously. Then you can just delete the video files after each run and they won't be re-downloaded.

The only other options I can think of is maybe a 'gphoto2 --list-files' could be executed. Then inspect the list. Then download specific files like so: 'gphoto2 --get-file 7-13'. I'm not sure how easy or efficient that would be.

Let me know if you try any of the suggestions and/or are successful.

@mikapietrus
Copy link
Author

Hi thanks for reply!

I think that these mod will be useful, especially for all pros using Sony cams (I don't know only vendors, but Sony is putting JPGs and RAWs in the same folder, which makes impossible to use folder specify import).

I was looking for solution, and found a way which is working, but have no idea how to implement it into your script:

gphoto2 -L --quiet | grep JPG | while read fn
do
gphoto2 -p $fn
done

Adding that would make the magic! Do you have any idea how to use it in sony-pm-alt.py?

@falk0069
Copy link
Owner

I can't get seem to make that command work for me because my Sony shuts down before it completes. You can try this and see if you have better luck.

Update: sony-pm-alt.py. Change:
GPHOTO_CMD_ARGS = ["/usr/local/bin/gphoto2","-P","--skip-existing"]
to
GPHOTO_CMD_ARGS = ["~/gphoto2jpg.sh","-P","--skip-existing"]

Then create a new shell script named: ~/gphoto2jpg.sh
Be sure to chmod it: chmod 755 ~/gphoto2jpg.sh
Then add some lines to the shell script:

#!/bin/bash
echo "Executing: gphoto2 --port $2 -L --quiet | grep -i JPG | while read fn; do gphoto2 --port $2 -p \$fn; done"
gphoto2 --port $2 -L --quiet | grep -i JPG | while read fn; do gphoto2 --port $2 -p $fn; done

Maybe you can try playing around with it and have better luck. If it does work, you might want to include '--skip-existing' so it doesn't re-download files.

Let me know if you have any luck

@mikapietrus
Copy link
Author

no luck so far. gphoto2 is starting to download a file (tmpfile*) but then it seems it drops the connection, files is 0 byte size. I'll investigate the topic

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

No branches or pull requests

2 participants