Recherche avancée

Médias (0)

Mot : - Tags -/masques

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

Autres articles (35)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Configuration spécifique pour PHP5

    4 février 2011, par

    PHP5 est obligatoire, vous pouvez l’installer en suivant ce tutoriel spécifique.
    Il est recommandé dans un premier temps de désactiver le safe_mode, cependant, s’il est correctement configuré et que les binaires nécessaires sont accessibles, MediaSPIP devrait fonctionner correctement avec le safe_mode activé.
    Modules spécifiques
    Il est nécessaire d’installer certains modules PHP spécifiques, via le gestionnaire de paquet de votre distribution ou manuellement : php5-mysql pour la connectivité avec la (...)

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

Sur d’autres sites (7207)

  • "wrong sample count" When reading MP4 files using OpenCV

    26 octobre 2022, par Object Unknown

    I want to marge some mp4 videos using OpenCV library, but when I try to read those videos using cv::VideoCapture, it outputs like that :

    


    [mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[h264 @ 000001EB9AAE9D80] co located POCs unavailable
[h264 @ 000001EB9AAE7D80] co located POCs unavailable
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[h264 @ 000001EB9A128600] co located POCs unavailable
[h264 @ 000001EB9A129840] co located POCs unavailable
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB9AA28E40] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[h264 @ 000001EB9A169B00] co located POCs unavailable
[h264 @ 000001EB9A16B680] co located POCs unavailable
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[h264 @ 000001EB960CD680] co located POCs unavailable
[h264 @ 000001EB960CC8C0] co located POCs unavailable
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[h264 @ 000001EB9A81DDC0] co located POCs unavailable
[h264 @ 000001EB9A81B000] co located POCs unavailable
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[h264 @ 000001EB960CB200] co located POCs unavailable
[h264 @ 000001EB960CBFC0] co located POCs unavailable
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[h264 @ 000001EB99F206C0] co located POCs unavailable
[h264 @ 000001EB99F20B40] co located POCs unavailable
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[h264 @ 000001EB9A81D480] co located POCs unavailable
[h264 @ 000001EB9A81B000] co located POCs unavailable
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[h264 @ 000001EB9AD02C00] co located POCs unavailable
[h264 @ 000001EB9AD02300] co located POCs unavailable
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[h264 @ 000001EB9A81B480] co located POCs unavailable
[h264 @ 000001EB9A81B940] co located POCs unavailable
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[h264 @ 000001EB9AD02780] co located POCs unavailable
[h264 @ 000001EB9AD01E40] co located POCs unavailable
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001EB96084B80] wrong sample count


    


    and just exited with exit value 0. I want to know why it is reporting this and how to solve it please.

    


    Heres my demo code :

    


    #include <string>&#xA;#include <iostream>&#xA;#include <opencv2></opencv2>core/core.hpp>&#xA;#include <opencv2></opencv2>video/video.hpp>&#xA;#include <opencv2></opencv2>imgproc/imgproc.hpp>&#xA;#include <opencv2></opencv2>videoio/videoio.hpp>&#xA;#include <opencv2></opencv2>highgui/highgui.hpp>&#xA;&#xA;int main()&#xA;{&#xA;        cv::Mat frame;&#xA;        cv::VideoCapture vcap;&#xA;        for (int i = 1; i &lt;= 60; i&#x2B;&#x2B;)&#xA;        {&#xA;            if (!vcap.open("G:\\Users\\15819\\Desktop\\Demo\\demo (" &#x2B; std::to_string(i) &#x2B; ").mp4"))&#xA;            {&#xA;                std::cout &lt;&lt; "Failed to Open File: demo (" &lt;&lt; i &lt;&lt; ").mp4" &lt;&lt; std::endl;&#xA;                continue;&#xA;            }&#xA;            while (!vcap.read(frame))&#xA;                cv::imshow("video", frame);&#xA;        }&#xA;        return 0;&#xA;}&#xA;</iostream></string>

    &#xA;

    I installed the OpenCV and FFmpeg library using vcpkg, here's the library information (displayed by vcpkg list command) :

    &#xA;

    ffmpeg:x64-windows                                4.4.1#21            a library to decode, encode, transcode, mux, dem...&#xA;ffmpeg:x86-windows                                4.4.1#21            a library to decode, encode, transcode, mux, dem...&#xA;ffmpeg[avcodec]:x64-windows                                           Build the avcodec library&#xA;ffmpeg[avcodec]:x86-windows                                           Build the avcodec library&#xA;ffmpeg[avdevice]:x64-windows                                          Build the avdevice library&#xA;ffmpeg[avdevice]:x86-windows                                          Build the avdevice library&#xA;ffmpeg[avfilter]:x64-windows                                          Build the avfilter library&#xA;ffmpeg[avfilter]:x86-windows                                          Build the avfilter library&#xA;ffmpeg[avformat]:x64-windows                                          Build the avformat library&#xA;ffmpeg[avformat]:x86-windows                                          Build the avformat library&#xA;ffmpeg[openh264]:x64-windows                                          H.264 de/encoding via openh264&#xA;ffmpeg[openh264]:x86-windows                                          H.264 de/encoding via openh264&#xA;ffmpeg[swresample]:x64-windows                                        Build the swresample library&#xA;ffmpeg[swresample]:x86-windows                                        Build the swresample library&#xA;ffmpeg[swscale]:x64-windows                                           Build the swscale library&#xA;ffmpeg[swscale]:x86-windows                                           Build the swscale library&#xA;opencv4:x64-windows                               4.6.0#6             computer vision library&#xA;opencv4:x86-windows                               4.6.0#6             computer vision library&#xA;opencv4[default-features]:x64-windows                                 Platform-dependent default features&#xA;opencv4[default-features]:x86-windows                                 Platform-dependent default features&#xA;opencv4[dnn]:x64-windows                                              Enable dnn module&#xA;opencv4[dnn]:x86-windows                                              Enable dnn module&#xA;opencv4[ffmpeg]:x64-windows                                           ffmpeg support for opencv&#xA;opencv4[ffmpeg]:x86-windows                                           ffmpeg support for opencv&#xA;opencv4[jpeg]:x64-windows                                             JPEG support for opencv&#xA;opencv4[jpeg]:x86-windows                                             JPEG support for opencv&#xA;opencv4[png]:x64-windows                                              PNG support for opencv&#xA;opencv4[png]:x86-windows                                              PNG support for opencv&#xA;opencv4[qt]:x64-windows                                               Qt GUI support for opencv&#xA;opencv4[qt]:x86-windows                                               Qt GUI support for opencv&#xA;opencv4[quirc]:x64-windows                                            Enable QR code module&#xA;opencv4[quirc]:x86-windows                                            Enable QR code module&#xA;opencv4[tiff]:x64-windows                                             TIFF support for opencv&#xA;opencv4[tiff]:x86-windows                                             TIFF support for opencv&#xA;opencv4[webp]:x64-windows                                             WebP support for opencv&#xA;opencv4[webp]:x86-windows                                             WebP support for opencv&#xA;opencv:x64-windows                                4.6.0               Computer vision library&#xA;opencv:x86-windows                                4.6.0               Computer vision library&#xA;opencv[default-features]:x64-windows                                  Platform-dependent default features&#xA;opencv[default-features]:x86-windows                                  Platform-dependent default features&#xA;opencv[dnn]:x64-windows                                               Enable dnn module&#xA;opencv[dnn]:x86-windows                                               Enable dnn module&#xA;opencv[jpeg]:x64-windows                                              JPEG support for opencv&#xA;opencv[jpeg]:x86-windows                                              JPEG support for opencv&#xA;opencv[png]:x64-windows                                               PNG support for opencv&#xA;opencv[png]:x86-windows                                               PNG support for opencv&#xA;opencv[quirc]:x64-windows                                             Enable QR code module&#xA;opencv[quirc]:x86-windows                                             Enable QR code module&#xA;opencv[tiff]:x64-windows                                              TIFF support for opencv&#xA;opencv[tiff]:x86-windows                                              TIFF support for opencv&#xA;opencv[webp]:x64-windows                                              WebP support for opencv&#xA;opencv[webp]:x86-windows                                              WebP support for opencv&#xA;

    &#xA;

    Other Environments :

    &#xA;

    OS: Windows 11 x64 Professional Workstation&#xA;IDE: Visual Studio 2022&#xA;Project C&#x2B;&#x2B; Standard: C&#x2B;&#x2B;14&#xA;Project Platform: x64 Release&#xA;

    &#xA;

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

  • pylwdrone and ffmpeg-python : pipe:0 : Invalid data found when processing input [closed]

    8 mai 2024, par Saail Chavan

    I am using a lewei camera on my drone and i have managed to get the stream using https://github.com/meekworth/pylwdrone, i want to do basic image processing like face or object detection or qr code scan which i am unable to do

    &#xA;

    when i use this command in terminal :

    &#xA;

    $ pylwdrone stream start --out-file - | ffplay -i -fflags nobuffer -flags low_delay -probesize 32 -sync ext -&#xA;

    &#xA;

    i get a clear feed with no errors

    &#xA;

    enter image description here

    &#xA;

    When i am using the script in python i am getting errors and the feed is bit lagged and skips frames

    &#xA;

    pipe:0: Invalid data found when processing input&#xA;

    &#xA;

    ERROR :

    &#xA;

    enter image description here

    &#xA;

    import cv2&#xA;import numpy as np&#xA;import pylwdrone&#xA;import ffmpeg&#xA;import sys&#xA;&#xA;drone = pylwdrone.LWDrone()&#xA;drone.set_time()&#xA;&#xA;window_name = &#x27;Drone Video Stream&#x27;&#xA;cv2.namedWindow(window_name, cv2.WINDOW_NORMAL)&#xA;&#xA;for packet in drone.start_video_stream():&#xA;    try:&#xA;&#xA;        out, _ = (&#xA;            ffmpeg.input(&#x27;pipe:0&#x27;)&#xA;            .output(&#x27;pipe:&#x27;, format=&#x27;rawvideo&#x27;, pix_fmt=&#x27;bgr24&#x27;)&#xA;            .run(input=packet.frame_bytes, capture_stdout=True, capture_stderr=True)&#xA;        )&#xA;        frame = np.frombuffer(out, np.uint8)&#xA;        height, width = 1152, 2048&#xA;        frame = frame.reshape((height, width, 3))&#xA;&#xA;&#xA;        # Display video stream&#xA;        cv2.imshow(window_name, frame)&#xA;&#xA;        # Check for &#x27;q&#x27; key to exit&#xA;        if cv2.waitKey(1) &amp; 0xFF == ord(&#x27;q&#x27;):&#xA;            break&#xA;&#xA;    except ffmpeg.Error as e:&#xA;        print(&#x27;An error occurred:&#x27;, e.stderr.decode(), file=sys.stderr)&#xA;&#xA;cv2.destroyAllWindows()&#xA;drone.stop_video_stream()&#xA;

    &#xA;