Recherche avancée

Médias (1)

Mot : - Tags -/copyleft

Autres articles (67)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (8537)

  • passing script variable of filename with spaces in bash to external program (ffmpeg) fails

    13 janvier 2016, par BostonScott

    Short story : I’m trying to write a script that will use FFmpeg to convert the many files stored in one directory to a "standard" mp4 format and save the converted files in another directory. It’s been a learning experience (a fun one !) since I haven’t done any real coding since using Pascal and FORTRAN on an IBM 370 mainframe was in vogue.

    Essentially the script takes the filename, strips the path and extension off it, reassembles the filename with the path and an mp4 extension and calls FFmpeg with some set parameters to do the conversion. If the directory contains only video files with without spaces in the names, then everything works fine. If the filenames contain spaces, then FFmpeg is not able to process the file and moves on to the next one. The error indicates that FFMpeg is only seeing the filename up to the first space. I’ve included both the script and output below.

    Thanks for any help and suggestions you may have. If you think I should be doing this in another way, please by all means, give me your suggestions. As I said, it’s been a long time since I did anything like this. I’m enjoying it though.

    I’ve include the code first followed by example output.

    for file in ./TBC/*.mp4
       do

       echo "Start of iteration"
       echo "Full text of file name:" $file

       #Remove everything up to  "C/" (filename without path)
       fn_orig=${file#*C/}
       echo "Original file name:" $fn_orig

       #Length of file name
       fn_len=${#fn_orig}
       echo "Filename Length:" $fn_len

       #file name without path or extension
       fn_base=${fn_orig:0:$fn_len-4}
       echo "Base file name:" $fn_base

       #new filename suffix
       newsuffix=".conv.mp4"

       fn_out=./CONV/$fn_base$newsuffix
       echo "Converted file name:" $fn_out

       ffmpeg -i $file -metadata title="$fn_orig" -c:v libx264 -c:a libfdk_aac -b:a 128k $fn_out

       echo "End of iteration"
       echo
       done
    echo "Script completed"

    With the ffmpeg line commented out, and two files in the ./TBC directory, this is the output that I get

       Start of iteration
       Full text of file name: ./TBC/Test file with spaces.mp4
       Original filename: Test file with spaces.mp4
       Filename Length: 25
       Base filename: Test file with spaces
       Converted file name: ./CONV/Test file with spaces.conv.mp4
       End of iteration

       Start of iteration
       Full text of file name: ./TBC/Test_file_with_NO_spaces.mp4
       Original file name: Test_file_with_NO_spaces.mp4
       Filename Length: 28
       Base file name: Test_file_with_NO_spaces
       Converted file name: ./CONV/Test_file_with_NO_spaces.conv.mp4
       End of iteration

       Script completed

    I won’t bother to post the results when ffmpeg is uncommented, other than to state that it fails with the error :
    ./TBC/Test : No such file or directory

    The script then continues to the next file which completes successfully because it has no spaces in its name. The actual filename is "Test file with spaces.mp4" so you can see that ffmpeg stops after the word "Test" when it encounters a space.

    I hope this has been clear and concise and hopefully someone will be able to point me in the right direction. There is a lot more that I want to do with this script such as parsing subdirectories and ignoring non-video files, etc.

    I look forward to any insight you can give !

  • How do you create a crossfade transition between multiple videos in FFMPEG ?

    5 janvier 2016, par Katie Yamato

    I am currently looping MP4 videos with audio through FFMPEG. Here is the code

    del intermediate1.ts
    del f.txt
    echo file intermediate1.ts>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt

    ffmpeg -i "SHORT MUSIC.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts -nostdin
    ffmpeg -f concat -i f.txt -c copy -bsf:a aac_adtstoasc "LONG MUSIC.mp4" -nostdin

    However, the transition between each instance of the videos is not smooth. It cuts off as the next instance is shown. Would there be a way create a blend/crossfade transition for the videos ?

    I have come across this method however, it is only for 2 videos
    http://superuser.com/questions/778762/crossfade-between-2-videos-using-ffmpeg

    Hope someone can help me !
    Thank you very much !!

  • Build FFmpeg with Freetype2 for ARM

    28 avril 2016, par Pawel Cala

    I’m trying to build FFmpeg binary file with freetype library included ( I need it for drawtext filter ). Unfortunately I cannot configure ffmpeg properly and every try ends with "freetype not found" error.

    PS I’ve tried to build guardian-ffmpeg project but i’m getting errors during configure process.

    PS2 Building plain ffmpeg works perfectly well

    Configuration script :

    make distclean &./configure --target-os=linux \
    --cross-prefix=arm-linux-androideabi- \
    --arch=arm \
    --cpu=armv7-a \
    --enable-libfreetype --enable-filter=drawtext \ #!Freetype params
    --disable-network \
    --disable-ffplay \
    --disable-ffprobe \
    --disable-ffserver \
    --enable-protocol=file \
    --sysroot=${ANDROID_NDK_ROOT_PATH}/platforms/${ANDROID_API_VERSION}/arch-arm \
    --prefix=build/armeabi-v7a \
    --disable-asm \
    --extra-cflags='-DANDROID -Ifreetype2/ -I${ANDROID_NDK_ROOT_PATH}/sources/cxx-stl/system/include -march=armv7-a -mfloat-abi=softfp' \
    --extra-ldflags='-Wl,--fix-cortex-a8 -Lfreetype2/ -L../android-libs -Wl,-rpath-link,../android-libs' \
    --extra-cxxflags='-Wno-multichar -fno-exceptions -fno-rtti'
    make -j6 && make install || exit 0

    Directories sctructure :

    ffmpeg/
      -ffmpeg dirs/
      -freetype2/
      -rest of ffmpeg files ( including configure, make, etc )

    I’ve checked patch sources in guardian-project and I’ve found that ffmpeg configure file might need some changes in require_libfreetype method ?!

    Thanks in advance ( and sorry for my bad english )

    EDIT :
    Building on OSX Mavericks,
    Last 3 lines of config.log ; OSX hasn’t got pkg-config therefore false in 2nd line :

    require_libfreetype
    false --exists --print-errors freetype
    ERROR: freetype not found

    EDIT :
    SOLUTION !!!

    I’ve manadged to solve my issue. I’ve used Xubuntu 14.04 64bit + Freetype 2.5.3 + newest FFmpeg repo + install linux package "pkg_config" and small modifications in ffmpeg configure script ( find pkg_config and check initialization variable )

    config file for freetype :

    NDK_BASE=/home/dpc/Documents/android-ndk-r9d/
    NDK_PROCESSOR=x86_64
    NDK_PLATFORM_LEVEL=9
    NDK_ABI=arm
    NDK_COMPILER_VERSION=4.6

    # Android NDK setup
    NDK_PLATFORM_LEVEL=9
    NDK_ABI=arm
    NDK_COMPILER_VERSION=4.6
    NDK_SYSROOT=$NDK_BASE/platforms/android-$NDK_PLATFORM_LEVEL/arch-$NDK_ABI
    NDK_UNAME=`uname -s | tr '[A-Z]' '[a-z]'`
    if [ $NDK_ABI = "x86" ]; then
       HOST=i686-linux-android
       NDK_TOOLCHAIN=$NDK_ABI-$NDK_COMPILER_VERSION
    else
       HOST=$NDK_ABI-linux-androideabi
       NDK_TOOLCHAIN=$HOST-$NDK_COMPILER_VERSION
    fi
    NDK_TOOLCHAIN_BASE=$NDK_BASE/toolchains/$NDK_TOOLCHAIN/prebuilt/$NDK_UNAME-$NDK_PROCESSOR
    echo "dpc:" $NDK_TOOLCHAIN_BASE

    CC="$NDK_TOOLCHAIN_BASE/bin/$HOST-gcc --sysroot=$NDK_SYSROOT"
    LD=$NDK_TOOLCHAIN_BASE/bin/$HOST-ld
    STRIP=$NDK_TOOLCHAIN_BASE/bin/$HOST-strip
    PREFIX=$(pwd)/build

    simple_config(){
    make clean
    ./configure --host=arm-linux-androideabi --without-zlib --without-png --prefix=
    make -j4
    make install DESTDIR=$(pwd)
    }

    complex_config(){

       ./configure \
       CC="$CC" \
       LD="$LD" \
       CFLAGS="-std=gnu99 -mcpu=cortex-a8 -marm -mfloat-abi=softfp -mfpu=neon" \
       --host=$HOST \
       --with-sysroot="$NDK_SYSROOT" \
       --enable-static \
       --disable-shared \
       --prefix=$PREFIX
       --without-bzip2

       make -j4
       make install
    }


    make clean
    complex_config

    ffmpeg config file :

    #!/bin/sh

    ANDROID_NDK_ROOT_PATH=/home/dpc/Documents/android-ndk-r9d
    ANDROID_API_VERSION=android-9
    #export PATH=${ANDROID_NDK_ROOT_PATH}:${ANDROID_NDK_ROOT_PATH}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/:$PATH
    export PATH=${ANDROID_NDK_ROOT_PATH}:${ANDROID_NDK_ROOT_PATH}/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/:$PATH
    echo $PATH
    #export PKG_CONFIG_PATH=/home/dpc/Documents/freetype-2.5.3/build/lib/pkgconfig/
    #echo $PKG_CONFIG_PATH

    #armv7-a neon
    #export ARCH=armeabi-v7a-neon
    #./configure --target-os=linux --cross-prefix=arm-linux-androideabi- --arch=arm --cpu=armv7-a --sysroot=${ANDROID_NDK_ROOT_PATH}/platforms/${ANDROID_API_VERSION}/arch-arm --disable-avdevice --disable-decoder=h264_vdpau  --prefix=build/armeabi-v7a-neon --extra-cflags='-DANDROID -I${ANDROID_NDK_ROOT_PATH}/sources/cxx-stl/system/include -march=armv7-a -mfloat-abi=softfp -mfpu=neon' --extra-ldflags='-Wl,--fix-cortex-a8 -L../android-libs -Wl,-rpath-link,../android-libs' --extra-cxxflags='-Wno-multichar -fno-exceptions -fno-rtti'
    #make -j6 && make install && make distclean|| exit 0

    #armv7-a
    export ARCH=armeabi-v7a
    ./configure --target-os=linux \
    --cross-prefix=arm-linux-androideabi- \
    --arch=arm \
    --enable-libfreetype \
    --cpu=armv7-a \
    --sysroot=${ANDROID_NDK_ROOT_PATH}/platforms/${ANDROID_API_VERSION}/arch-arm \
    --disable-avdevice \
    --disable-decoder=h264_vdpau  \
    --prefix=build/armeabi-v7a \
    --extra-cflags='-DANDROID -I${ANDROID_NDK_ROOT_PATH}/sources/cxx-stl/system/include -march=armv7-a -mfloat-abi=softfp' \
    --extra-ldflags='-Wl,--fix-cortex-a8 -L../android-libs -Wl,-rpath-link,../android-libs' \
    --extra-cxxflags='-Wno-multichar -fno-exceptions -fno-rtti'
    make -j6 && make install && make distclean|| exit 0

    Hope it helps someone (cc : @SinhHo )