this is my first post here and I hope I can find some help
I'm working on embedded linux on samsung ok6410 board and ov9650 cmos camera
I have to capture a video and save it on a SD-card
I want to use a circular buffer that captures video and, when it is full, allow new data will overwrite the old.
There is a flag that, when raised, capturing continues for 10 seconds then stops. The video is saved to sd-card should contain the 10 seconds before raising the flag and 10 seconds after raising.
I read the capture example on the official site of v4l2 API specifications here
http://free-electrons.com/kerneldoc/latest/video4linux/API.html
but there are some points that I can't understand or don't know if i understand it correctly
In this example,there are 4 frame buffers,each buffer can hold one frame. Is this right?
There is a variable (frame_count)that is initialized to 70,does this mean that by finishing this program I will have a video that contains 70 frames?
What do the fns (main loop) and (read frame) do? I know what they should do but can't understand the written code ,the loops..etc
How can I adjust the fps in this code ? or I should write the value in the camera registers?
After capturing the video I will have a buffer that is filled with raw data, I want to compress it or use codecs to save it as MPEG , can I change the pixel format to be compressed (MPEG for example) instead of YUYV? or what should I do to compress the video? codecs or what?
Can I write these raw data in the buffer to a file .yuv? I found some software that can play videos of this format.
Is it possible to use circular buffers instead of linear buffers to hold the captured video?
I know that my post is too long but I'm a newbie and can't find any tutorials that can help me to write my code.
thanks in advance