资源简介
(之前代码有几句话没改,做了一下修改,下载了我之前代码的人,应该做一下删除那几句话就可以了,如果还有问题,发邮件147355624@qq.com,我给你新代码)该项目是linux下基于V4L2实现,有视频采集(MJPEG,+YUYV2格式,运行代码选择MJPEG格式,可根据自身需要修改),显示(将摄像头信息显示到屏幕上),JPG图片保存。(代码默认从图像信息缓存中直接导入QT类中显示(效率较高),也可以保存为图片,一帧一帧显示,效率较低,供自己选择),若要得到图片,代码有getpicture()接口,可直接调用。(如果大家在使用的时候遇到一些问题,可以发邮件到147355624@qq.com,可以交流一下是什么问题。)
代码片段和文件信息
/*
* avilib.c
*
* Copyright (C) Thomas 謘treich - June 2001
* multiple audio track support Copyright (C) 2002 Thomas 謘treich
*
* Original code:
* Copyright (C) 1999 Rainer Johanni
*
* This file is part of transcode a linux video stream processing tool
*
* transcode is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 or (at your option)
* any later version.
*
* transcode is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Make; see the file COPYING. If not write to
* the Free Software Foundation 675 Mass Ave Cambridge MA 02139 USA.
*
*/
//SLM
#ifdef WIN32
#include
#define ftruncate _chsize
#define strncasecmp _strnicmp
typedef int ssize_t;
#endif
#ifdef __CYGWIN__
#include
#endif
#include “avilib.h“
//#include
#define INFO_LIST
/* The following variable indicates the kind of error */
long AVI_errno = 0;
#define MAX_INFO_STRLEN 64
static char id_str[MAX_INFO_STRLEN];
#define frame_RATE_SCALE 1000000
/*******************************************************************
* *
* Utilities for writing an AVI File *
* *
*******************************************************************/
static size_t avi_read(int fd char *buf size_t len)
{
size_t n = 0;
size_t r = 0;
while (r < len) {
n = read (fd buf + r len - r);
if ((ssize_t)n <= 0)
return r;
r += n;
}
return r;
}
static size_t avi_write (int fd char *buf size_t len)
{
size_t n = 0;
size_t r = 0;
while (r < len) {
n = write (fd buf + r len - r);
if ((ssize_t)n < 0)
return n;
r += n;
}
return r;
}
/* HEADERBYTES: The number of bytes to reserve for the header */
#define HEADERBYTES 2048
/* AVI_MAX_LEN: The maximum length of an AVI file we stay a bit below
the 2GB limit (Remember: 2*10^9 is smaller than 2 GB) */
#define AVI_MAX_LEN (UINT_MAX-(1<<20)*16-HEADERBYTES)
#define PAD_EVEN(x) ( ((x)+1) & ~1 )
/* Copy n into dst as a 4 byte little endian number.
Should also work on big endian machines */
static void long2str(unsigned char *dst int n)
{
dst[0] = (n )&0xff;
dst[1] = (n>> 8)&0xff;
dst[2] = (n>>16)&0xff;
dst[3] = (n>>24)&0xff;
}
/* Convert a string of 4 or 2 bytes to a number
also working on big endian machines */
static unsigned long str2ulong(unsigned char *str)
{
return ( str[0] | (str[1]<<8) | (str[2]<<1
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
I.A.... 23558 2014-11-20 12:26 uvcView111\111.jpg
I.A.... 52953 2015-11-26 15:09 uvcView111\avilib.c
I.A.... 11659 2015-11-26 15:09 uvcView111\avilib.h
I.A.... 4012 2015-11-26 15:09 uvcView111\color.c
I.A.... 2902 2015-11-26 15:09 uvcView111\color.h
I.A.... 2259 2015-11-26 15:09 uvcView111\dynctrl-logitech.h
I.A.... 5652 2015-11-26 15:09 uvcView111\huffman.h
I.A.... 42576 2015-11-26 15:09 uvcView111\luvcview.c
I.A.... 1237 2015-12-24 11:22 uvcView111\main.cpp
I.A.... 2283 2015-11-26 15:09 uvcView111\moc_tmainwnd.cpp
I.A.... 3448 2015-12-24 11:27 uvcView111\tmainwnd.cpp
I.A.... 849 2015-11-27 09:02 uvcView111\tmainwnd.h
I.A.... 29117 2015-11-30 09:24 uvcView111\utils.c
I.A.... 2464 2015-11-30 08:51 uvcView111\utils.h
I.A.... 362 2015-11-26 15:09 uvcView111\uvcView.pro
I.A.... 13114 2015-12-26 12:32 uvcView111\uvcView.pro.user
I.A.... 13022 2015-12-24 11:16 uvcView111\uvcView.pro.user.dc08273
I.A.... 58684 2015-11-26 15:09 uvcView111\uvcView___这是arm可执行文件
I.A.... 35989 2015-11-30 11:34 uvcView111\v4l2uvc.c
I.A.... 4273 2015-11-30 11:41 uvcView111\v4l2uvc.h
I.A.... 895 2015-11-26 15:09 uvcView111\说明.txt
I..D... 0 2015-12-26 12:32 uvcView111
----------- --------- ---------- ----- ----
311308 22
相关资源
- 嵌入式视频采集外文翻译
- 使用Linux的V4L2读取摄像头数据+Opencv图
- SAA7113H在视频采集接口设计中的应用
- v4l2 qt实时显示摄像头数据未使用ope
- V4L2视频采集与h264编码
- 火车头优酷视频采集规则.rar
- 基于mini2440的USB视频采集
- linux下v4l2实现图片采集
- 基于QT的V4L2摄像头视频采集并显示
- tiny4412 + qtopia + v4l2 + usb camera
- 福凯威5100系列采集卡驱动软件 v2016
- 福凯威FKW1304采集卡驱动软件 v2016 官方
- 福凯威FKW1700采集卡驱动软件 v2016 官方
- Linux Media Subsystem Documentation
- F407+XC6SLX9视频采集显示板原理图及P
- 视频采集
- 冒死上传公司车载设备源码 支持gp
- V4L2+FFMPEG+live555实现流媒体服务端
- Qt4摄像头视频采集
- LINUX下采集视频数据并编码为H264项目
- Linux 下V4l2摄像头采集图片,实现yuy
- 利用opencv在arm9上实现USB摄像头视频采
- linux v4l2视频采集教程
- TI OMAP3 ISP驱动整体框架、流程整理分
- 基于V4l2的uvc摄像头视频录像代码avi
- linux下v4l2视频采集源代码
- Labview 视频采集部分代码
- 视频采集录像和回放
- Linux 下 v4l2 和 Qt 连接usb摄像头
- UVC驱动抓图测试程序--基于V4L2
评论
共有 条评论