
Recherche avancée
Autres articles (16)
-
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...) -
Librairies et logiciels spécifiques aux médias
10 décembre 2010, parPour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...) -
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;
Sur d’autres sites (3708)
-
Problem compiling libsrt for ffmpeg, library not found using pkg-config
3 juin 2022, par KodsamaI am trying to build ffmpeg and dependencies from sources (as it will be used from a container on aws) but I have hard time with ffmpeg and pkg-config.


I compile static libraries, among which libsrt from sources and put generated files to well defined directories. pkg-config finds srt without problem but ffmpeg doesn't for some reason (see output below).


Here is how it looks like :


Build code (I extracted the interesting parts, other libraries are built as well, I added prints to be able to see what happens) :


echo "*** Building libsrt ***"
cd $BUILD_DIR/srt*
make distclean
PKG_CONFIG_PATH="$TARGET_DIR/lib/pkgconfig" \
 PATH="$BIN_DIR:$PATH" \
 cmake -G "Unix Makefiles" \
 -DCMAKE_INSTALL_PREFIX="$TARGET_DIR" \
 -DCMAKE_INSTALL_LIBDIR="$TARGET_DIR/lib" \
 -DCMAKE_INSTALL_INCLUDEDIR="$TARGET_DIR/include" \
 -DCMAKE_INSTALL_BINDIR="$BIN_DIR" \
 -DENABLE_SHARED:bool=off \
 -DENABLE_C_DEPS:bool=on \
 -DENABLE_STATIC:bool=on
make -j $jval
make install
echo '========================================================================'
pwd
echo "$TARGET_DIR"
echo "$BUILD_DIR"
echo 'target_dir=' && ls "$TARGET_DIR"
echo 'lib=' && ls "$TARGET_DIR/lib"
echo 'lib/pkgconfig=' && ls "$TARGET_DIR/lib/pkgconfig"
echo 'bin_dir=' && ls "$BIN_DIR"
echo 'include=' && ls "$TARGET_DIR/include"
echo 'path=' && echo $PATH
pkg-config --modversion srt
export PKG_CONFIG_PATH="$TARGET_DIR/lib/pkgconfig":$PKG_CONFIG_PATH


echo "*** Building FFmpeg ***"
cd $BUILD_DIR/FFmpeg*
make distclean
PATH="$BIN_DIR:$PATH" \
 ./configure \
 --prefix="$TARGET_DIR" \
 --pkg-config-flags="--static" \
 --extra-cflags="-I$TARGET_DIR/include -I$TARGET_DIR/usr/local/include -I/usr/local/cuda/include" \
 --extra-ldflags="-L$TARGET_DIR/lib -L$TARGET_DIR/usr/local/lib -L/usr/local/cuda/lib64" \
 --extra-libs="-Wl,-Bstatic -lharfbuzz -lfreetype -lpng -lz -lbz2 -Wl,-Bdynamic -lm -ldl -lpthread -lsrt -lssl -lcrypto" \
 --extra-ldexeflags="-Wl,-Bstatic" \
 --nvccflags="-gencode arch=compute_75,code=sm_75 -O2" \
 --bindir="$BIN_DIR" \
 --enable-pic \
 --enable-ffplay \
 --enable-fontconfig \
 --enable-frei0r \
 --enable-gpl \
 --enable-version3 \
 --enable-libass \
 --enable-libfribidi \
 --enable-libfdk-aac \
 --enable-libfreetype \
 --enable-libmp3lame \
 --enable-libopenjpeg \
 --enable-libopus \
 --enable-libsoxr \
 --enable-libspeex \
 --enable-libtheora \
 --enable-libvidstab \
 --enable-libvorbis \
 --enable-libvpx \
 --enable-libwebp \
 --enable-libx264 \
 --enable-libx265 \
 --enable-libxvid \
 --enable-libzimg \
 --enable-nonfree \
 --enable-openssl \
 --enable-cuda-nvcc \
 --enable-cuvid \
 --enable-nvenc \
 --enable-libsrt \
 --enable-libnpp || tail -n 100 ${HOME}/build/FFmpeg*/ffbuild/config.log

PATH="$BIN_DIR:$PATH" make -j $jval
make install



This what I get printed in the logs (I put [...] to take away parts which are not relevant) :


[...]
[100%] Built target srt-file-transmit
Install the project...
-- Install configuration: "Release"
-- Installing: /codebuild/output/ffmpeg/target/lib/libsrt.a
-- Installing: /codebuild/output/ffmpeg/target/include/srt/version.h
-- Installing: /codebuild/output/ffmpeg/target/include/srt/srt.h
-- Installing: /codebuild/output/ffmpeg/target/include/srt/logging_api.h
-- Installing: /codebuild/output/ffmpeg/target/include/srt/access_control.h
-- Installing: /codebuild/output/ffmpeg/target/include/srt/platform_sys.h
-- Installing: /codebuild/output/ffmpeg/target/include/srt/udt.h
-- Installing: /codebuild/output/ffmpeg/target/lib/pkgconfig/haisrt.pc
-- Installing: /codebuild/output/ffmpeg/target/lib/pkgconfig/srt.pc
-- Installing: /codebuild/output/ffmpeg/bin/srt-live-transmit
-- Up-to-date: /codebuild/output/ffmpeg/bin/srt-live-transmit
-- Installing: /codebuild/output/ffmpeg/bin/srt-file-transmit
-- Up-to-date: /codebuild/output/ffmpeg/bin/srt-file-transmit
-- Installing: /codebuild/output/ffmpeg/bin/srt-tunnel
-- Up-to-date: /codebuild/output/ffmpeg/bin/srt-tunnel
-- Installing: /codebuild/output/ffmpeg/bin/srt-ffplay
========================================================================
/codebuild/output/ffmpeg
/codebuild/output/ffmpeg/target
/codebuild/output/ffmpeg/build

target_dir=
bin
etc
include
lib
share
ssl
var

lib=
cmake
[...]
libsrt.a
libssl.a
[...]
pkgconfig

lib/pkgconfig=
[...]
haisrt.pc
[...]
libcrypto.pc
libssl.pc
[...]
openssl.pc
[...]
srt.pc
[...]

bin_dir=
[...]
srt-ffplay
srt-file-transmit
srt-live-transmit
srt-tunnel
[...]

include=
[...]
srt
[...]

path=
/root/.cargo/bin:/root/miniconda3/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/codebuild/user/bin
1.4.3
========================================================================
*** Building FFmpeg ***
ERROR: srt >= 1.3.0 not found using pkg-config

If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.
tail: cannot open '/root/build/FFmpeg*/ffbuild/config.log' for reading: No such file or directory

[Container] 2021/06/09 15:03:22 Command did not exit successfully ./build.sh exit status 1
[Container] 2021/06/09 15:03:22 Phase complete: BUILD State: FAILED
[Container] 2021/06/09 15:03:22 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: ./build.sh. Reason: exit status 1



Any idea what can be wrong ?


Thanks !


-
Passing bytes to ffmpeg in python with io
8 juin 2021, par TrykowoSorry, new to stackoverflow


Just wondering if it's possible to pass byte data from io.

I'm trying to extract frames from a gif with ffmpeg then use Pillow to resize it.

I know you can extract frames from a gif with Pillow, but sometimes it butchers certain gifs. So I'm using ffmpeg as a fix.

As for why I'd like the gif to be read from memory is because I'm going to change this so gifs from urls will be wrapped in Bytesio instead of saving.

As for why I have the extra Pillow code, I did successfully get it working by passing an actual filename into the ffmpeg command.


original_pil = Image.open("1.gif")

bytes_io = open("1.gif", "rb")
bytes_io.seek(0)

ffmpeg = 'ffmpeg'

cmd = [ffmpeg,
 '-i', '-',
 '-vsync', '0',
 '-f', 'image2pipe',
 '-pix_fmt', 'rgba',
 '-vcodec', 'png',
 '-report',
 '-']

depth = 4
width, height = original_pil.size
buf_size = depth * width * height + 100
nbytes = width * height * 4

proc = SP.Popen(cmd, stdout=SP.PIPE, stdin=SP.PIPE, stderr=SP.PIPE, bufsize=buf_size, shell=False)
out, err = proc.communicate(input=bytes_io.read(), timeout=None)



FFMPEG report :


ffmpeg started on 2021-06-07 at 18:58:14
Report written to "ffmpeg-20210607-185814.log"
Command line:
ffmpeg -i - -vsync 0 -f image2pipe -pix_fmt rgba -vcodec png -report -
ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
 built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
 configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --ena WARNING: library configuration mismatch
 avcodec configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enab libavutil 56. 31.100 / 56. 31.100
 libavcodec 58. 54.100 / 58. 54.100
 libavformat 58. 29.100 / 58. 29.100
 libavdevice 58. 8.100 / 58. 8.100
 libavfilter 7. 57.100 / 7. 57.100
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 5.100 / 5. 5.100
 libswresample 3. 5.100 / 3. 5.100
 libpostproc 55. 5.100 / 55. 5.100
Splitting the commandline.
Reading option '-i' ... matched as input url with argument '-'.
Reading option '-vsync' ... matched as option 'vsync' (video sync method) with argument '0'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'image2pipe'.
Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel format) with argument 'rgba'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'png'.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option vsync (video sync method) with argument 0.
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url -.
Successfully parsed a group of options.
Opening an input file: -.
[NULL @ 0x55b59c38f7c0] Opening 'pipe:' for reading
[pipe @ 0x55b59c390240] Setting default whitelist 'crypto'
[gif @ 0x55b59c38f7c0] Format gif probed with size=2048 and score=100
[AVIOContext @ 0x55b59c398680] Statistics: 4614093 bytes read, 0 seeks
pipe:: Input/output error



-
bad audio mic recording quality with ffmpeg compared to sox
1er juillet 2021, par user2355330I am contacting you as after 3 days of searching I am stuck on a really simple point.


I want to record the sound of my mic on MacOS using ffmpeg.


I managed to do it using the following command :


ffmpeg -f avfoundation -audio_device_index 2 -i "none:-" -c:a pcm_s32l alexspeaking.wav -y -loglevel debug



The issue is that each time I am speaking, there are cracks and pop in the sound...


I tried to use sox and it gave me a perfect and crystal clear sound and I have no idea why... Below is the output of the sox command :


sox -t coreaudio "G935 Gaming Headset" toto.wav -V6
sox: SoX v
time: Nov 15 2020 01:06:02
uname: Darwin MacBook-Pro.local 20.5.0 Darwin Kernel Version 20.5.0: Sat May 8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64
compiler: gcc Apple LLVM 12.0.0 (clang-1200.0.32.27)
arch: 1288 48 88 L
sox INFO coreaudio: Found Audio Device "DELL U2721DE"
sox INFO coreaudio: Found Audio Device "G935 Gaming "
sox DBUG coreaudio: audio device did not accept 2 channels. Use 1 channels instead.
sox DBUG coreaudio: audio device did not accept 44100 sample rate. Use 48000 instead.
Input File : 'G935 Gaming Headset' (coreaudio)
Channels : 1
Sample Rate : 48000
Precision : 32-bit
Sample Encoding: 32-bit Signed Integer PCM
Endian Type : little
Reverse Nibbles: no
Reverse Bits : no
sox INFO sox: Overwriting `toto.wav'
sox DBUG wav: Writing Wave file: Microsoft PCM format, 1 channel, 48000 samp/sec
sox DBUG wav: 192000 byte/sec, 4 block align, 32 bits/samp
Output File : 'toto.wav'
Channels : 1
Sample Rate : 48000
Precision : 32-bit
Sample Encoding: 32-bit Signed Integer PCM
Endian Type : little
Reverse Nibbles: no
Reverse Bits : no
Comment : 'Processed by SoX'
sox DBUG effects: sox_add_effect: extending effects table, new size = 8
sox INFO sox: effects chain: input 48000Hz 1 channels (multi) 32 bits unknown length
sox INFO sox: effects chain: output 48000Hz 1 channels (multi) 32 bits unknown length
sox DBUG sox: start-up time = 0.051332
In:0.00% 00:00:07.13 [00:00:00.00] Out:340k [ | ] Clip:0 ^C
sox DBUG input: output buffer still held 2048 samples; dropped.
Aborted.
sox DBUG wav: Finished writing Wave file, 1359872 data bytes 339968 samples



I am pretty sure the issue is linked to the way the encoding is done and the params I used with ffmpeg but I don't seem to be able to grasp which one I must use.


Any ideas if there are ffmpeg experts here ?