gpt4 book ai didi

video - 如何从 H.264 .TS 文件中提取视频信息?

转载 作者:行者123 更新时间:2023-11-28 21:42:00 25 4
gpt4 key购买 nike

是否有任何好的 linux/unix 工具可以获取 H264 .TS 文件的属性?

我需要时长、视频分辨率和比特率、fps、音频分辨率和比特率。

我尝试了 mplayer -vo null -ao null -frames 0 -identify _file_,但它报告了错误的视频宽度和高度,并且还报告了文件长度(持续时间)为 0.00。

最佳答案

您可以运行 mediainfo ( here) 并解析其输出。

mediainfo <filename>会给你这样的信息:

General
ID : 2 (0x2)
Format : MPEG-TS
File size : 915 MiB
Duration : 8mn 31s
Start time : UTC 2009-06-09 14:15:57
End time : UTC 2009-06-09 14:24:12
Overall bit rate : 15.0 Mbps

Video #1
ID : 256 (0x100)
Menu ID : 1 (0x1)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L3.0
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : 27
Duration : 8mn 31s
Width : 720 pixels
Height : 576 pixels
Display aspect ratio : 4:3
Frame rate : 25.000 fps
Standard : PAL
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : MBAFF
Scan order : Top Field First
Color primaries : BT.470-6 System B, BT.470-6 System G, BT.601-6 625, BT.1358 625, BT.1700 625 PAL, BT.1700 625 SECAM
Transfer characteristics : BT.470-6 System B, BT.470-6 System G
Matrix coefficients : BT.470-6 System B, BT.470-6 System G, BT.601-6 625, BT.1358 625, BT.1700 625 PAL, BT.1700 625 SECAM, IEC 61966-2-4 601

Video #2
ID : 1001 (0x3E9)
Menu ID : 3 (0x3)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L3.0
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Format settings, GOP : M=3, N=24
Codec ID : 27
Duration : 8mn 30s
Width : 720 pixels
Height : 576 pixels
Display aspect ratio : 4:3
Frame rate : 25.000 fps
Standard : PAL
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : MBAFF
Color primaries : BT.470-6 System B, BT.470-6 System G, BT.601-6 625, BT.1358 625, BT.1700 625 PAL, BT.1700 625 SECAM
Transfer characteristics : BT.470-6 System B, BT.470-6 System G
Matrix coefficients : BT.470-6 System B, BT.470-6 System G, BT.601-6 625, BT.1358 625, BT.1700 625 PAL, BT.1700 625 SECAM, IEC 61966-2-4 601

Audio #1
ID : 258 (0x102)
Menu ID : 1 (0x1)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Mode : Joint stereo
Mode extension : Intensity Stereo + MS Stereo
Codec ID : 3
Duration : 8mn 31s
Bit rate mode : Constant
Bit rate : 192 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Compression mode : Lossy
Stream size : 11.7 MiB (1%)

Audio #2
ID : 1002 (0x3EA)
Menu ID : 3 (0x3)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Codec ID : 3
Duration : 8mn 31s
Bit rate mode : Constant
Bit rate : 192 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Compression mode : Lossy
Delay relative to video : 7s 978ms
Stream size : 11.7 MiB (1%)

Menu #1
ID : 257 (0x101)
Menu ID : 1 (0x1)
Duration : 8mn 31s
List : 256 (0x100) (AVC) / 258 (0x102) (MPEG Audio)
Service name : vv
Service type : digital television

Menu #2
ID : 1000 (0x3E8)
Menu ID : 3 (0x3)
Duration : 8mn 31s
List : 1001 (0x3E9) (AVC) / 1002 (0x3EA) (MPEG Audio)
Service name : Lenni
Service type : digital television

关于video - 如何从 H.264 .TS 文件中提取视频信息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9278573/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com