Recherche avancée

Médias (0)

Mot : - Tags -/xmp

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

Autres articles (53)

  • MediaSPIP en mode privé (Intranet)

    17 septembre 2013, par

    À partir de la version 0.3, un canal de MediaSPIP peut devenir privé, bloqué à toute personne non identifiée grâce au plugin "Intranet/extranet".
    Le plugin Intranet/extranet, lorsqu’il est activé, permet de bloquer l’accès au canal à tout visiteur non identifié, l’empêchant d’accéder au contenu en le redirigeant systématiquement vers le formulaire d’identification.
    Ce système peut être particulièrement utile pour certaines utilisations comme : Atelier de travail avec des enfants dont le contenu ne doit pas (...)

  • 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

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

Sur d’autres sites (4161)

  • Create new synced streaming from 2 inputs using FFMPEG library in C++ [libavformat]

    23 janvier 2021, par blacksmith

    I wrote this program that connects to two RTMP streamings that are running in my machine.

    


    Stream 1 has audio and video.

    


    Stream 2 has only video.

    


    When I print their timestamps i get different values for each stream, and every time i run the program, the difference between those 2 values changes. (I also attach the output)

    


    I would like to create a 3rd streaming that mixes audio from the first streaming and video from the second one while syncing their timestamps.

    


    I believe I should buffer the first stream and "wait" for the second stream to reach the same timestamp as the first one. Or maybe I'm wrong and I don't understand any of this. How should approach this problem ?

    


    #include &#xA;#include<iostream>&#xA;using namespace std;&#xA;&#xA;extern "C"&#xA;{&#xA;    #include "libavcodec\avcodec.h"&#xA;    #include "libavformat\avformat.h"&#xA;}&#xA;&#xA;int main() {&#xA;&#xA;    // STREAM 1&#xA;    AVFormatContext* context1 = avformat_alloc_context();&#xA;    AVPacket packet1;&#xA;    AVFrame* frame1;&#xA;    int width1 = -1;&#xA;    int height1 = -1;&#xA;    int video_stream_index1 = -1;&#xA;&#xA;&#xA;    // STREAM 2&#xA;    AVFormatContext* context2 = avformat_alloc_context();&#xA;    AVPacket packet2;&#xA;    AVFrame* frame2;&#xA;    int width2 = -1;&#xA;    int height2 = -1;&#xA;    int video_stream_index2 = -1;&#xA;&#xA;    avformat_network_init();&#xA;&#xA;    // Opening Stream 1&#xA;    if (avformat_open_input(&amp;context1, "rtmp://localhost/live/STREAM_NAME.flv", NULL, NULL) != 0)&#xA;    {&#xA;        avformat_close_input(&amp;context1);&#xA;        return 0;&#xA;    }&#xA;&#xA;&#xA;    // Opening Stream 2&#xA;    if (avformat_open_input(&amp;context2, "rtmp://localhost/live/STREAM_NAME2.flv", NULL, NULL) != 0)&#xA;    {&#xA;        avformat_close_input(&amp;context2);&#xA;        return 0;&#xA;    }&#xA;&#xA;    // Obtain info from Stream 1&#xA;    if (avformat_find_stream_info(context1, NULL) &lt; 0)&#xA;    {&#xA;        avformat_close_input(&amp;context1);&#xA;        return 0;&#xA;    }&#xA;&#xA;    // Obtain info from Stream 2&#xA;    if (avformat_find_stream_info(context2, NULL) &lt; 0)&#xA;    {&#xA;        avformat_close_input(&amp;context2);&#xA;        return 0;&#xA;    }&#xA;    cout &lt;&lt; "CONTEXT 1 NUMBER OF STREAMS DETECTED: " &lt;&lt; context1->nb_streams &lt;&lt; "\n";&#xA;    cout &lt;&lt; "CONTEXT 2 NUMBER OF STREAMS DETECTED: " &lt;&lt; context2->nb_streams &lt;&lt; "\n";&#xA;&#xA;    //Width and Height Stream 1&#xA;    for (int i = 0; i &lt; context1->nb_streams; i&#x2B;&#x2B;) {&#xA;        if (context1->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {&#xA;            video_stream_index1 = i;&#xA;            width1 = context1->streams[i]->codecpar->width;&#xA;            height1 = context1->streams[i]->codecpar->height;&#xA;        }&#xA;    }&#xA;    //Width and Height Stream 2&#xA;    for (int i = 0; i &lt; context2->nb_streams; i&#x2B;&#x2B;) {&#xA;        if (context2->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {&#xA;            video_stream_index2 = i;&#xA;            width2 = context2->streams[i]->codecpar->width;&#xA;            height2 = context2->streams[i]->codecpar->height;&#xA;        }&#xA;    }&#xA;&#xA;    cout &lt;&lt; "START TIME STREAM 1:" &lt;&lt; context1->start_time &lt;&lt; "\n";&#xA;    cout &lt;&lt; "START TIME STREAM 2:" &lt;&lt; context2->start_time  &lt;&lt; "\n";&#xA;&#xA;    while (true) {&#xA;        if (av_read_frame(context1, &amp;packet1) >= 0) {&#xA;            if (packet1.stream_index == video_stream_index1) {&#xA;                cout &lt;&lt; "TS STREAM 1:" &lt;&lt; packet1.dts &lt;&lt; "\n";&#xA;            }&#xA;        }   &#xA;        if (av_read_frame(context2, &amp;packet2) >= 0) {&#xA;            if (packet2.stream_index == video_stream_index2) {&#xA;                cout &lt;&lt; "TS STREAM 2:" &lt;code></iostream>

    &#xA;

    Output :

    &#xA;

    CONTEXT 1 NUMBER OF STREAMS DETECTED: 3&#xA;CONTEXT 2 NUMBER OF STREAMS DETECTED: 2&#xA;START TIME STREAM 1:10799753000&#xA;START TIME STREAM 2:158654000&#xA;TS STREAM 1:10799746&#xA;TS STREAM 2:158654&#xA;TS STREAM 2:158673&#xA;TS STREAM 2:158692&#xA;TS STREAM 1:10799788&#xA;TS STREAM 2:158712&#xA;TS STREAM 2:158731&#xA;TS STREAM 2:158750&#xA;TS STREAM 1:10799830&#xA;TS STREAM 2:158769&#xA;TS STREAM 2:158788&#xA;TS STREAM 2:158808&#xA;TS STREAM 1:10799872&#xA;TS STREAM 2:158827&#xA;TS STREAM 2:158846&#xA;TS STREAM 1:10799913&#xA;TS STREAM 2:158865&#xA;TS STREAM 2:158885&#xA;TS STREAM 2:158904&#xA;TS STREAM 1:10799955&#xA;TS STREAM 2:158923&#xA;TS STREAM 2:158942&#xA;TS STREAM 2:158962&#xA;TS STREAM 1:10799997&#xA;TS STREAM 2:158981&#xA;TS STREAM 2:159000&#xA;...&#xA;

    &#xA;

  • Revert "mpeg4videodec : raise an error if sprite_trajectory.table is NULL"

    23 janvier 2021, par Andreas Rheinhardt
    Revert "mpeg4videodec : raise an error if sprite_trajectory.table is NULL"
    

    This reverts commit 6ac0e7818399a57e4684202bac79f35b3561ad1e.

    The mpeg4video parser can reach code that presumes that a certain VLC
    has been initialized ; yet Libav did not ensure this and Libav bug #1012
    [1] is about an ensuing crash.

    Instead of fixing the root cause a simple check for whether said VLC
    has already been initialized was added ; said check is inherently racy.

    The proper fix is of course to ensure that the VLC is initialized and
    commit 7c76eaeca2791261d3f4f5c98c95f44abdbd879a already ensured this,
    so there was no need to merge 6ac0e7818399a57e4684202bac79f35b3561ad1e
    at all. This commit therefore reverts said commit.

    [1] : https://bugzilla.libav.org/show_bug.cgi?id=1012

    Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@gmail.com>

    • [DH] libavcodec/mpeg4videodec.c
  • avcodec/frame_thread_encoder : Avoid allocations of AVFrames

    7 février 2021, par Andreas Rheinhardt
    avcodec/frame_thread_encoder : Avoid allocations of AVFrames
    

    Up until now, when using frame threaded encoding, an AVFrame would be
    allocated for every frame to be encoded. These AVFrames would reach the
    worker threads via a FIFO of tasks, a structure which contained the
    AVFrame as well as an index into an array which gives the place where
    the worker thread shall put the returned packet ; in addition to that,
    said structure also contained several unused fields.

    This commit changes this : The AVFrames are now allocated during init in
    the array that is up until now only used to return the packets. The
    contents to be encoded are put into the AVFrame in the same array
    element that is also used to return the packets.

    Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@gmail.com>

    • [DH] libavcodec/frame_thread_encoder.c