目标检测 多分辨率检测
Video resolution has always been something I've been interested in, starting with the purchase of my first HD television. The HD video quality felt life-changing, especially when watching the World Cup, which I'd bought that TV for. I carried that enthusiasm through to being an early adopter of 4K TVs, which are absolutely amazing.
从购买第一台高清电视开始,视频分辨率一直是我一直感兴趣的东西。 高清视频质量改变了人们的生活,尤其是在观看世界杯时,我购买了这台电视。 我将这种热情带到了4K电视的早期采用者中,这绝对是惊人的。
These days you can get 4K videos on YouTube, Netflix, and other networks, and I see that Samsung and Sony are even offering 8K televisions. With that in mind, I wanted to figure out how to detect video resolution from a downloaded video file. Let's check it out!
这些天,您可以在YouTube,Netflix和其他网络上获得4K视频,而且我看到三星和索尼甚至都提供8K电视。 考虑到这一点,我想弄清楚如何从下载的视频文件中检测视频分辨率。 让我们来看看!
标准视频分辨率 (Standard Video Resolutions)
The following are standard video resolutions you may recognize:
以下是您可能会认识到的标准视频分辨率:
Standard | Resolution | Aspect Ratio | Pixels |
---|---|---|---|
720 × 480 (NTSC) | 4:3 or 16:9 | 345,600 | |
720 × 576 (PAL) | 414,720 | ||
() | 1280 × 720 | 16:9 | 921,600 |
1366 × 768 (FWXGA) | 1,049,088 | ||
, (, ) | 1920 × 1080 | 16:9 | 2,073,600 |
() | 3840 × 2160 | 16:9 | 8,294,400 |
() | 7680 × 4320 | 16:9 | 33,177,600 |
标准 | 解析度 | 长宽比 | 像素 |
---|---|---|---|
720×480(NTSC) | 4:3或16:9 | 345,600 | |
720×576(PAL) | 414,720 | ||
( ) | 1280×720 | 16:9 | 921,600 |
1366×768(FWXGA) | 1,049,088 | ||
, ( , ) | 1920×1080 | 16:9 | 2,073,600 |
(超 ) | 3840×2160 | 16:9 | 8,294,400 |
(超 ) | 7680×4320 | 16:9 | 33,177,600 |
This provides other popular resolutions used in different devices.
提供了在不同设备上使用的其他常用分辨率。
使用ffprobe检测视频分辨率 (Detect Video Resolution with ffprobe)
Installing ffmpeg provides another utility, ffprobe, which allows us to get the resolution of a video file, albeit with a :
安装ffmpeg提供了另一个实用程序ffprobe,它使我们能够获得视频文件的分辨率,尽管使用了一个 :
eval $(ffprobe -v error -of flat=s=_ -select_streams v:0 -show_entries stream=height,width MyVideo.mkv)size=${streams_stream_0_width}x${streams_stream_0_height}echo $size // "3840x1606"
We can create a to make this type of video resolution query more dynamic:
我们可以创建一个来使这种类型的视频分辨率查询更加动态:
getVideoResolution() { eval $(ffprobe -v error -of flat=s=_ -select_streams v:0 -show_entries stream=height,width $1) size=${streams_stream_0_width}x${streams_stream_0_height} echo $size}# getVideoResolution myVideo.mkv
Many media sites allow you to choose the video quality you prefer, so knowing the maximum video quality available (that of the original source, in theory) is useful.
许多媒体网站都允许您选择自己喜欢的视频质量,因此了解可用的最大视频质量(理论上是原始来源的视频质量)非常有用。
Retrieving the resolution of a video isn't difficult using ffprobe!
使用ffprobe检索视频的分辨率并不困难!
翻译自:
目标检测 多分辨率检测