video - FFmpeg 错误 : ratecontrol_init: can't open stats file

标签 video ffmpeg

我已经设置了一个运行 Ubuntu 14.04 的 AWS EC2 实例并安装了 FFmpeg,以便我可以压缩和转码视频。

我正在尝试使用以下代码进行两次转换:

ffmpeg -i input-file.avi -codec:v libx264 -profile:v high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale=702:-1 -threads 0 -通过 1 -an -f mp4 ~/encoded/null

第二遍:

ffmpeg -i input-file.avi -codec:v libx264 -profile:v high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale=702:-1 -threads 0 -通过 2 -codec:a libfdk_aac -b:a 128k -f mp4 output-file.mp4

但是我得到以下错误:

ffmpeg version N-77283-g91c2a33 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04)
  configuration: --prefix=/home/ubuntu/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/ubuntu/ffmpeg_build/include --extra-ldflags=-L/home/ubuntu/ffmpeg_build/lib --bindir=/home/ubuntu/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree
  libavutil      55. 11.100 / 55. 11.100
  libavcodec     57. 17.100 / 57. 17.100
  libavformat    57. 20.100 / 57. 20.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 21.100 /  6. 21.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, avi, from 'input-file.avi':
  Duration: 01:18:05.29, start: 0.000000, bitrate: 2025 kb/s
    Stream #0:0: Video: mpeg4 (Simple Profile) (XVID / 0x44495658), yuv420p, 720x480 [SAR 1:1 DAR 3:2], 1789 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn, 29.97 tbc
    Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, fltp, 224 kb/s
[libx264 @ 0x1e04240] using SAR=1/1
[libx264 @ 0x1e04240] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
[libx264 @ 0x1e04240] ratecontrol_init: can't open stats file
Output #0, mp4, to '/home/ubuntu/encoded/null':
    Stream #0:0: Video: h264, none, q=2-31, 128 kb/s, SAR 1:1 DAR 0:0, 29.97 fps
    Metadata:
      encoder         : Lavc57.17.100 libx264
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg4 (native) -> h264 (libx264))
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

上面写的命令在我的本地计算机(运行 OSX)上运行良好。有没有人对如何解决这个问题有任何建议?

最佳答案

大胆的猜测:

通过 1 添加:

 -vcodec libx264 -strict -2 -passlogfile /tmp/mydummy

传递 2 添加:

 -vcodec libx264 -strict -2 -passlogfile /tmp/mydummy

关于video - FFmpeg 错误 : ratecontrol_init: can't open stats file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34345989/

相关文章:

flash - 尝试使用 Flowplayer 作为 html5 视频的 flash 回退时出现问题

python - 使用 Opencv 和 python 获取 RTSP 流

FFMPEG混合两个立体声文件代码问题

android - FFMPEG 错误!!! moov atom not found 处理输入时发现无效数据

ffmpeg - 在命令行中使用 FFMPEG 检测 QuickTime .MOV 文件

ffmpeg 版本 2.6.8 : Stream specifier ':a' in filtergraph description matches no streams

api - 通过 php 向 youtube 用户请求未列出的视频

android - 删除时未删除的文件仍显示在 ListView 中

iphone - 当iPod仍在播放音频时,如何使iOS上的视频静音?

video - FFmpeg:省略 -filter_complex 会导致某些播放器中的视频丢失