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.

Get video height and width by ffprobe

Last updated at Posted at 2022-02-20

example1

ffprobe -v error -show_entries stream=width,height -of default=noprint_wrappers=1 file.mp4

# width=2160 height=1080

example2

ffprobe -v error -show_entries stream=width,height -of csv=p=0:s=x file.mp4

# 2160x1080

example3

ffprobe -v error -show_entries stream=width,height -of json file.mp4

{
  "programs": [],
  "streams": [{},
    {
      "width": 2160,
      "height": 1080
    }
  ]
}

-v error 进行安静输出,但允许显示错误。排除常见的 FFmpeg 输出信息,包括版本、配置和输入详细信息。

-show_entries stream=width,height 只显示 width 和 height 流信息。

-of 选项选择输出格式(default、compact、csv、flat、ini、json、xml)。

-select_streams v:0 如果输入包含多个视频流,则可以添加此选项。v:0将只选择第一个视频流。否则,你将获得与视频流一样多的 width 和 height 输出。

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?