Wow, why haven't I found that before, that's brilliant!
I can already now see several solutions:
- Feed ffmpeg through a named pipe with YUV video data.
This might be the solution with the lowest latency. Since I couldn't figure out jet, how the image data from CHDK PTP looks like, I don't know how easy it will be to convert data and if that even will be necessary.
- Put the image from the camera directly into a named pipe and use -loop_input on ffmpeg side.
Since ffmpeg can convert a hell lot of different formats, this would be a quite easy solution. Also, I wouldn't have to take care of anything related to the framerate. The latency shouldn't play a big role in this case either.
- Same solution as above, just with files instead of pipes.
High latency, especially on a RPI, since everything goes through a SD card. But at least a plan-B.
I'm quite happy with this, since it saves me quite a lot of coding work.
Now to the getting-image-data-from-camera part.
It appears to be very hard to figure out how this could work. While browsing through the source of
chdkptp I found some indications on, that it actually could be YUV data (YAY!). But I havn't fully understood the code jet, so I'm not sure.
Also, I'm not sure if CHDKPTP will work with our EOS cameras. PTPcam does, but that doesn't mean that CHDKPTP does!? There is no real documentation about anything here
A random linkI'll keep you up to date
EDIT: If i would choose to go for the 3rd solution, everything would be quite easy. I could use CHDKPTP -dumpframes in order to save the frame into a file. Almost too easy to be true. I'll give it a try and see the latency. But since I currently don't have access to my own computer nor the RPI, things will have to wait.
dumpframes [options] [file]: - dump camera display frames to file
file: optional output file name, defaults to chdk_<pid>_<date>_<time>.lvdump
options:
-count=<N> number of frames to dump
-wait=<N> wait N ms between frames
-novp don't get viewfinder data
-nobm don't get ui overlay data
-nopal don't get palette for ui overlay
-quiet don't print progress
EDIT2: The lag of documentation doesn't make things easier. Look what I found in PTPcam source: live_view_get_data(); Is there a feature in PTPcam I'm note aware of?