Recherche avancée

Médias (91)

Autres articles (49)

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

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

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

Sur d’autres sites (4605)

  • PHP script works when called from command line, does not when called as background via web server

    6 juin 2014, par fNek

    I am facing a problem with a certain PHP script (CLI mode) I wrote. It should take certain arguments to convert a video with FFMPEG. When I call it from the command prompt, it works fine. However, I have to call it from a web server.

    The PHP script that handles the request calls the PHP script in the background via code I found here at SE :

    if (substr(php_uname(), 0, 7) == "Windows"){
       pclose(popen("start /B ". $cmd, "r"));  
    }
    else {
       exec("nohup " . $cmd . " > /dev/null &");
    }

    When run this way, however, the PHP script does not create the files, even after a much longer time than it took via the command prompt.

    The script runs, I have checked that by letting it insert dummy entries into the database. It also has the permission to create files, which I verified by letting it create a text file.

    What could be the difference that prevents my script from working properly ? I develop and test this code with XAMPP on Windows 7.

    //EDIT : I forgot to give you this link to the background PHP script : http://pastebin.com/pfTZMfwi

    //EDIT2 : I found out that the PHP process runs for a very short time (only until next refresh of the Windows task manager). Could it be that PHP kills its children when it exits ?

    //EDIT3 : No, that seems not to be the problem. I cannot execute programs via exec() when the script is called as background from the web server. What could the problem be, and what would be a solution/workaround ?

    //EDIT4 : The command that seems to cause the trouble is not exec()/etc. but the echo command I did before the exec(). I am going to remove it, but why does it cause a problem ?

  • Reverse video using many commands in a script

    19 août 2021, par Sam

    I am trying to make a script with FFmpeg using Reverse mode, i am not able to make it work correctly, unfortunately is some weeks i am using Linux and FFmpeg, my intention is ;

    


      

    • put the original video in Reverse directory
    • 


    • start the script
the script make this job ;
    • 


    • create the directory mkdir 01-Elaborazione
    • 


    • FFMPEG separate the video in small clips of 5 sec and put in 01-Elaborazione
after that
    • 


    • create the directory mkdir 01
    • 


    • FFMPEG make the Reverse of the clips and put in the directory 01
    • 


    • create a list Originale.txt of the Reversed clips in directory 01
    • 


    • change the list Inversa to invert the lines (so that the FFmpeg is making the concat correctly)
    • 


    • FFMPEG concat all the Reversed clips using the list Inversa.txt and put the output Pronto.mp4 in the directory Reverse
after that
    • 


    • delete the directory 01- Elaborazione with all the files
    • 


    


    at the end i have to put also many done before it start, but also doing this is not doing the job i want

    


    i have to make this, because this way i do not have problem with the Ram and Swap

    


    the script is this ;

    


    # !/bin/bash

    


    cd /srv/dev-sataa24/Lavori/Z-Modifiche/Reverse

    


    mkdir 01-Elaborazione

    


    for i in *.mp4 ; do ffmpeg -i "$i" -f segment -segment_time 5 -c copy -reset_timestamps 1 01-Elaborazione/sample_%03d.mp4 -hide_banner && rm "$i"

    


    done

    


    for i in *.MP4 ; do ffmpeg -i "$i" -f segment -segment_time 5 -c copy -reset_timestamps 1 01-Elaborazione/sample_%03d.mp4 -hide_banner && rm "$i"

    


    Wait for the processes to finish

    


    wait

    


    done && cd

    


    cd /srv/dev-sataa24/Lavori/Z-Modifiche/Reverse/01-Elaborazione

    


    mkdir 01

    


    for i in .MP4 ; do ffmpeg -i "$i" -threads 1 -vf reverse -af areverse 01/"$i%..mp4"

    


    cd /srv/dev-sataa24/Lavori/Z-Modifiche/Reverse/01-Elaborazione

    


    for i in .mp4 ; do ffmpeg -i "$i" -threads 1 -vf reverse -af areverse 01/"$i%..mp4"

    


    Wait for the processes to finish

    


    wait

    


    done && cd

    


    cd /srv/dev-sataa24/Lavori/Z-Modifiche/Reverse/01-Elaborazione/01

    


    for f in *.mp4 ; do echo file '$f' >> originale.txt

    


    tac originale.txt > inversa.txt

    


    ffmpeg -f concat -safe 0 -i inversa.txt -c copy /srv/dev-sataa24/Lavori/Z-Modifiche/Reverse/Pronto.mp4

    


    Wait for the processes to finish

    


    wait

    


    cd /srv/dev-sataa24/Lavori/Z-Modifiche/Reverse

    


    rm -r 01-Elaborazione/

    


    cd

    


    done
done

    


  • doc : add script to compute texi files dependencies

    28 mai 2013, par Stefano Sabatini
    doc : add script to compute texi files dependencies
    

    Replace the inline awk script with a Perl script which tracks the
    dependencies recursively.

    This allows to correctly track dependencies for files including files
    with a second level include (for example : ffmpeg-devices.texi ->
    devices.texi -> outdevs.texi).

    This also adds a dependency on perl for computing the dependencies, which
    should not be a problem since perl is already required all the way for
    building documentation.

    • [DH] configure
    • [DH] doc/Makefile
    • [DH] doc/texidep.pl