[FFmpeg-user] fast video codec for screen casting

dE . de.techno at gmail.com
Wed Jan 4 19:51:40 CET 2012


On 01/04/12 20:38, Carl Eugen Hoyos wrote:
> dE .<de.techno<at>  gmail.com>  writes:
>
>> setting -f to null results in error -- unknown format null.
> Please elaborate (command line and complete, uncut console output), I can
> benchmark -f x11grab fine here with -f null
>
> Carl Eugen
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
I get 12 FPS at most -

ffmpeg -f alsa -i default -f x11grab -s 1280x800 -i :0.0 -threads 1 
-qscale 2 -threads 1 -b 20000k -vcodec mpeg1video -ar 44100 -ac 2.0 
-acodec pcm_s16le out.avi
ffmpeg version , Copyright (c) 2000-2011 the FFmpeg developers
   built on Dec 29 2011 08:31:02 with gcc 4.4.5
   configuration: --enable-libdc1394 --prefix=/usr --extra-cflags='-Wall 
-g ' --cc='ccache cc' --enable-shared --enable-libmp3lame --enable-gpl 
--enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid 
--enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora 
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 
--enable-libspeex --enable-nonfree --disable-stripping --enable-avfilter 
--enable-libdirac --disable-decoder=libdirac --enable-libschroedinger 
--disable-encoder=libschroedinger --enable-version3 --enable-libopenjpeg 
--enable-libvpx --enable-librtmp --extra-libs=-lgcrypt --disable-altivec 
--disable-armv5te --disable-armv6 --disable-vis
   libavutil    50. 43. 0 / 50. 43. 0
   libavcodec   52.123. 0 / 52.123. 0
   libavformat  52.111. 0 / 52.111. 0
   libavdevice  52.  5. 0 / 52.  5. 0
   libavfilter   1. 80. 0 /  1. 80. 0
   libswscale    0. 14. 1 /  0. 14. 1
   libpostproc  51.  2. 0 / 51.  2. 0
[alsa @ 0x19f92e0] capture with some ALSA plugins, especially dsnoop, 
may hang.
[alsa @ 0x19f92e0] Estimating duration from bitrate, this may be inaccurate
Input #0, alsa, from 'default':
   Duration: N/A, start: 1325702385.056147, bitrate: N/A
     Stream #0.0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
[x11grab @ 0x1a1ada0] device: :0.0 -> display: :0.0 x: 0 y: 0 width: 
1280 height: 800
[x11grab @ 0x1a1ada0] shared memory extension found
[x11grab @ 0x1a1ada0] Estimating duration from bitrate, this may be 
inaccurate
Input #1, x11grab, from ':0.0':
   Duration: N/A, start: 1325702385.185941, bitrate: 982057 kb/s
     Stream #1.0: Video: rawvideo, bgra, 1280x800, 982057 kb/s, 29.97 
tbr, 1000k tbn, 29.97 tbc
File 'out.avi' already exists. Overwrite ? [y/N] y
Incompatible pixel format 'bgra' for codec 'mpeg1video', auto-selecting 
format 'yuv420p'
[buffer @ 0x1a1e940] w:1280 h:800 pixfmt:bgra tb:1/1000000 sar:0/1 
sws_param:
[buffersink @ 0x19f1f80] auto-inserting filter 'auto-inserted scaler 0' 
between the filter 'src' and the filter 'out'
[scale @ 0x19f2480] w:1280 h:800 fmt:bgra -> w:1280 h:800 fmt:yuv420p 
flags:0x4
Output #0, avi, to 'out.avi':
   Metadata:
     ISFT            : Lavf52.111.0
     Stream #0.0: Video: mpeg1video, yuv420p, 1280x800, q=2-31, 20000 
kb/s, 29.97 tbn, 29.97 tbc
     Stream #0.1: Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s
Stream mapping:
   Stream #1.0 -> #0.0
   Stream #0.0 -> #0.1
Press [q] to stop, [?] for help
frame=    3 fps=  0 q=2.0 size=     786kB time=00:00:01.21 
bitrate=5319.6kbits/sframe=    9 fps=  7 q=2.0 size=     973kB 
time=00:00:02.16 bitrate=3682.1kbits/sframe=   16 fps=  9 q=2.0 size=    
1164kB time=00:00:02.72 bitrate=3503.4kbits/sframe=   24 fps= 10 q=2.0 
size=    1280kB time=00:00:03.27 bitrate=3197.6kbits/sframe=   31 fps= 
11 q=2.0 size=    1821kB time=00:00:03.83 bitrate=3889.2kbits/sframe=   
38 fps= 11 q=2.0 size=    1999kB time=00:00:04.31 
bitrate=3791.1kbits/sframe=   46 fps= 12 q=2.0 size=    2544kB 
time=00:00:04.76 bitrate=4373.6kbits/sframe=   53 fps= 12 q=2.0 size=    
2704kB time=00:00:05.32 bitrate=4162.6kbits/sframe=   61 fps= 12 q=2.0 
size=    3285kB time=00:00:05.87 bitrate=4577.0kbits/sframe=   68 fps= 
12 q=2.0 size=    3863kB time=00:00:06.43 bitrate=4917.1kbits/sframe=   
74 fps= 12 q=2.0 size=    4069kB time=00:00:06.99 
bitrate=4766.7kbits/sframe=   81 fps= 12 q=2.0 size=    4685kB 
time=00:00:07.54 bitrate=5083.7kbits/sframe=   89 fps= 13 q=2.0 size=    
4831kB time=00:00:07.92 bitrate=4995.9kbits/sframe=   97 fps= 13 q=2.0 
size=    5450kB time=00:00:08.47 bitrate=5264.8kbits/sframe=  103 fps= 
13 q=2.0 size=    6060kB time=00:00:09.03 bitrate=5493.5kbits/sframe=  
109 fps= 13 q=2.0 size=    6264kB time=00:00:09.59 
bitrate=5348.0kbits/s[mpeg1video @ 0x19f6300] warning, clipping 1 dct 
coefficients to -255..255
frame=  114 fps= 12 q=2.0 size=    7119kB time=00:00:10.15 
bitrate=5744.9kbits/sframe=  118 fps= 12 q=2.0 size=    7776kB 
time=00:00:10.62 bitrate=5992.4kbits/sframe=  123 fps= 12 q=2.0 size=    
8861kB time=00:00:11.08 bitrate=6551.0kbits/sframe=  131 fps= 12 q=2.0 
size=    9564kB time=00:00:11.63 bitrate=6732.1kbits/sframe=  138 fps= 
12 q=2.0 size=   10323kB time=00:00:12.19 bitrate=6934.6kbits/sframe=  
143 fps= 12 q=2.0 size=   10548kB time=00:00:12.75 
bitrate=6775.8kbits/sframe=  150 fps= 12 q=2.0 size=   11142kB 
time=00:00:13.30 bitrate=6857.6kbits/sframe=  155 fps= 12 q=2.0 size=   
11378kB time=00:00:13.68 bitrate=6812.9kbits/sframe=  159 fps= 12 q=2.0 
size=   12038kB time=00:00:14.23 bitrate=6926.1kbits/sframe=  165 fps= 
12 q=2.0 size=   13078kB time=00:00:14.79 bitrate=7241.2kbits/sframe=  
171 fps= 12 q=2.0 size=   14252kB time=00:00:15.26 
bitrate=7647.2kbits/sframe=  177 fps= 12 q=2.0 size=   14755kB 
time=00:00:15.72 bitrate=7687.2kbits/sframe=  181 fps= 12 q=2.0 size=   
15391kB time=00:00:16.28 bitrate=7744.1kbits/sframe=  188 fps= 12 q=2.0 
size=   16132kB time=00:00:16.83 bitrate=7847.9kbits/sframe=  195 fps= 
12 q=2.0 size=   17373kB time=00:00:17.39 bitrate=8180.9kbits/s    Last 
message repeated 2 times
frame=  201 fps= 12 q=2.0 Lsize=   19247kB time=00:00:17.95 
bitrate=8782.3kbits/s
video:14867kB audio:3093kB global headers:0kB muxing overhead 7.166209%

On Gentoo, I get 2 to 4 FPS -

ffmpeg -f alsa -i default -f x11grab -s 1280x800 -i :0.0 -qscale 2 
-threads 1 -b 20000k -vcodec mpeg1video -ar 44100 -ac 2.0 -acodec 
pcm_s16le out.avi
ffmpeg version N-35180-g31a1342, Copyright (c) 2000-2011 the FFmpeg 
developers
   built on Nov 26 2011 11:05:40 with gcc 4.5.3
   configuration: --prefix=/usr --libdir=/usr/lib64 
--shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared 
--cc=x86_64-pc-linux-gnu-gcc --disable-optimizations --disable-static 
--enable-gpl --enable-version3 --enable-postproc --enable-avfilter 
--disable-stripping --disable-debug --disable-doc --disable-network 
--disable-vaapi --disable-vdpau --enable-libmp3lame 
--enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libtheora 
--enable-libvorbis --enable-libx264 --enable-libxvid --enable-libaacplus 
--enable-nonfree --enable-openal --disable-indev=v4l 
--disable-indev=v4l2 --disable-indev=oss --disable-indev=jack 
--enable-x11grab --disable-outdev=oss --enable-libfreetype 
--enable-pthreads --enable-libopencore-amrwb --enable-libopencore-amrnb 
--enable-libgsm --enable-libdirac --enable-libschroedinger 
--enable-libspeex --enable-libvpx --enable-libopenjpeg --disable-altivec 
--disable-avx --disable-ssse3 --disable-vis --disable-neon 
--disable-iwmmxt --cpu=host --enable-hardcoded-tables
   libavutil    51. 29. 1 / 51. 29. 1
   libavcodec   53. 37. 1 / 53. 37. 1
   libavformat  53. 21. 0 / 53. 21. 0
   libavdevice  53.  4. 0 / 53.  4. 0
   libavfilter   2. 49. 1 /  2. 49. 1
   libswscale    2.  1. 0 /  2.  1. 0
   libpostproc  51.  2. 0 / 51.  2. 0
[alsa @ 0x1515430] Estimating duration from bitrate, this may be inaccurate
Input #0, alsa, from 'default':
   Duration: N/A, start: 1325702995.554633, bitrate: N/A
     Stream #0:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
[x11grab @ 0x1550c10] device: :0.0 -> display: :0.0 x: 0 y: 0 width: 
1280 height: 800
[x11grab @ 0x1550c10] shared memory extension found
[x11grab @ 0x1550c10] Estimating duration from bitrate, this may be 
inaccurate
Input #1, x11grab, from ':0.0':
   Duration: N/A, start: 1325702995.794243, bitrate: 982057 kb/s
     Stream #1:0: Video: rawvideo (BGRA / 0x41524742), bgra, 1280x800, 
982057 kb/s, 29.97 tbr, 1000k tbn, 29.97 tbc
Please use -b:a or -b:v, -b is ambiguous
Incompatible pixel format 'bgra' for codec 'mpeg1video', auto-selecting 
format 'yuv420p'
[buffer @ 0x1551580] w:1280 h:800 pixfmt:bgra tb:1/1000000 sar:0/1 
sws_param:
[buffersink @ 0x151b370] auto-inserting filter 'auto-inserted scale 0' 
between the filter 'src' and the filter 'out'
[scale @ 0x156ddb0] w:1280 h:800 fmt:bgra -> w:1280 h:800 fmt:yuv420p 
flags:0x4
Output #0, avi, to 'out.avi':
   Metadata:
     ISFT            : Lavf53.21.0
     Stream #0:0: Video: mpeg1video (mpg1 / 0x3167706D), yuv420p, 
1280x800, q=2-31, 20000 kb/s, 29.97 tbn, 29.97 tbc
     Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 2 
channels, s16, 1411 kb/s
Stream mapping:
   Stream #1:0 -> #0:0 (rawvideo -> mpeg1video)
   Stream #0:0 -> #0:1 (pcm_s16le -> pcm_s16le)
Press [q] to stop, [?] for help
[alsa @ 0x1515430] ALSA buffer xrun.
frame=   27 fps=  3 q=2.0 Lsize=    4924kB time=00:00:07.64 
bitrate=5272.6kbits/s
video:1495kB audio:1318kB global headers:0kB muxing overhead 75.069700%

Setting -f to null results in  -

ffmpeg -f alsa -i default -f null -s 1280x800 -i :0.0 -qscale 2 -threads 
1 -b 20000k -vcodec mpeg1video -ar 44100 -ac 2.0 -acodec pcm_s16le out.avi
ffmpeg version N-35180-g31a1342, Copyright (c) 2000-2011 the FFmpeg 
developers
   built on Nov 26 2011 11:05:40 with gcc 4.5.3
   configuration: --prefix=/usr --libdir=/usr/lib64 
--shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared 
--cc=x86_64-pc-linux-gnu-gcc --disable-optimizations --disable-static 
--enable-gpl --enable-version3 --enable-postproc --enable-avfilter 
--disable-stripping --disable-debug --disable-doc --disable-network 
--disable-vaapi --disable-vdpau --enable-libmp3lame 
--enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libtheora 
--enable-libvorbis --enable-libx264 --enable-libxvid --enable-libaacplus 
--enable-nonfree --enable-openal --disable-indev=v4l 
--disable-indev=v4l2 --disable-indev=oss --disable-indev=jack 
--enable-x11grab --disable-outdev=oss --enable-libfreetype 
--enable-pthreads --enable-libopencore-amrwb --enable-libopencore-amrnb 
--enable-libgsm --enable-libdirac --enable-libschroedinger 
--enable-libspeex --enable-libvpx --enable-libopenjpeg --disable-altivec 
--disable-avx --disable-ssse3 --disable-vis --disable-neon 
--disable-iwmmxt --cpu=host --enable-hardcoded-tables
   libavutil    51. 29. 1 / 51. 29. 1
   libavcodec   53. 37. 1 / 53. 37. 1
   libavformat  53. 21. 0 / 53. 21. 0
   libavdevice  53.  4. 0 / 53.  4. 0
   libavfilter   2. 49. 1 /  2. 49. 1
   libswscale    2.  1. 0 /  2.  1. 0
   libpostproc  51.  2. 0 / 51.  2. 0
[alsa @ 0x1054430] Estimating duration from bitrate, this may be inaccurate
Input #0, alsa, from 'default':
   Duration: N/A, start: 1325703074.790174, bitrate: N/A
     Stream #0:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s


More information about the ffmpeg-user mailing list