Recherche avancée

Médias (1)

Mot : - Tags -/university

Autres articles (34)

  • À propos des documents

    21 juin 2013, par

    Que faire quand un document ne passe pas en traitement, dont le rendu ne correspond pas aux attentes ?
    Document bloqué en file d’attente ?
    Voici une liste d’actions ordonnée et empirique possible pour tenter de débloquer la situation : Relancer le traitement du document qui ne passe pas Retenter l’insertion du document sur le site MédiaSPIP Dans le cas d’un média de type video ou audio, retravailler le média produit à l’aide d’un éditeur ou un transcodeur. Convertir le document dans un format (...)

  • Modifier la date de publication

    21 juin 2013, par

    Comment changer la date de publication d’un média ?
    Il faut au préalable rajouter un champ "Date de publication" dans le masque de formulaire adéquat :
    Administrer > Configuration des masques de formulaires > Sélectionner "Un média"
    Dans la rubrique "Champs à ajouter, cocher "Date de publication "
    Cliquer en bas de la page sur Enregistrer

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

Sur d’autres sites (5690)

  • Shell script works fine from shell but doesn’t work as expected when executed via PHP “shell_exec” code

    9 décembre 2019, par Eric Feillant

    This record.sh script shell is here and works fine on command line to record an MP4 file from a local flv live stream :

    DATE=`date +"%d-%m-%Y-%T"`
    if [ -s NAMESTREAM ]
    then
    cat config.php | dos2unix | grep auth | grep username | \
    awk -F ' ' '{print $3}' | sed "s/'//g" | sed "s/;//g" | while read VAR
    do echo $VAR > RECSTREAM
    echo "Starting recording ..."
    ffmpeg -i "rtmp://localhost/hls/$VAR" -crf 19 videos/"$VAR"_"$DATE".mp4
    done
    else
    echo "Streaming is not started, please start it before"
    fi

    I send a shell_exec to call the last shell script in a php script like this :

    $old_path = getcwd();
    chdir('/usr/local/nginx/html/mydir');
    $output = shell_exec('nohup ./record.sh >/dev/null 2>/dev/null &');
    chdir($old_path);

    The MP4 video files are generated but unreadable with VLC, etc… It seems that the problem is due to my PHP script but I am not able to know why.

    When executing from the shell command line : PHP myphpscript.php works fine, MP4 video files are OK. But from the PHP web page, the MP4 video files are corrupted.

    Any ideas ? Any param to test in FFmpeg to have a good mp4 video file ?

  • How to apply 2 filters drawtext and drawbox using FFMPEG

    9 juillet 2017, par user6972

    I’m having problems combining filters. I’m trying to take video from the camera, apply a timer on it and also overlay a box in the center. I can put a time code (local time and pts) using the -vf drawtext command no problems :

    ffmpeg -f video4linux2 -input_format mjpeg -s 1280x720 -i /dev/video0 \
    -vf "drawtext=fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: \
    text='%{localtime} %{pts\:hms}':  fontcolor=white: fontsize=24: box=1: \
    boxcolor=black@0.8: boxborderw=5: x=0: y=0" -vcodec libx264 \
    -preset ultrafast -f mp4 -pix_fmt yuv420p -y output.mp4

    Then I have one that draws a small box using drawbox :

    ffmpeg -f video4linux2 -input_format mjpeg -s 1280x720 -i /dev/video0 \
    -filter_complex " drawbox=x=iw/2:y=0:w=10:h=ih:color=red@0.1": \
    -vcodec libx264 -preset ultrafast -f mp4 -pix_fmt yuv420p -y output.mp4

    I assumed I could combine these with the filter_complex switch and separate them using the semicolon like this

    ffmpeg -f video4linux2 -input_format mjpeg -s 1280x720 -i /dev/video0 -filter_complex "drawtext=fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='%{localtime} %{pts\:hms}':  fontcolor=white: fontsize=24: box=1: boxcolor=black@0.8;drawbox=x=iw/2:y=0:w=10:h=ih:color=red@0.1": -vcodec libx264 -preset ultrafast -f mp4 -pix_fmt yuv420p -y output.mp4

    But it fails to find the input stream on the second filter :

    Input #0, video4linux2,v4l2, from ’/dev/video0’ :

    Duration : N/A, start : 10651.720690, bitrate : N/A

    Stream #0:0 : Video : mjpeg, yuvj422p(pc, bt470bg/unknown/unknown), 1280x720, -5 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc

    Cannot find a matching stream for unlabeled input pad 0 on filter Parsed_drawbox_1

    I tried to direct it to [0] like this :

    ffmpeg -f video4linux2 -input_format mjpeg -s 1280x720 -i /dev/video0 -filter_complex " \
    drawtext=fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: \
    text='%{localtime} %{pts\:hms}':  fontcolor=white: fontsize=24: box=1: \
    boxcolor=black@0.8;[0] drawbox=x=iw/2:y=0:w=10:h=ih:color=red@0.1": \
    -vcodec libx264 -preset ultrafast -f mp4 -pix_fmt yuv420p -y output.mp4

    But it fails to put the box on the output.

    So I tried to split streams like this

    ffmpeg -f video4linux2 -input_format mjpeg -s 1280x720 -i /dev/video0 -filter_complex " \
    split [main][tmp];\
    [main] drawtext=fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: \
    text='%{localtime} %{pts\:hms}':  fontcolor=white: fontsize=24: box=1: boxcolor=black@0.8 [tmp];\
    [main] drawbox=x=iw/2:y=0:w=10:h=ih:color=red@0.1 [tmp2]; [tmp][tmp2] overlay": \
    -vcodec libx264 -preset ultrafast -f mp4 -pix_fmt yuv420p -y output.mp4

    But my build doesn’t have the overlay filter complied with it. At this point I decided to stop and ask if I’m making this harder than it should be. The end result is I just want a timer and a box drawn on the video. Is there a better way or a formatting trick to do this ?

    Thanks

  • How do I write a batch file that opens a msys shell and then run commands in the shell ?

    19 septembre 2024, par cxu

    I'm trying to automate the process of building ffmpeg on Windows 10. I'm following the guide here : https://trac.ffmpeg.org/wiki/CompilationGuide/MSVC

    



    Everything works fine when I do it manually, however I want to write a batch file that I can run to go through the entire process automatically.

    



    Building requires me to set up the Visual Studio environment and the MSYS environment. This is where I'm having trouble, since running the MSYS environment opens up a new shell. I want to pass the configure/make/make install commands to the MSYS shell after it is opened.

    



    I've tried the solution here : How to open a new shell in cmd,then run script in a new shell ?

    



    The problem they had looks similar to mine, but the solutions posted there didn't work for me.

    



    Here is the bat file currently :

    



    call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\vcvars64.bat"
call "C:\workspace\windows\mingw-get\msys\1.0\msys.bat" start cmd.exe /k bscript
pause


    



    and bscript :

    



    ./configure --enable-shared --toolchain=msvc --arch=amd64
make
make install


    



    I've tried all sorts of variations like :

    



    call "C:\workspace\windows\mingw-get\msys\1.0\msys.bat" /k bscript
call "C:\workspace\windows\mingw-get\msys\1.0\msys.bat" bscript
start "C:\workspace\windows\mingw-get\msys\1.0\msys.bat" /k bscript
start "C:\workspace\windows\mingw-get\msys\1.0\msys.bat" bscript


    



    And I've also tried leaving the bscript code in the original batch file.

    



    The configure/make commands will either run in the original cmd window, a new cmd window or wont run at all.

    



    Is there a way to pass commands to the MSYS shell like that ?