FFmpeg:从mp4读取配置文件级别信息 [英] FFmpeg: Read profile level information from mp4

查看:448
本文介绍了FFmpeg:从mp4读取配置文件级别信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个mp4文件,需要其配置文件级别。 FFmpeg说,它具有基线配置文件,这是我需要的,但是我还需要级别



这是从FFmpeg获得的:

  ffmpeg版本0.8,版权所有(c)2000-2011 FFmpeg开发者
建于2011年7月20日13:32:19与gcc 4.4.3
配置:--enable-gpl --enable-version3 - -enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264
libavutil 51。 9. 1 / 51. 9. 1
libavcodec 53. 7. 0 / 53. 7. 0
libavformat 53. 4. 0 / 53. 4. 0
libavdevice 53. 1。 1 / 53. 1. 1
libavfilter 2. 23. 0 / 2. 23. 0
libswscale 2. 0. 0 / 2. 0. 0
libpostproc 51. 2. 0 / 51.从$ test-show.mp4输入#0,mov,mp4,m4a,3gp,3g2,mj2:
元数据:
main_brand:f4v
minor_version:0
compatible_brands:isommp42m4v
creation_time:2012-03-21 16:00:00
持续时间:00:56:07.40,开始:0.000000,比特率:2004 kb / s
流#0.0(eng):Video:h264(Baseline),yuv420p,854x480 [PAR 1:1 DAR 427:240],1904 kb / s,25 fps,25 tbr,90k tbn,50 tbc
元数据:
creation_time:2012-03-21 16:00:00
流#0.1(eng):音频:aac,48000 Hz,立体声,s16,96 kb / s
元数据:
creation_time:2012-03-21 16:00:00
必须至少指定一个输出文件

除了 -i 之外还有其他选项我可以用来获取级别的信息吗?

解决方案

尝试 ffprobe -show_streams



ffprobe 与FFmpeg捆绑在一起,并提供有关视频文件的大量信息,包括级别信息,例如:

  $ ffprobe -loglevel error -show_streams Test.mp4 
[STREAM]
ind ex = 0
codec_name = h264
codec_long_name = H.264 / AVC / MPEG-4 AVC / MPEG-4第10部分
codec_type = video
codec_time_base = 1001/48000
codec_tag_string = avc1
codec_tag = 0x31637661
width = 704
height = 400
has_b_frames = 0
sample_aspect_ratio = N / A
display_aspect_ratio = N / A
pix_fmt = yuv420p
level = 51< == level!
timecode = N / A
is_avc = 1
nal_length_size = 4
id = N / A
r_frame_rate = 24000/1001
avg_frame_rate = 1384898760/57761819
time_base = 1/44100
start_time = 0.000000
持续时间= 6548.959070
bit_rate = 701946
nb_frames = 157018
nb_read_frames = N / A
nb_read_packets = N / A
标签:creation_time = 2006-08-17 18:14:49
标签:language = eng
标签:handler_name =
[/ STREAM]


I have a mp4 file and need the profile level of it. FFmpeg says, it has baseline profile, which is what I need, but I need also the level.

Here is what I get from FFmpeg:

ffmpeg version 0.8, Copyright (c) 2000-2011 the FFmpeg developers
  built on Jul 20 2011 13:32:19 with gcc 4.4.3
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264
  libavutil    51.  9. 1 / 51.  9. 1
  libavcodec   53.  7. 0 / 53.  7. 0
  libavformat  53.  4. 0 / 53.  4. 0
  libavdevice  53.  1. 1 / 53.  1. 1
  libavfilter   2. 23. 0 /  2. 23. 0
  libswscale    2.  0. 0 /  2.  0. 0
  libpostproc  51.  2. 0 / 51.  2. 0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test-show.mp4':
  Metadata:
    major_brand     : f4v 
    minor_version   : 0
    compatible_brands: isommp42m4v 
    creation_time   : 2012-03-21 16:00:00
  Duration: 00:56:07.40, start: 0.000000, bitrate: 2004 kb/s
    Stream #0.0(eng): Video: h264 (Baseline), yuv420p, 854x480 [PAR 1:1 DAR 427:240], 1904 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Metadata:
      creation_time   : 2012-03-21 16:00:00
    Stream #0.1(eng): Audio: aac, 48000 Hz, stereo, s16, 96 kb/s
    Metadata:
      creation_time   : 2012-03-21 16:00:00
At least one output file must be specified

Is there any option other than -i I can use to get the level information?

解决方案

Try ffprobe -show_streams.

ffprobe is bundled with FFmpeg and gives lots of information about video files including level information, e.g.:

$ ffprobe -loglevel error -show_streams Test.mp4 
[STREAM]
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
codec_type=video
codec_time_base=1001/48000
codec_tag_string=avc1
codec_tag=0x31637661
width=704
height=400
has_b_frames=0
sample_aspect_ratio=N/A
display_aspect_ratio=N/A
pix_fmt=yuv420p
level=51                 <== level!
timecode=N/A
is_avc=1
nal_length_size=4
id=N/A
r_frame_rate=24000/1001
avg_frame_rate=1384898760/57761819
time_base=1/44100
start_time=0.000000
duration=6548.959070
bit_rate=701946
nb_frames=157018
nb_read_frames=N/A
nb_read_packets=N/A
TAG:creation_time=2006-08-17 18:14:49
TAG:language=eng
TAG:handler_name=
[/STREAM]

这篇关于FFmpeg:从mp4读取配置文件级别信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆