Our use case is to capture images/snapshots on demand, which is very similar to nvgstcapture when “j” clicked.
As we go through the sample code and create our own pipeline basically just running
capbin → cap_tee → ienc_q → svc_imgbin → img_bin
with copying the part of trigger_image_capture() and the callback cam_image_captured().
We couldn’t figure out how to start the pipeline and keep it in an idle mode (if that’s the right word). Like in nvgstcapture, only when “j” clicked, there is a frame captured and go through the pipeline.
But in our own application, there are frames going through the pipeline constantly. We’ve checked “mode” for nvtee, and “intent”/“trigger” for nvcamerasrc, but still coudn’t figure out.
Update:
I guess my question is how to turn off the auto-capture after the pipeline runs. Capturing only on-demand.
I edit the title.
Hi Michael,
The pipeline is continuous jpeg encoding. I misunderstood your usecase.
So in your application, do you use nvcamerasrc? The element nvcamerasrc implements intent and trigger properties for on-demand jpeg encoding. If you don’t use nvcamerasrc, the function may not work.
Yes, we use nvcamerasrc and its properties intent/trigger trying to duplicate what nvgstcapture does when “j” clicked. While nvgstcapture pass a sinlge frame, our pipeline continuously has data. We are trying to figure out how to idle the pipeline. Thanks a lot for the reply.
Thanks for the sample. It captures two images when frame_count = 123/168 in each run.
When it’s not saving the frame to a jpeg, there are still data/frame running in the pipeline which is similar to what our application does.
My question is, is it possbile to idle/freeze the pipeline after “GST_STATE_PLAYING”, during which no data running. Until user sends request, then there is a single frame/buffer passsing through the pipeline and saved to a jpg.
“nvgstcapture” seems to like that, but we couldn’t figure out the trick at this moment.
Hi Michael,
You can build full nvgstcapture and remove the part not required in your usecase. There are four source pads in nvtee: pre_src, img_src, vid_src, vsnap_src. Looks like vid_src and vsnap_src are not required in your usecase.