资源简介
ffmpeg摄像头数据h264编码并封装avi
http://blog.csdn.net/jklinux/article/details/72478004
代码片段和文件信息
/*
* avilib.c
*
* Copyright (C) Thomas streich - June 2001
* multiple audio track support Copyright (C) 2002 Thomas streich
*
* 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 endi
相关资源
- JM阅读笔记(学习H264)
- h264 ip核,经过asic验证
- Behaviors of fatigue crack propagation in fric
- Navicat Keygen Patch v5.6.0 DFoX
- Navicat V11全系列注册机
- Investigation on the present situation of envi
- nginx-rtmp-win32-master.rar
- WinAVI 8.0 绿色中文版
- Analytical behaviour of concrete-encased CFST
- Global existence and behavior in thehigher-dim
- PatchNavicat11.0.10破解文件亲测可用
- Behavior Designer 1.6.3(u2018.3.0).unitypa
- navicat注册机含详细使用说明
- FFMEPG实现h264解码
- ffmpegh265rtmp.zip
- H264标准的详细图解
- RTMP_H265推流直播技术研讨
- 电子-GravityI2C3.7V锂电池电量计stm32L1
- Navicat 完整版 (Mac 破解版,亲试成功
- ffserver(windows下编译32位)
- qt_ffmpeg_mp4_export_and_import.zip
- 最简单的基于FFmpeg的推流器 1.2
- 简单的ffmpeg推流demo
- FFmpeg和SDL,读内存中的视频流,进行
- ffmpeg之pcm转AAC
- Google DeepMind的David Silver的强化学习课
- ffmpeg-2.8.14.tar.gz
- 利用ffmpeg的filter混音
- vs2010 ffmpeg实时解码h264码流
- ffmpeg 音视频转码代码
评论
共有 条评论