Recherche avancée

Médias (3)

Mot : - Tags -/image

Autres articles (37)

  • 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 (...)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

Sur d’autres sites (5460)

  • ffmpeg converter php script not working as expected

    8 juillet 2012, par mintuz

    I have been looking into a php video converter method and have followed a tutorial on how to get one set up. It can read the source video file fine, my script shows an md5, fps rate, bit rate etc but it does not create the destination file. Any suggestions on why my code is not working.

    I have tried both system() ; and exec() ; commands, both do not work and safe_mode is off. I have also tried a more basic command

    "/usr/bin/ffmpeg -i /home/mintuz/video.avi /var/www/video.flv"

    This command however works through the terminal.

    <?php
    define('FFMPEG_LIBRARY', '/usr/bin/ffmpeg');

    //ALTER STUFF HERE
    $srcFile = "/home/mintuz/video.avi"; //source file
    $destFile = "/var/www/video.flv"; //destination file


    if (strpos($srcFile, '.avi'))
    {
       $type = "avi";
       echo $type;
    }

    if (strpos($srcFile, '.mp4'))
    {
       $type = "mp4";
       echo $type;
    }

    if (strpos($srcFile, '.mov'))
    {
       $type = "mov";
       echo $type;
    }

    //-------------------------------------------------------------------------------------------------------------------
    // Create our FFMPEG-PHP class
    $ffmpegObj = new ffmpeg_movie($srcFile);

    // Save our needed variables
    $srcWidth = makeMultipleTwo($ffmpegObj->getFrameWidth());
    echo "<br />".$srcWidth."<br />";

    $srcHeight = makeMultipleTwo($ffmpegObj->getFrameHeight());
    echo $srcHeight."<br />";

    $srcFPS = $ffmpegObj->getFrameRate();
    echo $srcFPS."<br />";

    $srcAB = intval($ffmpegObj->getAudioBitRate()/1000);  
    $srcAR = $ffmpegObj->getAudioSampleRate();  

    // Call our convert using exec()
    $cmd = FFMPEG_LIBRARY." -i ".$srcFile." -ar ".$srcAR." -ab ".$srcAB." -f flv -s ".$srcWidth."x".$srcHeight." ".$destFile;
    system($cmd);

    echo "Source File MD5 : ".md5_file($srcFile)."<br />";
    echo "Destination File MD5 : ".md5_file($destFile);

    // Make multiples function
    function makeMultipleTwo ($value)
    {
       $sType = gettype($value/2);
       if($sType == "integer")
       {
           return $value;
       } else {
           return ($value-1);
       }
    }
    ?>
  • Assign output to a variable instead to a Output file

    25 juin 2013, par rash

    Here is the Python code :

    import subprocess

    cmnd = ["ffmpeg", "-i", "/home/xincoz/test/connect.flv", "-acodec", "copy", "-ss", "00:00:00", "-t", "00:00:30", "/home/xincoz/test/output.flv"]

    subprocess.call(cmnd)

    Here I get the 30sec long video output file output.flv from connect.flv video. But i want to store that 30sec long binary data in a variable instead of copying that into an output file.
    How can I able to do that ?

    Please help me. Thanks a lot in advance.

  • How can I get FFmpeg to locate installed libraries when —sysroot is pointing to another directory ?

    3 février 2013, par Xaero Degreaz

    I've been going at this, literally for days. I'm trying to build FFmpeg with libmp3lame for use in an Android application. The build script sets a --sysroot flag that points to the Android NDK directory necessary to build these libraries in a way that Android can use them.

    The problem comes when I add the flag to --enable-libmp3lame ; I get ERROR: libmp3lame >= 3.98.3 not found during the build start up. I know that LAME, and it's libraries are installed, because I can just run ./configure --enable-libmp3lame manually and the configuration launches without a hitch, and shows that libmp3lame is enabled for this build. However, building like this will simply not work for what I need it for, since I need the Android NDK to do some work.

    I've tracked the problem down to the fact that this build script is declaring the sysroot, and through some research, I've tried adding -Luser/include, -L/user/includeto the extra cflags, and ldflags (which I've read is the default search location for gcc). I've tried several other things as well, but I'm confident that someone out here can help with this specific problem. This entire build script is as follows :

    Extra info :

    • Build OS : Ubuntu 11.10
    • FFmpeg Ver : Latest from git
    • LAME Ver : 3.9.x
    • Android NDK : r7

    build.sh

    #!/bin/bash

    if [ "$NDK" = "" ]; then
       echo NDK variable not set, assuming ${HOME}/android-ndk
       export NDK=${HOME}/android-ndk
    fi

    SYSROOT=$NDK/platforms/android-3/arch-arm
    # Expand the prebuilt/* path into the correct one
    TOOLCHAIN=`echo $NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/*-x86`
    export PATH=$TOOLCHAIN/bin:$PATH

    rm -rf build/ffmpeg
    mkdir -p build/ffmpeg
    cd ffmpeg

    # Don&#39;t build any neon version for now
    for version in armv5te armv7a; do

           DEST=../build/ffmpeg
           FLAGS="--target-os=linux --cross-prefix=arm-linux-androideabi- --arch=arm"
           FLAGS="$FLAGS --sysroot=$SYSROOT"
           FLAGS="$FLAGS --soname-prefix=/data/data/net.smartnotes/lib/"
           FLAGS="$FLAGS --enable-shared --disable-symver"
           FLAGS="$FLAGS --enable-small --optimization-flags=-O2"
           FLAGS="$FLAGS --disable-everything --enable-protocol=file"
           FLAGS="$FLAGS --enable-libmp3lame --enable-encoder=nellymoser"

           case "$version" in
                   neon)
                       EXTRA_CFLAGS="-march=armv7-a -mfloat-abi=softfp -mfpu=neon"
                       EXTRA_LDFLAGS="-Wl,--fix-cortex-a8"
                       # Runtime choosing neon vs non-neon requires
                       # renamed files
                       ABI="armeabi-v7a"
                       ;;
                   armv7a)
                       # I have tried many things here.
                       EXTRA_CFLAGS="-march=armv7-a -mfloat-abi=softfp"
                       EXTRA_LDFLAGS=""
                       ABI="armeabi-v7a"
                       ;;
                   *)
                       # I have tried many things here.
                       EXTRA_CFLAGS="-Luser/include"
                       EXTRA_LDFLAGS=""
                       ABI="armeabi"
                       ;;
           esac
           DEST="$DEST/$ABI"
           FLAGS="$FLAGS --prefix=$DEST"

           mkdir -p $DEST
           echo $FLAGS --extra-cflags="$EXTRA_CFLAGS" --extra-ldflags="$EXTRA_LDFLAGS" > $DEST/info.txt
           ./configure $FLAGS --extra-cflags="$EXTRA_CFLAGS" --extra-ldflags="$EXTRA_LDFLAGS" | tee $DEST/configuration.txt
           [ $PIPESTATUS == 0 ] || exit 1
           make clean
           make -j4 || exit 1
           make install || exit 1

    done