Recherche avancée

Médias (1)

Mot : - Tags -/bug

Autres articles (111)

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

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

Sur d’autres sites (10937)

  • Ffmpeg burnt in subtitles out of sync when converting to hls

    19 mai 2020, par user1503606

    I have a file that has subtitles burn into it and they are perfectly in sync.

    



    Here is the file. https://983yqbz442.s3.amazonaws.com/little-mermaid-captions.mp4

    



    I run this command to convert to hls and it creates the .ts files and the .vtt files.

    



    ffmpeg -i little-mermaid-captions.mp4 -profile:v baseline -level 3.0 -s 640x360 -start_number 0 -hls_time 10 -hls_list_size 0 -f hls index.m3u8


    



    I also then create a master.m3u8 file in the same folder with the following.

    



    #EXTM3U
#EXT-X-VERSION:3
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-STREAM-INF:BANDWIDTH=800000,RESOLUTION=640x360,SUBTITLES="subtitles"
index.m3u8
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subtitles",NAME="English",DEFAULT=YES,AUTOSELECT=YES,FORCED=NO,LANGUAGE="ENG",URI="index_vtt.m3u8"


    



    Now if I play the master.m3u8 file the subtitles are now out of sync and are about 1 sec to quick. I understand this is probably a setting I am missing through FFmpeg but really stuck on this and would appreciate any insight.

    



    Thanks

    



    More info.

    



    Here is a link to the direct .m3u8 this can be opened in Safari.

    



    https://983yqbz442.s3.amazonaws.com/hlstests/master.m3u8

    



    The generated vtt file is here.

    



    https://983yqbz442.s3.amazonaws.com/hlstests/subs-0.vtt

    



    If you look at the start of the .vtt file you will see this.

    



    WEBVTT

00:06.840 --> 00:10.320
once long ago in the deep blue below


    



    It should start at 00:06.840 but when playing the .m3u8 file in Safari you should see it starts at around 5 seconds not 6 about a second too early.

    


  • dds : Fix palette decoding

    21 juillet 2015, par Vittorio Giovara
    dds : Fix palette decoding
    

    Red and blue channels were decoded in the wrong order.

    Found-By : ami_stuff

    • [DBH] libavcodec/dds.c
    • [DBH] tests/ref/fate/dds-pal
    • [DBH] tests/ref/fate/dds-pal-ati
  • How to read RTSP video streams with low latency

    24 mai 2023, par rayion

    I want to make a code to read rtsp video stream with low latency, I just found the libav library to reduce the frame reading and decoding latency, but it still has a latency of about 230ms, can it be faster ?

    


    Here is my code, I don't know why the displayed image is black by running this code :

    


    #include <cstdio>&#xA;#include <cstring>&#xA;#include <iostream>&#xA;#include <sstream>&#xA;#include <queue>&#xA;#include &#xA;#include <thread>&#xA;#include <chrono>&#xA;#include <vector>&#xA;#include "opencv2/opencv.hpp"&#xA;extern "C"&#xA;{&#xA;#include <libavformat></libavformat>avformat.h>&#xA;#include <libavutil></libavutil>error.h>&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include <libswscale></libswscale>swscale.h>&#xA;}&#xA;&#xA;#define ERR_BUFF_SIZE 1024&#xA;bool is_ready = false;&#xA;std::mutex mtx;&#xA;std::queue frames;&#xA;std::chrono::_V2::system_clock::time_point td;&#xA;std::vector<avpacket> pkt_queue;&#xA;&#xA;void show()&#xA;{&#xA;    cv::namedWindow("test");&#xA;&#xA;    while (true)&#xA;    {&#xA;        if (is_ready == true)&#xA;        {&#xA;            break;&#xA;        }&#xA;&#xA;        if (!frames.empty())&#xA;        {&#xA;&#xA;            mtx.lock();&#xA;            cv::Mat f = frames.front();&#xA;            frames.pop();&#xA;            // const auto te = std::chrono::system_clock::now();&#xA;            mtx.unlock();&#xA;            // int ted = std::chrono::duration_cast(te-td).count();&#xA;            // std::cout &lt;&lt; "Now  show  time spent :" &lt;<ted></ted>/ std::cout &lt;&lt; "get !"&lt;&lt; std::endl;&#xA;            cv::imshow("test", f);&#xA;            cv::waitKey(1);&#xA;        }&#xA;    }&#xA;&#xA;    cv::destroyWindow("test");&#xA;}&#xA;&#xA;int main(int argc, char **argv)&#xA;{&#xA;&#xA;    const char *url = "rtsp://admin:hik123456@192.168.10.64";&#xA;&#xA;    av_register_all();&#xA;&#xA;    AVFormatContext *container = nullptr;&#xA;    AVDictionary *options = NULL;&#xA;    av_dict_set(&amp;options, "max_delay", "0", 0);&#xA;&#xA;    av_dict_set(&amp;options, "preset", "ultrafast", 0);&#xA;&#xA;    av_dict_set(&amp;options, "rtsp_transport", "tcp", 0);&#xA;&#xA;    av_dict_set(&amp;options, "tune", "zerolatency", 0);&#xA;&#xA;    if (avformat_open_input(&amp;container, url, NULL, &amp;options) != 0)&#xA;    {&#xA;        char error_buffer[ERR_BUFF_SIZE];&#xA;        av_strerror(errno, error_buffer, sizeof(error_buffer));&#xA;        std::cerr &lt;&lt; "Failed to open input: " &lt;&lt; error_buffer &lt;&lt; std::endl;&#xA;        return 1;&#xA;    }&#xA;&#xA;    if (avformat_find_stream_info(container, NULL) &lt; 0)&#xA;    {&#xA;        std::cerr &lt;&lt; "Failed to find stream info" &lt;&lt; std::endl;&#xA;        return 1;&#xA;    }&#xA;&#xA;    av_dump_format(container, 0, url, 0);&#xA;&#xA;    int video_stream = -1;&#xA;    AVCodecParameters *codecContext = nullptr;&#xA;    AVCodec *codec = nullptr;&#xA;    for (unsigned i = 0; i &lt; container->nb_streams; i&#x2B;&#x2B;)&#xA;    {&#xA;        auto codecpar = container->streams[i]->codecpar;&#xA;        if (codecpar->codec_type == AVMEDIA_TYPE_VIDEO)&#xA;        {&#xA;            video_stream = i;&#xA;            if (AVCodecID::AV_CODEC_ID_HEVC != codecpar->codec_id)&#xA;                std::cout &lt;&lt; "now same codec" &lt;&lt; std::endl;&#xA;&#xA;            codec = avcodec_find_decoder(codecpar->codec_id);&#xA;            codecContext = codecpar;&#xA;            break;&#xA;        }&#xA;    }&#xA;&#xA;    if (!codec)&#xA;    {&#xA;        std::cerr &lt;&lt; "Failed to find codec" &lt;&lt; std::endl;&#xA;        return 1;&#xA;    }&#xA;&#xA;    AVCodecContext *decoderContext = avcodec_alloc_context3(codec);&#xA;    int err = avcodec_parameters_to_context(decoderContext, codecContext);&#xA;    if (err &lt; 0)&#xA;    {&#xA;        std::cerr &lt;&lt; "Failed to copy codec parameters to decoder context" &lt;&lt; std::endl;&#xA;        return 1;&#xA;    }&#xA;&#xA;    decoderContext->flags2 |= AV_CODEC_FLAG2_FAST;&#xA;&#xA;    if (avcodec_open2(decoderContext, codec, nullptr) &lt; 0)&#xA;    {&#xA;        std::cerr &lt;&lt; "Failed to open codec" &lt;&lt; std::endl;&#xA;        return 1;&#xA;    }&#xA;&#xA;    int i = 0;&#xA;    std::thread t(show);&#xA;&#xA;    while (true)&#xA;    {&#xA;        const auto ta = std::chrono::system_clock::now();&#xA;        AVPacket packet;&#xA;        av_init_packet(&amp;packet);&#xA;        if (av_read_frame(container, &amp;packet) &lt; 0)&#xA;        {&#xA;            std::cerr &lt;&lt; "Failed to read frame" &lt;&lt; std::endl;&#xA;            return 1;&#xA;        }&#xA;        const auto tb = std::chrono::system_clock::now();&#xA;        int tba = std::chrono::duration_cast(tb - ta).count();&#xA;        std::cout &lt;&lt; "Now  read time spent :" &lt;&lt; tba &lt;&lt; "us " &lt;&lt; std::endl;&#xA;        if (packet.stream_index == video_stream)&#xA;        {&#xA;            AVFrame *frame = av_frame_alloc();&#xA;            int got_frame = 0;&#xA;&#xA;            int len = avcodec_decode_video2(decoderContext, frame, &amp;got_frame, &amp;packet);&#xA;&#xA;            const auto tc = std::chrono::system_clock::now();&#xA;            int tcb = std::chrono::duration_cast(tc - tb).count();&#xA;            std::cout &lt;&lt; "Now  decode  time spent :" &lt;&lt; tcb &lt;&lt; "us " &lt;&lt; std::endl;&#xA;&#xA;            if (len >= 0 &amp;&amp; got_frame)&#xA;            {&#xA;                cv::Mat image(frame->height, frame->width, CV_8UC1, frame->data[0], frame->linesize[0]);&#xA;                mtx.lock();&#xA;                frames.push(image);&#xA;                td = std::chrono::system_clock::now();&#xA;                mtx.unlock();&#xA;            }&#xA;            int tdc = std::chrono::duration_cast(td - tc).count();&#xA;            std::cout &lt;&lt; "Now  get frame   time spent :" &lt;&lt; tdc &lt;&lt; "us " &lt;&lt; std::endl;&#xA;&#xA;            av_frame_free(&amp;frame);&#xA;        }&#xA;&#xA;        av_packet_unref(&amp;packet);&#xA;        i&#x2B;&#x2B;;&#xA;        if (i > 10000)&#xA;        {&#xA;            is_ready = true;&#xA;            break;&#xA;        }&#xA;    }&#xA;    t.join();&#xA;    avcodec_close(decoderContext);&#xA;    avformat_close_input(&amp;container);&#xA;&#xA;    return 0;&#xA;}&#xA;</avpacket></vector></chrono></thread></queue></sstream></iostream></cstring></cstdio>

    &#xA;

    I think this delay is still too slow, but I don't know if there's a better setting.

    &#xA;