Recherche avancée

Médias (1)

Mot : - Tags -/censure

Autres articles (42)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (5531)

  • How to remove colour background into transparent or other colour with ffmpeg ?

    30 janvier 2017, par FillzZ

    My video is like in this picture. I need to remove blue background into transparent or other colour. How can I make it ?enter image description here

  • How to download/convert multiple streams to multiple outputs with FFmpeg ?

    16 avril 2016, par Website Newbie

    Let’s say I have 20 different online stream videos (playlist.m3u8) and I want every video to output to their own .avi files. How can I do that in single file, so I don’t have to download and convert every single one separately ?

    I found a -map command online, but didn’t get straight answer to this.

    Will this be a working code ?

    ffmpeg -i 1playlist.m3u8 -vf scale=768:-1 -vcodec libx264 -crf 24 -acodec copy -map 0 1.avi \
    -i 2playlist.m3u8 -vf scale=768:-1 -vcodec libx264 -crf 24 -acodec copy -map 1 2.avi \
    -i 3playlist.m3u8 -vf scale=768:-1 -vcodec libx264 -crf 24 -acodec copy -map 2 3.avi
  • How to seek one frame forward in ffmpeg [closed]

    10 mars, par Summit

    i want to seek one frame forward when i call this function but it gets stuck on the first frame seeked and does not move forward.

    


    void seekFrameUp() {
    if (!fmt_ctx || video_stream_index == -1) return;

    AVRational frame_rate = fmt_ctx->streams[video_stream_index]->r_frame_rate;
    if (frame_rate.num == 0) return;  // Avoid division by zero

    // Compute frame duration in AV_TIME_BASE_Q
    int64_t frame_duration = av_rescale_q(1,
        av_make_q(frame_rate.den, frame_rate.num),
        AV_TIME_BASE_Q);

    int64_t next_pts = requestedTimestamp + frame_duration;

    qDebug() << "Seeking forward: " << next_pts
        << " (Current PTS: " << requestedTimestamp
        << ", Frame Duration: " << frame_duration << ")";

    requestFrameAt(next_pts);

    // Update the requested timestamp after seeking
    requestedTimestamp = next_pts;
}





void requestFrameAt(int64_t timestamp) {
     {
         std::lock_guard lock(mtx);
         decoding = true;  // Ensure the thread keeps decoding when needed
     }
     cv.notify_one();
 }


void decodeLoop() {
    while (!stopThread) {
        std::unique_lock lock(mtx);
        cv.wait(lock, [this] { return decoding || stopThread; });

        if (stopThread) break;

        // Avoid redundant seeking
        if (requestedTimestamp == lastRequestedTimestamp) {
            decoding = false;
            continue;
        }

       

        lastRequestedTimestamp.store(requestedTimestamp.load());
        int64_t target_pts = av_rescale_q(requestedTimestamp, AV_TIME_BASE_Q, fmt_ctx->streams[video_stream_index]->time_base);

        target_pts = FFMAX(target_pts, 0); // Ensure it's not negative

        if (av_seek_frame(fmt_ctx, video_stream_index, target_pts, AVSEEK_FLAG_ANY) >= 0) {
            avcodec_flush_buffers(codec_ctx);  // Clear old frames from the decoder
            qDebug() << "Seek successful to PTS:" << target_pts;
        }
        else {
            qDebug() << "Seeking failed!";
            decoding = false;
            continue;
        }

        lock.unlock();

        // Keep decoding until we receive a valid frame
        bool frameDecoded = false;
        while (av_read_frame(fmt_ctx, pkt) >= 0) {
            if (pkt->stream_index == video_stream_index) {
                if (avcodec_send_packet(codec_ctx, pkt) == 0) {
                    while (avcodec_receive_frame(codec_ctx, frame) == 0) {
                        qDebug() << "FRAME DECODED ++++++++++++ PTS:" << frame->pts;
                        if (frame->pts != AV_NOPTS_VALUE) {
                            // Rescale PTS to AV_TIME_BASE_Q
                            int64_t pts_in_correct_base = av_rescale_q(frame->pts,
                                fmt_ctx->streams[video_stream_index]->time_base,
                                AV_TIME_BASE_Q);

                            // Ensure we don’t reset to 0 incorrectly
                            if (pts_in_correct_base > 0) {
                                current_pts.store(pts_in_correct_base);
                                qDebug() << "Updated current_pts to:" << current_pts.load();
                            }
                            else {
                                qDebug() << "Warning: Decoded frame has PTS <= 0, keeping last valid PTS.";
                            }
                        }
                        else {
                            qDebug() << "Invalid frame->pts (AV_NOPTS_VALUE)";
                        }

                        QImage img = convertFrameToImage(frame);
                        emit frameDecodedSignal(img);
                
                        frameDecoded = true;
                        break;  // Exit after the first valid frame
                    }

                    if (frameDecoded) {
                        decoding = (requestedTimestamp != lastRequestedTimestamp);
                        break;
                    }
                }
            }
            av_packet_unref(pkt);
        }
    }
}