Recherche avancée

Médias (91)

Autres articles (47)

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

  • Déploiements possibles

    31 janvier 2010, par

    Deux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
    L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
    Version mono serveur
    La version mono serveur consiste à n’utiliser qu’une (...)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

Sur d’autres sites (4168)

  • How can I change a video frame rate with FFmpeg keeping the same total number of frames ?

    28 mai 2017, par Nuno

    I’ve been searching for an answer here on Stack Overflow and googling everywhere... even though it seems like it should be a very simple command line to me, I just can’t find an answer anywhere.

    I would like to change the frame rate of a video from 23.976fps to 24fps with FFmpeg, lossless and keeping the total number of frames.

    To make it simpler :

    Let’s say I have a 25fps video with a total lenght of 100 frames.

    How can I change it’s frame rate to 50fps, with FFmpeg, lossless and keeping the same total lenght of 100 frames ?

    This was so far the best solution I came across with (which can be found here) :

    Extract the frames as rawvideo :

    ffmpeg -i input.mov -f rawvideo -b 50000000 -pix_fmt yuv420p -vcodec
    rawvideo -s 1920x1080 -y temp.raw

    Recreate the video with new framerate :

    ffmpeg -f rawvideo -b 50000000 -pix_fmt yuv420p -r 24 -s 1920x1080 -i
    temp.raw -y output.mov

    Note 1 : I had to remove "-b 50000000" when recreating the video with the new frame rate, in order to get it to work properly.

    It did exactly what I intended it to do, but I’m still wondering if there is any simpler way to do this ? I’ve tried to pipe them together in one line only, as suggested in the same post, but couldn’t get it to work.

    Note 2 : Even though it does exactly what I wanted it to do, I’ve just later realized there is quality loss using this method, which I would prefer to avoid.

    Thanks everyone in advance !

  • Restart ffmpeg process using monit if TOTAL CPU is less than 1%

    15 mai 2017, par user2201239

    I have used kind of similar solution like this Restarting ffmpeg process using monit to restart my ffmpeg stream in case it fails for some reason. Remember its not duplicate problem/question, because I have other issues unlike the example question/solution Restarting ffmpeg process using monit, which I’m gonna explain below. So here is my monit configuration :

       check process FFMPEGStream with pidfile PATH-to-file/streampid.pid
       start program = "PATH-to-file/streambash.sh restart"
       stop program = "PATH-to-file/streambash.sh stop"
       if TOTAL CPU is less than 1% for 10 cycles then restart

    Here is my streambash.sh file :

       #!/bin/bash
       pid_file="PATH-to-file/streampid.pid"

       case "$1" in
        restart)
           PATH-to-file/streambash.sh stop
           PATH-to-file/streambash.sh start
              ;;

        start)
           rm $pid_file
           /usr/bin/ffmpeg -i "INPUT-PATH" -c:v libx264 -b:v 900k -preset ultrafast -aspect 16:9 -s 640x376 -strict experimental -c:a aac -b:a 96k -f flv "RTMP-PATH" &> /dev/null &
           ch_pid=$!
           echo "Start Stream1: ffmpeg = $ch_pid";
           echo $ch_pid > $pid_file
              ;;

        stop)
           echo "Stop ffmpeg Stream1";
           kill `cat $pid_file` &> /dev/null
              ;;

        *)
           echo "Usage: PATH-to-file/streambash.sh {start|stop|restart}"
           exit 1
              ;;

        esac
       exit 0
       echo $pid_file

    Monit can start the bash file successfully, but when this condition "if TOTAL CPU is less than 1% for 10 cycles then restart" is matched in monit configuration, it tries to restart, it gives error that process is not running. But in actual the ffmpeg process still runs in the background and I can see that the stream is live on my website. Here is monit logs :

       [CET Jan 10 12:55:02] error    : 'FFMPEGStream' total cpu usage of 0.4% matches resource limit [cpu usage>1.0%]
       [CET Jan 10 12:55:07] error    : 'FFMPEGStream' total cpu usage of 0.0% matches resource limit [cpu usage>1.0%]
       [CET Jan 10 12:55:12] error    : 'FFMPEGStream' total cpu usage of 0.0% matches resource limit [cpu usage>1.0%]
       [CET Jan 10 12:55:17] error    : 'FFMPEGStream' total cpu usage of 0.4% matches resource limit [cpu usage>1.0%]
       [CET Jan 10 12:55:22] error    : 'FFMPEGStream' total cpu usage of 0.9% matches resource limit [cpu usage>1.0%]
       [CET Jan 10 12:55:27] error    : 'FFMPEGStream' total cpu usage of 0.9% matches resource limit [cpu usage>1.0%]
       [CET Jan 10 12:55:32] error    : 'FFMPEGStream' total cpu usage of 0.0% matches resource limit [cpu usage>1.0%]
       [CET Jan 10 12:55:37] error    : 'FFMPEGStream' total cpu usage of 0.0% matches resource limit [cpu usage>1.0%]
       [CET Jan 10 12:55:42] error    : 'FFMPEGStream' total cpu usage of 0.0% matches resource limit [cpu usage>1.0%]
       [CET Jan 10 12:55:47] error    : 'FFMPEGStream' total cpu usage of 0.4% matches resource limit [cpu usage>1.0%]
       [CET Jan 10 12:55:50] info     : 'FFMPEGStream' trying to restart
       [CET Jan 10 12:55:50] info     : 'FFMPEGStream' stop: PATH-to-file/streambash.sh
       [CET Jan 10 12:55:51] info     : 'FFMPEGStream' start: PATH-to-file/streambash.sh
       [CET Jan 10 12:55:56] error    : 'FFMPEGStream' process is not running
       [CET Jan 10 12:55:58] info     : 'FFMPEGStream' trying to restart
       [CET Jan 10 12:55:58] info     : 'FFMPEGStream' start: PATH-to-file/streambash.sh
       [CET Jan 10 12:56:04] error    : 'FFMPEGStream' process is not running
       [CET Jan 10 12:56:04] info     : 'FFMPEGStream' trying to restart
       [CET Jan 10 12:56:04] info     : 'FFMPEGStream' start: PATH-to-file/streambash.sh
       [CET Jan 10 12:56:09] error    : 'FFMPEGStream' process is not running
       [CET Jan 10 12:56:09] info     : 'FFMPEGStream' trying to restart
       [CET Jan 10 12:56:09] info     : 'FFMPEGStream' start: PATH-to-file/streambash.sh

    Monit keeps trying to restart the process and on each retry, it dumps a new pid to the PATH-to-file/streampid.pid, but as I said it seems, it somehow can stop the actual ffmpeg stream/pid, which keep running in the background.

  • Adding total duration/enable seeking in mp4 AAC audio stream file with FFMPEG

    12 avril 2016, par lex82

    I’m trying to write an AAC audio stream into an mp4 file using the FFMPEG libraries. I am using a custom IO context that writes directly to a socket so I have to set ioContext->seekable = 0. To make this work I had to add the "movflags" empty_moov and frag_keyframe when writing the header.

    After writing the output to a file on the other end of the socket, I can play the file in VLC or Windows Media Player. However, seeking to a specific position in the file is not working properly in both players. WMP also does not show the total duration and VLC only flashes it shortly when reaching the end of the audio.

    Is there a way to add more metadata when muxing so the players are able to treat the file as if it was not written as a stream ? Transfer via the socket is not interrupted abruptly, so I could write metadata at the end of the file. I also know the total duration in advance, so I could add it to the header of the file if it was possible. I cannot use the faststart flag because this would require output to a seekable file before writing to the socket.

    Update : I learned that I can set the duration in AVFormatContext and I can set nb_frames and avg_frame_rate in AVStream. However, it doesn’t solve my problem. When I set the codecContext flag AV_CODEC_FLAG_QSCALE, VLC seems to be able to estimate the total time. However, seeking still doesn’t work.