ffmeg x264 预设不起作用

war*_*iuc 4 ffmpeg

尝试将屏幕捕获到使用无损 x264 编码的视频文件:

vic@vic-X202E ~/Desktop » ffmpeg -f x11grab -r 15 -s 1366x768 -i :0.0 -sameq -vcodec libx264 -preset:v ultrafast test.mkv
ffmpeg version 0.8.4-6:0.8.4-0ubuntu0.12.10.1, Copyright (c) 2000-2012 the Libav developers
  built on Nov  6 2012 16:51:11 with gcc 4.7.2
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
[x11grab @ 0xc2bf60] device: :0.0 -> display: :0.0 x: 0 y: 0 width: 1366 height: 768
[x11grab @ 0xc2bf60] shared memory extension  found
[x11grab @ 0xc2bf60] Estimating duration from bitrate, this may be inaccurate
Input #0, x11grab, from ':0.0':
  Duration: N/A, start: 1357648973.267658, bitrate: 503562 kb/s
    Stream #0.0: Video: rawvideo, bgra, 1366x768, 503562 kb/s, 15 tbr, 1000k tbn, 15 tbc
Unrecognized option 'preset:v'
Failed to set value 'ultrafast' for option 'preset:v'
Run Code Online (Sandbox Code Playgroud)

另一个尝试:

vic@vic-X202E ~/Desktop » ffmpeg -f x11grab -r 15 -s 1366x768 -i :0.0 -sameq -vcodec libx264 -preset ultrafast test.mkv  
ffmpeg version 0.8.4-6:0.8.4-0ubuntu0.12.10.1, Copyright (c) 2000-2012 the Libav developers
  built on Nov  6 2012 16:51:11 with gcc 4.7.2
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
[x11grab @ 0x2482f60] device: :0.0 -> display: :0.0 x: 0 y: 0 width: 1366 height: 768
[x11grab @ 0x2482f60] shared memory extension  found
[x11grab @ 0x2482f60] Estimating duration from bitrate, this may be inaccurate
Input #0, x11grab, from ':0.0':
  Duration: N/A, start: 1357648985.325860, bitrate: 503562 kb/s
    Stream #0.0: Video: rawvideo, bgra, 1366x768, 503562 kb/s, 15 tbr, 1000k tbn, 15 tbc
Unrecognized option 'preset'
Failed to set value 'ultrafast' for option 'preset'
vic@vic-X202E ~/Desktop » 
Run Code Online (Sandbox Code Playgroud)

东西坏了?使用 Kubuntu 12.10。

slh*_*hck 9

不要使用该same_quant选项。它没有达到您认为的效果。

现在,实现无损压缩,你需要指定一个恒定的质量的0与-crf 0

avconv -f x11grab -r 15 -s 1366x768 -i :0.0 \
-c:v libx264 -preset ultrafast -crf 0 \
test.mkv
Run Code Online (Sandbox Code Playgroud)

有关更多选项,请参阅x264 编码指南。如果您没有 x264,则需要libavcodec-extra.


请注意,FFmpeg 和 Libav 应将此命令视为相同。你的系统的问题是你的 FFmpeg 版本已经过时了。您应该自己编译它从主页下载静态构建。两者都将包括 x264。