Trying to capture screen to video file encoded with lossless 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'
Another try:
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 »
Something broken? Using Kubuntu 12.10.
Please don't use the
same_quant
option. It doesn't achieve what you think it does.Now, to achieve lossless compression, you need to specify a constant quality of 0 with
-crf 0
.See the x264 encoding guide for more options. If you don't have x264, you need
libavcodec-extra
.Note that FFmpeg and Libav should treat this command the same. The problem with your system is that your FFmpeg version is terribly outdated. You should compile it yourself or download a static build from the homepage. Both would include x264.
Try using
avconv
in place offfmpeg
. (The relationship between these two forks in Ubuntu appears to be a complex issue).On my 12.10 system I have both the executables for
ffmpeg
andavconv
, but only preset files foravconv
(in/usr/share/avconv
).Try: