Recherche avancée

Médias (1)

Mot : - Tags -/ticket

Autres articles (39)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

  • Selection of projects using MediaSPIP

    2 mai 2011, par

    The examples below are representative elements of MediaSPIP specific uses for specific projects.
    MediaSPIP farm @ Infini
    The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...)

Sur d’autres sites (5843)

  • Encoding H.264 CBR videos with FFmpeg

    27 août 2015, par Cornstalks

    I’m trying to encode a video with ffmpeg into H.264 (via the libx264 library) with a constant bit rate. I know, I know, VBR is often preferred, but for this specific job I’m required to use CBR (just as long as it’s so many kilobytes per second ; it doesn’t have to be an exact kilobytes per frame, afaik). My sample video I’m using to test is from here : http://a1408.g.akamai.net/5/1408/1388/2005110403/1a1a1ad948be278cff2d96046ad90768d848b41947aa1986/sample_iTunes.mov.zip (it comes from http://support.apple.com/kb/HT1425)

    I can get a constant bit rate when encoding the video with MPEG-4 Video (using the commands ffmpeg -i sample_iTunes.mov -b 819968 -minrate 819968 -maxrate 819968 out.mov), and the bit rate is as expected. Reading the video’s specs via the QuickTime Inspector, it’s got a data rate of 844.94 kbit/s. Cool.

    However, when I change the codec to libx264, it seems to completely ignore my bitrate requests ! The command I’m trying is "ffmpeg -i sample_iTunes.mov -vcodec libx264 -vpre medium -b 819968 -vb 819968 -minrate 819968 -maxrate 819968 -bufsize 400000 test.mov". But when I check the video’s specs via the QuickTime Inspector, it’s got a data rate of 254.74 kbit/s. WTF ? That’s not even close !

    I’ve tried changing so many parameters and adding tons of different things, and I’ve spent 2 days googling this, but I can’t seem to get it to work. If I encode the video with the MainConcept H.264 encoder, I can get a constant bitrate, but I need this to work with ffmpeg.

    If someone can help me figure out how to do CBR H.264 encoding with FFmpeg, I will love you forever !

  • Encoding H.264 CBR videos with FFmpeg

    27 août 2015, par Cornstalks

    I’m trying to encode a video with ffmpeg into H.264 (via the libx264 library) with a constant bit rate. I know, I know, VBR is often preferred, but for this specific job I’m required to use CBR (just as long as it’s so many kilobytes per second ; it doesn’t have to be an exact kilobytes per frame, afaik). My sample video I’m using to test is from here : http://a1408.g.akamai.net/5/1408/1388/2005110403/1a1a1ad948be278cff2d96046ad90768d848b41947aa1986/sample_iTunes.mov.zip (it comes from http://support.apple.com/kb/HT1425)

    I can get a constant bit rate when encoding the video with MPEG-4 Video (using the commands ffmpeg -i sample_iTunes.mov -b 819968 -minrate 819968 -maxrate 819968 out.mov), and the bit rate is as expected. Reading the video’s specs via the QuickTime Inspector, it’s got a data rate of 844.94 kbit/s. Cool.

    However, when I change the codec to libx264, it seems to completely ignore my bitrate requests ! The command I’m trying is "ffmpeg -i sample_iTunes.mov -vcodec libx264 -vpre medium -b 819968 -vb 819968 -minrate 819968 -maxrate 819968 -bufsize 400000 test.mov". But when I check the video’s specs via the QuickTime Inspector, it’s got a data rate of 254.74 kbit/s. WTF ? That’s not even close !

    I’ve tried changing so many parameters and adding tons of different things, and I’ve spent 2 days googling this, but I can’t seem to get it to work. If I encode the video with the MainConcept H.264 encoder, I can get a constant bitrate, but I need this to work with ffmpeg.

    If someone can help me figure out how to do CBR H.264 encoding with FFmpeg, I will love you forever !

  • How to publish selfmade stream with ffmpeg and c++ to rtmp server ?

    25 octobre 2013, par Alexandr R

    Have a nice day to you, people !

    I am writing an application for Windows that will capture the screen and send the stream to Wowza server by rtmp (for broadcasting). My application use ffmpeg and Qt.
    I capture the screen with WinApi, convert a buffer to YUV444(because it's simplest) and encode frame as described at the file decoding_encoding.c (from FFmpeg examples) :

    ///////////////////////////
    //Encoder initialization
    ///////////////////////////
    avcodec_register_all();
    codec=avcodec_find_encoder(AV_CODEC_ID_H264);
    c = avcodec_alloc_context3(codec);
    c->width=scr_width;
    c->height=scr_height;
    c->bit_rate = 400000;
    int base_num=1;
    int base_den=1;//for one frame per second
    c->time_base= (AVRational){base_num,base_den};
    c->gop_size = 10;
    c->max_b_frames=1;
    c->pix_fmt = AV_PIX_FMT_YUV444P;
    av_opt_set(c->priv_data, "preset", "slow", 0);

    frame = avcodec_alloc_frame();
    frame->format = c->pix_fmt;
    frame->width  = c->width;
    frame->height = c->height;

    for(int counter=0;counter<10;counter++)
    {
    ///////////////////////////
    //Capturing Screen
    ///////////////////////////
       GetCapScr(shotbuf,scr_width,scr_height);//result: shotbuf is filled by screendata from HBITMAP
    ///////////////////////////
    //Convert buffer to YUV444 (standard formula)
    //It's handmade function because of problems with prepare buffer to swscale from HBITMAP
    ///////////////////////////
       RGBtoYUV(shotbuf,frame->linesize,frame->data,scr_width,scr_height);//result in frame->data
    ///////////////////////////
    //Encode Screenshot
    ///////////////////////////
       av_init_packet(&pkt);
       pkt.data = NULL;    // packet data will be allocated by the encoder
       pkt.size = 0;
       frame->pts = counter;
       avcodec_encode_video2(c, &pkt, frame, &got_output);
       if (got_output)
       {
           //I think that  sending packet by rtmp  must be here!
           av_free_packet(&pkt);            

       }

    }
    // Get the delayed frames
    for (int got_output = 1,i=0; got_output; i++)
    {
       ret = avcodec_encode_video2(c, &pkt, NULL, &got_output);
       if (ret < 0)
           {
               fprintf(stderr, "Error encoding frame\n");
               exit(1);
           }
           if (got_output)
           {
           //I think that  sending packet by rtmp  must be here!
           av_free_packet(&pkt);      
           }
    }

    ///////////////////////////
    //Deinitialize encoder
    ///////////////////////////
    avcodec_close(c);
    av_free(c);
    av_freep(&frame->data[0]);
    avcodec_free_frame(&frame);

    I need to send video stream generated by this code to RTMP server.
    In other words, I need c++/c analog for this command :

    ffmpeg -re -i "sample.h264" -f flv rtmp://sample.url.com/screen/test_stream

    It's useful, but I don't want to save stream to file, I want to use ffmpeg libraries for realtime encoding screen capture and sending encoded frames to RTMP server inside my own application.
    Please give me a little example how to initialize AVFormatContext properly and to send my encoded video AVPackets to server.

    Thanks.