rharder / imagesnap

Capture Images from the Command Line
https://github.com/rharder/imagesnap
458 stars 50 forks source link

Does not work on High Sierra #16

Closed peterhellberg closed 6 years ago

peterhellberg commented 6 years ago

It seems like imagesnap doesn't actually work on High Sierra. (It looks like it does, no errors, but there is no output file)

$ ./imagesnap -w 1 foo.jpg
Capturing image from device "<AVCaptureDALDevice: 0x7f9b7ad2f800 [FaceTime Camera][CC27173CH6UHGWCAE]>"...~

(I've tried with both 0.2.5 and the latest commit d947e68)

danodea commented 6 years ago

I'm on Sierra (10.12.6) and am seeing this same issue. From the docs it seems like it should be outputting a filename after the ellipsis, but that isn't happening. I installed an Xcode update today so I wonder if a new version of Xcode is the underlying issue.

juax335 commented 6 years ago

I run into the same problem as peterhellberg (similar terminal output and no output file). I'm running on macOS High Sierra 10.13.1 on a MacBook Air (Early 2014). I recently reinstalled macOS and also XCode (Version 9.1). I installed (and uninstalled and reinstalled and uninstalled and reinstalled) imagesnap with brew I would be happy for every hint on solving this problem :).

akaped commented 6 years ago

Hello, I would like to join the "image now saved" group! Same problem here MacBook Air 2012 and High Sierra. When I open imagesnap I see the green light of my iSight blinking, but no file was generated.

nkirsch commented 6 years ago

+1 :(

Capturing image from device "<AVCaptureDALDevice: 0x7fe87ec16b50 [FaceTime HD Camera (Display)][0x4015000005ac1112]>"...%

10.13.1 (17B1003) Mac mini (Late 2014) Apple Thunderbolt Display (Intel Iris 1536 MB graphics) imagesnap Version: 0.2.5

Light blinks, but no data saved. Works fine on my iMac, same build.

EdgarJeremy commented 6 years ago

Same here on High Sierra (10.13.1) with FaceTime HD Camera.

Trying to capture on 1 sec interval it generates the output files very well. imagesnap -t 1

But still don't work with one-time capture

lp74 commented 6 years ago

The same happens here with both the FaceTime and the HD Pro C920 Web Cam;

imagenap 0.2.5 on macOS High SIerra 10.13.1

the command imagesnap -t 1 works with both the cameras.

arkarkark commented 6 years ago

an alternative until this is fixed is

ffmpeg -f avfoundation -video_size 1280x720 -i "0" -vframes 1 "snapshot-$(date +%F-%T | tr : -).jpg"

manico commented 6 years ago

@arkarkark Alternative how? Where do you run this?

arkarkark commented 6 years ago

@manico where I would previously type imagesnap I type in the command above. you might need to brew install ffmpeg (just like you had to brew install imagesnap)

friedrichweise commented 6 years ago

Version 2.6 is still broken. I just figured out, that Version 2.5 ist still working under macOS 10.13. You can download the executable via SourceForge: https://netix.dl.sourceforge.net/project/iharder/imagesnap/ImageSnap-v0.2.5.tgz

BarcoMasile commented 6 years ago
memming commented 6 years ago

Temporary solution if you're using homebrew: brew switch imagesnap 0.2.5

mpk99 commented 6 years ago

that temporary solution didn't work for me. Is there any other way to make this work? How are those using ffmpeg to take a screenshot every 1 second for example?

imagesnap -t 1

i would normally use this, what's the equivalent for ffmpeg?

jonlorusso commented 6 years ago

~fwiw, I've got a fix for this:~

Edit: Just noticed this is already addressed in this pull request.

Sangdol commented 6 years ago

Until it's fixed, this could be a quick and dirty solution:

imagesnap -t 10 -w 1 & sleep 3 && killall imagesnap
pocketrocket commented 6 years ago

@arkarkark you had a typo missing the closing quote in the end... based on your solution + silencing the STDOUT and STDERR: ffmpeg -f avfoundation -video_size 1280x720 -i "0" -vframes 1 "snapshot-$(date +%F-%T | tr : -).jpg" 1>/dev/null 2>&1

cc @manico

Sangdol commented 6 years ago

@pocketrocket May I ask why you don't like my solution?

By the way, the ffmpeg command doesn't work for me for some reason. It makes this error, that's why I came up with that solution.

[avfoundation @ 0x7f8136802e00] Selected framerate (29.970030) is not supported by the device
[avfoundation @ 0x7f8136802e00] Supported modes:
[avfoundation @ 0x7f8136802e00]   1280x720@[1.000000 30.000000]fps
    Last message repeated 2 times
[avfoundation @ 0x7f8136802e00]   640x480@[1.000000 30.000000]fps
    Last message repeated 2 times
[avfoundation @ 0x7f8136802e00]   320x240@[1.000000 30.000000]fps
    Last message repeated 2 times
0: Input/output error
pocketrocket commented 6 years ago

@Sangdol because it didn't work (as of a typo? as well... now as it's working I'll change my reaction to đź‘Ť )

toshibochan commented 6 years ago

@friedrichweise how to install 0.2.5?

friedrichweise commented 6 years ago

as @memming mentioned, use brew switch imagesnap 0.2.5

toshibochan commented 6 years ago

@friedrichweise thanks for replay. When in run “brew switch imagesnap 0.2.5” give me: Error: imagesnap does not have a version “0.2.5” in the Cellar

memming commented 6 years ago

@toshibochan yeah, my trick only works if you have installed 0.2.5 in the past via homebrew. Perhaps just install 0.2.5 manually?

Wandmalfarbe commented 6 years ago

@toshibochan brew switch only switches to a version that was installed previously and is still on your drive. This Stack Overflow post discusses how to install old versions of homebrew formulas. Unfortunately the old formula is not available (and would point to a nonexistent download location).

It seems the only option is to install imagesnap manually then.

toshibochan commented 6 years ago

I was able to download from @friedrichweise link: https://netix.dl.sourceforge.net/project/iharder/imagesnap/ImageSnap-v0.2.5.tgz

And I made 0.2.5 folder inside imagesnap folde and make bin folder in 0.2.5 folder and copy and paste imagesnap to the bin folder and run “brew switch imagesnap 0.2.5. And now work good

erickga commented 6 years ago

I brew uninstalled imagesnap(2.6) and copy paste /usr/local/bin imagesnap v2.5 file and it works now!

JayBrown commented 6 years ago

I always had 0.2.5 installed—v0.2.6 was never available via Homebrew—, and it still doesn't work. Didn't work on El Capitan 10.11.6, and now doesn't work on High Sierra 10.13.5.

EDIT: no, I actually have 0.2.6 installed, but imagesnap itself with imagesnap -h prints 0.2.5 as the version number.

dllahr commented 6 years ago

đź‘Ť I'm having the same issue

edit: I found I had to add the -r 30 option to ffmpeg to get it to work - to set the framerate to 30. I think this is the problem @Sangdol (and possibly others) were having.

Here's the script I used to take images once per second using ffmpeg:

#!/bin/bash

for i in $(seq -f "%04g" 1 3600)
do
    fn=photo_$i.jpg
    echo $i $fn

    ffmpeg -f avfoundation -video_size 1280x720 -r 30 -i "0" -vframes 1 $fn
done