collecting raw images and video using c-code

Hi, I would just like to use the video.c and capture-dualcam.c code to capture jpg images and video files. Whenever I run that code, it captures the real time image okay but then freezes the rpi4 when closing. I end up having to restart the rpi4 by cutting the power out and then back on. How do I prevent the crashing???

Also, if i want to make a change the c code and then re-compile, I would run:

gcc video.c -o video ???

I look forward to hearing from you!

Best,

Tom

 

Hello,

Don’t worry and I will try my best to help you.

About freeze the PI4 you said. Can you attach me a video demo? I will help you check it in detail.

If you want to add a new or modify a c code demo. you should add compile support in the Makefile file which is in the MIPI_Camera?RPI path.

Then you just need to run make to compile all the demos.

Let me know if you need more help.

Hi Bin,

When I run the video using:

usleep(1000 * 1000 * 10);

on line 121 of video.c, the video runs okay and saves okay.

When I change it to:

usleep(5000 * 1000 * 10);

It freezes. Ideally I want to be able to use the video.c file to create a video however long I need based on a gtk+ gui push button. Also, how could I modify the video.c file to run indefinitely?

Best,

 

Tom

Hi Bin, I am attaching an image of what happens when it freezes. I am also interested in runningg an infinite loop for the video.c. What lines of code can i add or change to do that?

Hi Bin,

The RPI freezes after the second time I ran video.c. Here is a pic of what the command window looked like. I am also interested in running the video in an infinite while loop until I press q. Could you let me know how I can modify the code to do that?

Hi Bin,

The RPI freezes after the second time I ran video.c. Here is a pic of what the command window looked like. I am also interested in running the video in an infinite while loop until I press q. Could you let me know how I can modify the code to do that?

Hi,

I have help you write a demo code about loop encoding until you press ‘q’ to exit.

Please try it and let me know if you need more help.