scrion
Posts: 2
Joined: Fri Jul 18, 2014 6:16 pm

Streaming and Taking picture

Fri Jul 18, 2014 6:20 pm

Hey guys, I was wondering if if it's possible to take picture with the camera while it is streaming?

I get this when trying to take an image white streaming:mmal: mmal_vc_component_enable: failed to enable component: ENOSPC
mmal: camera component couldn't be enabled
mmal: main: Failed to create camera component
mmal: Failed to run camera app. Please check for firmware updates

ThankS!

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6899
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Streaming and Taking picture

Fri Jul 18, 2014 8:28 pm

If you're trying to run raspistill whilst raspivid (or equivalent) is already running and streaming, then expect it to fail. The camera only supports a single client at a time.

If you amend the raspivid code to include an image_encode component and triggering the capture, then it would work but currently will interrupt the streaming briefly whilst the full res image is captured. There is the intent to sort out stills capture during encode without interruption (but would limit the input resolution to whatever encode is running with), but it's not happened yet.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
waveform80
Posts: 303
Joined: Mon Sep 23, 2013 1:28 pm
Location: Manchester, UK

Re: Streaming and Taking picture

Sat Jul 19, 2014 9:04 pm

scrion wrote:Hey guys, I was wondering if if it's possible to take picture with the camera while it is streaming?

I get this when trying to take an image white streaming:mmal: mmal_vc_component_enable: failed to enable component: ENOSPC
mmal: camera component couldn't be enabled
mmal: main: Failed to create camera component
mmal: Failed to run camera app. Please check for firmware updates

ThankS!
There's a recipe in the picamera docs for capturing images whilst recording video (picamera uses a splitter in the MMAL pipeline to implement this functionality).

Dave.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6899
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Streaming and Taking picture

Sun Jul 20, 2014 8:19 am

waveform80 wrote:There's a recipe in the picamera docs for capturing images whilst recording video (picamera uses a splitter in the MMAL pipeline to implement this functionality).

Dave.
That's one way, but loses EXIF and forces the resolution. Really must find the time to sort out real video snapshot with all the bells and whistles.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
waveform80
Posts: 303
Joined: Mon Sep 23, 2013 1:28 pm
Location: Manchester, UK

Re: Streaming and Taking picture

Sun Jul 20, 2014 1:53 pm

6by9 wrote:
waveform80 wrote:There's a recipe in the picamera docs for capturing images whilst recording video (picamera uses a splitter in the MMAL pipeline to implement this functionality).

Dave.
That's one way, but loses EXIF and forces the resolution. Really must find the time to sort out real video snapshot with all the bells and whistles.
Yes, certainly no way of getting the EXIF without opaque encoding on the still port (at least that I've discovered yet). For the resolution, one could use a high resolution for the camera, stick a resizer in front of the video encoder and then capture images at the higher resolution (someone's been doing that recently in a ticket on picamera's github).

Dave.

gregd72002_
Posts: 49
Joined: Mon Apr 14, 2014 8:50 am

Re: Streaming and Taking picture

Thu Feb 05, 2015 3:19 pm

Hi, has there been any progress on this, is it now possible?
Thanks,

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6899
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Streaming and Taking picture

Thu Feb 05, 2015 3:45 pm

gregd72002_ wrote:Hi, has there been any progress on this, is it now possible?
Thanks,
Not within raspivid, mainly due to Broadcom having shed all the main engineers (including me) who were working on Pi and related projects. I don't know what waveform80 has been up to with PiCcamera.
It's still on my to-do list, but time to play is limited.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Zombievirus
Posts: 19
Joined: Sun Sep 20, 2015 5:44 am

Re: Streaming and Taking picture

Fri Oct 23, 2015 9:24 pm

Hi,

Has there been any progress in this regard?

I already have a stream running via UV4L. Below the stream i want to have 2 buttons. Capture Image and Record Video. All while streaming.

If i use raspistill or raspivid the stream stops and resumes again after the picture has been taken or the video recorded.

Thank You.

Ahmer07
Posts: 9
Joined: Wed Dec 20, 2017 7:24 pm

Re: Streaming and Taking picture

Tue Nov 20, 2018 10:19 am

Zombievirus wrote:
Fri Oct 23, 2015 9:24 pm

I already have a stream running via UV4L. Below the stream i want to have 2 buttons. Capture Image and Record Video. All while streaming.

If i use raspistill or raspivid the stream stops and resumes again after the picture has been taken or the video recorded.

Thank You.
How did you achieve this? Please refer to code or any related link. I have a similar project. Thanks in advance.

alexthemanzano
Posts: 1
Joined: Tue Jun 25, 2019 4:54 am

Re: Streaming and Taking picture

Tue Jun 25, 2019 5:35 pm

You can give this a try. Web stream and picture taking.
:idea: :idea: :idea: :arrow:
https://www.youtube.com/watch?v=gqv1_-f2H98

Return to “Camera board”