Recherche avancée

Médias (1)

Mot : - Tags -/epub

Autres articles (59)

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

Sur d’autres sites (13598)

  • how to set nVidia video bitrate in a system service ?

    12 septembre 2021, par qycx

    I use an nvidia card for compression and decompression in a video conferencing software. The program uses ffmpeg. The program is a system service. Need to control the bit rate. But I found that I didn't control it. The setting code rate was 700k, and the actual value was 10M. What went wrong ?

    


    /* put sample parameters */
    pUnit->encV_var.c->bit_rate = bitrate;//400000;
    /* resolution must be a multiple of two */
    pUnit->encV_var.c->width = in_w;//352;
    pUnit->encV_var.c->height = in_h;//288;
    pUnit->encV_var.c->qmin=10;
    pUnit->encV_var.c->qmax=30;
    /* frames per second */
    AVRational t1={1,25};
    t1.den=fps;
    pUnit->encV_var.c->time_base = t1;//(AVRational){1, 25};
    AVRational t2={25,1};
    t2.num=fps;
    pUnit->encV_var.c->framerate = t2;//(AVRational){25, 1};

    /* emit one intra frame every ten frames
     * check frame pict_type before passing frame
     * to encoder, if frame->pict_type is AV_PICTURE_TYPE_I
     * then gop_size is ignored and the output of encoder
     * will always be I frame irrespective to gop_size
     */
    pUnit->encV_var.c->gop_size = 256;//10;
    pUnit->encV_var.c->max_b_frames = 0;//1;
    pUnit->encV_var.c->pix_fmt = AV_PIX_FMT_YUV420P;


    


  • how to improve image quality when I write c++ using ffmpeg( avcodec)

    6 septembre 2021, par qycx

    I am writing a c++ program, using ffmpeg to encode video.
but the image quality is very bad.
can you help me to improve the video quality ?

    


    following is my code :

    


        pUnit->encV_var.pkt = av_packet_alloc();
    if (!pUnit->encV_var.pkt) {
        goto errLabel;
    }

    /* put sample parameters */
    pUnit->encV_var.c->bit_rate = bitrate;//400000;
    pUnit->encV_var.c->rc_max_rate=bitrate;
    pUnit->encV_var.c->rc_min_rate=bitrate;
    AVCodecContext *c=pUnit->encV_var.c;
    int br = bitrate;
    c->bit_rate_tolerance = br;
c->rc_buffer_size=br;
c->rc_initial_buffer_occupancy = c->rc_buffer_size*3/4;
//c->rc_buffer_aggressivity= (float)1.0;
//c->rc_initial_cplx= 0.5; 



    /* resolution must be a multiple of two */
    pUnit->encV_var.c->width = in_w;//352;
    pUnit->encV_var.c->height = in_h;//288;
    /* frames per second */
    AVRational t1={1,25};
    t1.den=fps;
    pUnit->encV_var.c->time_base = t1;//(AVRational){1, 25};
    AVRational t2={25,1};
    t2.num=fps;
    pUnit->encV_var.c->framerate = t2;//(AVRational){25, 1};

    /* emit one intra frame every ten frames
     * check frame pict_type before passing frame
     * to encoder, if frame->pict_type is AV_PICTURE_TYPE_I
     * then gop_size is ignored and the output of encoder
     * will always be I frame irrespective to gop_size
     */
    pUnit->encV_var.c->gop_size = 256;//10;
    pUnit->encV_var.c->max_b_frames = 0;//1;
    pUnit->encV_var.c->pix_fmt = AV_PIX_FMT_YUV420P;

    //
    pUnit->encV_var.c->flags|=AV_CODEC_FLAG_GLOBAL_HEADER;

    //
    if (codec_id == AV_CODEC_ID_H264) {
        int ret;
        ret = av_opt_set(pUnit->encV_var.c->priv_data, "preset", "fast", 0);
        //ret = av_opt_set(pUnit->encV_var.c->priv_data, "preset", "slow", 0);
        //ret = av_opt_set(pUnit->encV_var.c->priv_data, "preset", "medium", 0);

        //
        ret = av_opt_set(pUnit->encV_var.c->priv_data, "tune","zerolatency",0);

        //
        ret = av_opt_set(pUnit->encV_var.c->priv_data, "profile","main",0);

    }

    /* open it */
    ret = avcodec_open2(pUnit->encV_var.c, pUnit->encV_var.codec, NULL);
   


    


    please help me to improve image quality

    


    mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm

    


  • FFMPEG/C++ How to simply write out/passthrough h264 stream ?

    11 août 2021, par Schuerta

    Im trying to learn the basics of ffmpeg writing (reading already works), so im just trying to take in an input .ts file and write out/passthrough the exact same h264 stream to a new output file. I dont get any compilation errors, but for some reason i cant figure out why my output file's framerate is very wrong. Also when i read in my output file, i get printouts saying "Packet corrupt (stream = 0, dts = #)"

    


    I followed the instructions in the ffmpeg library comments so im not sure what im missing. I call initOutStream(), then initH264encoder(), then during the reading/decoding readH264Packet() is called repeatedly. (Removed code for readability sake, left relevant sections below) ;

    


    Edit : If i put my output file through the actuall ffmpeg cmd app, the framerate issue seems to get fixed. Wonder where im messing up

    


    void test::initOutStream() {

//create muxing context
outstreamContext = avformat_alloc_context();

//oformat
AVOutputFormat *guessFormat; //Populate oformat
guessFormat = av_guess_format(NULL, inputVideoUrl.c_str(), NULL);
outstreamContext->oformat = guessFormat; 
outstreamContext->oformat->video_codec = AV_CODEC_ID_H264; 
//outstreamContext->bit_rate = 400000; //No affect; 

//pb
AVIOContext *outAVIOContext = nullptr;
//int result = avio_open(&outAVIOContext, outputVideoUrl.c_str(), AVIO_FLAG_WRITE);
int result = avio_open2(&outAVIOContext, outputVideoUrl.c_str(), AVIO_FLAG_WRITE, NULL, NULL); //Documentain said to use this method
outstreamContext->pb = outAVIOContext;
}


    


    .

    


    void test::initH264encoder() { //Frame -> packet&#xA;int result;&#xA;&#xA;h264OutCodec = avcodec_find_encoder(AV_CODEC_ID_H264);&#xA;&#xA;h264OutStream = avformat_new_stream(outstreamContext, h264OutCodec);&#xA;h264OutStream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;&#xA;h264OutStream->codecpar->codec_id = AV_CODEC_ID_H264;&#xA;h264OutStream->codecpar->width = 640;&#xA;h264OutStream->codecpar->height = 480;&#xA;h264OutStream->id = H264_STREAM_ID;&#xA;h264OutStream->codecpar->color_range = AVCOL_RANGE_MPEG;&#xA;//h264OutStream->codecpar->bit_rate = 400000;&#xA;&#xA;h264OutContext = avcodec_alloc_context3(h264OutCodec);&#xA;&#xA;h264OutContext->width = 640;&#xA;h264OutContext->height = 480;&#xA;h264OutContext->time_base = (AVRational){1,static_cast<int>(29.97)};&#xA;h264OutContext->pix_fmt = AV_PIX_FMT_YUV420P;&#xA;&#xA;result = avcodec_open2(h264OutContext, h264OutCodec, nullptr);&#xA;&#xA;//Alloc packet &#x2B; finish&#xA;outPacket = av_packet_alloc();&#xA;&#xA;//Write header&#xA;result = avformat_write_header(outstreamContext, NULL);&#xA;}&#xA;</int>

    &#xA;

    Assume that reading was set up correctly

    &#xA;

    void test::readH264Packet(__unused uint64_t tick) {&#xA;//...av_read_frame(streamContext, inPacket);&#xA;//...avcodec_send_packet(h264Context, inPacket);&#xA;//...avcodec_receive_frame(h264Context, yuvFrame)&#xA;//My passthrough:&#xA;if(shouldOutputH264Stream){&#xA;        result = avcodec_send_frame(h264OutContext, yuvFrame); //1. Encode frame to packet&#xA;        result = avcodec_receive_packet(h264OutContext, outPacket2); //2. get encoded packet&#xA;        result = av_interleaved_write_frame(outstreamContext, outPacket2); //3. write packet&#xA;        //Write trailer and free happens later&#xA;    }&#xA;}&#xA;

    &#xA;