/*
* copyright (c) 2001 Fabrice Bellard
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_AVCODEC_H
#define AVCODEC_AVCODEC_H
/**
* @file
* @ingroup libavc
* Libavcodec external API header
*/
#include "libavutil/samplefmt.h"
#include "libavutil/attributes.h"
#include "libavutil/avutil.h"
#include "libavutil/buffer.h"
#include "libavutil/dict.h"
#include "libavutil/frame.h"
#include "libavutil/log.h"
#include "libavutil/pixfmt.h"
#include "libavutil/rational.h"
#include "codec.h"
#include "codec_desc.h"
#include "codec_par.h"
#include "codec_id.h"
#include "defs.h"
#include "packet.h"
#include "version.h"
/**
* @defgroup libavc libavcodec
* Encoding/Decoding Library
*
* @{
*
* @defgroup lavc_decoding Decoding
* @{
* @}
*
* @defgroup lavc_encoding Encoding
* @{
* @}
*
* @defgroup lavc_codec Codecs
* @{
* @defgroup lavc_codec_native Native Codecs
* @{
* @}
* @defgroup lavc_codec_wrappers External library wrappers
* @{
* @}
* @defgroup lavc_codec_hwaccel Hardware Accelerators bridge
* @{
* @}
* @}
* @defgroup lavc_internal Internal
* @{
* @}
* @}
*/
/**
* @ingroup libavc
* @defgroup lavc_encdec send/receive encoding and decoding API overview
* @{
*
* The avcodec_send_packet()/avcodec_receive_frame()/avcodec_send_frame()/
* avcodec_receive_packet() functions provide an encode/decode API, which
* decouples input and output.
*
* The API is very similar for encoding/decoding and audio/video, and works as
* follows:
* - Set up and open the AVCodecContext as usual.
* - Send valid input:
* - For decoding, call avcodec_send_packet() to give the decoder raw
* compressed data in an AVPacket.
* - For encoding, call avcodec_send_frame() to give the encoder an AVFrame
* containing uncompressed audio or video.
*
* In both cases, it is recommended that AVPackets and AVFrames are
* refcounted, or libavcodec might have to copy the input data. (libavformat
* always returns refcounted AVPackets, and av_frame_get_buffer() allocates
* refcounted AVFrames.)
* - Receive output in a loop. Periodically call one of the avcodec_receive_*()
* functions and process their output:
* - For decoding, call avcodec_receive_frame(). On success, it will return
* an AVFrame containing uncompressed audio or video data.
* - For encoding, call avcodec_receive_packet(). On success, it will return
* an AVPacket with a compressed frame.
*
* Repeat this call until it returns AVERROR(EAGAIN) or an error. The
* AVERROR(EAGAIN) return value means that new input data is required to
* return new output. In this case, continue with sending input. For each
* input frame/packet, the codec will typically return 1 output frame/packet,
* but it can also be 0 or more than 1.
*
* At the beginning of decoding or encoding, the codec might accept multiple
* input frames/packets without returning a frame, until its internal buffers
* are filled. This situation is handled transparently if you follow the steps
* outlined above.
*
* In theory, sending input can result in EAGAIN - this should happen only if
* not all output was received. You can use this to structure alternative decode
* or encode loops other than the one suggested above. For example, you could
* try sending new input on each iteration, and try to receive output if that
* returns EAGAIN.
*
* End of stream situations. These require "flushing" (aka draining) the codec,
* as the codec might buffer multiple frames or packets internally for
* performance or out of necessity (consider B-frames).
* This is handled as follows:
* - Instead of valid input, send NULL to the avcodec_send_packet() (decoding)
* or avcodec_send_frame() (encoding) functions. This will enter draining
* mode.
* - Call avcodec_receive_frame() (decoding) or avcodec_receive_packet()
* (encoding) in a loop until AVERROR_EOF is returned. The functions will
* not return AVERROR(EAGAIN), unless you forgot to enter draining mode.
* - Before decoding can be resumed again, the codec has to be reset with
* avcodec_flush_buffers().
*
* Using the API as outlined above is highly recommended. But it is also
* possible to call functions outside of this rigid schema. For example, you can
* call avcodec_send_packet() repeatedly without calling
* avcodec_receive_frame(). In this case, avcodec_send_packet() will succeed
* until the codec's internal buffer has been filled up (which is typically of
* size 1 per output frame, after initial input), and then reject input with
* AVERROR(EAGAIN). Once it starts rejecting input, you have no choice but to
* read at least some output.
*
* Not all codecs will follow a rigid and predictable dataflow; the only
* guarantee is that an AVERROR(EAGAIN) return value on a send/receive call on
* one end implies that a receive/send call on the other end will succeed, or
* at least will not fail with AVERROR(EAGAIN). In general, no codec will
* permit unlimited buffering of input or output.
*
* A codec is not allowed to return AVERROR(EAGAIN) for both sending and receiving. This
* would be an invalid state, which could put the codec user into an endless
* loop. The API has no concept of time either: it cannot happen that trying to
* do avcodec_send_packet() results in AVERROR(EAGAIN), but a repeated call 1 second
* later accepts the packet (with no other receive/flush API calls involved).
* The API is a strict state machine, and the passage of time is not supposed
* to influence it. Some timing-dependent behavior might still be deemed
* acceptable in certain cases. But it must never result in both send/receive
* returning EAGAIN at the same time at any point. It must also absolutely be
* avoided that the current state is "unstable" and can "flip-flop" between
* the send/receive APIs allowing progress. For example, it's not allowed that
* the codec randomly decides that it actually wants to consume a packet now
* instead of returning a frame, after it just returned AVERROR(EAGAIN) on an
* avcodec_send_packet() call.
* @}
*/
/**
* @defgroup lavc_core Core functions/structures.
* @ingroup libavc
*
* Basic definitions, functions for querying libavcodec capabilities,
* allocating core structures, etc.
* @{
*/
/**
* @ingroup lavc_encoding
* minimum encoding buffer size
* Used to avoid some checks during header writing.
*/
#define AV_INPUT_BUFFER_MIN_SIZE 16384
/**
* @ingroup lavc_encoding
*/
typedef struct RcOverride{
int start_frame;
int end_frame;
int qscale; // If this is 0 then quality_factor will be used instead.
float quality_factor;
} RcOverride;
/* encoding support
These flags can be passed in AVCodecContext.flags before initialization.
Note: Not everything is supported yet.
*/
/**
* Allow decoders to produce frames with data planes that are not aligned
* to CPU requirements (e.g. due to cropping).
*/
#define AV_CODEC_FLAG_UNALIGNED (1 << 0)
/**
* Use fixed qscale.
*/
#define AV_CODEC_FLAG_QSCALE (1 << 1)
/**
*
FFmpeg编译32位版本,下载直接开发引用

FFmpeg是一款开源的多媒体处理工具,它包含了音频和视频的编码、解码、转换、流媒体等功能,广泛应用于音视频处理领域。对于开发者而言,直接使用预编译的库文件可以简化开发流程,但有时为了特定平台或配置的兼容性,可能需要手动编译FFmpeg。本篇文章将详细介绍如何在32位系统上编译FFmpeg,以及编译过程中可能遇到的问题和解决方法。
你需要获取FFmpeg的源代码。通常,你可以从FFmpeg的官方网站或者GitHub仓库下载最新版本的源代码。下载完成后,解压到一个适当的目录。
编译FFmpeg的过程分为以下几个步骤:
1. **设置环境**:确保你的系统已经安装了必要的编译工具,如GCC编译器、Make等。对于32位系统,可能还需要安装32位的交叉编译工具链,例如在64位Linux系统上编译32位FFmpeg,需要安装`g++-multilib`和`gcc-multilib`。
2. **配置**:进入FFmpeg源代码目录,运行`./configure`命令进行配置。在这个阶段,你需要指定目标体系结构,比如`--target-os=linux --arch=i686`,以及你想要包含的组件和编译选项。例如,如果你需要支持某些特定的编解码器,可以通过`--enable-libxxx`来开启。
3. **编译**:配置完成后,使用`make`命令开始编译过程。这可能需要一段时间,因为FFmpeg包含了众多的编解码器和库。
4. **安装**:编译成功后,使用`make install`命令将编译好的库文件和可执行程序安装到系统路径。如果希望安装到非标准位置,可以添加`--prefix=/your/install/path`选项。
5. **测试**:安装完毕后,可以运行`ffmpeg`命令来检查是否能够正常执行,并通过`ffmpeg -h`查看帮助信息,确认各种编解码器和功能是否可用。
在编译过程中,可能会遇到一些问题,例如依赖库不完整、配置选项错误等。为了解决这些问题,你需要查阅FFmpeg的官方文档、编译错误信息,甚至参与社区讨论寻求帮助。此外,注意保持源代码和编译工具的更新,以获取最新的修复和优化。
本文提供的`ffmpegbak`压缩包,可能是编译好的32位FFmpeg库文件,对于不想自行编译的开发者来说,可以直接使用。在使用前,需要确保与你的开发环境兼容,并正确链接到项目中。
虽然编译FFmpeg可能相对复杂,但了解并掌握这一过程能让你更好地理解和定制FFmpeg,以满足特定的项目需求。同时,分享已编译好的库文件也是对开发者社区的一种贡献,可以帮助他人节省时间和精力。

艰苦奋斗_Ay
- 粉丝: 0
最新资源
- 支路电气介数Matlab仿真研究:HVDC、FACTS(TCSC与UPFC)模型的选择与对比 · Matlab仿真 参考
- 我的自己总结的知识点总结
- 基于GA遗传优化的混合发电系统(Matlab)优化配置算法:风力、光伏与蓄电池发电
- 基于PI控制的PMSM永磁同步电机Simulink建模与仿真技术研究 - Matlab2022a版
- 基于PSO优化的MPPT光伏发电系统Simulink仿真:构建与优化详解 · MATLAB 文档
- 基于MATLAB的车辆行驶控制运动学模型建模与仿真及其应用 - MATLAB (2025-07-28)
- 基于Simulink的Flyback反激型电路建模与仿真:Matlab 2022a版全流程解析
- 电力系统负荷损失与潮流计算matlab仿真下的节点攻击对比研究:最高度数、最高介数及最高关键度的停电规模评估
- 100KW三相光伏并网逆变器设计方案:原理图、PCB、源码及元器件详解 故障保护 深度版
- 基于Copula函数的风光联合场景生成与K-means聚类削减算法研究
- COMSOL冻土水热耦合模型:PDE建模与降水入渗的入门指南
- 基于springboot的车辆充电桩系统_join1375.zip
- ADC建模与数字校准:基于MATLAB的模数转换器及模拟IC设计实践教程
- 基于SMIC18EE工艺的24位高精度Sigma Delta ADC调制器电路设计学习包
- 复现OEA顶刊论文:紧聚焦矢量光束激发纳米颗粒MIe散射物理模型,多极分解与任意矢量光设置和激发
- 基于FLAC3D点安全系数法的边坡安全系数计算与软件内置强度折减法的对比分析 · FLAC3D 2025版