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

Canon 6D #4

Open
claussteinmassl opened this issue Feb 20, 2017 · 13 comments
Open

Canon 6D #4

claussteinmassl opened this issue Feb 20, 2017 · 13 comments

Comments

@claussteinmassl
Copy link

Hey!

I didn't want to hijack the other issue about Canon camera even though the problem might be similar.
When I run QT_QPA_EGLFS_FORCE888=1 ./camera-toolbox I get these errors:

Unable to query physical screen size, defaulting to 100 dpi.
To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
1 cameras detected.
Open camera : "Canon EOS 6D" at port "usb:001,008"
Error : "Unable to get single config shootingmode: Bad parameters"
Error : "Unable to get single config exposurecompensation: Bad parameters"
Start camera thread
Start liveview decoder thread
Idle event: Unknown
Unknown data: PTP Property d194 changed
Error : "Unable to get single config shootingmode: Bad parameters"
Error : "Unable to get single config exposurecompensation: Bad parameters"
Idle event: Unknown
Unknown data: PTP Property d1c3 changed
Error : "Unable to get single config shootingmode: Bad parameters"
Error : "Unable to get single config exposurecompensation: Bad parameters"
Idle event: Unknown
Unknown data: PTP Property d1c7 changed
Error : "Unable to get single config shootingmode: Bad parameters"
Error : "Unable to get single config exposurecompensation: Bad parameters"
Idle event: Unknown

This goes on and on with a similar warning with a different number for the property.

@claussteinmassl
Copy link
Author

I ran gphoto2 --list-all-config since I saw it in the other thread.
I hope this information is helpful to you! :)

canon6d_gphoto_list_all_config.txt

@rlamarche
Copy link
Owner

Thank you for the informations.
I'm gonna need to read the attachment and update the code to use specific Canon 6D parameters.

@rlamarche
Copy link
Owner

Have you tried to use the liveview ?

@claussteinmassl
Copy link
Author

When I first tried a few days ago, the screen went completely black just by starting the camera-toolbox and nothing worked. When I tried again today, the UI opened and the liveview directly on the HDMI-Output of the raspberry pi was working. I got around 22 fps. :)

The MJPEG-Stream isn't working though. It only gives me a lot of crazy symbols if try to view it in my webbrowser (see screenshot). But those symbols are changing fast, so at least there seems to be a stream. :D

bildschirmfoto 2017-02-22 um 23 16 57

Some functions like changing aperture and shutter speed worked!
I tried to capture some images and the camera was doing something (I could hear the mirror flipping), but I couldn't find any files. Where should I look for them?
Recording a video didn't work and threw this error:

Error : "Unable to start record a movie: Bad parameters"

@rlamarche
Copy link
Owner

Ok good news that it's finally working a little ;)

It seems that the browser does not recognize the image format. It's strange because you see the images on the HDMI.

Can you run the command :

curl http://..../api/v1/preview.jpg > preview.jpg

And post here the file preview.jpg ?

This url send 1 preview and return.

@claussteinmassl
Copy link
Author

claussteinmassl commented Feb 25, 2017

Ok, here is the single frame. Why is it only half resolution? I would have expected 1920x1280, but got 960x640.

preview

PS: After some time while running the liveview on the pi camera-toolbox crashed with the error 'Segmentation fault'.

@claussteinmassl
Copy link
Author

I just tried a different webbrowser and the liveview was working!
Until now I had used Safari Version 9.1.2 (11601.7.7) and only got the symbols as mentioned before.
When I open the url in Firefox I can see the mjpeg-stream and it is in nearly perfect sync to the HDMI-Output of the pi. :)

@rlamarche
Copy link
Owner

Ok I think that the image resolution is high and your browser is not as fast as it should or the bandwidth is not enough.
The image resolution is not 1920x1080 because the camera downsize the picture before making it available.
On my D800, preview images are 640x426.
These images are for monitoring only, not for recording.

@rlamarche
Copy link
Owner

Ok I just saw your last message, good news ! Try with chrome also, it would works well.

By the way, can you tell me what's your purpose for using camera-toolbox ? And what features you would need in priority ? Thanks.

@claussteinmassl
Copy link
Author

I'm working on building a photo booth.
It's heart is a Raspberry Pi3. Software is written in Python, UI is Kivy on a touchscreen. Camera will most likely not be the 6D, but some other Canon camera like 700D or something like that.

When the booth's users want's to capture a photo or video I want to show the liveview on the touchscreen, so the users can see themselves while posing. As I would like the liveview to be inside the apps gui, I thought the mjpeg-stream would be good way to integrate this. I haven't tested this yet and maybe this isn't a good idea performance-wise. Maybe you know a smarter way to tackle this?

So my needed features would be:

  1. A way to run camera-toolbox in the background, so my app is shown on the HDMI-output, so I can integrate the liveview in my app.

  2. Livestream: Right know I get around 20-22 fps which I think will be ok. If more was possible, it would be a nice bonus. I don't know if it's possible to reduce the delay even more. Right now it's not much, I think 1 second or even less. So if not possible, it would still be good for this purpose. :)

It would be nice to have the ability to flip the livestream horizontally, so it feels like a mirror when you are in front of the camera and see the livestream. Otherwise it's a bit confusing to pose. :)

  1. Control basic camera functions like shutter, aperture, ISO.
    I think the autofocus isn't triggered right now, even though it normally does when manually taking a picture. Maybe constantly pulling the focus would be a good idea in my case anyway. Otherwise people might only see them out of focus while watching the liveview or capturing a video.

  2. Capture photos and videos while the liveview is active.
    It would be cool if I could set the path where those captured files are stored through the api.

  3. Controll all this from python through the camera toolbox api.
    I have to admit I haven't used swagger before, but as far as I understand this, it will offer me an easy way to integrate the api into my app, instead of doing it all manually. Any hint on how to do this is very much appreciated! :)

I think most of this is already on your current feature list. :)

Yeah, that's my primary goal right now, but I can see a lot of other possible use cases. Maybe using the camera + pi for doing timelapse or using the liveview over wifi to monitor the image. This would be a cheap alternative to using wireless HDMI/SDI transmitters when capturing videos. Or using it together with a motion control rig to trigger the camera.

I'm really, really thankful for your great work! If there is a way where I can donate something let me know.
And if you should come somewhere around here (Düsseldorf, Germany), you're invited to as many beer as you like! ;)

@rlamarche
Copy link
Owner

Hi @claussteinmassl ,

Thank for your answer and sorry for my late answer ;)

Your idea is nice and to be honest I already have had this kind of project in mind (the photobooth).
About the lag, I think that it comes from the network layer.
Do you have a lag while showing on a screen/TV connected directly to the PI ?

I think that my mistake is to use a TCP protocol. I should use UDP to prevent the lag to appear. So the frames would be displayed if ready or no.

Using mjpeg livestream through http/tcp force the network to use a buffer and this way lag appear. Sometimes you can also loose the connection (in case of buffer overflow).

About your project to control the camera from python, I think that the best solution would be to have python bindings for camera-toolbox. I think that it is possible but I've never done that.

Doing this, you could use my camera classes directly and getting preview images directly in binary/jpeg bytearray.

Thank you for your invitation to drink beer, you are right I love it ;)
I keep it in mind in case if I go to Germany !

About donation, I will wait and see if other people would be interested to do this. For the moment, it's a hobby project but I want to make it go further and I need people like you who believe in this project and use it 👍

@claussteinmassl
Copy link
Author

Hey Romain,

sorry for my super late answer! Daily business stopped me from doing anything on my project. :(

I also have the lag while showing the stream directly via HDMI. The network stream and the HDMI output are nearly synced. So I assume the lag is somewhere before the whole network thing.

Using python bindings sounds like a very good idea! I didn't think about this yet. Unfortunately, I don't know any C, so I've got no idea where to start on this right now.... :D

Let me know once you've setup something for donation! :)

@rlamarche
Copy link
Owner

No problem ! I'm discussing on another ticket about the framerate and the possibility to reduce the preview image size to improve it.

It might also reduce the lag maybe, if we succeed in. Here the ticket : #5 (comment)

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