Recherche avancée

Médias (0)

Mot : - Tags -/organisation

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

Autres articles (53)

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

  • MediaSPIP Player : problèmes potentiels

    22 février 2011, par

    Le lecteur ne fonctionne pas sur Internet Explorer
    Sur Internet Explorer (8 et 7 au moins), le plugin utilise le lecteur Flash flowplayer pour lire vidéos et son. Si le lecteur ne semble pas fonctionner, cela peut venir de la configuration du mod_deflate d’Apache.
    Si dans la configuration de ce module Apache vous avez une ligne qui ressemble à la suivante, essayez de la supprimer ou de la commenter pour voir si le lecteur fonctionne correctement : /** * GeSHi (C) 2004 - 2007 Nigel McNie, (...)

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

  • How to encode a video from several images generated in a C++ program without writing the separate frame images to disk ?

    5 mai 2021, par ksb496

    I am writing a C++ code where a sequence of N different frames is generated after performing some operations implemented therein. After each frame is completed, I write it on the disk as IMG_%d.png, and finally I encode them to a video through ffmpeg using the x264 codec.

    



    The summarized pseudocode of the main part of the program is the following one :

    



    std::vector<int> B(width*height*3);&#xA;for (i=0; i/ void generateframe(std::vector<int> &amp;, int)&#xA;  generateframe(B, i); // Returns different images for different i values.&#xA;  sprintf(s, "IMG_%d.png", i&#x2B;1);&#xA;  WriteToDisk(B, s); // void WriteToDisk(std::vector<int>, char[])&#xA;}&#xA;</int></int></int>

    &#xA;&#xA;

    The problem of this implementation is that the number of desired frames, N, is usually high (N 100000) as well as the resolution of the pictures (1920x1080), resulting into an overload of the disk, producing write cycles of dozens of GB after each execution.

    &#xA;&#xA;

    In order to avoid this, I have been trying to find documentation about parsing directly each image stored in the vector B to an encoder such as x264 (without having to write the intermediate image files to the disk). Albeit some interesting topics were found, none of them solved specifically what I exactly want to, as many of them concern the execution of the encoder with existing images files on the disk, whilst others provide solutions for other programming languages such as Python (here you can find a fully satisfactory solution for that platform).

    &#xA;&#xA;

    The pseudocode of what I would like to obtain is something similar to this :

    &#xA;&#xA;

    std::vector<int> B(width*height*3);&#xA;video_file=open_video("Generated_Video.mp4", ...[encoder options]...);&#xA;for (i=0; icode></int>

    &#xA;&#xA;

    According to what I have read on related topics, the x264 C++ API might be able to do this, but, as stated above, I did not find a satisfactory answer for my specific question. I tried learning and using directly the ffmpeg source code, but both its low ease of use and compilation issues forced me to discard this possibility as a mere non-professional programmer I am (I take it as just as a hobby and unluckily I cannot waste that many time learning something so demanding).

    &#xA;&#xA;

    Another possible solution that came to my mind is to find a way to call the ffmpeg binary file in the C++ code, and somehow manage to transfer the image data of each iteration (stored in B) to the encoder, letting the addition of each frame (that is, not "closing" the video file to write) until the last frame, so that more frames can be added until reaching the N-th one, where the video file will be "closed". In other words, call ffmpeg.exe through the C++ program to write the first frame to a video, but make the encoder "wait" for more frames. Then call again ffmpeg to add the second frame and make the encoder "wait" again for more frames, and so on until reaching the last frame, where the video will be finished. However, I do not know how to proceed or if it is actually possible.

    &#xA;&#xA;

    Edit 1 :

    &#xA;&#xA;

    As suggested in the replies, I have been documenting about named pipes and tried to use them in my code. First of all, it should be remarked that I am working with Cygwin, so my named pipes are created as they would be created under Linux. The modified pseudocode I used (including the corresponding system libraries) is the following one :

    &#xA;&#xA;

    FILE *fd;&#xA;mkfifo("myfifo", 0666);&#xA;&#xA;for (i=0; i/ void WriteToPipe(std::vector<int>, FILE *&amp;fd)&#xA;  fflush(fd);&#xA;  fd=fclose("myfifo");&#xA;}&#xA;unlink("myfifo");&#xA;</int>

    &#xA;&#xA;

    WriteToPipe is a slight modification of the previous WriteToFile function, where I made sure that the write buffer to send the image data is small enough to fit the pipe buffering limitations.

    &#xA;&#xA;

    Then I compile and write the following command in the Cygwin terminal :

    &#xA;&#xA;

    ./myprogram | ffmpeg -i pipe:myfifo -c:v libx264 -preset slow -crf 20 Video.mp4&#xA;

    &#xA;&#xA;

    However, it remains stuck at the loop when i=0 at the "fopen" line (that is, the first fopen call). If I had not called ffmpeg it would be natural as the server (my program) would be waiting for a client program to connect to the "other side" of the pipe, but it is not the case. It looks like they cannot be connected through the pipe somehow, but I have not been able to find further documentation in order to overcome this issue. Any suggestion ?

    &#xA;

  • The ultimate solution to knowing how your business is performing overall

    8 janvier 2018, par InnoCraft

    Would you like to know how your business is performing overall at a glance ? Guess what, you can now do this easily with Roll-Up Reporting.

    What is Roll-Up Reporting about ?

    Roll-Up Reporting is a premium feature which you can acquire through the Matomo (Piwik) Marketplace. Developed by InnoCraft, the professional company behind Matomo, this plugin will :

    1. Save you heaps of time and gives you completely new insights
    2. Make this process easy as pie
    3. Reflect the structure of your business or organization

    1 – Roll-Up Reporting does the maths for you

    Yes, you read it right. Compared to having to sum reports of multiple websites manually, you can get aggregated results for your business or departments instantly with a single click directly in Matomo (Piwik). Not only does this save you heaps of time compared to doing this complicated work in a spreadsheet, you also avoid human errors. With this feature, you get a clear overview over all your websites, apps, and shops performances.

    For example, if you want to know which referrers bring you the most value across all websites, then you will get the answer in a report. Same results for e-commerce reports, actions, and other metrics.

    2 – Easy as pie, no tracking code involved

    The best part of this feature is that you do not need to push data through additional tracking code. The setup is simple and made through the UI of the plugin.

    3 – Roll-Up Reporting meets even the hardest requirements

    You can also create “nested roll-ups”. This feature allows you to create a roll-up consisting of several other roll-ups. With a nested roll-up, you can create a roll-up for each department in your company (and assign all the websites of a department to that roll-up), then group several departments easily into a new roll-up simply by assigning several department roll-ups to this new roll-up.

    For example, a company with multiple brands can assign multiple websites to each brand, and then get aggregated results for each brand and for the business overall. As a roll-up is basically the same as a website, you can give users access to a roll-up without having to give them access to each site, and the other way around.

    How does it work ?

    As with all premium features, this plugin is straightforward to use. Once activated in your Matomo (Piwik) administrator panel, you will notice that when you add a website, you have the choice between two possibilities :

    When you select the “Roll-Up” option, a new window will appear asking you which websites and mobile apps you would like to aggregate into a roll-up :

    The created roll-up will then be shown just like any other website that you have in Matomo (Piwik). You can create as many roll-up entities as you want.

    Features, such as custom alerts, segments, and e-mail reports work for a roll-up just like for any website.

    Real-Time reports

    One of the most interesting features of Roll-Up Reporting is, that you can view all the Real-Time reports, such as the “Visitors in Real-Time” widget, the “Real-Time Map”, and the “Visitor Log” across several websites making it much easier to keep an eye on your business :

    How to get the Roll-up reporting plugin ?

    Developed by InnoCraft, the makers of Matomo (Piwik), Roll-Up Reporting is a premium feature which you can purchase on the Matomo Marketplace. You can also try it for free on the Matomo Cloud (formerly Piwik Cloud) for 30 days.

    The post The ultimate solution to knowing how your business is performing overall appeared first on Analytics Platform - Matomo.

  • value of got_picture_ptr is always 0. when use avcodec_decode_video2()

    4 septembre 2014, par user3867261

    I’m using visual studio 2013 professional.

    below code is simple decode tutorial using ffmpeg.

    ///> Include FFMpeg
    extern "C" {
    #include <libavformat></libavformat>avformat.h>
    }

    ///> Library Link On Windows System
    #pragma comment( lib, "avformat.lib" )  
    #pragma comment( lib, "avutil.lib" )
    #pragma comment( lib, "avcodec.lib" )

    static void write_ascii_frame(const char *szFileName, const AVFrame *pVframe);

    int main(void)
    {
       const char *szFilePath = "C:\\singlo\\example.avi";

       ///> Initialize libavformat and register all the muxers, demuxers and protocols.
       av_register_all();

       ///> Do global initialization of network components.
       avformat_network_init();

       int ret;
       AVFormatContext *pFmtCtx = NULL;

       ///> Open an input stream and read the header.
       ret = avformat_open_input( &amp;pFmtCtx, szFilePath, NULL, NULL );
       if( ret != 0 ) {
           av_log( NULL, AV_LOG_ERROR, "File [%s] Open Fail (ret: %d)\n", ret );
           exit( -1 );
       }
       av_log( NULL, AV_LOG_INFO, "File [%s] Open Success\n", szFilePath );
       av_log( NULL, AV_LOG_INFO, "Format: %s\n", pFmtCtx->iformat->name );

       ///> Read packets of a media file to get stream information.
       ret = avformat_find_stream_info( pFmtCtx, NULL );
       if( ret &lt; 0 ) {
           av_log( NULL, AV_LOG_ERROR, "Fail to get Stream Information\n" );
           exit( -1 );
       }
       av_log( NULL, AV_LOG_INFO, "Get Stream Information Success\n" );

       ///> Find Video Stream
       int nVSI = -1;
       int nASI = -1;
       int i;
       for( i = 0 ; i &lt; pFmtCtx->nb_streams ; i++ ) {
           if( nVSI &lt; 0 &amp;&amp; pFmtCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO ) {
               nVSI = i;
           }
           else if( nASI &lt; 0 &amp;&amp; pFmtCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO ) {
               nASI = i;
           }
       }

       if( nVSI &lt; 0 &amp;&amp; nASI &lt; 0 ) {
           av_log( NULL, AV_LOG_ERROR, "No Video &amp; Audio Streams were Found\n");
           exit( -1 );
       }

       ///> Find Video Decoder
       AVCodec *pVideoCodec = avcodec_find_decoder( pFmtCtx->streams[nVSI]->codec->codec_id );
       if( pVideoCodec == NULL ) {
           av_log( NULL, AV_LOG_ERROR, "No Video Decoder was Found\n" );
           exit( -1 );
       }

       ///> Initialize Codec Context as Decoder
       if( avcodec_open2( pFmtCtx->streams[nVSI]->codec, pVideoCodec, NULL ) &lt; 0 ) {
           av_log( NULL, AV_LOG_ERROR, "Fail to Initialize Decoder\n" );
           exit( -1 );
       }

       ///> Find Audio Decoder
       AVCodec *pAudioCodec = avcodec_find_decoder( pFmtCtx->streams[nASI]->codec->codec_id );
       if( pAudioCodec == NULL ) {
           av_log( NULL, AV_LOG_ERROR, "No Audio Decoder was Found\n" );
           exit( -1 );
       }

       ///> Initialize Codec Context as Decoder
       if( avcodec_open2( pFmtCtx->streams[nASI]->codec, pAudioCodec, NULL ) &lt; 0 ) {
           av_log( NULL, AV_LOG_ERROR, "Fail to Initialize Decoder\n" );
           exit( -1 );
       }

       AVCodecContext *pVCtx = pFmtCtx->streams[nVSI]->codec;
       AVCodecContext *pACtx = pFmtCtx->streams[nASI]->codec;

       AVPacket pkt;
       AVFrame* pVFrame, *pAFrame;
       int bGotPicture = 0;    // flag for video decoding
       int bGotSound = 0;      // flag for audio decoding

       int bPrint = 0; // ë¹ëì¤ ì²« ì¥ë©´ë§ íì¼ë¡ ë¨ê¸°ê¸° ìí ìì flag ìëë¤

       pVFrame = avcodec_alloc_frame();
       pAFrame = avcodec_alloc_frame();

       while( av_read_frame( pFmtCtx, &amp;pkt ) >= 0 ) {
           ///> Decoding
           if( pkt.stream_index == nVSI ) {
               if( avcodec_decode_video2( pVCtx, pVFrame, &amp;bGotPicture, &amp;pkt ) >= 0 ) {
          ///////////////////////problem here/////////////////////////////////////////////
                   if( bGotPicture ) {
                       ///> Ready to Render Image
                       av_log( NULL, AV_LOG_INFO, "Got Picture\n" );
                       if( !bPrint ) {
                           write_ascii_frame( "output.txt", pVFrame );
                           bPrint = 1;
                       }
                   }
               }
               // else ( &lt; 0 ) : Decoding Error
           }
           else if( pkt.stream_index == nASI ) {
               if( avcodec_decode_audio4( pACtx, pAFrame, &amp;bGotSound, &amp;pkt ) >= 0 ) {
                   if( bGotSound ) {
                       ///> Ready to Render Sound
                       av_log( NULL, AV_LOG_INFO, "Got Sound\n" );
                   }
               }
               // else ( &lt; 0 ) : Decoding Error
           }

           ///> Free the packet that was allocated by av_read_frame
           av_free_packet( &amp;pkt );
       }

       av_free( pVFrame );
       av_free( pAFrame );

       ///> Close an opened input AVFormatContext.
       avformat_close_input( &amp;pFmtCtx );

       ///> Undo the initialization done by avformat_network_init.
       avformat_network_deinit();

       return 0;
    }

    static void write_ascii_frame(const char *szFileName, const AVFrame *frame)
    {
       int x, y;
       uint8_t *p0, *p;
       const char arrAsciis[] = " .-+#";

       FILE* fp = fopen( szFileName, "w" );
       if( fp ) {
           /* Trivial ASCII grayscale display. */
           p0 = frame->data[0];        
           for (y = 0; y &lt; frame->height; y++) {
               p = p0;
               for (x = 0; x &lt; frame->width; x++)
                   putc( arrAsciis[*(p++) / 52], fp );
               putc( '\n', fp );
               p0 += frame->linesize[0];
           }
           fflush(fp);
           fclose(fp);
       }
    }

    there is a problem in below part

    if( avcodec_decode_video2( pVCtx, pVFrame, &amp;bGotPicture, &amp;pkt ) >= 0 ) {
          ///////////////////////problem here/////////////////////////////////////////////
          if( bGotPicture ) {
                ///> Ready to Render Image
               av_log( NULL, AV_LOG_INFO, "Got Picture\n" );
               if( !bPrint ) {
                    write_ascii_frame( "output.txt", pVFrame );
                    bPrint = 1;
                }
           }
    }

    the value of bGotPicture is always 0.. So i can’t decode video
    plz help me.
    where do problem occurs from ? in video ? in my code ?