Recherche avancée

Médias (91)

Autres articles (73)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

Sur d’autres sites (8633)

  • Find better VP8 parameters for robustness in UDP streaming with libav/ffmpeg

    24 octobre 2014, par lmNt

    I’m facing some problems in my video chat application, which is using libav libraries. I am sending 1080p videos encoded in VP8 as WebM container via UDP and it works quite well. Most of the time, the decoder on either side recovers from packet losses due to the transmission.

    However at some point in time it just freezes and never recovers again. This happens on both sides eventually. I was searching for VP8 codec parameters to set for increased robustness, when sending over lossy transmission channels. And I combined some of which I found, in order to increase robustness. However, it still freezes after some time of video chat.

    Here are the parameters I am currently using.

     pVidCodecCtx->codec_id     = AV_CODEC_ID_VP8;
     pVidCodecCtx->codec_type   = AVMEDIA_TYPE_VIDEO;
     pVidCodecCtx->width        = frmQ->pCodecCtx->width; //1920
     pVidCodecCtx->height       = frmQ->pCodecCtx->height; //1080
     pVidCodecCtx->time_base    = frmQ->pCodecCtx->time_base;
     pVidCodecCtx->pix_fmt      = PIX_FMT_YUV420P;
     pVidCodecCtx->qmin         = 4;
     pVidCodecCtx->qmax         = 56;
     pVidCodecCtx->bit_rate     = pVidCodecCtx->width * pVidCodecCtx->height * 6;
     pVidCodecCtx->slices       = 8;
     pVidCodecCtx->profile      = 3;
     pVidCodecCtx->thread_count = 3;
     pVidCodecCtx->keyint_min   = 5;
     av_dict_set(&pDictCodecOpts, "rc_lookahead", "0", 0);
     av_dict_set(&pDictCodecOpts, "quality", "realtime", 0);
     av_dict_set(&pDictCodecOpts, "deadline", "realtime", 0);
     av_dict_set(&pDictCodecOpts, "max-intra-rate", "0", 0);
     av_dict_set(&pDictCodecOpts, "qcomp", "0", 0);
     av_dict_set(&pDictCodecOpts, "default", "er", 0);
     av_dict_set(&pDictCodecOpts, "error_resilient", "er", 0);
     av_dict_set(&pDictCodecOpts, "partitions", "er", 0);

    Most of the parameters I extracted from the ffmpeg code for the vpx encoder.

    Do I also have to set parameters for the decoder in order to increase error resilience ?
    Or am I missing some parameters in the encoder or setting them incorrectly. Any help or hints are greatly appreciated.

  • mpeg2 ts android ffmpeg openmax

    10 octobre 2014, par WLGfx

    The setup is as follows :

    1. Multicast server 1000Mbs, UDP, Mpeg2-TS Part 1 (H.222) streaming live TV-channels.
    2. Quad core 1.5Ghz Android 4.2.2 GLES 2.0 renderer.
    3. FFMpeg library.
    4. Eclipse Kepler, Android SDK/NDK, etc. Running on Windows 8.1.
    5. Output screen 1920 x 1080, I am using a texture of 2048 x 1024 and getting between 35 and 45 Frames per second.

    The app :

    1. Renderer thread runs continuously and updates a single texture by uploading segments to the gpu when media images are ready.
    2. Media handler thread, downloads and processes media from server/or local storage.
    3. Video thread(s), one for buffering the UDP packets and another for decoding the packets into frames.

    I am connecting ffmpeg to the UDP stream just fine and the packets are being buffered and seemingly decoded fine. The packet buffers are plenty, no under/over-flows. The problem I am facing is it appears to be chopping up frames (ie only playing back 1 out of every so many frames). I understand that I need to distinguish I/P/B frames, but at the moment, hands up, I ain’t got a clue. I’ve even tried a hack to detect I frames to no avail. Plus, I am only rendering the frames to less than a quarter of the screen. So I’m not using full screen decoding.

    The decoded frames are also stored in separate buffers to cut out page tearing. The number of buffers I’ve changed too, from 1 to 10 with no luck.

    From what I’ve found about OpenMax IL, is it only handles MPeg2-TS Part 3 (H.264 and AAC), but you can use your own decoder. I understand that you can add your own decode component to it. Would it be worth me trying this route or should I continue on with ffmpeg ?

    The frame decoder (only the renderer will convert and scale the frames when ready)
    /*
    * This function will run through the packets and keep decoding
    * until a frame is ready first, or out of packets
    */

    while (packetsUsed[decCurrent])
    {
       hack_for_i_frame:
       i = avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packets[decCurrent]);
       packetsUsed[decCurrent] = 0; // finished with this one
       i = packets[decCurrent].flags & 0x0001;
       decCurrent++;
       if (decCurrent >= MAXPACKETS) decCurrent = 0;
       if (frameFinished)
       {
           ready_pFrame = pFrame;
           frameReady = true;  // notify renderer
           frameCounter++;
           if (frameCounter>=MAXFRAMES) frameCounter = 0;
           pFrame = pFrames[frameCounter];
           return 0;
       }
       else if (i)
           goto hack_for_i_frame;
    }

    return 0;

    The packet reader (spawned as a pthread)
    void *mainPacketReader(void *voidptr)

    int res ;

    while ( threadState == TS_RUNNING )
    {
       if (packetsUsed[prCurrent])
       {
           LOGE("Packet buffer overflow, dropping packet...");
           av_read_frame( pFormatCtx, &packet );
       }
       else if ( av_read_frame( pFormatCtx, &packets[prCurrent] ) >= 0 )
       {
           if ( packets[prCurrent].stream_index == videoStream )
           {
               packetsUsed[prCurrent] = 1; // flag as used
               prCurrent++;
               if ( prCurrent >= MAXPACKETS )
               {
                   prCurrent = 0;
               }
           }

           // here check if the packet is audio and add to audio buffer
       }
    }
    return NULL;

    And the renderer just simply does this
    // texture has already been bound before calling this function

    if ( frameReady == false ) return;

    AVFrame *temp;  // set to frame 'not' currently being decoded
    temp = ready_pFrame;

    sws_scale(sws_ctx,(uint8_t const* const *)temp->data,
           temp->linesize, 0, pCodecCtx->height,
           pFrameRGB->data, pFrameRGB->linesize);

    glTexSubImage2D(GL_TEXTURE_2D, 0,
           XPOS, YPOS, WID, HGT,
           GL_RGBA, GL_UNSIGNED_BYTE, buffer);

    frameReady = false;

    In the past, libvlc had audio syncing problems too, so that is my decision for going with ffmpeg and doing all the donkey work from scratch.

    If anybody has any pointers of how to stop the choppiness of the video playback (works great in VLC player) or possibly another route to go down, it would be seriously appreciated.

    EDIT I removed the hack for the I-frame (completely useless). Move the sws_scale function from the renderer to the packet decoder. And I left the udp packet reader thread alone.

    In the meantime I’ve also changed the packet reader thread and the packet decoder threads priority to real-time. Since doing that I don’t get shed loads of dropped packets.

  • Support scaling to UHD

    6 mai 2018, par Aurelius Schnitzler

    I am using ffmpeg with

    ffmpeg -i GOPR1373.MP4 -c:v libx264 -vf "pad=width=5848:height=2924:x=1964:y=922:color=black,scale=3840:2160" GOPR1373_w.MP4

    Which yields to Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height and x264 [error]: malloc of size 43688832 failed

    yet

    ffmpeg -i GOPR1373.MP4 -c:v libx264 -vf "pad=width=5848:height=2924:x=1964:y=922:color=black,scale=1920:1080" GOPR1373_w.MP4

    works.

    How to fix this ?

    EDIT : I solved it by freeing up memory.