g_timebase.den 超出范围

g_timebase.den 超出范围

我有一部摩托罗拉 moto xt1225 智能手机,并录制了一段视频,我正尝试使用 Ubuntu 15.10 上的 ffmpeg 为 VP9 webM 编码。这是关于我的输入视频的 ffprobe 输出:

ffprobe VID_20151231_235957320.mp4
ffprobe version 2.7.3-   0ubuntu0.15.10.1 Copyright (c) 2007-2015 the FFmpeg developers
  built with gcc 5.2.1 (Ubuntu 5.2.1-22ubuntu2) 20151010
  configuration: --prefix=/usr --extra-version=0ubuntu0.15.10.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --enable-shared --disable-stripping --enable-avresample --enable-avisynth --enable-frei0r --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-openal --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libxvid --enable-libzvbi --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-libssh --enable-libsoxr --enable-libx264 --enable-libopencv --enable-libx265
  libavutil      54. 27.100 / 54. 27.100
  libavcodec     56. 41.100 / 56. 41.100
  libavformat    56. 36.100 / 56. 36.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 16.101 /  5. 16.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.100 /  1.  2.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'VID_20151231_235957320.mp4':
  Metadata:
major_brand     : mp42
minor_version   : 0
compatible_brands: isommp42
creation_time   : 2016-01-01 02:16:22
location        : -22.9634-043.1666/
location-eng    : -22.9634-043.1666/
  Duration: 00:16:22.57, start: 0.000000, bitrate: 17134 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 16999 kb/s, SAR 1:1 DAR 16:9, 25.19 fps, 90k tbr, 90k tbn, 180k tbc (default)
Metadata:
  creation_time   : 2016-01-01 02:16:22
  handler_name    : VideoHandle
  encoder         : MOTO
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
  creation_time   : 2016-01-01 02:16:22
  handler_name    : SoundHandle

当我尝试任何编码选项时VP9 编码指南如最佳质量(最慢)推荐设置:

ffmpeg -i VID_20151231_235957320.mp4 -c:v libvpx-vp9 -pass 1 -b:v 1000K -threads 1 -speed 4 -tile-columns 0 -frame-parallel 0 -g 9999 -aq-mode 0 -an -f webm /dev/null

我总是收到错误输出,抱怨 g_timebase.den 超出范围:

[libvpx-vp9 @ 0x1bf1860] v1.4.0
[libvpx-vp9 @ 0x1bf1860] Failed to initialize encoder: Invalid parameter
[libvpx-vp9 @ 0x1bf1860]   Additional information: g_timebase.den out of range [1..1000000000]
Output #0, webm, to '/dev/null':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    location-eng    : -22.9634-043.1666/
    location        : -22.9634-043.1666/
    Stream #0:0(eng): Video: vp9, none, q=2-31, 128 kb/s, SAR 1:1 DAR 0:0, 25.19 fps (default)
Metadata:
  creation_time   : 2016-01-01 02:16:22
  handler_name    : VideoHandle
  encoder         : Lavc56.41.100 libvpx-vp9
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> vp9 (libvpx-vp9))
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

看起来我需要提供额外的参数,但我不知道该怎么做,有什么提示吗?

答案1

您应该使用您使用的完整命令来更新您的问题,但是这里有一个您可以尝试的模板:

ffmpeg -i VID_20151231_235957320.mp4 -c:v libvpx-vp9 -r 25 -crf 33 -b:v 0 output.webm

音频将使用 ffmpeg 构建为 WebM 设置的默认值进行编码。

相关内容