Recherche avancée

Médias (1)

Mot : - Tags -/getid3

Autres articles (66)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (8400)

  • Normalizing audio in ffmpeg - how ?

    11 novembre 2020, par Betty Crokker

    I'm creating one of those "Brady Bunch" videos for a choir using a C# application I'm writing that uses ffmpeg for all the heavy lifting, and for the most part it's working great but I'm having trouble getting the audio levels just right.

    


    What I'm doing right now, is first "normalizing" the audio from the individual singers like this :

    


      

    • Extract audio into a WAV file using ffmpeg
    • 


    • Load the WAV file into my application using NAudio
    • 


    • Find the maximum 16-bit value
    • 


    • When I create the merged video, specify a volume for this stream that boosts the maximum value to 32767
    • 


    


    So, for example, if I have 3 streams : stream A's maximum audio is 32767 already, stream B's maximum audio is 32000, and stream C's maximum audio is 16000, then when I merge these videos I will specify

    


    [0:a]volume=1.0,aresample=async=1:first_pts=0[aud0]
[1:a]volume=1.02,aresample=async=1:first_pts=0[aud1]
[2:a]volume=2.05,aresample=async=1:first_pts=0[aud2]
[aud0][aud1][aud2]amix=inputs=3[a]


    


    (I have an additional "volume tweak" that lets me adjust the volume level of individual singers as necessary, but we can ignore that for this question)

    


    I am reading the ffmpeg wiki on Audio Volume Manipulation, and I will implement that next, but I don't know what to do with the output it generates. It looks like I'm going to get mean and max volume levels in dB and while I understand decibels in a "yeah, I learned about those in college 30 years ago" kind of way, I don't know how to use those values to normalize the audio of my input videos.

    


    The problem is, in the ffmpeg output video, the audio level is quite low. If I do the same process of extracting the audio and looking at the WAV file in the merged video that ffmpeg generated, the maximum value is only 4904.

    


    How do I implement an algorithm that automatically sets the output volume to a "reasonable" level ? I realize I can simply add a manual volume filter and have the human set the level, but that's going to be a lot of back & forth of generating the merged video, listening to it, adjusting the level, merging again, etc. I want a way where my application figures out an appropriate output volume (possibly with human adjustment allowed).

    


    EDIT

    


    Asking ffmpeg to determine the mean and max volume of each clip does provide mean and max volume in dB, and I can then use those values to scale each input clip :

    


    [0:a]volume=3.40dB,aresample=async=1:first_pts=0[aud0]
[1:a]volume=3.90dB,aresample=async=1:first_pts=0[aud1]
[2:a]volume=4.40dB,aresample=async=1:first_pts=0[aud2]
[3:a]volume=-0.00dB,aresample=async=1:first_pts=0[aud3]


    


    But my final video is still strangely quiet. For now, I've added a manually-entered volume factor that gets applied at the very end :

    


    [aud0][aud1][aud2]amix=inputs=3[a]
[a]volume=volume=3.00[b]


    


    So my question is, in effect, how do I determine algorithmically what this final volume factor needs to be ?

    


    MORE EDIT

    


    There's something deeper going on here, I just set the volume filter to 100 and the output is only slightly louder. Here are my filters, and the relevant portions of the command line :

    


    color=size=1920x1080:c=0x0000FF [base];
[0:v] scale=576x324 [clip0];
[0:a]volume=1.48,aresample=async=1:first_pts=0[aud0];
[1:v] crop=808:1022:202:276,scale=384x486 [clip1];
[1:a]volume=1.57,aresample=async=1:first_pts=0[aud1];
[2:v] crop=1160:1010:428:70,scale=558x486 [clip2];
[2:a]volume=1.66,aresample=async=1:first_pts=0[aud2];
[3:v] crop=1326:1080:180:0,scale=576x469 [clip3];
[3:a]volume=1.70,aresample=async=1:first_pts=0[aud3];
[4:a]volume=0.20,aresample=async=1:first_pts=0[aud4];
[5:a]volume=0.73,aresample=async=1:first_pts=0[aud5];
[6:v] crop=1326:1080:276:0,scale=576x469 [clip4];
[6:a]volume=1.51,aresample=async=1:first_pts=0[aud6];
[base][clip0] overlay=shortest=1:x=32:y=158 [tmp0];
[tmp0][clip1] overlay=shortest=1:x=768:y=27 [tmp1];
[tmp1][clip2] overlay=shortest=1:x=1321:y=27 [tmp2];
[tmp2][clip3] overlay=shortest=1:x=32:y=625 [tmp3];
[tmp3][clip4] overlay=shortest=1:x=672:y=625 [tmp4];
[aud0][aud1][aud2][aud3][aud4][aud5][aud6]amix=inputs=7[a];
[a]adelay=delays=200:all=1[b];
[b]volume=volume=100.00[c];
[c]asplit[a1][a2];

ffmpeg -y ....
   -map "[tmp4]" -map "[a1]" -c:v libx264 "D:\voutput.mp4" 
   -map "[a2]" "D:\aoutput.mp3""


    


    When I do this, the audio I want is louder (loud enough to clip and get distorted), but definitely not 100x louder.

    


  • ffmpeg build fails with gcc error even with gcc installed (C compiler test failed)

    15 mars 2023, par Martin

    I am on macos 11.2.3, trying to build ffmpeg in my terminal. When I run my script sh buildffmpeg.sh which is below :

    


    #!/bin/bash

# If you get error `c compiler failed` run `sudo apt install libglfw3-dev libglew-dev`
# apt-get install build-essential
# apt-get build-dep ffmpeg
# when running this on mac, you need to install some libraries such as 'brew install opus'

set -e

CWD=$(pwd)
PACKAGES="$CWD/packages"
WORKSPACE="$CWD/workspace"
ADDITIONAL_CONFIGURE_OPTIONS=""


mkdir -p "$PACKAGES"
mkdir -p "$WORKSPACE"

FFMPEG_TAG="$1"
FFMPEG_URL="http://git.ffmpeg.org/gitweb/ffmpeg.git/snapshot/74c4c539538e36d8df02de2484b045010d292f2c.tar.gz"

FFMPEG_ARCHIVE="$PACKAGES/ffmpeg.tar.gz"

if [ ! -f "$FFMPEG_ARCHIVE" ]; then
    echo "Downloading tag ${FFMPEG_TAG}..."
    curl -L -o "$FFMPEG_ARCHIVE" "$FFMPEG_URL"
fi

EXTRACTED_DIR="$PACKAGES/extracted"

mkdir -p "$EXTRACTED_DIR"

echo "Extracting..."
tar -xf "$FFMPEG_ARCHIVE" --strip-components=1 -C "$EXTRACTED_DIR"

cd "$EXTRACTED_DIR"

echo "Building..."

# Min electron supported version
MACOS_MIN="10.10"

./configure $ADDITIONAL_CONFIGURE_OPTIONS \
    --pkgconfigdir="$WORKSPACE/lib/pkgconfig" \
    --prefix=${WORKSPACE} \
    --pkg-config-flags="--static" \
    --extra-libs=-static \
    --extra-cflags=--static \
    --enable-cross-compile \
    --extra-cflags="-I$WORKSPACE/include -mmacosx-version-min=${MACOS_MIN}" \
    --extra-ldflags="-L$WORKSPACE/lib -mmacosx-version-min=${MACOS_MIN} -L/usr/local/opt/lame/lib -Wl,-rpath,/usr/local/opt/lame/lib" \
    --extra-libs="-lpthread -lm" \
    --enable-static \
    --disable-securetransport \
    --disable-debug \
    --disable-shared \
    --disable-ffplay \
    --disable-lzma \
    --disable-doc \
    --enable-version3 \
    --enable-pthreads \
    --enable-runtime-cpudetect \
    --enable-avfilter \
    --enable-filters \
    --disable-libxcb \
    --enable-gpl \
    --disable-libass \
    --enable-libmp3lame \
    --enable-libx264 \
    --enable-libopus

make -j 4
make install

otool -L "$WORKSPACE/bin/ffmpeg"
otool -L "$WORKSPACE/bin/ffprobe"

echo "Building done. The binaries can be found here: $WORKSPACE/bin/ffmpeg $WORKSPACE/bin/ffprobe"

mkdir ffmpeg-mac/ 
cp -r "$WORKSPACE/bin/" "$CWD/ffmpeg-mac/"

rm -rf "$PACKAGES"
rm -rf "$WORKSPACE"

exit 0



    


    It fails with this error :

    


    > sh buildffmpeg.sh

Extracting...
Building...
gcc is unable to create an executable file.
C compiler test failed.

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.


    


    I have been trying to solve this error, and have installed gcc with brew, if i run gcc -v I can see my installed gcc version :

    


    $ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/12.2.0/bin/../libexec/gcc/x86_64-apple-darwin20/12/lto-wrapper
Target: x86_64-apple-darwin20
Configured with: ../configure --prefix=/usr/local/opt/gcc --libdir=/usr/local/opt/gcc/lib/gcc/current --disable-nls --enable-checking=release --with-gcc-major-version-only --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-12 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-zstd=/usr/local/opt/zstd --with-pkgversion='Homebrew GCC 12.2.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --with-system-zlib --build=x86_64-apple-darwin20 --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (Homebrew GCC 12.2.0) 


    


    So if gcc is installed correctly (i think) why is it failing with a gcc error when I build ffmpeg ?

    


    ffbuild/config.log :

    


    ...
mktemp -u XXXXXX
9v9a2o
test_ld cc
test_cc
BEGIN /var/folders/p7/w8ysrm_x76v_z4n3nk70yd6m0000gn/T//ffconf.rUw6aGKJ/test.c
    1   int main(void){ return 0; }
END /var/folders/p7/w8ysrm_x76v_z4n3nk70yd6m0000gn/T//ffconf.rUw6aGKJ/test.c
gcc --static -I/Users/martinbarker/Documents/projects/rendertunev1.1.2/workspace/include -mmacosx-version-min=10.10 -c -o /var/folders/p7/w8ysrm_x76v_z4n3nk70yd6m0000gn/T//ffconf.rUw6aGKJ/test.o /var/folders/p7/w8ysrm_x76v_z4n3nk70yd6m0000gn/T//ffconf.rUw6aGKJ/test.c
gcc -L/Users/martinbarker/Documents/projects/rendertunev1.1.2/workspace/lib -mmacosx-version-min=10.10 -L/usr/local/opt/lame/lib -Wl,-rpath,/usr/local/opt/lame/lib -o /var/folders/p7/w8ysrm_x76v_z4n3nk70yd6m0000gn/T//ffconf.rUw6aGKJ/test /var/folders/p7/w8ysrm_x76v_z4n3nk70yd6m0000gn/T//ffconf.rUw6aGKJ/test.o -lpthread -lm -static
ld: warning: directory not found for option '-L/Users/martinbarker/Documents/projects/rendertunev1.1.2/workspace/lib'
ld: library not found for -lcrt0.o
collect2: error: ld returned 1 exit status
C compiler test failed.



    


    gcc test :

    


    apples-MacBook:gcctest apple$ export CC=$(which gcc)
apples-MacBook:gcctest apple$ export CXX=$(which g++)
apples-MacBook:gcctest apple$ ls
minimal.c
apples-MacBook:gcctest apple$ gcc -static -Wall -o minimal minimal.c -v
Apple LLVM version 10.0.0 (clang-1000.10.44.4)
Target: x86_64-apple-darwin17.0.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
 "/Library/Developer/CommandLineTools/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.13.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name minimal.c -static-define -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fno-strict-return -masm-verbose -munwind-tables -target-cpu penryn -dwarf-column-info -debugger-tuning=lldb -target-linker-version 409.12 -v -resource-dir /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0 -Wall -fdebug-compilation-dir /Users/apple/Documents/projects/gcctest -ferror-limit 19 -fmessage-length 157 -stack-protector 1 -fblocks -fencode-extended-block-signature -fobjc-runtime=macosx-10.13.0 -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o /var/folders/7t/d2z0gq194s92vn5xz923gq5h0000gn/T/minimal-8cfbfc.o -x c minimal.c
clang -cc1 version 10.0.0 (clang-1000.10.44.4) default target x86_64-apple-darwin17.0.0
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include
 /Library/Developer/CommandLineTools/usr/include
 /usr/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
 "/Library/Developer/CommandLineTools/usr/bin/ld" -demangle -lto_library /Library/Developer/CommandLineTools/usr/lib/libLTO.dylib -no_deduplicate -static -arch x86_64 -macosx_version_min 10.13.0 -o minimal -lcrt0.o /var/folders/7t/d2z0gq194s92vn5xz923gq5h0000gn/T/minimal-8cfbfc.o
ld: library not found for -lcrt0.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)


    


  • Error in compiling x264 on ARM 64-bit platform

    2 septembre 2021, par yanzhang.guo

    The same x264 source code I compiled on Debian 10 (Buster) system has no problem, but I can't compile it on an ARM 64-bit platform. Why ?

    


    Maybe there is something wrong with the Makefile, but I don't know where it is.

    


      

    1. Configure

      


      ./configure --disable-asm --enable-shared  --host=aarch64-linux

platform:      AARCH64
byte order:    little-endian
system:        LINUX
cli:           yes
libx264:       internal
shared:        yes
static:        no
asm:           no
interlaced:    yes
avs:           avxsynth
lavf:          no
ffms:          no
mp4:           no
gpl:           yes
thread:        posix
opencl:        yes
filters:       crop select_every
lto:           no
debug:         no
gprof:         no
strip:         no
PIC:           yes
bit depth:     all
chroma format: all


      


    2. 


    3. Edit file config.mak,

      


      SRCPATH=.
prefix=/usr/local
exec_prefix=${prefix}
bindir=${exec_prefix}/bin
libdir=${exec_prefix}/lib
includedir=${prefix}/include
SYS_ARCH=AARCH64
SYS=LINUX
CC=aarch64-linux-gnu-gcc
CFLAGS=-Wno-maybe-uninitialized -Wshadow -O3 -ffast-math  -Wall -I. -I$(SRCPATH) -std=gnu99 -
D_GNU_SOURCE -fPIC -fomit-frame-pointer -fno-tree-vectorize
COMPILER=GNU
COMPILER_STYLE=GNU
DEPMM=-MM -g0
DEPMT=-MT
LD=aarch64-linux-gnu-gcc -o
LDFLAGS= -lm -lpthread -ldl
LIBX264=libx264.a
AR=aarch64-linux-gnu-gcc-ar rc
RANLIB=aarch64-linux-gnu-gcc-ranlib
STRIP=aarch64-linux-gnu-strip
INSTALL=install
AS=
ASFLAGS= -I. -I$(SRCPATH) -DSTACK_ALIGNMENT=16 -DPIC
RC=
RCFLAGS=
EXE=
HAVE_GETOPT_LONG=1
DEVNULL=/dev/null
PROF_GEN_CC=-fprofile-generate
PROF_GEN_LD=-fprofile-generate
PROF_USE_CC=-fprofile-use
PROF_USE_LD=-fprofile-use
HAVE_OPENCL=yes
CC_O=-o $@
default: cli
install: install-cli
SOSUFFIX=so
SONAME=libx264.so.157
SOFLAGS=-shared -Wl,-soname,$(SONAME)  -Wl,-Bsymbolic
default: lib-shared
install: install-lib-shared
LDFLAGSCLI = -ldl
CLI_LIBX264 = $(LIBX264)


      


    4. 


    5. Make, an error occurred, details in error.

      


    6. 


    7. Add file config.h after configure,

      


       #define HAVE_MALLOC_H 1
 #define ARCH_X86_64 1
 #define SYS_LINUX 1
 #define STACK_ALIGNMENT 64
 #define HAVE_POSIXTHREAD 1
 #define HAVE_CPU_COUNT 1
 #define HAVE_THREAD 1
 #define HAVE_LOG2F 1
 #define HAVE_STRTOK_R 1
 #define HAVE_CLOCK_GETTIME 1
 #define HAVE_MMAP 1
 #define HAVE_THP 1
 #define HAVE_AVS 1
 #define USE_AVXSYNTH 1
 #define HAVE_VECTOREXT 1
 #define fseek fseeko
 #define ftell ftello
 #define HAVE_BITDEPTH8 1
 #define HAVE_BITDEPTH10 1
 #define HAVE_GPL 1
 #define HAVE_INTERLACED 1
 #define HAVE_OPENCL (BIT_DEPTH==8)
 #define HAVE_ALTIVEC 0
 #define HAVE_ALTIVEC_H 0
 #define HAVE_MMX 0
 #define HAVE_ARMV6 0
 #define HAVE_ARMV6T2 0
 #define HAVE_NEON 0
 #define HAVE_BEOSTHREAD 0
 #define HAVE_WIN32THREAD 0
 #define HAVE_SWSCALE 0
 #define HAVE_LAVF 0
 #define HAVE_FFMS 0
 #define HAVE_GPAC 0
 #define HAVE_LSMASH 0
 #define HAVE_X86_INLINE_ASM 0
 #define HAVE_AS_FUNC 0
 #define HAVE_INTEL_DISPATCHER 0
 #define HAVE_MSA 0
 #define HAVE_WINRT 0
 #define HAVE_VSX 0
 #define HAVE_ARM_INLINE_ASM 0


      


    8.