Bluid minimal ffmpeg on raspberrypi
Lundi 14 décembre 2020If you have a minimalist raspian system and you want to install ffmpeg, with the command apt install ffmpeg you will find yourself in front of a huge list of dependencies, and more than 700MB of downloads.
Why not choose to compile a minimalist ffmpeg that will meet your needs:
Download source file:
wget -O ffmpeg-snapshot.tar.bz2 https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz
Extract file content:
tar xvjf ffmpeg-snapshot.tar.bz2
Run configure script
./configure --extra-libs="-lpthread -lm -latomic"
Now, build
make -j4
Check version
user@raspberrypi:~/ffmpeg/ffmpeg $ ./ffmpeg -version
ffmpeg version N-100408-g081a179 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 8 (Raspbian 8.3.0-6+rpi1)
configuration: --extra-libs='-lpthread -lm -latomic'
libavutil 56. 62.100 / 56. 62.100
libavcodec 58.115.102 / 58.115.102
libavformat 58. 65.100 / 58. 65.100
libavdevice 58. 11.103 / 58. 11.103
libavfilter 7. 93.100 / 7. 93.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
user@raspberrypi:~/ffmpeg/ffmpeg $ ldd ./ffmpeg
linux-vdso.so.1 (0x7ecc4000)
/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so => /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so (0x76ec7000)
libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x76e45000)
libz.so.1 => /lib/arm-linux-gnueabihf/libz.so.1 (0x76e1a000)
libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x76df0000)
libatomic.so.1 => /usr/lib/arm-linux-gnueabihf/libatomic.so.1 (0x76dd7000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x76c89000)
/lib/ld-linux-armhf.so.3 (0x76edc000)
Use it to download snapshot from network camera:
./ffmpeg -i rtsp://192.168.1.17:554/user=admin_password=tlJwpbo6_channel=0_stream=0.sdp?real_stream -vframes 1 -r 1 -vframes 1 -r 1 output.jpeg