Recherche avancée

Médias (0)

Mot : - Tags -/flash

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (51)

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

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (7689)

  • Anomalie #4111 : Quand un formulaire est posté, donner accès aux retours dans l’environnement glob...

    13 mars 2018, par cedric -

    J’étais sûr qu’il y avait déjà un ticket là-dessus mais je le retrouve pas.

    Donc c’est une issue connue et je pensais plutôt à quelque chose de plus directif, à savoir modifier directement le title pour prendre en compte le message d’erreur soit au niveau de affichage_final soit en injectant du JS qui le fera quand on est en ajax.

    Car l’injection des retours du formulaire dans le env pose un problème de cohérence sur l’affichage du reste de la page entre le cas où on est en ajax et le cas où on ne l’est pas (par construction on a plus de garantie que le reste de la page est identique, donc potentiellement le post AJAX perd des fonctionnalités)

    Donc cela ne traiterait que partiellement le problème, c’est à dire quand on est pas en ajax, et uniquement si le squelette a pris en compte cette contrainte, ce qui est assez aléatoire.
    En traitant la problématique dans le core "erreur => on modifie le title", on permet que tous les sites bénéficient directement de la feature et du gain en accessibilité.

    On peut envisager d’avoir une fonction surchargeable qui est appelée pour déterminer ce qui est injecté dans le title à partir du retour du formulaire, par défaut le message d’erreur direct, ce qui permettra éventuellement d’avoir un contrôle plus fin là dessus en cas de requis accessibilité.

  • avfilter/vf_overlay : Fix double-free of AVFilterFormats on error

    7 août 2020, par Andreas Rheinhardt
    avfilter/vf_overlay : Fix double-free of AVFilterFormats on error
    

    The query_formats function of the overlay filter tries to allocate
    two lists (only one in a special case) of formats which on success
    are attached to more permanent objects (AVFilterLinks) for storage
    afterwards. If attaching a list to an AVFilterLink succeeds, it is
    in turn owned by the AVFilterLink (or more exactly, the AVFilterLink
    becomes one of the common owners of the list). Yet if attaching a list
    to one of its links succeeds and an error happens lateron, both lists
    were manually freed, whic is wrong if the list is already owned by one
    or more links ; these links' pointers to their lists will become dangling
    and there will be a double-free/use-after-free when these links are
    cleaned up automatically.

    This commit fixes this by removing the custom freeing code ; this will
    temporarily add a leaking codepath (if attaching a list not already
    owned by a link to a link fails, the list will leak), but this will
    be fixed soon by making sure that an AVFilterFormats without owner will
    be automatically freed when attaching it to an AVFilterLink fails.
    Notice that at most one list leaks because a new list is only allocated
    after the old list has been successfully attached to a link.

    Reviewed-by : Nicolas George <george@nsup.org>
    Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@gmail.com>

    • [DH] libavfilter/vf_overlay.c
  • Why my code that based on ffmpeg can't sync video' time and audio's time ?

    6 juillet 2021, par ZSpirytus

    Background

    &#xA;

    Recently, I use ffmpeg to write my first Android video player. But video channel's time is faster than audio channel's time about 2 3 times.

    &#xA;

    Code

    &#xA;

    In short, I use PacketDispatcher to read AVPacket from http hlv source :

    &#xA;

    void PacketDispatcher::RealDispatch() {&#xA;    while (GetStatus() != DISPATCHER_STOP) {&#xA;        while (GetStatus() == DISPATCHER_PAUSE) {&#xA;            LOGD(TAG, "wait signal");&#xA;            pthread_mutex_lock(&amp;mutex);&#xA;            pthread_cond_wait(&amp;cond, &amp;mutex);&#xA;            pthread_mutex_unlock(&amp;mutex);&#xA;        }&#xA;&#xA;        AVPacket *av_packet = av_packet_alloc();&#xA;        int ret = av_read_frame(av_format_context, av_packet);&#xA;        if (ret) {&#xA;            LOGE(TAG, "av_read_frame ret=%d", ret);&#xA;            break;&#xA;        }&#xA;&#xA;        // PacketDispatcher is who read the AVPacket from http hlv source &#xA;        // and dispatch to decoder by its stream index.&#xA;        decoder_map[av_packet->stream_index]->Push(av_packet);&#xA;    }&#xA;}&#xA;

    &#xA;

    And then, Decoder written by Producer-Consumer Pattern, Decoder maintain a queue that store all the AVPacket received from PacketDispatcher. The code like this :

    &#xA;

    // write to the queue&#xA;void BaseDecoder::Push(AVPacket *av_packet) {&#xA;    pthread_mutex_lock(&amp;av_packet_queue_mutex);&#xA;    av_packet_queue.push(av_packet);&#xA;    pthread_cond_signal(&amp;av_packet_queue_cond);&#xA;    pthread_mutex_unlock(&amp;av_packet_queue_mutex);&#xA;}&#xA;&#xA;// real decode logic&#xA;void BaseDecoder::RealDecode() {&#xA;    SetDecoderState(START);&#xA;    LOGI(LogSpec(), "start decode");&#xA;&#xA;    while (true) {&#xA;        // 1. check decoder status and queue size to decide if call thread.wait&#xA;&#xA;        // 2. send packet to codec&#xA;        AVPacket* av_packet = av_packet_queue.front();&#xA;        int ret = avcodec_send_packet(av_codec_ctx, av_packet);&#xA;&#xA;        // 3. read frame from codec&#xA;        AVFrame *av_frame = av_frame_alloc();&#xA;        ret = avcodec_receive_frame(av_codec_ctx, av_frame);&#xA;&#xA;        if (m_render) {&#xA;            // 3. custom decode logic overrided by child class&#xA;            void *decode_result = DecodeFrame(av_frame);&#xA;            if (decode_result) {&#xA;                // 4. dispatch to render&#xA;                m_render->Render(decode_result);&#xA;            } else {&#xA;                LOGD("BaseDecoder", "decode_result=nullptr");&#xA;            }&#xA;        }&#xA;    }&#xA;}&#xA;

    &#xA;

    Finally, I do rendering logic in Render. Render also written by Producer-Consumer Pattern, it maintain a queue that store AVFrame received from Decoder, the code like this :

    &#xA;

    // write AVFrame&#xA;void BaseRender::Render(void *frame_data) {&#xA;    Lock();&#xA;    frame_queue.push(frame_data);&#xA;    Signal();&#xA;    UnLock();&#xA;}&#xA;&#xA;// render to surface or Open SL&#xA;void BaseRender::RealRender() {&#xA;    // frame data that contain frame pts and other metadata&#xA;    frame_data->pts = av_frame->pts = av_frame->best_effort_timestamp * av_q2d(GetTimeBase());&#xA;    // video only&#xA;    frame_data->video_extra_delay = av_frame->repeat_pict * 1.0 / fps * 2.0;&#xA;    if (m_render_synchronizer &amp;&amp; m_render_synchronizer->Sync(frame_data)) {&#xA;        continue;&#xA;    }&#xA;}&#xA;

    &#xA;

    And then, the synchronizer will decide to sleep time or drop video frame according to the frame pts, frame pts is :

    &#xA;

    frame_data->pts = av_frame->best_effort_timestamp * av_q2d(GetTimeBase());&#xA;

    &#xA;

    Also, video extra delay is :

    &#xA;

    frame_data->video_extra_delay = av_frame->repeat_pict * 1.0 / fps * 2.0;&#xA;

    &#xA;

    RenderSynchronizer code like this :

    &#xA;

    bool RenderSynchronizer::Sync(void *frame_data) {&#xA;    auto base_frame_data = static_cast<baseframedata>(frame_data);&#xA;    if (base_frame_data->media_type == AVMEDIA_TYPE_AUDIO) {&#xA;        return ReceiveAudioFrame(static_cast<pcmdata>(frame_data));&#xA;    } else if (base_frame_data->media_type == AVMEDIA_TYPE_VIDEO) {&#xA;        return ReceiveVideoFrame(static_cast<rgbadata>(frame_data));&#xA;    }&#xA;    return false;&#xA;}&#xA;&#xA;bool RenderSynchronizer::ReceiveAudioFrame(PCMData *pcm_data) {&#xA;    audio_pts = pcm_data->pts;&#xA;    return false;&#xA;}&#xA;&#xA;bool RenderSynchronizer::ReceiveVideoFrame(RGBAData *rgba_data) {&#xA;    video_pts = rgba_data->pts;&#xA;&#xA;    if (audio_pts &lt;= 0 || video_pts &lt;= 0) {&#xA;        return false;&#xA;    }&#xA;&#xA;    double diff = video_pts - audio_pts;&#xA;    if (diff > 0) {&#xA;        if (diff > 1) {&#xA;            av_usleep((unsigned int) (rgba_data->extra_delay * 1000000.0));&#xA;        } else {&#xA;            av_usleep((unsigned int) ((diff &#x2B; rgba_data->extra_delay) * 1000000.0));&#xA;        }&#xA;        return false;&#xA;    } else if (diff &lt; 0) {&#xA;        LOGD(TAG, "drop video frame");&#xA;        return true;&#xA;    } else {&#xA;        return false;&#xA;    }&#xA;}&#xA;</rgbadata></pcmdata></baseframedata>

    &#xA;

    Why my code can not sync video time and audio time ? Thanks for your reading and answers.

    &#xA;