Recherche avancée

Médias (1)

Mot : - Tags -/censure

Autres articles (48)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

  • Encodage et transformation en formats lisibles sur Internet

    10 avril 2011

    MediaSPIP transforme et ré-encode les documents mis en ligne afin de les rendre lisibles sur Internet et automatiquement utilisables sans intervention du créateur de contenu.
    Les vidéos sont automatiquement encodées dans les formats supportés par HTML5 : MP4, Ogv et WebM. La version "MP4" est également utilisée pour le lecteur flash de secours nécessaire aux anciens navigateurs.
    Les documents audios sont également ré-encodés dans les deux formats utilisables par HTML5 :MP3 et Ogg. La version "MP3" (...)

Sur d’autres sites (6454)

  • MP4 to DASH (bash script)

    18 mars 2019, par Francesco Galgani

    I have a web site in which users can upload video files. I want to stream all of them using DASH to obtain an adaptive bitrate streaming. So I wrote a bash script (to run by cron) that converts all mp4 files to DASH, but it doesn’t work properly : what is wrong ?

    For example, using the following script, I obtained :
    https://www.informatica-libera.net/dash_faq/stream.mpd

    It validates, but it doesn’t play. I tested it on :
    http://dash-mse-test.appspot.com/dash-player.html?url=https%3A%2F%2Fwww.informatica-libera.net%2Fdash_faq%2Fstream.mpd&autoplay=on&adapt=auto&flavor=

    Thank you for any help.
    The code :

    #!/bin/bash

    # THIS SCRIPT CONVERTS EVERY MP4 (IN THE CURRENT FOLDER AND SUBFOLDER)
    # TO A MULTI-BITRATE VIDEO IN MP4-DASH
    # For each file "videoname.mp4" it creates a folder "dash_videoname"
    # containing a dash manifest file "stream.mpd" and subfolders containing
    # video segments.

    # mp4dash documentation and download: https://www.bento4.com/developers/dash/

    MYDIR=$(dirname $(readlink -f ${BASH_SOURCE[0]}))
    SAVEDIR=$(pwd)

    # Check programs
    if [ -z "$(which ffmpeg)" ]; then
       echo "Error: ffmpeg is not installed"
       exit 1
    fi

    if [ -z "$(which mp4dash)" ]; then
       echo "Error: mp4dash is not installed"
       exit 1
    fi

    cd "$MYDIR"

    TARGET_FILES=$(find ./ -type f -name "*.mp4")
    for f in $TARGET_FILES
    do
     f=$(basename "$f") # fullname of the file
     f="${f%.*}" # name without extension

     if [ ! -d "dash_${f}" ]; then
       echo "Converting \"$f\" to multi-bitrate video in MPEG-DASH"

       ffmpeg -y -i "${f}.mp4" -c:a libfdk_aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 1500k -vf "scale=-2:720" -f mp4 -pass 1 -y /dev/null
       ffmpeg -y -i "${f}.mp4" -c:a libfdk_aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 1500k -vf "scale=-2:720" -f mp4 -pass 2 "${f}_1500.mp4"

       ffmpeg -y -i "${f}.mp4" -c:a libfdk_aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 800k -vf "scale=-2:540" -f mp4 -pass 1 -y /dev/null
       ffmpeg -y -i "${f}.mp4" -c:a libfdk_aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 800k -vf "scale=-2:540" -f mp4 -pass 2 "${f}_800.mp4"

       ffmpeg -y -i "${f}.mp4" -c:a libfdk_aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 400k -vf "scale=-2:360" -f mp4 -pass 1 -y /dev/null
       ffmpeg -y -i "${f}.mp4" -c:a libfdk_aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 400k -vf "scale=-2:360" -f mp4 -pass 2 "${f}_400.mp4"

       ffmpeg -y -i "${f}.mp4" -c:a libfdk_aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 200k -vf "scale=-2:180" -f mp4 -pass 1 -y /dev/null
       ffmpeg -y -i "${f}.mp4" -c:a libfdk_aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 200k -vf "scale=-2:180" -f mp4 -pass 2 "${f}_200.mp4"

       rm -f ffmpeg*log*

       mp4fragment "${f}_1500.mp4" "${f}_1500_fragmented.mp4"
       mp4fragment "${f}_800.mp4" "${f}_800_fragmented.mp4"
       mp4fragment "${f}_400.mp4" "${f}_400_fragmented.mp4"
       mp4fragment "${f}_200.mp4" "${f}_200_fragmented.mp4"

       rm -f "${f}_1500.mp4" "${f}_800.mp4" "${f}_400.mp4" "${f}_200.mp4"

       mp4dash -v -o "dash_${f}" "${f}_1500_fragmented.mp4" "${f}_800_fragmented.mp4" "${f}_400_fragmented.mp4" "${f}_200_fragmented.mp4"

       rm -f "${f}_1500_fragmented.mp4" "${f}_800_fragmented.mp4" "${f}_400_fragmented.mp4" "${f}_200_fragmented.mp4"

       fi

    done

    cd "$SAVEDIR"
  • MP4 to DASH (bash script)

    13 mars 2017, par francesco.galgani

    I have a web site in which users can upload video files. I want to stream all of them using DASH to obtain an adaptive bitrate streaming. So I wrote a bash script (to run by cron) that converts all mp4 files to DASH, but it doesn’t work properly : what is wrong ?

    For example, using the following script, I obtained :
    https://www.informatica-libera.net/dash_faq/stream.mpd

    It validates, but it doesn’t play. I tested it on :
    http://dash-mse-test.appspot.com/dash-player.html?url=https%3A%2F%2Fwww.informatica-libera.net%2Fdash_faq%2Fstream.mpd&autoplay=on&adapt=auto&flavor=

    Thank you for any help.
    The code :

    #!/bin/bash

    # THIS SCRIPT CONVERTS EVERY MP4 (IN THE CURRENT FOLDER AND SUBFOLDER)
    # TO A MULTI-BITRATE VIDEO IN MP4-DASH
    # For each file "videoname.mp4" it creates a folder "dash_videoname"
    # containing a dash manifest file "stream.mpd" and subfolders containing
    # video segments.

    # mp4dash documentation and download: https://www.bento4.com/developers/dash/

    MYDIR=$(dirname $(readlink -f ${BASH_SOURCE[0]}))
    SAVEDIR=$(pwd)

    # Check programs
    if [ -z "$(which ffmpeg)" ]; then
       echo "Error: ffmpeg is not installed"
       exit 1
    fi

    if [ -z "$(which mp4dash)" ]; then
       echo "Error: mp4dash is not installed"
       exit 1
    fi

    cd "$MYDIR"

    TARGET_FILES=$(find ./ -type f -name "*.mp4")
    for f in $TARGET_FILES
    do
     f=$(basename "$f") # fullname of the file
     f="${f%.*}" # name without extension

     if [ ! -d "dash_${f}" ]; then
       echo "Converting \"$f\" to multi-bitrate video in MPEG-DASH"

       ffmpeg -y -i "${f}.mp4" -c:a libfdk_aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 1500k -vf "scale=-2:720" -f mp4 -pass 1 -y /dev/null
       ffmpeg -y -i "${f}.mp4" -c:a libfdk_aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 1500k -vf "scale=-2:720" -f mp4 -pass 2 "${f}_1500.mp4"

       ffmpeg -y -i "${f}.mp4" -c:a libfdk_aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 800k -vf "scale=-2:540" -f mp4 -pass 1 -y /dev/null
       ffmpeg -y -i "${f}.mp4" -c:a libfdk_aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 800k -vf "scale=-2:540" -f mp4 -pass 2 "${f}_800.mp4"

       ffmpeg -y -i "${f}.mp4" -c:a libfdk_aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 400k -vf "scale=-2:360" -f mp4 -pass 1 -y /dev/null
       ffmpeg -y -i "${f}.mp4" -c:a libfdk_aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 400k -vf "scale=-2:360" -f mp4 -pass 2 "${f}_400.mp4"

       ffmpeg -y -i "${f}.mp4" -c:a libfdk_aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 200k -vf "scale=-2:180" -f mp4 -pass 1 -y /dev/null
       ffmpeg -y -i "${f}.mp4" -c:a libfdk_aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 200k -vf "scale=-2:180" -f mp4 -pass 2 "${f}_200.mp4"

       rm -f ffmpeg*log*

       mp4fragment "${f}_1500.mp4" "${f}_1500_fragmented.mp4"
       mp4fragment "${f}_800.mp4" "${f}_800_fragmented.mp4"
       mp4fragment "${f}_400.mp4" "${f}_400_fragmented.mp4"
       mp4fragment "${f}_200.mp4" "${f}_200_fragmented.mp4"

       rm -f "${f}_1500.mp4" "${f}_800.mp4" "${f}_400.mp4" "${f}_200.mp4"

       mp4dash -v -o "dash_${f}" "${f}_1500_fragmented.mp4" "${f}_800_fragmented.mp4" "${f}_400_fragmented.mp4" "${f}_200_fragmented.mp4"

       rm -f "${f}_1500_fragmented.mp4" "${f}_800_fragmented.mp4" "${f}_400_fragmented.mp4" "${f}_200_fragmented.mp4"

       fi

    done

    cd "$SAVEDIR"
  • ffmpeg with "-pattern_type glob" and variable in bash script

    20 juin 2019, par KlausPeter

    I’m trying to let ffmpeg make a video of all pictures in a directory using the -pattern_type glob switch and "/foo/bar/*.jpg". This works well, if I execute the command manually für just one directory. For example :

    ffmpeg -framerate 35 -pattern_type glob -i '/root/webcam_test/2018-07-21/*.jpg' -vf scale=1280:-1 -c -c:v libx264 -pix_fmt yuv420p /root/clips/out01_cut.mp4

    However, if I do it in a bash script and set the path via a variable, according to ffmpegs output, the variable gets substituted correctly, but ffmpeg states that

    ’/root/webcam_test/2018-07-21/*.jpg’ : No such file or directory

    The part of the script looks like this :

    for D in `find /root/webcam_test/ -type d`
    do
       [...]
       cmd="ffmpeg -framerate 35 -pattern_type glob -i '$D/*.jpg' -vf scale=1280:-1 -c -c:v libx264 -pix_fm                                 t yuv420p /root/clips/$d_cut.mp4"
       echo $cmd
    [...]
    done

    Does anyone know how to make ffmpeg do its wildcard interpretation even if the path is constructed by a script and not just try to plainly use the given path ?
    Best regards and thanks in advance