0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ffmpeg之ffprobe

Last updated at Posted at 2021-06-01

基本介绍

FFmpeg是一套非常知名的音视频处理的开源工具,它包含了开发完成的工具软件、封装好的函数库以及源代码供我们按需使用。FFmpeg提供了非常强大的功能,可以完成视频采集、音视频的编码、解码、转码、后处理(抓图、水印、封装/解封装、格式转换等),还有流媒体服务等诸多功能,可以说涵盖了音视频开发中绝大多数的领域。

mac 安装

brew install ffmpeg -with-ffplay

FFmpeg组成

FFmpeg有四个不同作用的工具软件,分别是:

  • ffmpeg:音视频转码器
  • ffplay:简单的音视频播放器
  • ffserver: 流媒体服务器
  • ffprobe:简单的多媒体码流分析器

使用方法

ffprobe -print_format json -show_format  -i file.mp4

# -print_format json #以json格式输出
# -show_format  输出封装格式信息
# -show_streams 输出流信息

"format":{
    "filename":"file.mp4",
    "nb_streams":2,
    "nb_programs":0,
    "format_name":"mov,mp4,m4a,3gp,3g2,mj2",
    "format_long_name":"QuickTime / MOV",
    "start_time":"0.000000",
    "duration":"4560.557000",
    "size":"2417651585",
    "bit_rate":"4240975",
    "probe_score":100,
    "tags":{
          "major_brand":"mp42",
          "minor_version":"0",
          "compatible_brands":"isommp42",
          "creation_time":"2018-05-20T07:36:17.000000Z",
          "com.android.version":"9"
    }
}

例子

ffprobe -loglevel 0 -print_format json -show_format -show_streams 1.MOV

参考:

http://ffmpeg.org/ffprobe.html
https://juejin.im/post/5a59993cf265da3e4f0a1e4b
https://mp.weixin.qq.com/s/FpDuI0VnRN63TfIXEKAdcw

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?