2010-07-01

Slitaz -- ffmpeg / x11grab

352x288 (default)

1280x1024

1. install xorg-xextproto xorg-libXfixes-dev xorg-libXext-dev
# tazpkg get-install xorg-xextproto
# tazpkg get-install xorg-libXfixes-dev
# tazpkg get-install xorg-libXext-dev

2. enable-x11grab
edit /home/slitaz/wok/ffmpeg/receipt

# Rules to configure and make the package.
compile_rules()
{
cd $src
./configure \
--prefix=/usr \
--enable-gpl \
--arch=i486 \
--cpu=i486 \
--enable-shared \
--enable-small \
--enable-pthreads \
--enable-postproc \
--enable-x11grab \
--disable-mmx \
--disable-mmx2 \
--disable-ssse3 &&
make &&
make DESTDIR=$PWD/_pkg install
}

3. add -lXfixes
edit /home/slitaz/wok/ffmpeg/stuff/configure

[..]
line #2135
# deal with the X11 frame grabber
enabled x11grab &&
check_header X11/Xlib.h &&
check_header X11/extensions/XShm.h &&
check_func XOpenDisplay -lX11 &&
check_func XShmCreateImage -lX11 -lXext -lXfixes
[..]

root@slitaz-3:/home/slitaz/wok# tazpkg info ffmpeg

Tazpkg information
================================================================================
Package : ffmpeg
Version : 0.5
Category : multimedia
Short desc : Record, convert and stream audio and video.
Maintainer : pascal.bellard@slitaz.org
Depends : bzlib freetype imlib2 alsa-lib jack-audio-connection-kit zlib
Suggested : ffplay
Build deps : imlib2-dev freetype-dev libsdl-dev zlib-dev coreutils-file-format xorg-xextproto xorg-libXfixes-dev xorg-libXext-dev
Web site : http://ffmpeg.org/
================================================================================

root@slitaz-3:/home/slitaz/wok# tazpkg info ffplay

Tazpkg information
================================================================================
Package : ffplay
Version : 0.5
Category : multimedia
Short desc : Very simple and portable media player using the ffmpeg and the SDL library.
Maintainer : pascal.bellard@slitaz.org
Depends : ffmpeg libsdl
Wanted src : ffmpeg
Web site : http://ffmpeg.org/
================================================================================

root@slitaz-3:/home/slitaz/wok# ls -l ../packages/ff*
-rw-r--r-- 1 root root 1299204 Jul 2 09:19 ../packages/ffmpeg-0.5.tazpkg
-rw-r--r-- 1 root root 1411916 Jul 2 09:19 ../packages/ffmpeg-dev-0.5.tazpkg
-rw-r--r-- 1 root root 20468 Jul 2 09:19 ../packages/ffplay-0.5.tazpkg
root@slitaz-3:/home/slitaz/wok# ffmpeg -f x11grab -s cif -r 30 -i :0.0 /tmp/out.mpg
FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --prefix=/usr --enable-gpl --arch=i486 --cpu=i486 --enable-shared --enable-small --enable-pthreads --enable-postproc --enable-x11grab --disable-mmx --disable-mmx2 --disable-ssse3
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 0 / 52.20. 0
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Jul 2 2010 09:18:59, gcc: 4.4.1
[x11grab @ 0x8062290]device: :0.0 -> display: :0.0 x: 0 y: 0 width: 352 height: 288
[x11grab @ 0x8062290]shared memory extension found
Input #0, x11grab, from ':0.0':
Duration: N/A, start: 1278063783.835441, bitrate: 97320 kb/s
Stream #0.0: Video: rawvideo, rgb32, 352x288, 97320 kb/s, 30 tbr, 1000k tbn, 30 tbc
Output #0, mpeg, to '/tmp/out.mpg':
Stream #0.0: Video: mpeg1video, yuv420p, 352x288, q=2-31, 200 kb/s, 90k tbn, 30 tbc
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
frame= 1198 fps= 30 q=31.0 Lsize= 1650kB time=39.90 bitrate= 338.8kbits/s
video:1639kB audio:0kB global headers:0kB muxing overhead 0.642477%
root@slitaz-3:/home/slitaz/wok# ls -l /tmp/out.mpg
-rw-r--r-- 1 root root 1689600 Jul 2 09:43 /tmp/out.mpg
root@slitaz-3:/home/slitaz/wok# ffplay /tmp/out.mpg
FFplay version 0.5, Copyright (c) 2003-2009 Fabrice Bellard, et al.
configuration: --prefix=/usr --enable-gpl --arch=i486 --cpu=i486 --enable-shared --enable-small --enable-pthreads --enable-postproc --enable-x11grab --disable-mmx --disable-mmx2 --disable-ssse3
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 0 / 52.20. 0
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Jul 2 2010 09:18:59, gcc: 4.4.1
root@slitaz-3:/home/slitaz/wok#

----

Unknown input or output format: x11grab (Ubuntu)
.