当前位置: 首页 > news >正文

利用ffmpeg分析视频流

ffprobe -show_packets -i "rtsp://192.168.61.46:8554/live?channel=0&type=0":该命令用于显示 RTSP 流中的数据包信息,例如时间戳、大小、持续时间等。

ffprobe -i "rtsp://192.168.61.46:8554/live?channel=0&type=0":该命令用于显示输入 RTSP 流的基本信息,例如时长、编解码器、分辨率等。

ffprobe -show_format -i "rtsp://192.168.61.46:8554/live?channel=0&type=0":该命令用于显示输入 RTSP 流的格式信息,例如容器格式、音视频流信息等。

ffprobe -show_frames -i "rtsp://192.168.61.46:8554/live?channel=0&type=0":该命令用于显示输入 RTSP 流的帧信息,例如帧类型、时间戳、关键帧标志等。

ffprobe -show_streams -i "rtsp://192.168.61.46:8554/live?channel=0&type=0":该命令用于显示输入 RTSP 流的流信息,例如音视频流的基本信息、编解码器参数等。

ffprobe -show_pixel_formats -i "rtsp://admin:test1234@192.168.42.234:554/h264/ch33/main/av_stream":该命令用于显示输入 RTSP 流支持的像素格式。

ffprobe -show_data -i "rtsp://192.168.61.46:8554/live?channel=0&type=0":该命令用于显示输入 RTSP 流的数据信息,例如每个数据包的字节内容。

显示媒体文件的帧率、码率等信息:
ffprobe -i input.mp4 -show_entries stream=codec_type,codec_name,bit_rate,r_frame_rate,sample_rate,duration,size

显示媒体文件中所有关键帧的位置:
ffprobe -i input.mp4 -select_streams v:0 -skip_frame nokey -show_frames -of csv

显示媒体文件编码器的参数设置:
ffprobe -i input.mp4 -show_entries format_tags=encoder -v 0

使用 XML 格式输出媒体文件信息:
ffprobe -i input.mp4 -print_format xml -show_format -show_streams > output.xml
ffprobe -v quiet -print_format json -show_format -show_streams input.mp4 > output.json

只看视频流:
ffprobe -show_frames -select_streams v -of xml input.mp4

查看flv视频格式的信息
ffprobe -v trace -i key.flv
 

仅展示宽高
ffprobe -v error -hide_banner -of default=noprint_wrappers=0 -print_format flat -select_streams v:0 -show_entries stream=width,height simpsons_1080p2398_clip.mp4
查看pts
ffprobe -v error -hide_banner -of default=noprint_wrappers=1 -select_streams v:0 -show_entries packet=pts_time simpsons_1080p2398_clip.mp4
查看时长duration
ffprobe -v error -hide_banner -of default=noprint_wrappers=0 -print_format xml -select_streams v:0 -show_entries stream=duration simpsons_1080p2398_clip.mp4
帧类型信息:
ffprobe -v error -hide_banner -of default=noprint_wrappers=0 -print_format flat  -select_streams v:0 -show_entries frame=pict_type simpsons_1080p2398_clip.mp4
码率
ffprobe -v error -hide_banner -of default=noprint_wrappers=0 -print_format flat  -select_streams v:0 -show_entries stream=bit_rate simpsons_1080p2398_clip.mp4
使用ffprobe输出编解码器信息
ffprobe -v error -hide_banner -of default=noprint_wrappers=0 -print_format flat  -select_streams v:0 -show_entries stream=codec_name,codec_long_name,profile,codec_tag_string simpsons_1080p2398_clip.mp4
使用ffprobe显示像素格式
ffprobe -v error -hide_banner -of default=noprint_wrappers=0 -print_format flat  -select_streams v:0 -show_entries stream=pix_fmt simpsons_1080p2398_clip.mp4

放音频文件时,不确定文件的声音是否正常,噪声数据等分析,可以直接使用ffplay播放音频文
件,播放的时候将会把解码后的音频数据以音频波形显示出来:
#ffplay -showmode 1 output.mp3

# 通过图中的箭头可以看到p帧运动估计的信息
# ffplay.exe -flags2 +export_mvs -ss 40 "D:/hik_h264.mp4" -vf codecview=mv=pf+bf+bb

现在要计算 rec.yuv 和 dec.yuv 的 psnr,则在视频所在目录下打开 cmd 输入
ffmpeg  -pix_fmt  yuv420p  -s 1920x1080  -i rec.yuv  -pix_fmt yuv420p  -s 1920x1080 -i decs.yuv -lavfi psnr="stats_file=psnr.log"  -f null  -

计算 PSNR
use '-frame' to specify the number of frames to be cauculated, i.e.
ffmpeg  -pix_fmt  yuv420p  -s 1920x1080  -i Kimono_1920x1080_24.yuv  -pix_fmt yuv420p  -s 1920x1080 -i Kimono22.yuv -frames 12 -lavfi psnr="stats_file=psnr.log"  -f null  -

计算 SSIM
ffmpeg -s 352x288 -i rec.yuv -s 352x288 -i dec.yuv -lavfi ssim="stats_file=ssim.log" -f null -

http://www.lryc.cn/news/117493.html

相关文章:

  • 基于kettle实现pg数据定时转存mongodb
  • 使用 POI 在 Word 中重新开始编号、自定义标题格式
  • 【java】default/private/public/protected比较
  • 面试热题(最长上升子序列)
  • Vue 简版文件预览笔记
  • 数据结构--栈和队列
  • 泰国的区块链和NFT市场调研
  • 精彩回顾 | D-Day深圳 上海站:高频策略研发再提速
  • 新法!《个人信息保护合规审计管理办法(征求意见稿)》解读
  • 南大通用数据库-Gbase-8a-学习-37-delete误删数据恢复方法
  • 【高光谱图像的去噪算法】通过全变异最小化对受激拉曼光谱图像进行去噪研究(Matlab代码实现)
  • UEditorPlus v3.3.0 图片上传压缩重构,UI优化,升级基础组件
  • 百度翻译API整合SpringBoot
  • Spring @Primary、@Order、JSR @Priority作用与区别
  • 【Mac】mac 系统下格式化U盘或移动硬盘为ext4格式
  • ubuntu20.4 sgx环境配置
  • 01.图片下拉触底分页加载每张图片
  • “精准学习嵌入式开发:明确目标,提升技能“
  • C语言--联合体-共用体
  • echarts实现中国地图下钻进入下一级行政区(地图钻取)
  • 从0到1学会手写操作系统,我只用了2个小时
  • 软件包管理
  • 【逗老师的PMP学习笔记】9、项目资源管理
  • react-virtualized可视化区域渲染的使用
  • navicat连接postgresql报错
  • 题目:灾后重建
  • Vue 插槽 slot
  • 【C/C++】C语言位图操作实例(亲测)
  • Mahout教程_编程入门自学教程_菜鸟教程-免费教程分享
  • wxwidgets Ribbon使用wxRibbonToolBar实例