Recherche avancée

Médias (1)

Mot : - Tags -/getid3

Autres articles (65)

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

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

Sur d’autres sites (8118)

  • Do we have to return full buffers each time our AVIO `read_packet()` callback from FFMPEG is called ?

    8 janvier 2023, par Alexis Wilke

    I allocate an AVIO context with my own read_packet() implementation. Only my implementation is such that I may return with a count smaller than the required input buf_size. Is that allowed ? Or do we have to fill the buffer as much as possible each time out read_packet() function gets called ?

    


    // initialization&#xA;    [...snip...]&#xA;    m_avio_context.reset(avio_alloc_context(&#xA;                          avio_buffer&#xA;                        , avio_buffer_size&#xA;                        , 0             // write flag&#xA;                        , this          // opaque&#xA;                        , &amp;FFMPEGDecoder::decoder_read_static&#xA;                        , nullptr       // write func.&#xA;                        , nullptr));    // seek func.&#xA;    [...snip...]&#xA;&#xA;// implementation of static function&#xA;int FFMPEGDecoder::decoder_read_static(void * opaque, std::uint8_t * buf, int size)&#xA;{&#xA;    return reinterpret_cast<ffmpegdecoder>(opaque)->decoder_read(buf, size);&#xA;}&#xA;&#xA;// the actual read_packet()&#xA;int FFMPEGDecoder::decoder_read(std::uint8_t * buf, int size)&#xA;{&#xA;    // in flushing mode, we won&#x27;t receive any more packets&#xA;    //&#xA;    if(m_flushing)&#xA;    {&#xA;        return 0;&#xA;    }&#xA;&#xA;    // m_packet is my own packet implementation (an std::vector&lt;>)&#xA;    //&#xA;    while(m_packet == nullptr&#xA;       || static_cast(m_read_pos) >= m_packet->size())&#xA;    {&#xA;        if(!m_incoming_packets.pop_front(m_packet, -1))&#xA;        {&#xA;            return 0;&#xA;        }&#xA;        if(m_packet->is_flush())&#xA;        {&#xA;            m_flushing = true;&#xA;            return 0;&#xA;        }&#xA;        m_read_pos = 0;&#xA;    }&#xA;&#xA;    // the number of bytes to copy size `size` or less if there are&#xA;    // less bytes available in my m_packet&#xA;    //&#xA;    int const copy(std::min(static_cast(size), m_packet->size() - m_read_pos));&#xA;&#xA;    memcpy(buf, m_packet->data().data() &#x2B; m_read_pos, copy);&#xA;&#xA;    m_read_pos &#x2B;= copy;&#xA;&#xA;    return copy;&#xA;}&#xA;</ffmpegdecoder>

    &#xA;

    I'm not looking for a way to fill the buffer, I'm going to implement it that way now. I'm looking for confirmation (or not) that the FFMPEG libraries are not capable of accepting less than size bytes in buf when our read_packet() gets called.

    &#xA;

    Do you know ?

    &#xA;

  • Port r17546 from Tremor ; although pieces had made it over to libvorbis, a comprehensive

    3 février 2012, par Monty
    Port r17546 from Tremor ; although pieces had made it over to libvorbis, a comprehensive
    port and verification was called for.  This patch provided some additional floor0
    hardening :
    

    floor0 code could potentially use a book where the number of vals it
    needed to decode was not an integer number of dims wide. This caused
    it to overflow the output vector as the termination condition was in
    the outer loop of vorbis_book_decodev_set.

    None of the various vorbis_book_decodeXXXX calls internally guard
    against this case either, but in every other use the calling code does
    properly guard (and avoids putting more checks in the tight inner
    decode loop).

    For floor0, move the checks into the inner loop as there’s little
    penalty for doing so.

    [an equivalent change was already in libvorbis, but I’ve
    harmonized the code with tremor]

    For floor0, move the checks into the inner loop as there’s little
    penalty for doing so. Add commentary indicating where guarding is
    done for each call variant.

    git-svn-id : http://svn.xiph.org/trunk/vorbis@18183 0101bb08-14d6-0310-b084-bc0e0c8e3800

    • [DH] lib/codebook.c
    • [DH] lib/floor0.c
  • Build Live Audio Stream Player

    5 décembre 2011, par Kurt

    For an internship project i've been trying to develop a simple audio player for audio live stream.

    Currently i'm using a homemade three buffering (of 1/3 s each) solution played by QAudioOutput, which recall himself after finished his reading.

    void VideoServer::getBuf(QBuffer * p_buf)
    {
       audio_chunk*    ac = NULL;
       std::vector v;

       v.clear();
       for (int i = 0; i &lt; 20;)
       {
           ac = _audioPreviewSharedData->deQueueAudio();
           if (ac)
           {
               v.insert(v.end(), ac->v_buf.begin(), ac->v_buf.end());
               i++;
               delete ac;
           }
           else
               usleep(50000);
       }
       p_buf->close();
       p_buf->setData((const char *)(&amp;v[0]), v.size()*2);
       p_buf->open(QIODevice::ReadOnly);
    }

    -

    void VideoServer::slot_launchAudioPreviewBuffering()
    {
       getBuf(_buf1);
       getBuf(_buf2);
       _state = 2;
       connect(_audioPreviewTimer, SIGNAL(timeout()), this, SLOT(slot_audioPreviewBuffering()));
       _audioPreviewTimer->start(0);
       connect(_audioOut, SIGNAL(stateChanged(QAudio::State)), this, SLOT(finishedPlaying(QAudio::State)));
    }

    -

    void VideoServer::finishedPlaying(QAudio::State state)
    {
       if(state == QAudio::IdleState) {
           slot_audioPreviewBuffering();
       }
    }

    -

    void VideoServer::slot_audioPreviewBuffering()
    {
       switch (_state) {
       case 0:
           {
               _audioOut->start(_buf2);
               getBuf(_buf1);
               _state = 1;
               break;
           }
       case 1:
           {
               _audioOut->start(_buf3);
               getBuf(_buf2);
               _state = 2;
               break;
           }
       case 2:
           {
               _audioOut->start(_buf1);
               getBuf(_buf3);
               _state = 0;
               break;
           }
       }
    }

    But i'm suffering of choppy sound (little interruption between audio chunk).

    How to play this flux without interruption () and with a reasonable delay between audio and video (less 1s) ? Is there a best way ? Am i doing wrong ?

    Thank you !