
FFmpeg/Libav基础库
FFmpeg 是媒体处理的基石,流媒体的半壁江山。掌握FFmpeg是每一个音视频开发者的入门首选和必选项。
优惠券已抵扣
余额抵扣
还需支付
¥29.90
¥99.00
购买须知?
本专栏为图文内容,最终完结不会低于15篇文章。
订阅专栏,享有专栏所有文章阅读权限。
本专栏为虚拟产品,一经付款概不退款,敬请谅解。
等风来不如迎风去
音视频行业深耕多年,熟悉会议、直播、RTC,对在线教育、娱乐秀场等音视频端到端技术及系统架构有深入研究
展开
-
【obs】x264_encoder_encode 编码输出pts dts和 framesize
x264_encoder_encode原创 2022-07-27 12:25:40 · 56 阅读 · 0 评论 -
【FFmpeg】avformat_find_stream_info 帧率探测
【ffmpeg】 Setting r_frame_rate num 120,den 1 是发生在 avformat_find_stream_info 过程中的帧率探测结果。不可信赖的tb 则需探测帧率tb_unreliableAV_CODEC_ID_MPEG2VIDEO 和 AV_CODEC_ID_H264 都需要探测帧率。这是在快速接受中的值之间进行平衡的启发式方法MPEG-2 通常滥用字段重复标志来存储不同的帧速率。还有一些“可变”的 fps 文件也需要检测。/* ..原创 2022-05-08 17:19:33 · 223 阅读 · 0 评论 -
【ffmpeg】 Setting r_frame_rate num 120,den 1
ffmepg 统计的r frame rate 是一个帧率的公倍数所以会有24 和 10 ,得到帧率 12030和25 得到150 的情况使用阿里云的cicadplayer 可以播放 一个ts 看看结果,ffmpeg版本 4.2.1 ,这是cicadplayer里的:全部采用ffmpeg 的api 打开一个http ts网络下载的ts ,可能是变下边播放的22-05-08 10:30:17.046 0 0 D [1.6] [avFormatDemuxer]269: [avFormat..原创 2022-05-08 10:49:11 · 343 阅读 · 0 评论 -
【FFmpeg】没有平均fps,计算音视频 pkt duration
音频包duration的计算大小 * 1000000 (1000K) / 采样率 AVCodecParameters *codecpar = mCtx->streams[pkt->stream_index]->codecpar; if (codecpar->sample_rate > 0 && codecpar->frame_size > 0) { pkt-&.原创 2022-05-02 15:27:26 · 2196 阅读 · 0 评论 -
【ffmpeg】CasparCG Server 帧率、duration的处理
CasparCG ServerCasparCG Server看起来是支持混画、转码的专业图形图像服务器。Thank you for your interest in CasparCG Server, a professional software used to play out and record professional graphics, audio and video to multiple outputs. CasparCG Server has been in 24/7 b原创 2022-05-02 13:27:35 · 1072 阅读 · 0 评论 -
【ffprobe】查看TS : 视频和音频的pts、dts;查看文件的音频包/视频包总数
ffprobe查看时间戳大神的命令行查看视频dtsffprobe -show_packets -select_streams v 1549465385_4706.ts | grep dts_time查看视频ptsffprobe -show_packets -select_streams v 1549465385_4706.ts | grep pts_time音频时间戳 DTSzhangbin@LAPTOP-F1POBCSR MINGW64 /d/Download$..原创 2022-04-29 16:23:40 · 267 阅读 · 0 评论 -
【h.264】 SPS写入timing相关及openh264实现
vui 写入http://h264bitstream.sourceforge.net/doxygen/0.1.5/h264__stream_8c-source.htmlBsWriteUElog2_max_frame_num_minus4 读取写入 log2_max_frame_num_minus4https://www.codeleading.com/article/87445516826/30fps- fParsedFrameRate=time_s.原创 2022-04-24 01:25:44 · 153 阅读 · 0 评论 -
【无标题】
Understand H.264 Time CodePosted on January 30, 2011 by MotoSMPTE12M specifies time code counting rules only for broadcast frame rates such as 29.97 fps. We can calculate the timing information from time code with the knowledge of frame rate and the ti原创 2022-04-24 01:24:40 · 119 阅读 · 0 评论 -
【H.264】SPS 解析
LiveRtspClient+Gpac保存MP4文件https://codeantenna.com/a/MdIlXRTs8xVUI 解析https://github.com/GPUOpen-LibrariesAndSDKs/AMF/blob/master/amf/public/samples/CPPSamples/common/BitStreamParserH264.cppVUI 最关键的就是帧率相关了 // VUI bool timing_info_pr.原创 2022-04-24 00:54:18 · 176 阅读 · 0 评论 -
【openh264】meson_x86_vs2022: test项目及新建YUV编码264测试exe
meson_x86_vs2022重新构建已启动重新生成…1>------ 已启动全部重新生成: 项目: REGEN, 配置: debug Win32 ------1>Checking whether solution needs to be regenerated.1>Everything is up-to-date, regeneration of build files is not needed.2>------ 已启动全部重新生成: 项目: libpr原创 2022-04-23 21:05:06 · 188 阅读 · 0 评论 -
【openh264】cmake: msopenh264-static
owtAdding docker support for basic example #101run the this script ./source/agent/video/install_openh264.sh,FindOpenH264.cmakemsopenh264cmakeFindOpenH264.cmake############################################################################# Fi原创 2022-04-23 00:52:41 · 886 阅读 · 0 评论 -
【HLS】可变帧率和固定帧率拉流
固定帧率 Duration: N/A, start: 44246.143744, bitrate: N/A Program 0 Metadata: variant_bitrate : 0 Stream #0:0, 21, 1/90000: Video: h264 (Constrained Baseline), 1 reference frame ([27][0][0][0] / 0x001B), yuv420p(left), 640x480, 0/1, 25 fps,.原创 2022-04-21 23:37:10 · 141 阅读 · 0 评论 -
【openh264】SPS的 timing_info_present_flag
看起来timing_info_present_flag 编码器直接false啊这是不写入啊编码器直接不写入啊解码器支持vui 解析 ,如num_units_in_tickG:\LAS\A264\cc_openh264\meson_x86_vs2022\codec\decoder\core\src\au_parser.cpp WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //timing_info_pre..原创 2022-04-21 21:14:30 · 177 阅读 · 0 评论 -
【H.264】H.264 解析 工具、web解析
h264-frame-viewerH264 PARSE a Web version在线解析Based on h264bitstream and inspired by H264Naked.Done by compiling h264bitstream into WebAssembly and building a simple UI on top of it.Output information for NAL units is taken from H264Naked at the m..原创 2022-04-21 21:11:24 · 274 阅读 · 0 评论 -
【TS】 windows : TS DEMUX
## Processing TS stream from D:\Download\625d5c80ea07bc001675877c-common-1080p-1650288302811.ts ##(TSDemux)TSDemux::AVContext::configure_ts: packet size is 188(TSDemux)TSDemux::AVContext::parse_ts_psi: new PAT version 0(TSDemux)TSDemux::AVContext::cle..原创 2022-04-21 19:07:45 · 104 阅读 · 0 评论 -
【FFmpeg】命令行
ffmpeg-commands.sh# To extract the sound from a video and save it as MP3:ffmpeg -i <video.mp4> -vn <sound>.mp3# To convert frames from a video or GIF into individual numbered images:ffmpeg -i <video.mpg|video.gif> <frame_%d.png..原创 2022-04-21 17:25:25 · 99 阅读 · 0 评论 -
【H.264】SPS 计算帧率方法
FFmpeg 帧率要从解码器获取才是正途FFmpeg(三) 编解码相关函数理解_weixin_33966095的博客-程序员信息网static double r2d(AVRational r){ return r.num==0||r.den == 0 ? 0 :(double)r.num/(double)r.den;} fps = r2d(as->avg_frame_rate);#include <jni.h>#include <stri.原创 2022-04-21 11:16:44 · 167 阅读 · 0 评论 -
【H.264】简单编码器及SPS
THE H.264 SEQUENCE PARAMETER SETTHE H.264 SEQUENCE PARAMETER SETThe H.264/AVC reference software JM 19.0.the Sequence Parameter Set (SPS) and the Picture Parameter Set (PPS).This is a follow-up to my World’s Smallest H.264 Encoder post. I’ve r原创 2022-04-21 11:09:09 · 65 阅读 · 0 评论 -
【FFmpeg】avg_frame_rate 计算 及在TS 中使用
根据r_frame_rate计算avg_frame_rate ?G:\FFmpeg\ffmpeg-5.0.1\libavformat\demux.cvoid ff_rfps_calculate(AVFormatContext *ic){ for (unsigned i = 0; i < ic->nb_streams; i++) { AVStream *const st = ic->streams[i]; FFStream *const .原创 2022-04-20 01:27:30 · 259 阅读 · 0 评论 -
【FFmpeg】dump stream format 里的时间基准
static void dump_s12m_timecode(void *ctx, const AVStream *st, const AVPacketSideData *sd) { const uint32_t *tc = (const uint32_t *)sd->data; if ((sd->size != sizeof(uint32_t) * 4) || (tc[0] > 3)) { av_log(ctx, AV_LOG_ER...原创 2022-04-18 23:55:10 · 64 阅读 · 0 评论 -
【FFprobe】直接读取TS文件 的stream信息
【FFprobe】直接读取http-flv的metadata使用同样的命令,读取ts的metadata 信息TS的metadatazhangbin@LAPTOP-F1POBCSR MINGW64 /d/Download$ ffprobe -v quiet -print_format json -show_format -show_streams -show_error -show_chapters https://dev.zhblive.com:1080/hls/625d5c80...原创 2022-04-18 23:39:02 · 148 阅读 · 0 评论 -
【ffmpeg】curl : m3u8 to mkv
大神的命令行download_m3u8.sh 使用curl#!/usr/bin/env bashif [ "$#" -ne 2 ] ; then echo "USAGE: $0 <m3u8_url> <out_file>"; exitfibase=$(echo "$1" | rev | cut -d'/' -f2- | rev)curl -s $1 | grep -v "^#" | sed -e "s>^>$base/>" | xargs..原创 2022-04-18 22:08:15 · 68 阅读 · 0 评论 -
【openh264】chrome的openh264
chromium / external / github.com / cisco / openh264 / HEAD升级到2.2.0原创 2022-03-23 20:04:14 · 215 阅读 · 0 评论 -
【ffmpeg】flv1转码h264且降低分辨率
【ffmpeg】flv1转码h264 在此基础上,转分辨率。参考 A quick guide to using FFmpeg to convert media files420p-vf format=yuv420p chooses YUV 4:2:0 chroma-subsampling which is recommended for H.264 compatibility.Influencing the qualityNow that we have a handle on t..原创 2022-03-23 12:09:47 · 343 阅读 · 0 评论 -
【ffmpeg】flv1转码h264
视频转h264,音频copyzhangbin@LAPTOP-F1POBCSR MINGW64 /g/LAS/las/transcode/screencast (master)$ ffmpeg -i screencast-15fps-20220323_111452.flv -c:v libx264 -c:a copy screencast-15fps-X264-20220323_111452.flvffmpeg version n4.4.1-ffmpeg-windows-build-help.原创 2022-03-23 11:45:42 · 226 阅读 · 0 评论 -
【openh264】H.264 常用选项解释说明
h264-advanced-guideopenh264 给出的profile ID/*** @brief Enumerate the type of profile id*/typedef enum { PRO_UNKNOWN = 0, PRO_BASELINE = 66, PRO_MAIN = 77, PRO_EXTENDED = 88, PRO_HIGH = 100, PRO_HIGH10 = 110, PRO_HIGH4.原创 2022-03-22 00:07:39 · 156 阅读 · 0 评论 -
【openh264】一些参数相互影响的打印
openh264 一些参数相互影响的打印Monitor(0) info: 3840x2160Monitor(1) info: 1920x1080DXGI Screen capture start, monitor index: 1[libx264 @ 034344c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2[libx264 @ 034344c0] profile Constrained B.原创 2022-03-10 23:06:29 · 125 阅读 · 0 评论 -
【openh264】meson构建生成vs x64 工程
C:\Program Files\Microsoft Visual Studio\2022\Enterprise>G:G:>cd G:\LAS\A264\cc_openh264\meson_vs2022x64 nativemeson setup builddir --backend vs2022原创 2022-03-08 00:20:52 · 146 阅读 · 0 评论 -
【openh264】meson windows构建
【openh264】WelsEncoder vs2022 构建【openh264】python3.10 安装mesonninja 也有了webrtc 安装后有的?meson builddir然后:nasmC:\Program Files\NASM设置代理,不下载gtest了?export https_proxy=http://127.0.0.1:7890export http_proxy=http://127.0.0.1:7890export a..原创 2022-03-07 23:47:26 · 449 阅读 · 0 评论 -
【openh264】libavcodec 支持libopenh264编码
libavcodec 对openh264的支持https://github.com/FFmpeg/FFmpeg/tree/master/libavcodec日志回调 WelsTraceCallback#ifndef AVCODEC_LIBOPENH264_H#define AVCODEC_LIBOPENH264_H#define OPENH264_VER_AT_LEAST(maj, min) \ ((OPENH264_MAJOR > (maj)) || \ .原创 2022-03-07 16:52:17 · 117 阅读 · 0 评论 -
【googletest】gtest项目windows vs2022 构建
googletest 本身支持cmake构建应该可以方便的输出windows工程就使用了vs2022 和x64 构建-打开了test sample啥的报错了去掉还是报错去掉gmockgtest项目原创 2022-03-07 15:05:49 · 262 阅读 · 0 评论 -
【openh264】WelsEncoder vs2022 构建
WelsEncoder sln 直接构建官方给出了 source 目录下有测试的控制台工程我复制了两份代码,一份是ubuntu下构建,一份是win下构建。ubuntu目录下试试已启动生成…1>------ 已启动生成: 项目: WelsVP, 配置: Debug x64 ------1>Performing Custom Build Tools1>Performing Custom Build Tools1>Performing Custom..原创 2022-03-07 14:40:50 · 64 阅读 · 0 评论 -
【ubuntu18.04】meson 安装 及python升级python3.9
发现openh264 支持meson发现openh264 支持meson写的也太简单了完全不知道openh264 到底怎么搞meson看起来支持windows和ubuntu先安装python3参考大神:注意:meson安装前必须确认是否已经安装python3.5及以上版本;因为meson依赖于python3和ninja1 安装python3和ninja:sudo apt-get install python3 python3-pip ninja-build发现pytho原创 2022-03-06 21:35:46 · 814 阅读 · 0 评论 -
【openh264】编码参数
VideoEncoder.cppVideoEncoder.cpp //获取默认参数 ppEncoder->GetDefaultParams(¶mExt); ECOMPLEXITY_MODE complexityMode = HIGH_COMPLEXITY; RC_MODES rc_mode = RC_BITRATE_MODE; bool bEnableAdaptiveQuant = false; //TODO 这里暂时写死,需要外.原创 2022-03-04 17:15:13 · 89 阅读 · 0 评论 -
【H.264】nalu解析
Yaka 项目NALU 判断//// H264Common.h// Yaka//// Created by Enki on 2019/10/9.// Copyright © 2019 Enki. All rights reserved.//#ifndef H264Common_h#define H264Common_hnamespace H264 {// The size of a full NALU start sequence {0 0 0 1}, use..原创 2022-03-04 16:50:36 · 55 阅读 · 0 评论 -
【openh264】YUV测试源
https://github.com/MozillaSecurity/openh264fuzz/tree/master/resourceshttps://github.com/gongluck/media/tree/64218c62f1d42768a324131dcd28c49027fb0c2e原创 2022-03-04 16:49:17 · 80 阅读 · 0 评论 -
【openh264】编码例子
例子大神音视频文章: https://github.com/gongluck/AnalysisAVP/blob/5cd6313263850dcb7d04fe83e249f30460096852/%E9%9F%B3%E8%A7%86%E9%A2%91%E6%A1%86%E6%9E%B6.md#windows%E7%BC%96%E8%AF%91-2提供了一个openh264的使用例子:/* * @Author: gongluck * @Date: 2021-05-26 11:51:14 .原创 2022-03-03 00:25:26 · 760 阅读 · 0 评论 -
【openh264】不跳帧实现CBR
API : https://github.com/cisco/openh264/blob/master/codec/api/svc/codec_api.hCBR support without skipping frames #3260CBR support without skipping frames #3260ISVCEncoderHello. I have tried to use the ISVCEncoder with low bitrate, like 100Kbps t..原创 2022-03-02 22:43:54 · 80 阅读 · 0 评论 -
【docker】ffmpeg本地转码三路推srs
疯掉了root@bb4207a83566:/usr/local/srs/objs# ./ffmpeg/bin/ffmpeg -i 2mi.flv ffmpeg version N-60236-gffb000fff8-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2022 the FFmpeg developers built with gcc 8 (Debian 8.3.0-6) configuration: -.原创 2022-02-15 18:48:02 · 719 阅读 · 0 评论 -
【FFmpeg】【转载】图像拼接:画中画连麦
所谓画中画就是在一个视频里面再播放另一个小一点的视频。连麦是互动直播的一种产品形式,是在主播直播的时候,观众发起连线,其他观众能看到主播画面的右下角有连线观众的画面,同时听到主播和连线观众的语音。转载大神教程大神 高级水印 实验素材:ad_inner.mp4: 分辨率只有180x120,一定要小于外面的视频,不然就看不出两个ad_BQ.mp4: 分辨率是720x480画中画会出现在左上角ffmpeg -i ad_BQ.mp4 -vf "movie=ad_inner.mp4[inn..转载 2022-02-15 16:10:47 · 132 阅读 · 0 评论