当前位置: 首页 > news >正文

标识公司建设优化网站

标识公司,建设优化网站,免费pc 微网站模板,负责网站的建设规划avi 视频的视频流编码必须是jpeg&#xff0c;或者mjpg 直接用摄像头录取的视频都是这两种格式&#xff0c;不能用ffmpeg转成avi的视频。 #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <stdlib.…

avi 视频的视频流编码必须是jpeg,或者mjpg

直接用摄像头录取的视频都是这两种格式,不能用ffmpeg转成avi的视频。

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <linux/videodev2.h>
#include <string.h>
#include <sys/mman.h>
static int zz=1;int main(void){struct strf{unsigned char id[4];             //块ID,固定为strfunsigned int size;               //块大小,等于struct avi_strf_chunk去掉id和size的大小unsigned int size1;              //size1含义和值同size一样unsigned int width;              //视频主窗口宽度(单位:像素)unsigned int height;             //视频主窗口高度(单位:像素)unsigned short planes;           //始终为1unsigned short bitcount;         //每个像素占的位数,只能是1、4、8、16、24和32中的一个unsigned char compression[4];    //视频流编码格式,如JPEG、MJPG等unsigned int image_size;         //视频图像大小,等于width * height * bitcount / 8unsigned int x_pixels_per_meter; //显示设备的水平分辨率,设为0即可unsigned int y_pixels_per_meter; //显示设备的垂直分辨率,设为0即可unsigned int num_colors;         //含义不清楚,设为0即可unsigned int imp_colors;         //含义不清楚,设为0即可}str;FILE *f=fopen("/home/wzpc/Videos/tra_mjpg.avi","rb");            //必须是JPEG,MJPG格式的aviif(f==NULL){puts("file error");exit(-1);}fseek(f,0,SEEK_END);int fsize=ftell(f);fseek(f,0,SEEK_SET);int fd=fileno(f);char *m=mmap(NULL,fsize,PROT_READ,MAP_SHARED,fd,0);for(int t=0;t<fsize;t++){if((m[t]=='s')&&(m[t+1]=='t')&&(m[t+2]=='r')&&(m[t+3]=='f')){memcpy(&str,&m[t],sizeof(str));printf("%d\n",str.bitcount);printf("%s\n",str.compression);printf("%d*%d\n",str.width,str.height);char r[]={'M','J','P','G'};                 //avi 编码必须是jpeg,mjpgchar r1[]={'J','P','E','G'};int bj=memcmp(str.compression,r,4);int bj1=memcmp(str.compression,r1,4);if((bj==0)||(bj1==0)){zz=0;}}}if(zz!=0){puts("no zc");exit(-1);}for(int t=0;t<fsize;t++){if((m[t]=='0')&&(m[t+1]=='0')&&(m[t+2]=='d')&&(m[t+3]=='c')){char file[10]={};sprintf(file,"%d",t);chdir("/home/wzpc/Pictures/pic_avi");    //存储图片的目录FILE * fo=fopen(file,"w+b");if(fo==NULL){puts("fo error");exit(-1);}int k;memcpy(&k,&m[t+4],4);fwrite(&m[t+8],k,1,fo);                //直接从mmap中读数据到文件fclose(fo);}}munmap(m,fsize);return 0;
}

 

 

http://www.hkea.cn/news/176891/

相关文章:

  • 做网站接广告赚钱么凡科建站和华为云哪个好
  • 成都网站建设科技公seo营销外包公司
  • 重庆有哪些做网站 小程序的百度搜索引擎的特点
  • 仁怀哪里可以做网站自动秒收录网
  • 重庆市建设局网站推广软件一键发送
  • 合肥网络推广网络运营网站seo诊断分析和优化方案
  • 网站优化公司免费咨询sem优化推广
  • 个人做网站赚钱么宁波seo推荐推广平台
  • 员工支付做网站的费用分录成都营销型网站制作
  • 专业做网站的公司邢台专业做网站关键词搜索优化
  • 电商网站建设方案模板杭州百度首页优化
  • 网站建设服务价格东莞市网站建设
  • 网站开发所需要的的环境佛山网络推广哪里好
  • php网站的优点关键路径
  • 电子政务与网站建设 总结湖南网站推广
  • 境外网站做网站涉黄互联网媒体广告公司
  • 河南做网站公司汉狮怎么做蛋糕
  • 哈 做网站网店代运营收费
  • 制作网页的三大技术是什么郑州seo顾问
  • 网站建设报价流程行业网站网址
  • 提供邯郸做wap网站网页推广方案
  • 网站从域名广告营销公司
  • 网站链接的常见形式免费广告网
  • 微信微网站开发教程百度大数据平台
  • 网站服务设计引流推广是什么意思
  • 学校网站建设管理办法本周新闻热点事件
  • 网站移动版怎么做网站创建公司
  • wordpress 微商城模板下载地址苏州seo推广
  • 珠海网站哪家好百度com百度一下你
  • wordpress wp.net网络优化工程师是做什么的