Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.


  Search this Thread
Old 02-24-2012, 04:05 PM   #1
LQ Newbie
Registered: Feb 2012
Posts: 1

Rep: Reputation: Disabled
v4l2 video capture example

hi all,,

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 yo use circular buffer that captures video and when it is full,new data will overwrite old one

there is a flag that when raised,capturing continues for 10 seconds then stops,the video that is saved to sd-card should contains 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

but there are some points that I can't understand or don't know if i understand it correctly

1-in this example,there are 4 frame buffers,each buffer can hold one frame. Is this right?

2-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?

3- 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

3- How can I adjust the fps in this code ? or I should write the value in the camera registers?

4-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?

5- can I write these raw data in the buffer to a file .yuv? , I found some software that can play videos of this format

6- 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

Last edited by R.Eman; 02-25-2012 at 04:22 PM.
Old 05-25-2012, 12:07 AM   #2
linda lin
LQ Newbie
Registered: May 2012
Posts: 6

Rep: Reputation: Disabled

Forlinx could help users who is enthusiastic in Linux embedded board to resolve questions, we will provide you excellent after-sales service if you have purchased our products. we are the real manufacturer in China which could provide you most preferential price and perfect real time technical support.if you have any demands,please visit the web:, or you could directly email to for more quires.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to capture picture from V4L2 webcam? weiweif Programming 10 08-06-2013 04:17 AM
Exact time of image capture and Unicap library for video capture devices Dstruct0 Programming 3 09-10-2011 07:34 PM
v4l2: empty screen with capture device Dr_Death_UAE Linux - General 2 06-23-2010 03:55 PM
V4L2 image capture problem c0deland Linux - Software 4 12-12-2008 05:19 AM
How to V4L2, Video Outputt Device Sourabh Linux - Newbie 0 02-15-2007 08:20 AM > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 04:47 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration