Recherche avancée

Médias (0)

Mot : - Tags -/tags

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

Autres articles (108)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

Sur d’autres sites (7949)

  • Not able to encode image with ffmpeg

    29 juin 2012, par user1310596

    I am trying to encode one image with the help of ffmpeg library.. Actually i want to encode live video but for now i am starting with encoding an image..
    Here is my code for that..

       av_register_all();
       avcodec_init();
       avcodec_register_all();
       avformat_alloc_context();

       AVCodec *codec;
       AVCodecContext *ctx= NULL;
       int out_size, size, outbuf_size;
       AVFrame *picture;
       uint8_t *outbuf;
       unsigned char *flvdata = malloc(sizeof(unsigned char) * 30);


       outbuf_size = 100000;
       outbuf = malloc(outbuf_size);


       printf("Video encoding\n");

       codec = avcodec_find_encoder(CODEC_ID_FLV1);
       if (!codec) {
               fprintf(stderr, "codec not found\n");
               exit(1);
       }

       ctx= avcodec_alloc_context();
       picture= avcodec_alloc_frame();


       ctx->width = 320;
       ctx->height = 240;
       ctx -> sample_rate = 11025;
       ctx -> time_base.den = 1000;
       ctx -> time_base.num = 23976;
       ctx -> codec_id = CODEC_ID_FLV1;
       ctx -> codec_type = CODEC_TYPE_VIDEO;
       ctx->pix_fmt = PIX_FMT_YUV420P;

       if (avcodec_open(ctx, codec) < 0) {
               fprintf(stderr, "could not open codec\n");
               exit(1);
       }

       outbuf_size = 100000;
       outbuf = malloc(outbuf_size);
       size = ctx->width * ctx->height;

       AVFrame* outpic = avcodec_alloc_frame();
       int nbytes = avpicture_get_size(PIX_FMT_YUV420P, ctx->width, ctx->height);

       uint8_t* outbuffer = (uint8_t*)av_malloc(nbytes);

       fflush(stdout);

       int numBytes = avpicture_get_size(PIX_FMT_YUV420P, ctx->width, ctx->height);

       UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"0.jpg"]];
       CGImageRef newCgImage = [image CGImage];

       CGDataProviderRef dataProvider = CGImageGetDataProvider(newCgImage);
       CFDataRef bitmapData = CGDataProviderCopyData(dataProvider);
       long dataLength = CFDataGetLength(bitmapData);

       uint8_t *buffer = (uint8_t *)av_malloc(dataLength);
       buffer = (uint8_t *)CFDataGetBytePtr(bitmapData);

       for(int i = 0; i < dataLength; i++)
       {
               if((i + 1) % 16 == 1 && i != 1)
                       printf("\n");
               printf("%X\t",buffer[i]); // getting something different than the     actual hex value of the image
       }



       outpic -> pts = 0;        

       avpicture_fill((AVPicture*)picture, buffer, PIX_FMT_RGB8, ctx->width, ctx->height);

       avpicture_fill((AVPicture*)outpic, outbuffer, PIX_FMT_YUV420P, ctx->width, ctx->height);

       struct SwsContext* fooContext = sws_getContext(ctx->width, ctx->height,
                                                              PIX_FMT_RGB8,
                                                              ctx->width, ctx->height,
                                                              PIX_FMT_YUV420P,
                                                              SWS_FAST_BILINEAR, NULL, NULL, NULL);

       sws_scale(fooContext, picture->data, picture->linesize, 0, ctx->height, outpic->data, outpic->linesize);

       printf("abcdefghijklmnop");
       out_size = avcodec_encode_video(ctx, outbuf, outbuf_size, outpic);
       printf("\n\n out_size %d   outbuf_size %d",out_size,outbuf_size);

    so the size of image is 29 kb and the avcodec_encode_video is returning 20143.. So is it correct ? I mean i am encoding so its size should also decrease... And i have opened that image in hex mode and i am getting different data than that is in buffer (as shown in the code). so i think that buffer is not getting correct data. Right ?
    Can anyone please help me with my code ?
    Thank you in advance...

  • How to set time_base when muxing AVI with libavformat ?

    18 mai 2012, par Anastasia

    In my application I receive from a remote server synchronized video
    (mpeg4) and audio (mp3) and mux them to avi file. The video comes
    frame-by-frame, and the audio comes in small chunks, say 200-250 ms.
    Both video frames and audio chunks have timestamps in milliseconds.

    My question is how to set audio time_base and pts correctly ?
    For video I set time_base.num = framerate, time_base.den = 1 ; and
    calculate pts as follows :

     AVRational time_base_1kHz;
     time_base_1kHz.num = 1;
     time_base_1kHz.den = 1000;
     packet.pts = av_rescale_q(timeStamp - baseTimeStamp_, time_base_1kHz, videoStream_->time_base);

    where baseTimeStamp_ is the 1st timestamp of the stream.

    But if I try do similar calculation for audio, I don't get playable
    avi. If I always set to audio AV_NOPTS_VALUE, then avi has playable
    video, but no audio.

    So what are the correct values for audio time_base and pts's ?
    Do I set time_base and pts's for video correctly ?

  • Why does FFMPEG adds up extra bit rate to video ? [migrated]

    5 juin 2012, par user735647

    I use FFMPEG (command line Input) to convert my videos to a specific output format. The problem I am facing is when I try to pass a constant bit rate(700 kbps) to FFMPEG, the result is an output video with a different bit rate(say 1000 kbps). This phenomenon occurs invariably for all videos.Why is this happening ? I need to maintain a constant bit rate. Can anyone help me out.

    My FFMPEG version is 0.5

    The command line parameter which I am passing to FFMPEG is,

    -i {inputfile}
    -b 700k -ab 64k
    -vcodec libx264
    -acodec libfaac -ac 2 -ar 44100
    -y -s 320x240
    {outputfile}

    EDIT :

    I was able to force CBR with a fluctuation of 3% when I used the following parameters.

    ffmpeg -i myfile.avi
    -b 4000k -minrate 4000k
    -maxrate 4000k -bufsize 1835k   out.m2v

    But when I used -maxrate and - minrate along with my parameter set I was not able to force CBR. My parameter set is as follows,

    -i {inputfile}
    -b 1200k -minrate 1200k
    -maxrate 1200k -bufsize 1200k
    -ab 64k -vcodec libx264
    -acodec libfaac -ac 2 -ar 44100
    -y -s 320x240
    {outputfile}

    Why is this happening ?