FFmpeg简介1

news/2024/7/10 19:12:08 标签: ffmpeg

适逢FFmpeg6.1发布,准备深入学习下FFmpeg,将会写下系列学习记录。

在此列出主要学习资料,后续再不列,感谢这些大神的探路和分享,特别是雷神,致敬!

《FFmpeg从入门到精通》

《深入理解FFmpeg》

雷霄骅_FFMPEG,FFmpeg,视频质量评价-CSDN博客

Documentation (ffmpeg.org)

chatGPT

1、FFmpeg组成

命令行工具ffmpeg主命令行工具
ffplay基于SDL的播放器
ffprobe获取多媒体信息
基础库libavcodec编解码库
libavformat封装、解封库
libavfilter滤镜库
libavdevice多媒体输入/输出设备
libavutil通用工具
libswresample音频转换
libswscale图像转换
libpostproclibavfilter后期效果处理

2、FFmpeg支持

  • 源代码中查看支持情况

                  ./configure --list-encoders

查看编码器支持
./configure --list-decoders查看解码器支持
./configure --list-muxers查看封装支持
./configure --list-demuxers查看解封装支持
./configure --list-protocols查看通信协议支持

  • 编译好的FFmpeg中查看支持情况
ffmpeg -codecs查看全部编解码器
ffmpeg -encoders查看编码器
ffmpeg -decoders查看解码器
ffmpeg -filters查看滤镜
ffmpeg --help full查看全部信息

                ffmpeg -h encoder/decoder

                /muxer/demuxer/filter=xxx

查看具体参数

3、常用指令(需要啥功能问chatGPT是最好的)

  • 提取音频流

ffmpeg -i in.mp4 -vn -acodec copy out.aac

  • 提取H264视频流

ffmpeg -i in.mp4 -vcodec copy -an out.h264

  • 提取H265视频流

ffmpeg -i in.mp4 -vcodec copy -an -bsf hevc_mp4toannexb -f hevc out.hevc

  • 添加滤镜效果

ffmpeg -i input -vf filter_name=parameters output

4、使用FFmpeg

命令行直接使用编译出的三个程序即可。

二次开发则需要编译出的库,在下面博文介绍了编译方法。

适用于嵌入式arm的ffmpeg编解码-CSDN博客

这里看下我编译出来的文件如下图

可以发现install中有四个文件夹:

bin: 命令行程序

include: 头文件

lib: 共享库

share: 例程及文档

再看一下install中具体的文件树:

├── bin
│   ├── ffmpeg
│   ├── ffplay
│   └── ffprobe
├── include
│   ├── libavcodec
│   │   ├── ac3_parser.h
│   │   ├── adts_parser.h
│   │   ├── avcodec.h
│   │   ├── avdct.h
│   │   ├── avfft.h
│   │   ├── bsf.h
│   │   ├── codec_desc.h
│   │   ├── codec.h
│   │   ├── codec_id.h
│   │   ├── codec_par.h
│   │   ├── d3d11va.h
│   │   ├── defs.h
│   │   ├── dirac.h
│   │   ├── dv_profile.h
│   │   ├── dxva2.h
│   │   ├── jni.h
│   │   ├── mediacodec.h
│   │   ├── packet.h
│   │   ├── qsv.h
│   │   ├── vdpau.h
│   │   ├── version.h
│   │   ├── version_major.h
│   │   ├── videotoolbox.h
│   │   ├── vorbis_parser.h
│   │   └── xvmc.h
│   ├── libavdevice
│   │   ├── avdevice.h
│   │   ├── version.h
│   │   └── version_major.h
│   ├── libavfilter
│   │   ├── avfilter.h
│   │   ├── buffersink.h
│   │   ├── buffersrc.h
│   │   ├── version.h
│   │   └── version_major.h
│   ├── libavformat
│   │   ├── avformat.h
│   │   ├── avio.h
│   │   ├── version.h
│   │   └── version_major.h
│   ├── libavutil
│   │   ├── adler32.h
│   │   ├── aes_ctr.h
│   │   ├── aes.h
│   │   ├── ambient_viewing_environment.h
│   │   ├── attributes.h
│   │   ├── audio_fifo.h
│   │   ├── avassert.h
│   │   ├── avconfig.h
│   │   ├── avstring.h
│   │   ├── avutil.h
│   │   ├── base64.h
│   │   ├── blowfish.h
│   │   ├── bprint.h
│   │   ├── bswap.h
│   │   ├── buffer.h
│   │   ├── camellia.h
│   │   ├── cast5.h
│   │   ├── channel_layout.h
│   │   ├── common.h
│   │   ├── cpu.h
│   │   ├── crc.h
│   │   ├── csp.h
│   │   ├── des.h
│   │   ├── detection_bbox.h
│   │   ├── dict.h
│   │   ├── display.h
│   │   ├── dovi_meta.h
│   │   ├── downmix_info.h
│   │   ├── encryption_info.h
│   │   ├── error.h
│   │   ├── eval.h
│   │   ├── executor.h
│   │   ├── ffversion.h
│   │   ├── fifo.h
│   │   ├── file.h
│   │   ├── film_grain_params.h
│   │   ├── frame.h
│   │   ├── hash.h
│   │   ├── hdr_dynamic_metadata.h
│   │   ├── hdr_dynamic_vivid_metadata.h
│   │   ├── hmac.h
│   │   ├── hwcontext_cuda.h
│   │   ├── hwcontext_d3d11va.h
│   │   ├── hwcontext_drm.h
│   │   ├── hwcontext_dxva2.h
│   │   ├── hwcontext.h
│   │   ├── hwcontext_mediacodec.h
│   │   ├── hwcontext_opencl.h
│   │   ├── hwcontext_qsv.h
│   │   ├── hwcontext_vaapi.h
│   │   ├── hwcontext_vdpau.h
│   │   ├── hwcontext_videotoolbox.h
│   │   ├── hwcontext_vulkan.h
│   │   ├── imgutils.h
│   │   ├── intfloat.h
│   │   ├── intreadwrite.h
│   │   ├── lfg.h
│   │   ├── log.h
│   │   ├── lzo.h
│   │   ├── macros.h
│   │   ├── mastering_display_metadata.h
│   │   ├── mathematics.h
│   │   ├── md5.h
│   │   ├── mem.h
│   │   ├── motion_vector.h
│   │   ├── murmur3.h
│   │   ├── opt.h
│   │   ├── parseutils.h
│   │   ├── pixdesc.h
│   │   ├── pixelutils.h
│   │   ├── pixfmt.h
│   │   ├── random_seed.h
│   │   ├── rational.h
│   │   ├── rc4.h
│   │   ├── replaygain.h
│   │   ├── ripemd.h
│   │   ├── samplefmt.h
│   │   ├── sha512.h
│   │   ├── sha.h
│   │   ├── spherical.h
│   │   ├── stereo3d.h
│   │   ├── tea.h
│   │   ├── threadmessage.h
│   │   ├── timecode.h
│   │   ├── time.h
│   │   ├── timestamp.h
│   │   ├── tree.h
│   │   ├── twofish.h
│   │   ├── tx.h
│   │   ├── uuid.h
│   │   ├── version.h
│   │   ├── video_enc_params.h
│   │   ├── video_hint.h
│   │   └── xtea.h
│   ├── libswresample
│   │   ├── swresample.h
│   │   ├── version.h
│   │   └── version_major.h
│   └── libswscale
│       ├── swscale.h
│       ├── version.h
│       └── version_major.h
├── lib
│   ├── libavcodec.so -> libavcodec.so.60.31.102
│   ├── libavcodec.so.60 -> libavcodec.so.60.31.102
│   ├── libavcodec.so.60.31.102
│   ├── libavdevice.so -> libavdevice.so.60.3.100
│   ├── libavdevice.so.60 -> libavdevice.so.60.3.100
│   ├── libavdevice.so.60.3.100
│   ├── libavfilter.so -> libavfilter.so.9.12.100
│   ├── libavfilter.so.9 -> libavfilter.so.9.12.100
│   ├── libavfilter.so.9.12.100
│   ├── libavformat.so -> libavformat.so.60.16.100
│   ├── libavformat.so.60 -> libavformat.so.60.16.100
│   ├── libavformat.so.60.16.100
│   ├── libavutil.so -> libavutil.so.58.29.100
│   ├── libavutil.so.58 -> libavutil.so.58.29.100
│   ├── libavutil.so.58.29.100
│   ├── libswresample.so -> libswresample.so.4.12.100
│   ├── libswresample.so.4 -> libswresample.so.4.12.100
│   ├── libswresample.so.4.12.100
│   ├── libswscale.so -> libswscale.so.7.5.100
│   ├── libswscale.so.7 -> libswscale.so.7.5.100
│   ├── libswscale.so.7.5.100
│   └── pkgconfig
│       ├── libavcodec.pc
│       ├── libavdevice.pc
│       ├── libavfilter.pc
│       ├── libavformat.pc
│       ├── libavutil.pc
│       ├── libswresample.pc
│       └── libswscale.pc
└── share
    ├── ffmpeg
    │   ├── examples
    │   │   ├── avio_http_serve_files.c
    │   │   ├── avio_list_dir.c
    │   │   ├── avio_read_callback.c
    │   │   ├── decode_audio.c
    │   │   ├── decode_filter_audio.c
    │   │   ├── decode_filter_video.c
    │   │   ├── decode_video.c
    │   │   ├── demux_decode.c
    │   │   ├── encode_audio.c
    │   │   ├── encode_video.c
    │   │   ├── extract_mvs.c
    │   │   ├── filter_audio.c
    │   │   ├── hw_decode.c
    │   │   ├── Makefile
    │   │   ├── mux.c
    │   │   ├── qsv_decode.c
    │   │   ├── qsv_transcode.c
    │   │   ├── README
    │   │   ├── remux.c
    │   │   ├── resample_audio.c
    │   │   ├── scale_video.c
    │   │   ├── show_metadata.c
    │   │   ├── transcode_aac.c
    │   │   ├── transcode.c
    │   │   ├── vaapi_encode.c
    │   │   └── vaapi_transcode.c
    │   ├── ffprobe.xsd
    │   ├── libvpx-1080p50_60.ffpreset
    │   ├── libvpx-1080p.ffpreset
    │   ├── libvpx-360p.ffpreset
    │   ├── libvpx-720p50_60.ffpreset
    │   └── libvpx-720p.ffpreset
    └── man
        ├── man1
        │   ├── ffmpeg.1
        │   ├── ffmpeg-all.1
        │   ├── ffmpeg-bitstream-filters.1
        │   ├── ffmpeg-codecs.1
        │   ├── ffmpeg-devices.1
        │   ├── ffmpeg-filters.1
        │   ├── ffmpeg-formats.1
        │   ├── ffmpeg-protocols.1
        │   ├── ffmpeg-resampler.1
        │   ├── ffmpeg-scaler.1
        │   ├── ffmpeg-utils.1
        │   ├── ffplay.1
        │   ├── ffplay-all.1
        │   ├── ffprobe.1
        │   └── ffprobe-all.1
        └── man3
            ├── libavcodec.3
            ├── libavdevice.3
            ├── libavfilter.3
            ├── libavformat.3
            ├── libavutil.3
            ├── libswresample.3
            └── libswscale.3

        以前在某个地方看到说so库的后缀中可以看到版本号,从ffmpeg的lib中看到这个不一致,也就是这个规则不存在的。

        拿到这个install文件,实际就相当于一个ffmpeg的sdk了,利用它就开发自己的程序了。重点看看头文件中的函数,究竟给我们提供了怎样的接口函数、怎么使用就是难点了。


http://www.niftyadmin.cn/n/5174415.html

相关文章

Javaweb之javascript的小案例的详细解析

1.5.4 案例 1.5.4.1 需求说明 鲁迅说的好,光说不练假把式,光练不说傻把式。所以接下来我们需要通过案例来加强对于上述DOM知识的掌握。需求如下3个: 点亮灯泡 将所有的div标签的标签体内容后面加上:very good 使所有的复选框呈现被选中的…

NestJS——基于Node.js 服务器端应用程序的开发框架

文章目录 前言什么是 NestJS? 一、NestJS特性?二、使用步骤Typescript 知识后端开发基本知识新建项目目录结构 前言 Nestjs中文文档 什么是 NestJS? Nest (NestJS) 是一个用于构建高效、可扩展的 Node.js 服务器端应用程序的开发框架。它利用…

Git Commit 之道:规范化 Commit Message 写作指南

1 commit message 规范 commit message格式都包括三部分&#xff1a;Header&#xff0c;Body和Footer <type>(<scope>): <subject><body><footer>Header是必需的&#xff0c;Body和Footer则可以省略 1.1 Header Type&#xff08;必需&#xf…

C语言——贪吃蛇

一. 游戏效果 贪吃蛇 二. 游戏背景 贪吃蛇是久负盛名的游戏&#xff0c;它也和俄罗斯⽅块&#xff0c;扫雷等游戏位列经典游戏的⾏列。 贪吃蛇起源于1977年的投币式墙壁游戏《Blockade》&#xff0c;后移植到各种平台上。具体如下&#xff1a; 起源。1977年&#xff0c;投币式…

HDU 1027:Ignatius and the Princess II ← next_permutation()

【题目来源】http://acm.hdu.edu.cn/showproblem.php?pid1027【题目描述】 Now our hero finds the door to the BEelzebub feng5166. He opens the door and finds feng5166 is about to kill our pretty Princess. But now the BEelzebub has to beat our hero first. feng5…

【可解释AI】Alibi explain: 解释机器学习模型的算法

Alibi explain: 解释机器学习模型的算法 可解释人工智能简介Alibi特点算法Library设计展望参考资料 今天介绍Alibi Explain&#xff0c;一个开源Python库&#xff0c;用于解释机器学习模型的预测(https://github.com/SeldonIO/alibi)。该库具有最先进的分类和回归模型可解释性算…

LiteVNA 能做什么?

最近入手了一台 LiteVNA 设备&#xff0c;性价比非常高。因为之前没有接触过 VNA 这种测试仪器&#xff0c;所以准备好好研究一下。和它类似的一个项目是 NanoVNA6000&#xff0c;价格要高些&#xff0c;但可能性能要好点&#xff0c;另外&#xff0c;文档也要全一些。 VNA …

Producer

Producer开发样例 版本说明 新客 户端, 从Kafka 0.9.x 开始, client基于Java语言实现。同时提供C/C, Python等其他客户端实现。 开发步骤 配置客户端参数以及创建客户端实例;构建待发送消息;发送消息;关闭生产者实例; 代码示例 public class KafkaProducer {public stati…