如何基于FFMpeg编码命令或输出为AV1文件确定正确的HTML5视频编解码器属性? [英] How to determine the proper HTML5 video codec attribute for an AV1 file based on the FFMpeg encoding command or output?

查看:141
本文介绍了如何基于FFMpeg编码命令或输出为AV1文件确定正确的HTML5视频编解码器属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一些文件以AV1编码,但是最近我们注意到,Chrome移动版无法播放这些文件-但它并没有退回到可以使用的编码格式-只是将无法播放的AV1文件放在那里.我希望如果添加编解码器属性,我们可以对此进行补救-但我不确定如何确定这些AV1文件的编解码器.

我遇到了

MediaInfo 的输出是:

 常规全名:demo-av1.mp4格式:MPEG-4格式配置文件:基本媒体编解码器ID:ISO格式(isom/iso2/mp41)档案大小:291 KiB持续时间:1分钟40 s总比特率:23.7 kb/s写作申请:Lavf58.43.100视频编号:1格式:AV1格式/信息:AOMedia Video 1格式设定档:High@L3.0编解码器ID:AV01持续时间:1分钟40 s比特率:22.9 kb/s宽度:984像素高度:670像素显示宽高比:3:2帧率模式:恒定/恒定帧率:24.000 FPS色彩空间:YUV色度二次采样:4:4:4位深:8位扫描类型:逐行/逐行比特/(像素*帧):0.001流大小:281 KiB(96%)颜色范围:有限编解码器配置框:AV1C/AV1C 

创建文件和FFMpeg输出的命令如下:

 <代码>ffmpeg -y -i"D:\ RAW VIDEO \ Demos \ demo.avi"-ss 00:00:00 -c:v libaom-av1 -pix_fmt yuv444p-最小500 -b:v 48k-最大1000k-严格实验-movflags + faststart -f mp4 NUL&&ffmpeg -y -i"D:\ RAW VIDEO \ Demos \ demo.avi"-ss 00:00:00 -c:v libaom-av1 -pix_fmt yuv444p-最小500 -b:v 48k-最大1000k-严格实验-movflags + faststart -pass 2"D:\ RAW VIDEO \ Demos \ converted \demo-av1.mp4";ffmpeg版本git-2020-05-22-38490cb版权所有(c)2000-2020 FFmpeg开发人员建于gcc 9.3.1(GCC)20200513配置:--enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid-enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2--enable-avisynth --enable-libopenmpt --enable-amflibavutil 56. 46.100/56. 46.100libavcodec 58. 86.101/58. 86.101libavformat 58. 43.100/58. 43.100libavdevice 58. 9.103/58. 9.103libavfilter 7. 82.100/7. 82.100libswscale 5. 6.101/5. 6.101libswresample 3. 6.100/3. 6.100libpostproc 55. 6.100/55. 6.100从'D:\ RAW VIDEO \ Demos \ demo.avi'输入#0,avi:元数据:编码器:Lavf58.29.100期间:00:00:23.43,开始:0.000000,比特率:19719 kb/s流#0:0:视频:huffyuv(HFYU/0x55594648),bgr0、420x240、19739 kb/s,30 fps,30 tbr,30 tbn,30 tbc流映射:流#0:0->#0:0(huffyuv(本机)-> av1(libaom-av1))按[q]停止,按[?]寻求帮助[libaom-av1 @ 00000000003fb3c0] v1.0.0输出#0,mp4到"NUL":元数据:编码器:Lavf58.43.100流#0:0:视频:av1(libaom-av1)(av01/0x31307661),yuv444p,420x240,q = -1--1、48 kb/s,30 fps,15360 tbn,30 tbc元数据:编码器:Lavc58.86.101 libaom-av1辅助数据:cpb:最大/最小/平均比特率:0/0/0缓冲区大小:0 vbv_delay:不适用 

解决方案

av01.1.04M.08.0.000.02.02.02.02.02.0

代表以下组件: av01.P.LLT.DD.M.CCC.cp.tc.mc.F .

<身体>
组件您的视频结果值
P 格式配置文件: @ L3.0 1
LLT 格式配置文件:高级@ L3.0 ,主层 04M
DD 位深度:8位 08
M 不是单色的(不是黑白的) 0
CCC 色度二次采样:YUV 4:4:4 000
cp 未知 02
tc 未知 02
mc 未知 02
F 颜色范围:受限 0

  • 编解码器"常见媒体类型中的参数:AV1 将链接到提供有用的值表的AV1规范的相应部分.

  • mediainfo ffprobe 会告诉您 cp (彩色原色), tc (转印特性)和 mc (矩阵系数)都是未知的.由于这些未在 mediainfo 输出中列出,并且您未使用关联的编码选项( -colorspace -color_trc -color_primaries ),因此该值未知.

We have some files encoded in AV1, but we recently noticed that Chrome mobile fails to play the files - but it doesn't fall back to an encoding it can use - it just puts the unplayable AV1 file in there. I'm hoping that if we add a codec attribute we can remedy this - but I'm not sure how to determine the codec for these AV1 files.

I've come across this documentation on MDN, but I'm not sure how I would determine the proper codec from that. It starts off simple enough, but some of the values further down, I have no idea what the right value would be.

Opening the file in VLC player only shows this very limited information about the codec:

The output of MediaInfo is:

General
Complete name                            : demo-av1.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/mp41)
File size                                : 291 KiB
Duration                                 : 1 min 40 s
Overall bit rate                         : 23.7 kb/s
Writing application                      : Lavf58.43.100

Video
ID                                       : 1
Format                                   : AV1
Format/Info                              : AOMedia Video 1
Format profile                           : High@L3.0
Codec ID                                 : av01
Duration                                 : 1 min 40 s
Bit rate                                 : 22.9 kb/s
Width                                    : 984 pixels
Height                                   : 670 pixels
Display aspect ratio                     : 3:2
Frame rate mode                          : Constant / Constant
Frame rate                               : 24.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:4:4
Bit depth                                : 8 bits
Scan type                                : Progressive / Progressive
Bits/(Pixel*Frame)                       : 0.001
Stream size                              : 281 KiB (96%)
Color range                              : Limited
Codec configuration box                  : av1C / av1C

The command to create the files and the output of FFMpeg is like so:


ffmpeg -y -i "D:\RAW VIDEO\Demos\demo.avi" -ss 00:00:00  -c:v libaom-av1 -pix_fmt yuv444p -minrate 500 -b:v 48k -maxrate 1000k -strict experimental -movflags +faststart -f mp4 NUL && ffmpeg -y -i "D:\RAW VIDEO\Demos\demo.avi" -ss 00:00:00  -c:v libaom-av1 -pix_fmt yuv444p -minrate 500 -b:v 48k -maxrate 1000k -strict experimental -movflags +faststart -pass 2 "D:\RAW VIDEO\Demos\converted\demo-av1.mp4"
ffmpeg version git-2020-05-22-38490cb Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200513

  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 46.100 / 56. 46.100
  libavcodec     58. 86.101 / 58. 86.101
  libavformat    58. 43.100 / 58. 43.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 82.100 /  7. 82.100
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100

Input #0, avi, from 'D:\RAW VIDEO\Demos\demo.avi':
  Metadata:
    encoder         : Lavf58.29.100
  Duration:
00:00:23.43, start: 0.000000, bitrate: 19719 kb/s
    Stream #0:0: Video: huffyuv (HFYU / 0x55594648), bgr0, 420x240, 19739 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc

Stream mapping:
  Stream #0:0 -> #0:0 (huffyuv (native) -> av1 (libaom-av1))

Press [q] to stop, [?] for help

[libaom-av1 @ 00000000003fb3c0] v1.0.0

Output #0, mp4, to 'NUL':
  Metadata:
    encoder         : Lavf58.43.100

    Stream #0:0: Video: av1 (libaom-av1) (av01 / 0x31307661), yuv444p, 420x240, q=-1--1, 48 kb/s, 30 fps, 15360 tbn, 30 tbc
    Metadata:
      encoder         : Lavc58.86.101 libaom-av1
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A


解决方案

av01.1.04M.08.0.000.02.02.02.02.0

Represents the following components: av01.P.LLT.DD.M.CCC.cp.tc.mc.F.

Component Your video Resulting Value
P Format profile: High@L3.0 1
LLT Format profile: High@L3.0, Main tier 04M
DD Bit depth: 8 bits 08
M Not monochrome (its not black & white) 0
CCC Chroma subsampling: YUV 4:4:4 000
cp unknown 02
tc unknown 02
mc unknown 02
F Color range: Limited 0

  • The "codecs" parameter in common media types: AV1 will link to the appropriate sections of the AV1 specification which provides helpful tables of values.

  • mediainfo and ffprobe will tell you if cp (color primaries), tc (transfer characteristics), and mc (matrix coefficients) are not unknown. Since these are not listed in your mediainfo output, and you did not use the associated encoding options (-colorspace, -color_trc, -color_primaries), the value is therefore unknown.

这篇关于如何基于FFMpeg编码命令或输出为AV1文件确定正确的HTML5视频编解码器属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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