Trouble with GStreamer and taking pictures every 60 seconds using FLIR Lepton

Hello,

I am currently using the NVIDIA Jetson Nano along with the FLIR Lepton Purethermal Breakout Board 2 in an attempt to take pictures every 60 seconds and store them onto my home folder. In order to run a live preview (for testing purposes) I use the following command:

gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! xvimagesink

I am able to view live feed from my FLIR Lepton this way. My main object, however, is to take picture periodically (every 60 seconds). I use the following command to do so yet come into a problem.

gst-launch-1.0 -v videotestsrc is-live=true ! clockoverlay font-desc=\"Sans, 48\" ! videoconvert ! videorate ! video/x-raw,framerate=1/3 ! jpegenc ! multifilesink location=file-%02d.jpg

The problem being that when the picture is saved, it does not capture what the Lepton is looking at and instead just saves pictures of colored bars. I do not know much about gstreamer but is there anything I am missing and need to add or remove from this command, do I need to change it all together in order for me to capture images from my Lepton?

Thank you!

Hi @AumMok,

The second command you are providing uses videotestsrc as the video source, which is a color bar pattern, thats why you are seeing colores bars in the pictures.

You can use the source v4l2src of the first command and the rest the same I think:

gst-launch-1.0 -v v4l2src device=/dev/video0 ! clockoverlay font-desc="Sans, 48" ! videoconvert ! videorate ! video/x raw,framerate=1/3 ! jpegenc ! multifilesink location=file-%02d.jpg

Please tell me how that goes

Best regards,
Roberto Gutierrez
Embedded Software Developer

Hey @robertogs2 ,

Thanks for the fast reply! Unfortunately got an error, I think it is because of the font but I fixed it and got it to work. This is what the command looked like:

gst-launch-1.0 -v v4l2src device=/dev/video0 ! clockoverlay font-desc=\"Sans, 48\" ! videoconvert ! videorate ! video/x-raw,framerate=1/3 ! jpegenc ! multifilesink location=file-%02d.jpg

I do have one minor problem being that it never stops taking pictures, even after I kill the terminal process. Is there anyway I could fix that?

Thank you!
Aum Suthar

Hi Aum,

Does it just keeps taking pictures forever or it stopped after some time?

gst-launch-1.0 should’ve just kill the pipeline alongside with anything each element is doing inside, for example with a Ctrl-C signal.

Best regards,
Roberto

Hey @robertogs2,

Looks like it stopped by pressing Ctrl+C.

Thank you for your help!

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.