Recherche avancée

Médias (91)

Autres articles (102)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

Sur d’autres sites (9434)

  • ffmpeg converting MOV to MP4 add 5 second still frames to start of video [closed]

    17 février 2013, par Webfox

    I have a website that automatically converts MOV files to MP4. For some reason the client videos (which are exported from their own software) have about 5-8 seconds worth of a still frame added to the beginning of each video when they are converted. I have tried so many different variations trying to sort this but its always the same.

    The function/ffmpeg command that is currently being used is

       public function convertToMP4($file, $destination, $size=null, $qscale='10', $rate=25, $ab='192k', $ar=44100) {
       if (substr($destination, -1) == '/') {
           $destination = substr($destination, 0, -1);
       }

       $filename = end(explode("/", $file));
       $outfile = current(explode(".", $filename)).".mp4";

       // Media Size
       if (!isset($size) || $size == 'copy') {
           if ($dims = $this->getDimensions($file)) {
               $size = $dims['width'].'x'.$dims['height'];
           }
       }
       if ($ab == false) {
           $cmd = "ffmpeg -i $file -qscale $qscale -an -f mp4 -s $size -aspect 16:9 $destination/$outfile";
       } else {
           $cmd = "ffmpeg -i $file -acodec ".$this->mp3lib." -qscale $qscale -r $rate -ar $ar -ab $ab -f mp4 -s $size -aspect 16:9 $destination/$outfile";
       }

       $ret = shell_exec($cmd);

       if (file_exists("$destination/$outfile")) {
           return "$destination/$outfile";
       }
       return false;
    }

    where if $ab is false then remove the sound which is the case for 99% of the videos in scenario

    Thanks

  • Why does use of H264 in sender/receiver pipelines introduce just HUGE delay ?

    24 janvier 2012, par Serguey Zefirov

    When I try to create pipeline that uses H264 to transmit video, I get some enormous delay, up to 10 seconds to transmit video from my machine to... my machine ! This is unacceptable for my goals and I'd like to consult StackOverflow over what I (or someone else) do wrong.

    I took pipelines from gstrtpbin documentation page and slightly modified them to use Speex :

    This is sender pipeline :
    # !/bin/sh

    gst-launch -v gstrtpbin name=rtpbin \
           v4l2src ! ffmpegcolorspace ! ffenc_h263 ! rtph263ppay ! rtpbin.send_rtp_sink_0 \
                     rtpbin.send_rtp_src_0 ! udpsink host=127.0.0.1 port=5000                            \
                     rtpbin.send_rtcp_src_0 ! udpsink host=127.0.0.1 port=5001 sync=false async=false    \
                     udpsrc port=5005 ! rtpbin.recv_rtcp_sink_0                           \
           pulsesrc ! audioconvert ! audioresample  ! audio/x-raw-int,rate=16000 !    \
                     speexenc bitrate=16000 ! rtpspeexpay ! rtpbin.send_rtp_sink_1                   \
                     rtpbin.send_rtp_src_1 ! udpsink host=127.0.0.1 port=5002                            \
                     rtpbin.send_rtcp_src_1 ! udpsink host=127.0.0.1 port=5003 sync=false async=false    \
                     udpsrc port=5007 ! rtpbin.recv_rtcp_sink_1

    Receiver pipeline :

     !/bin/sh

    gst-launch -v\
       gstrtpbin name=rtpbin                                          \
       udpsrc caps="application/x-rtp,media=(string)video, clock-rate=(int)90000, encoding-name=(string)H263-1998" \
               port=5000 ! rtpbin.recv_rtp_sink_0                                \
           rtpbin. ! rtph263pdepay ! ffdec_h263 ! xvimagesink                    \
        udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0                               \
        rtpbin.send_rtcp_src_0 ! udpsink port=5005 sync=false async=false        \
       udpsrc caps="application/x-rtp,media=(string)audio, clock-rate=(int)16000, encoding-name=(string)SPEEX, encoding-params=(string)1, payload=(int)110" \
               port=5002 ! rtpbin.recv_rtp_sink_1                                \
           rtpbin. ! rtpspeexdepay ! speexdec ! audioresample ! audioconvert ! alsasink \
        udpsrc port=5003 ! rtpbin.recv_rtcp_sink_1                               \
        rtpbin.send_rtcp_src_1 ! udpsink host=127.0.0.1 port=5007 sync=false async=false

    Those pipelines, a combination of H263 and Speex, work fine enough. I snap my fingers near camera and micropohne and then I see movement and hear sound at the same time.

    Then I changed pipelines to use H264 along the video path.

    The sender becomes :
    # !/bin/sh

    gst-launch -v gstrtpbin name=rtpbin \
           v4l2src ! ffmpegcolorspace ! x264enc bitrate=300 ! rtph264pay ! rtpbin.send_rtp_sink_0 \
                     rtpbin.send_rtp_src_0 ! udpsink host=127.0.0.1 port=5000                            \
                     rtpbin.send_rtcp_src_0 ! udpsink host=127.0.0.1 port=5001 sync=false async=false    \
                     udpsrc port=5005 ! rtpbin.recv_rtcp_sink_0                           \
           pulsesrc ! audioconvert ! audioresample  ! audio/x-raw-int,rate=16000 !    \
                     speexenc bitrate=16000 ! rtpspeexpay ! rtpbin.send_rtp_sink_1                   \
                     rtpbin.send_rtp_src_1 ! udpsink host=127.0.0.1 port=5002                            \
                     rtpbin.send_rtcp_src_1 ! udpsink host=127.0.0.1 port=5003 sync=false async=false    \
                     udpsrc port=5007 ! rtpbin.recv_rtcp_sink_1

    And receiver becomes :
    # !/bin/sh

    gst-launch -v\
       gstrtpbin name=rtpbin                                          \
       udpsrc caps="application/x-rtp,media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264" \
               port=5000 ! rtpbin.recv_rtp_sink_0                                \
           rtpbin. ! rtph264depay ! ffdec_h264 ! xvimagesink                    \
        udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0                               \
        rtpbin.send_rtcp_src_0 ! udpsink port=5005 sync=false async=false        \
       udpsrc caps="application/x-rtp,media=(string)audio, clock-rate=(int)16000, encoding-name=(string)SPEEX, encoding-params=(string)1, payload=(int)110" \
               port=5002 ! rtpbin.recv_rtp_sink_1                                \
           rtpbin. ! rtpspeexdepay ! speexdec ! audioresample ! audioconvert ! alsasink \
        udpsrc port=5003 ! rtpbin.recv_rtcp_sink_1                               \
        rtpbin.send_rtcp_src_1 ! udpsink host=127.0.0.1 port=5007 sync=false async=false

    This is what happen under Ubuntu 10.04. I didn't noticed such huge delays on Ubuntu 9.04 - the delays there was in range 2-3 seconds, AFAIR.

  • pyav / ffmpeg / libav select number of P-frames and B-frames

    27 mai 2021, par user1315621

    I am streaming from an rtsp source. It looks like half of the frames received are key frames. Is there a way to reduce this percentage and have an higher number of P-frames and B-frames ? If possible, I would like to increase the number of P-frames (not the one of B-frames).
I am using pyav which is a Python wrapper for libav (ffmpeg)

    


    Code :

    


    container = av.open(
    url, 'r',
    options={
        'rtsp_transport': 'tcp',
        'stimeout': '5000000',
        'max_delay': '5000000',
    }
)
stream = container.streams.video[0]
codec_context = stream.codec_context
codec_context.export_mvs = True
codec_context.gop_size = 25  

for packet in self.container.demux(video=0):
    for video_frame in packet.decode():
        print(video_frame.is_key_frame)


    


    Output :

    


    True
False
True
False
...


    


    Note 1 : I can't edit the source. I can just edit the code used to stream the video.

    


    Note 2 : same solution should apply to pyav, libavi and ffmpeg.

    


    Edit : it seems that B-frames are disabled : codec_context.has_b_frames is False