Recherche avancée

Médias (2)

Mot : - Tags -/media

Autres articles (59)

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

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

Sur d’autres sites (4579)

  • Error decoding timecode using ffprobe

    16 novembre 2016, par Pablo Montilla

    I’m using ffprobe to get timecode from an mxf which has DF timecode but with a non DF frame rate. I’m getting the error Drop frame is only allowed with 30000/1001 or 60000/1001 FPS.

    I’m running ffprobe -i "IMX 10Bit.mxf" and getting the following :

     ffprobe version 3.2 Copyright (c) 2007-2016 the FFmpeg developers
       built with gcc 5.4.0 (GCC)
       configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
       libavutil      55. 34.100 / 55. 34.100
       libavcodec     57. 64.100 / 57. 64.100
       libavformat    57. 56.100 / 57. 56.100
       libavdevice    57.  1.100 / 57.  1.100
       libavfilter     6. 65.100 /  6. 65.100
       libswscale      4.  2.100 /  4.  2.100
       libswresample   2.  3.100 /  2.  3.100
       libpostproc    54.  1.100 / 54.  1.100
     [mxf @ 00000000025a3660] Drop frame is only allowed with 30000/1001 or 60000/1001 FPS
     Input #0, mxf, from 'IMX 10Bit.mxf':
       Metadata:
         uid             : 2b3801ea-ec5e-4dc1-ab3a-dba9a2b30ce4
         generation_uid  : 2b3801ea-ec5e-4dc2-ab3a-dba9a2b30ce4
         product_uid     : 00000000-0000-0000-0000-000000000000
         modification_date: 2009-11-04T10:39:42.000000Z
         material_package_umid: 0x060A2B340101010501010D43130000005C91020063D700800210F3FFFE154618
       Duration: 00:00:19.52, start: 0.000000, bitrate: 62580 kb/s
         Stream #0:0: Video: mpeg2video (4:2:2), yuv422p(tv, top first), 720x608 [SAR 152:135 DAR 4:3], 50000 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc
         Metadata:
           file_package_umid: 0x060A2B340101010501010D43130000005D91020063D700800210F3FFFE154618
         Stream #0:1: Audio: pcm_s24le, 48000 Hz, 4 channels, s32 (24 bit), 4608 kb/s
         Metadata:
           file_package_umid: 0x060A2B340101010501010D43130000005D91020063D700800210F3FFFE154618
  • 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 encode mp4 for wowza streaming ?

    29 août 2014, par lng0415

    i want to encode to mp4(h.264 codec) from avi,mpg..... for wowza streaming.

    encode mp4 using ffmpeg, jave.

    encode is success, but wowza streaming is not work on android and iphone OS.
    (it’s play successfully on my PC)

    please help me.

    thank you.

    ps. i’m sorry. i’m poor at english.

    [using jave]

    File source = new File("D://temp/20140704_163504.mp4");
    File target = new File("D://temp/jave.mp4");

    AudioAttributes audio = new AudioAttributes();
    audio.setCodec("libmp3lame");
    audio.setBitRate(new Integer(64000));
    audio.setChannels(new Integer(1));
    audio.setSamplingRate(new Integer(22050));

    VideoAttributes video = new VideoAttributes();
    video.setCodec("h263");
    video.setBitRate(new Integer(320000));
    video.setFrameRate(new Integer(15));
    video.setSize(new VideoSize(400, 300));

    EncodingAttributes attrs = new EncodingAttributes();
    attrs.setFormat("mp4");
    attrs.setAudioAttributes(audio);
    attrs.setVideoAttributes(video);
    Encoder encoder = new Encoder();
    encoder.encode(source, target, attrs);