-
Notifications
You must be signed in to change notification settings - Fork 70
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
[FEATURE]: Support live preview in windows #526
Comments
Hey and thanks for the report/request. Photobooth uses MediaStreamConstraints to use a webcam/virtual webcam for preview "from device cam". A different way is to use the preview "from URL" using CSS. For the start preview command we only use the OS command line, this could also be a batch file you call on Windows (for Windows small adjustments might be needed inside api/previewCamera.php if validation is active). The preview command is executed independent of the preview mode. In short: If you're able to start the preview via batch file you're able to use the preview "from URL" like this: |
(you could also try the pre-photo command if start Preview command makes trouble) |
Thanks for your reply. Setting the css is a good idea. I'll also have a look in that php file, I think my windows installation is missing pgrep which is used by that script. I also noticed that there is probably a conflict with the running digicamcontrol instance, which is required for the preview, and the capture command, which also wants to access the camera. The digicamcontrol instance needs some startup time, so maybe I'll start it AFTER the photo was taken and kill it before taking the photo.. I'll report back later. |
Yeah, the pgrep would be an issue, but shouldn't be executed if Execute preview commands without validation is enabled (default). Maybe you can call another batch file to kill digiCamControl via stop command? |
And for capture another batch file which will capture See https://www.digicamcontrol.com/doc/userguide/web also for adjusting the default capture folder etc. |
Thanks for the tips. I wrote this simple wrapper which starts the Liveview, captures an image and kills the Liveview. Only the The script can be used like this, if anyone is interested: # start Liveview
python digipy.py cmd LiveViewWnd_Show
# Capture a photo
python digipy.py slc capture %s
# Cancel Liveview
python digipy.py cmd LiveViewWnd_Hide |
Great! Thanks a lot for taking this challenge! About your repo: |
The typo was one problem, yes. 5514 is correct (default in digicamcontrol for the stream). I'm able to view it in the browser, but it crashes sometimes. There are issues in their repo about that, but it's still unfixed (dukus/digiCamControl#403). I'm still working on the digipy wrapper repo and will add everything needed. |
Ok, I found a way better method using the Linux subsystem for windows. I can now use gphoto2 with windows 👍🏻 I will now try to get the preview script working and write everything I did together. |
Great! I asked Benjamin also to write the steps down to install Photobooth from source on Windows too. This way we wouldn't depend on the release packages. |
Where I need to send the camera stream to? I've tried to read the cameracontrol.py script, which seems to send the data via ffmpeg to some device file. I think I need to find another way to get the data out of the wsl box.. |
Possible to make it an stream available via http? |
I think I could make it work with go2rtc. Will try and give feedback :) I looked in the python code and think this could also work....but it's complicated |
Almost there....AlexxIT/go2rtc#871 |
I can't seem to execute the capture command: [cmd] => wsl gphoto2 --capture-image-and-download-filename=C:\Apache24\htdocs\data\tmp\20240111_212300.jpg 2>&1 Fails with Maybe thats why: https://github.com/PhotoboothProject/photobooth/blob/dev/src/PhotoboothCapture.php#L95 I think I need a wrapper script to have more control over this^^ There is something going on with the path, because the backslashes are treated different in linux. Another problem is that the connection to the stream stays alive somehow and so the capture-movie commands keeps therefore running. Is it possible to close the preview connection before taking executing the capture command? |
On Linux we use the cameracontrol.py to start the stream, if that's used we also need to capture via cameracontrol.py |
There's also a docker file, not sure if the USB connected camera can be used there? |
Hm, might worth a try. It's certainly possible in linux, not so sure in windows tho. |
Currently trying to run a python script as the capture command. This is driving me insane. The error tells me it can't execute python3.exe or the script (not sure), but everything seems correct. Edit: Edit2: |
Is your feature request related to a problem?
Yes
Description
Currently the
cameracontrol.py
script relies onpython-gphoto2
which is linux/macos only. It would be cool to have an windows solution too. The digicamcontrol project has the possibility to start a webserver, start the live view and provide access to the stream viahttp://localhost:5513/live
...maybe this can be wrapped in a script.Describe the solution you'd like
A script which makes it possible to have live preview of the dslr. Something like this:
Describe alternatives you've considered
Additional context
No response
The text was updated successfully, but these errors were encountered: