Recherche avancée

Médias (91)

Autres articles (111)

  • Gestion générale des documents

    13 mai 2011, par

    MédiaSPIP ne modifie jamais le document original mis en ligne.
    Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
    Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (11742)

  • Class FFMPEG not found on Webfaction

    28 janvier 2016, par Luan Gabriel

    I’m trying to use FFMPEG on my application but its no working. The FFMPEG its install in my server (WebFaction) :

    FFmpeg version UNKNOWN, Copyright (c) 2000-2009 Fabrice Bellard, et al.
    configuration : —enable-gpl —enable-libamr-nb —enable-libamr-wb —enable-libfaac —enable-libfaad —enable-libmp3lame —enable-nonfree
    libavutil 49.14. 0 / 49.14. 0
    libavcodec 52.15. 0 / 52.15. 0
    libavformat 52.28. 0 / 52.28. 0
    libavdevice 52. 1. 0 / 52. 1. 0
    built on Jan 9 2015 12:30:52, gcc : 4.8.2 20140120 (Red Hat 4.8.2-16)

    But when I tried to do $mov = new ffmpeg_movie($movie); its showing me a error message : Class 'ffmpeg_movie' not found(...)

    Any ideas ?

  • how to change the frame rate and capturing image size from IP camera

    6 décembre 2015, par rockycai

    Now I have a IP camera and I want to capture image from it through RTSP.I use below code and it works well.But the camera’s frame rate is 25/s.So I got a lot of images per second.I don’t want it.And per image is 6.2MB.I also don’t want need to get high quality image.What can I do to slower the frame rate and smaller the size of image ?

    #ifndef INT64_C
    #define INT64_C(c) (c ## LL)
    #define UINT64_C(c) (c ## ULL)
    #endif

    #ifdef __cplusplus
    extern "C" {
    #endif
       /*Include ffmpeg header file*/
    #include <libavformat></libavformat>avformat.h>
    #include <libavcodec></libavcodec>avcodec.h>
    #include <libswscale></libswscale>swscale.h>
    #include
    #ifdef __cplusplus
    }
    #endif

    #include


    static void SaveFrame(AVFrame *pFrame, int width, int height, int iFrame);

    int main (int argc, const char * argv[])
    {
       AVFormatContext *pFormatCtx;
       int             i, videoStream;
       AVCodecContext  *pCodecCtx;
       AVCodec         *pCodec;
       AVFrame         *pFrame;
       AVFrame         *pFrameRGB;
       AVPacket        packet;
       int             frameFinished;
       int             numBytes;
       uint8_t         *buffer;

       // Register all formats and codecs
       av_register_all();
    //  const char *filename="C:\libraries\gfjyp.avi";
       // Open video file
       //AVDictionary *options = NULL;
       //av_dict_set(&amp;options,"rtsp_transport","tcp",0);
       if(av_open_input_file(&amp;pFormatCtx, argv[1], NULL, 0, NULL)!=0)
           return -1; // Couldn't open file

       // Retrieve stream information
       if(av_find_stream_info(pFormatCtx)&lt;0)
           return -1; // Couldn't find stream information

       // Dump information about file onto standard error
       dump_format(pFormatCtx, 0, argv[1], false);

       // Find the first video stream
       videoStream=-1;
       for(i=0; inb_streams; i++)
           if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO)
           {
               videoStream=i;
               break;
           }
           if(videoStream==-1)
               return -1; // Didn't find a video stream

           // Get a pointer to the codec context for the video stream
           pCodecCtx=pFormatCtx->streams[videoStream]->codec;

           // Find the decoder for the video stream
           pCodec=avcodec_find_decoder(pCodecCtx->codec_id);
           if(pCodec==NULL)
               return -1; // Codec not found

           // Open codec
           if(avcodec_open(pCodecCtx, pCodec)&lt;0)
               return -1; // Could not open codec

           // Hack to correct wrong frame rates that seem to be generated by some codecs

           if(pCodecCtx->time_base.num>1000 &amp;&amp; pCodecCtx->time_base.den==1)
               pCodecCtx->time_base.den=1000;

           //pCodecCtx->time_base.den=1;
           //pCodecCtx->time_base.num=1;
           // Allocate video frame
           pFrame=avcodec_alloc_frame();

           // Allocate an AVFrame structure
           pFrameRGB=avcodec_alloc_frame();
           if(pFrameRGB==NULL)
               return -1;

           // Determine required buffer size and allocate buffer
           numBytes=avpicture_get_size(PIX_FMT_RGB24, pCodecCtx->width,
               pCodecCtx->height);

           //buffer=malloc(numBytes);
           buffer=(uint8_t *)av_malloc(numBytes*sizeof(uint8_t));

           // Assign appropriate parts of buffer to image planes in pFrameRGB
           avpicture_fill((AVPicture *)pFrameRGB, buffer, PIX_FMT_RGB24,
               pCodecCtx->width, pCodecCtx->height);

           // Read frames and save first five frames to disk
           i=0;
           while(av_read_frame(pFormatCtx, &amp;packet)>=0)
           {
               // Is this a packet from the video stream?
               if(packet.stream_index==videoStream)
               {
                   // Decode video frame
                   avcodec_decode_video2(pCodecCtx, pFrame, &amp;frameFinished,
                       &amp;packet);

                   // Did we get a video frame?
                   if(frameFinished)
                   {

                       static struct SwsContext *img_convert_ctx;

    #if 0
                       // Older removed code
                       // Convert the image from its native format to RGB swscale
                       img_convert((AVPicture *)pFrameRGB, PIX_FMT_RGB24,
                           (AVPicture*)pFrame, pCodecCtx->pix_fmt, pCodecCtx->width,
                           pCodecCtx->height);

                       // function template, for reference
                       int sws_scale(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY,
                           int srcSliceH, uint8_t* dst[], int dstStride[]);
    #endif
                       // Convert the image into YUV format that SDL uses
                       if(img_convert_ctx == NULL) {
                           int w = pCodecCtx->width;
                           int h = pCodecCtx->height;

                           img_convert_ctx = sws_getContext(w, h,
                               pCodecCtx->pix_fmt,
                               w, h, PIX_FMT_RGB24, SWS_BICUBIC,
                               NULL, NULL, NULL);
                           if(img_convert_ctx == NULL) {
                               fprintf(stderr, "Cannot initialize the conversion context!\n");
                               exit(1);
                           }
                       }
                       int ret = sws_scale(img_convert_ctx, pFrame->data, pFrame->linesize, 0,
                           pCodecCtx->height, pFrameRGB->data, pFrameRGB->linesize);
    #if 0
                       // this use to be true, as of 1/2009, but apparently it is no longer true in 3/2009
                       if(ret) {
                           fprintf(stderr, "SWS_Scale failed [%d]!\n", ret);
                           exit(-1);
                       }
    #endif

                       // Save the frame to disk
                       if(i++&lt;=1000)
                           SaveFrame(pFrameRGB, pCodecCtx->width, pCodecCtx->height, i);
                   }
               }

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

           // Free the RGB image
           //free(buffer);
           av_free(buffer);
           av_free(pFrameRGB);

           // Free the YUV frame
           av_free(pFrame);

           // Close the codec
           avcodec_close(pCodecCtx);

           // Close the video file
           av_close_input_file(pFormatCtx);

           return 0;
    }

    static void SaveFrame(AVFrame *pFrame, int width, int height, int iFrame)
    {
       FILE *pFile;
       char szFilename[32];
       int  y;

       // Open file
       sprintf(szFilename, "frame%d.ppm", iFrame);
       pFile=fopen(szFilename, "wb");
       if(pFile==NULL)
           return;

       // Write header
       fprintf(pFile, "P6\n%d %d\n255\n", width, height);

       // Write pixel data
       for(y=0; ydata[0]+y*pFrame->linesize[0], 1, width*3, pFile);

       // Close file
       fclose(pFile);
    }
  • How to overlay swf files on a video

    17 décembre 2015, par Harsha Vardhan

    Hi recently I started working with ffmpeg, there I overlay-ed images as well as gif files on videos. Where coming to swf files ffmpeg is unable to recognize that format.

    I tried below command for overlaying :

    ffmpeg -i vid.mp4 -i swf.swf -filter_co
    mplex overlay=x=100:y=100:shortest=1  -q 15 -vcodec libx264 out.mp4
    ffmpeg version N-76822-g12a419d Copyright (c) 2000-2015 the FFmpeg developers
     built with gcc 5.2.0 (GCC)
     configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
    isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
    le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
    enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
    ibilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enab
    le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --en
    able-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --ena
    ble-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
    --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enabl
    e-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --
    enable-lzma --enable-decklink --enable-zlib
     libavutil      55.  9.100 / 55.  9.100
     libavcodec     57. 16.100 / 57. 16.100
     libavformat    57. 19.100 / 57. 19.100
     libavdevice    57.  0.100 / 57.  0.100
     libavfilter     6. 15.100 /  6. 15.100
     libswscale      4.  0.100 /  4.  0.100
     libswresample   2.  0.101 /  2.  0.101
     libpostproc    54.  0.100 / 54.  0.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'vid.mp4':
     Metadata:
       major_brand     : mp42
       minor_version   : 1
       compatible_brands: mp42avc1
       creation_time   : 2009-03-02 14:42:39
     Duration: 00:00:10.56, start: 0.000000, bitrate: 663 kb/s
       Stream #0:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, flt
    p, 125 kb/s (default)
       Metadata:
         creation_time   : 2009-03-02 14:42:39
         handler_name    : Apple Sound Media Handler
       Stream #0:1(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yu
    v420p(tv, smpte170m/smpte170m/bt709), 480x360, 196 kb/s, 24 fps, 24 tbr, 600 tbn
    , 1200 tbc (default)
       Metadata:
         creation_time   : 2009-03-02 14:42:40
         handler_name    : Apple Video Media Handler
       Stream #0:2(eng): Data: none (rtp  / 0x20707472), 202 kb/s
       Metadata:
         creation_time   : 2009-03-02 14:42:40
         handler_name    : hint media handler
       Stream #0:3(eng): Data: none (rtp  / 0x20707472), 129 kb/s
       Metadata:
         creation_time   : 2009-03-02 14:42:40
         handler_name    : hint media handler
    [swf @ 00000098cdb9e000] Could not find codec parameters for stream 0 (Audio: pc
    m_u8, 5512 Hz, mono, 44 kb/s): unspecified sample format
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    Input #1, swf, from 'swf.swf':
     Duration: 00:00:04.90, bitrate: 196 kb/s
       Stream #1:0: Audio: pcm_u8, 5512 Hz, mono, 44 kb/s
       Stream #1:1: Audio: mp3, 11025 Hz, mono, s16p, 16 kb/s
       Stream #1:2: Audio: mp3, 11025 Hz, mono, s16p, 16 kb/s
       Stream #1:3: Audio: mp3, 11025 Hz, mono, s16p, 16 kb/s
       Stream #1:4: Audio: mp3, 11025 Hz, mono, s16p, 16 kb/s
       Stream #1:5: Audio: mp3, 11025 Hz, mono, s16p, 16 kb/s
       Stream #1:6: Audio: mp3, 11025 Hz, mono, s16p, 16 kb/s
       Stream #1:7: Audio: mp3, 11025 Hz, mono, s16p, 16 kb/s
    Cannot find a matching stream for unlabeled input pad 1 on filter Parsed_overlay
    _0

    Any one please suggest me, how to resolve this issue or even getting frames from swf format files by using ffmpeg or any other similar tools.