Recherche avancée

Médias (3)

Mot : - Tags -/plugin

Autres articles (65)

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

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

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

Sur d’autres sites (6988)

  • Merge commit 'a2a9e4eea0e4fde2ed8d3405b4f33f655b600c2d'

    25 janvier 2018, par Mark Thompson
    Merge commit 'a2a9e4eea0e4fde2ed8d3405b4f33f655b600c2d'
    

    * commit 'a2a9e4eea0e4fde2ed8d3405b4f33f655b600c2d' :
    rtmp : Plug leak if sending bytes read report fails.

    This commit is a noop, see ee88f31d34c848fd95daf12bdf054b7228efdf14

    Merged-by : Mark Thompson <sw@jkqxz.net>

  • C++ RTSP Stream recording timebase wrong ffmpeg

    29 juillet 2021, par Tom Baires

    We fetch a camera stream over RTSP (Axis Q1755 H264). And after a random time we a start recording the stream to a file. I check the video file with ffprobe and realise the start time is not the start time of the recording it is the start time of fetch the stream. My Video has a length of 5 seconds and the start time of the video should be 0. But the real starttime of the Video is at second 20. This leads to a an incorrect timebase. (ffmpeg Version 3.3.3)

    &#xA;

    I try to repair it, but now i have some time the error timebase 1/180000... i marked my changes with the comment (timebase repair logic)

    &#xA;

    timebase video

    &#xA;

    ffprobe Output (without timebase repair logic)&#xA;The start is higher as the duration, correctly the start is 0 and not 20.080000

    &#xA;

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from&#xA;&#x27;C:\testvideo.mp4&#x27;:  &#xA; Metadata:&#xA;     major_brand     : isom&#xA;     minor_version   : 512&#xA;     compatible_brands: isomiso2avc1mp41&#xA;     encoder         : Lavf57.71.100   Duration: 00:00:05.04, start: 20.080000, bitrate: 2675 kb/s&#xA;     Stream #0:0(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuvj420p(pc, bt709), 800x450 [SAR 1:1 DAR 16:9], 2670 kb/s, 50.20 fps,&#xA; 50 tbr, 180k tbn, 360k tbc (default)&#xA;     Metadata:&#xA;       handler_name    : VideoHandler&#xA;

    &#xA;

    Error after the add of timebase repair logic

    &#xA;

    &#xA;

    [mpeg4 @ 00000178fcb12b40] timebase 1/180000 not supported by MPEG 4&#xA;standard, the maximum admitted value for the timebase denominator is&#xA;65535 Could not open codec 'mpeg4' : Unspecified error Cannot start&#xA;recording

    &#xA;

    &#xA;

    Here some parts of my code

    &#xA;

    Start Logic

    &#xA;

    bool RecordingStreamGrabber::start()&#xA;{&#xA;    CORE_LOG_INFO(m_logger, "Started RecordingStreamGrabber");&#xA;    if (m_thread == NULL)&#xA;    {&#xA;        if (this->prepareInputStream())&#xA;        {&#xA;            m_run = true;&#xA;            m_thread = new std::thread(RecordingStreamGrabber::run, this);&#xA;            return true;&#xA;        }&#xA;        CORE_LOG_ERROR(m_logger, "Error starting RecrodingStreamGrabber");&#xA;        return false;&#xA;    }&#xA;    return false;&#xA;}&#xA;

    &#xA;

    Prepare Input/Output Stream

    &#xA;

    bool RecordingStreamGrabber::prepareInputStream()&#xA;{&#xA;    CORE_LOG_INFO(m_logger, "Preparing Inputstream for recording: " &lt;&lt; m_url);&#xA;&#xA;    m_ifmtctx = avformat_alloc_context();&#xA;    interrupt_recording_nostop = false;&#xA;    interrupt_recording_timeout = m_timeout; // Timeout in milisekunde&#xA;    interrupt_recording_starttime = GetTickCount();&#xA;    m_ifmtctx->interrupt_callback = interrupt_timeout_cb;&#xA;&#xA;    if (avformat_open_input(&amp;m_ifmtctx, m_url.c_str(), NULL, NULL) != 0)&#xA;    {&#xA;        m_ifmtctx = NULL;&#xA;        CORE_LOG_ERROR(m_logger, "Error opening recording URL: " &lt;&lt; m_url);&#xA;        return false;&#xA;    }&#xA;&#xA;    interrupt_recording_nostop = true;&#xA;&#xA;    if (avformat_find_stream_info(m_ifmtctx, NULL) &lt; 0)&#xA;    {&#xA;        CORE_LOG_ERROR(m_logger, "Error finding stream in URL: " &lt;&lt; m_url);&#xA;        avformat_close_input(&amp;m_ifmtctx);&#xA;        m_ifmtctx = NULL;&#xA;        return false;&#xA;    }&#xA;&#xA;    //search for the first video stream&#xA;    m_stream_index = -1;&#xA;    for (unsigned int i = 0; i &lt; m_ifmtctx->nb_streams &amp;&amp; m_stream_index == -1; i&#x2B;&#x2B;)&#xA;    {&#xA;        m_iccx = m_ifmtctx->streams[i]->codec;&#xA;        if (m_iccx->codec_type == AVMEDIA_TYPE_VIDEO)&#xA;        {&#xA;            m_istream = m_ifmtctx->streams[i];&#xA;            m_stream_index = i;&#xA;        }&#xA;    }&#xA;&#xA;    if (m_stream_index == -1)&#xA;    {&#xA;        CORE_LOG_ERROR(m_logger, "Could not find video stream in URL: " &lt;&lt; m_url);&#xA;        avformat_close_input(&amp;m_ifmtctx);&#xA;        m_ifmtctx = NULL;&#xA;        return false;&#xA;    }&#xA;&#xA;    return true;&#xA;}&#xA;&#xA;bool RecordingStreamGrabber::prepareOutputStream()&#xA;{&#xA;    if (m_ofmtctx)&#xA;    {&#xA;        CORE_LOG_DEBUG(m_logger, "Close outputfile: " &lt;&lt; m_targetfile);&#xA;        avformat_free_context(m_ofmtctx);&#xA;        m_ofmtctx = NULL;&#xA;    }&#xA;&#xA;    m_ofmt = av_guess_format(NULL, m_targetfile.c_str(), NULL);&#xA;&#xA;    m_ofmtctx = avformat_alloc_context();&#xA;&#xA;    m_ofmtctx->oformat = m_ofmt;&#xA;&#xA;    if (avio_open2(&amp;m_ofmtctx->pb, m_targetfile.c_str(), AVIO_FLAG_WRITE, NULL, NULL) != 0)&#xA;    {&#xA;        avformat_free_context(m_ofmtctx);&#xA;        m_ofmtctx = NULL;&#xA;        CORE_LOG_ERROR(m_logger, "Error opening outputfile: " &lt;&lt; m_targetfile);&#xA;        return false;&#xA;    }&#xA;&#xA;    m_ostream = avformat_new_stream(m_ofmtctx, NULL);&#xA;&#xA;    avcodec_copy_context(m_ostream->codec, m_iccx);&#xA;&#xA;    m_ostream->sample_aspect_ratio.num = m_iccx->sample_aspect_ratio.num;&#xA;    m_ostream->sample_aspect_ratio.den = m_iccx->sample_aspect_ratio.den;&#xA;&#xA;    /* time base: this is the fundamental unit of time (in seconds) in terms&#xA;    of which frame timestamps are represented. for fixed-fps content,&#xA;    timebase should be 1/framerate and timestamp increments should be&#xA;    identically 1. */&#xA;    m_ostream->time_base.num = m_iccx->time_base.num;&#xA;    m_ostream->time_base.den = m_iccx->time_base.den;&#xA;&#xA;    avformat_write_header(m_ofmtctx, NULL);&#xA;&#xA;#ifdef WIN32&#xA;    sprintf_s(m_ofmtctx->filename, sizeof(m_ofmtctx->filename), "%s", m_targetfile.c_str());&#xA;#else&#xA;    snprintf(m_ofmtctx->filename, sizeof(m_ofmtctx->filename), "%s", m_targetfile.c_str());&#xA;#endif&#xA;    return true;&#xA;}&#xA;

    &#xA;

    Recording Logic

    &#xA;

    void RecordingStreamGrabber::run(RecordingStreamGrabber *_this)&#xA;{&#xA;    AVPacket packet;&#xA;    av_init_packet(&amp;packet);&#xA;    int i = 0;&#xA;    bool startFrame = true;&#xA;    bool keyFrame = false;&#xA;    int64_t pts, dts;&#xA;    _this->m_tailWritten = true;&#xA;    while (_this->m_run)&#xA;    {&#xA;        if (av_read_frame(_this->m_ifmtctx, &amp;packet) >= 0)&#xA;        {&#xA;            if ((packet.flags &amp; AV_PKT_FLAG_KEY) == AV_PKT_FLAG_KEY)&#xA;            {&#xA;                keyFrame = true;&#xA;                CORE_LOG_DEBUG(_this->m_logger, "Detected key frame: " &lt;&lt; i &lt;&lt; "");&#xA;            }&#xA;&#xA;            if (_this->m_record)&#xA;            {&#xA;                if (packet.stream_index == _this->m_stream_index)&#xA;                {&#xA;                    packet.stream_index = _this->m_ostream->id;&#xA;&#xA;                    if (_this->m_tailWritten == false || keyFrame == true)&#xA;                    {&#xA;                        //#####################################&#xA;                        //timebase repair logic (my changes)&#xA;                        //#####################################&#xA;                        AVStream *in_stream;&#xA;                        AVStream *out_stream;&#xA;&#xA;                        in_stream = _this->m_ifmtctx->streams[packet.stream_index];&#xA;                        out_stream = _this->m_ofmtctx->streams[packet.stream_index];&#xA;&#xA;                        if (startFrame)&#xA;                        {&#xA;                            pts = packet.pts;&#xA;                            dts = packet.dts;&#xA;                            startFrame = false;&#xA;                        }&#xA;                        packet.pts -= pts;&#xA;                        packet.dts -= dts;&#xA;&#xA;                        packet.pts = av_rescale_q_rnd(packet.pts, in_stream->time_base, out_stream->time_base, (AVRounding)((int)AV_ROUND_NEAR_INF | (int)AV_ROUND_PASS_MINMAX));&#xA;                        packet.dts = av_rescale_q_rnd(packet.dts, in_stream->time_base, out_stream->time_base, (AVRounding)((int)AV_ROUND_NEAR_INF | (int)AV_ROUND_PASS_MINMAX));&#xA;&#xA;                        packet.duration = av_rescale_q(packet.duration, in_stream->time_base, out_stream->time_base);&#xA;                        //end of my changes&#xA;                        &#xA;                        av_interleaved_write_frame(_this->m_ofmtctx, &amp;packet);&#xA;                        _this->m_tailWritten = false;&#xA;                    }&#xA;                }&#xA;            }&#xA;            else if (_this->m_ofmtctx)&#xA;            {&#xA;                if (_this->m_tailWritten == false)&#xA;                {&#xA;                    av_write_trailer(_this->m_ofmtctx);&#xA;                    avio_close(_this->m_ofmtctx->pb);&#xA;                }&#xA;                avformat_free_context(_this->m_ofmtctx);&#xA;                _this->m_tailWritten = true;&#xA;                _this->m_ofmtctx = NULL;&#xA;                startFrame = true;&#xA;            }&#xA;            i&#x2B;&#x2B;;&#xA;            keyFrame = false;&#xA;        }&#xA;        av_free_packet(&amp;packet);&#xA;        av_init_packet(&amp;packet);&#xA;    }&#xA;    if (_this->m_record)&#xA;    {&#xA;        av_write_trailer(_this->m_ofmtctx);&#xA;        avio_close(_this->m_ofmtctx->pb);&#xA;    }&#xA;    if (_this->m_ofmtctx)&#xA;    {&#xA;        avformat_free_context(_this->m_ofmtctx);&#xA;        _this->m_ofmtctx = NULL;&#xA;    }&#xA;    _this->m_record = false;&#xA;&#xA;    avformat_close_input(&amp;_this->m_ifmtctx);&#xA;    _this->m_ifmtctx = NULL;&#xA;}&#xA;

    &#xA;

    Other question&#xA;How can I check whether my project uses the deprecated api (answer of @berak) ?

    &#xA;

  • Anomalie #3616 (Nouveau) : procure dans le core

    8 décembre 2015, par Franck Dalot

    Bonjour
    Spip 3.1 [22635]

    Il y a 2 procures dans ce fichier qui ne semble pas être correcte
    https://core.spip.net/projects/spip/repository/entry/spip/ecrire/paquet.xml#L136


    Il s’agit de plugin qui sont natif à spip depuis spip 3.0, mais je ne suis pas sûr concernant les versions

    "Queue" est en 0.6.8 en plugin
    http://zone.spip.org/trac/spip-zone/browser/_plugins_/job_queue

    "Itérateur" est en version 1.0.6 en plugin
    http://zone.spip.org/trac/spip-zone/browser/_plugins_/iterateurs

    Les plugins sur la zone ne sont pas compatible 3.0 n’y 3.1 (logique) par contre, logiquement, si dans le core, il y bien eu report des commits qui ont été fait dans les plug, alors les numéros de version devrait être identique ?
    Faudrait vérifier s’il y a bien eu tous les reports et sans doute mettre les numéros de version à jour dans le core
    Franck