05 2024 档案
摘要:方法1:命令保存 # 保存bmp图片 ffmpeg -i input.mp4 -vf scale=768:432 picture/%d.bmp # 播放 ffplay picture/87.bmp 方法2:代码保存 main.c #include "libavutil/log.h" #include
阅读全文
摘要:方法1:命令修改颜色空间 # 修改颜色空间 ffmpeg -i input.mp4 -s 1280*1024 -pix_fmt rgb24 output.rgb # 播放 ffplay -s 1280*1024 -pix_fmt rgb24 output.rgb 方法2:代码转换 main.c #i
阅读全文
摘要:方法1:命令修改分辨率 # 修改分辨率 ffmpeg -i input.mp4 -vf scale=1280:1024 -f rawvideo output.yuv # 播放 ffplay -s 1280*1024 -pix_fmt yuv420p output.yuv 方法2:代码转换 main.
阅读全文
摘要:方法1:命令解码 # 解码命令 ffmpeg -i input.mp4 -f rawvideo output.yuv # 播放命令 ffplay -s 720x1280 -pix_fmt yuv420p output.yuv 方法2:代码解码 main.c #include "libavutil/l
阅读全文
摘要:方法1:命令截取 # 裁剪视频 -t支持数字和HH:MM:SS格式,数字格式是时长,从起始到指定时长,HH:MM:SS格式是结束时间,也可以通过 -ss 给出一个开始时间,-to 给出结束时间 ffmpeg -i input_video.mp4 -t 5 output_video.mp4 ffmpe
阅读全文
摘要:main.c #include "libavutil/log.h" #include "libavformat/avformat.h" #include "libavutil/avutil.h" #include "libavcodec/avcodec.h" int main(int argc, c
阅读全文
摘要:方法1:命令转换 ffmpeg -i input.mp4 output.flv 方法2:代码转换 main.c #include "libavutil/log.h" #include "libavformat/avformat.h" #include "libavutil/avutil.h" #in
阅读全文
摘要:方法1:命令提取 ffmpeg -i input.mp4 -an -vcodec copy out.h264 ffmpeg -i input.mp4 -an -vcodec copy -bsf: h264_mp4toannexb out1.h264 方法2:代码提取 main.c #include
阅读全文
摘要:方法1:通过命令提取 ffmpeg -i input.mp4 -vn -acodec aac ../output.aac 方法2:通过代码提取 流程图 main.c #include "libavutil/log.h" #include "libavformat/avformat.h" #inclu
阅读全文
摘要:方式1:通过命令获取 ffprobe ../input.mp4 方式2:代码获取 main.c #include "libavutil/log.h" #include "libavformat/avformat.h" int main(int argc,char **argv){ av_log_se
阅读全文
摘要:avutil:核心工具库,基础模块之一,提供了hash器、编解码器等工具函数。 avformat:文件格式和协议库,封装了Protoco1层和Demuxer、Muxer层。 avcodec:编解码库,封装了codec层,提供接口,支持第三方的codec以插件方式添加。 avfilter:音视频滤镜库
阅读全文
摘要:规则(Rules):一个Makefile文件由一条一条的规则构成,一条规则结构如下 target … (目标): prerequisites …(依赖) recipe(方法) … … 最简单的Makefile hello: hello.cpp g++ hello.cpp -o hello # 开头必
阅读全文
摘要:#通过ffmpeg查看文件属性,使用参数-hide_banner隐藏ffmpeg本身信息 ffmpeg -i video_file.mp4 -hide_banner # 格式转换,使用 -qscale 0 来保留原始的视频质量 ffmpeg -i video_input.wav -qscale 0
阅读全文
摘要:# 查看多媒体数据包 ffprobe -show_packets -show_data testVideo.flv # 查看封装格式 ffprobe -show_formrat testvideo.flv # 查看视频文件的帧信息 ffprobe -show_frames testvideo.flv
阅读全文
摘要:ffmpeg -i input.flv output.mp4
阅读全文