Recherche avancée

Médias (1)

Mot : - Tags -/Christian Nold

Autres articles (77)

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

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

Sur d’autres sites (10422)

  • Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead

    28 février 2018, par user1496491

    I’m using C API of MMPEG and getting this message. So I added time_base to my stream

    videoStream = avformat_new_stream(formatContext, codec);
    videoStream->time_base = AVRational{1, fps};

    and got rid of it in context

    codecContext->bit_rate = 400000;
    codecContext->width = width;
    codecContext->height = height;
    codecContext->gop_size = 10;
    codecContext->max_b_frames = 1;
    //codecContext->time_base = AVRational{1, fps};
    codecContext->pix_fmt = AV_PIX_FMT_YUV420P;

    avcodec_open2(codecContext, codec, NULL) immediately breaks

    WHY ? Do I need to apply the value to both of them ? I’ve duplicated values to both, and the message gone. But isn’t it just wrong ?

  • FFmpeg live streaming RGB frame buffer

    23 février 2018, par Mher Didaryan

    When we have a local video file This code works for streaming. What we want to achieve is to change input file with RGB frame buffer that we grab from screen. The code below uses input file’s time_base for PTS and DTS calculation.

    if(pkt.stream_index==videoindex) {
       AVRational time_base=ifmt_ctx->streams[videoindex]->time_base;
       AVRational time_base_q={1,AV_TIME_BASE};
       int64_t pts_time = av_rescale_q(pkt.dts, time_base, time_base_q);
       int64_t now_time = av_gettime() - start_time;
       if (pts_time > now_time)
           av_usleep(pts_time - now_time);
    }

    in_stream  = ifmt_ctx->streams[pkt.stream_index];
    out_stream = ofmt_ctx->streams[pkt.stream_index];
    /* copy packet */
    //Convert PTS/DTS
    pkt.pts = av_rescale_q_rnd(pkt.pts, in_stream->time_base, out_stream->time_base, (AVRounding)(AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX));
    pkt.dts = av_rescale_q_rnd(pkt.dts, in_stream->time_base, out_stream->time_base, (AVRounding)(AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX));
    pkt.duration = av_rescale_q(pkt.duration, in_stream->time_base, out_stream->time_base);

    Following this answer which increments PTS value by one for every frame VideoSt.Frame->pts = VideoSt.NextPts++; saving in local file or streaming to Wowza server works (low quality) but fails on Youtube and Twitch. av_interleaved_write_frame function returns error -22. To improve quality we lowered qmin and qmax values but the bit-rate of video increased too much (30Mb/s and even more for HD video).

    VideoSt.Ctx->codec_id = VideoCodec->id;
    VideoSt.Ctx->width = ViewportSize.X;
    VideoSt.Ctx->height = ViewportSize.Y;
    VideoSt.Stream->time_base = VideoSt.Ctx->time_base = { 1, 30 };
    VideoSt.Ctx->time_base = timeBase;
    VideoSt.Ctx->gop_size = 60;
    VideoSt.Ctx->bit_rate = 400000;
    VideoSt.Ctx->pix_fmt = AV_PIX_FMT_YUV420P;
    VideoSt.Ctx->qmin = 1;
    VideoSt.Ctx->qmax = 2;
    VideoSt.Ctx->max_qdiff = 3;
    VideoSt.Ctx->qcompress = 1.0f;

    How can we stream lossless quality video with reasonable bit-rate using flv1 codec ? If streaming to Youtube or Twitch fails is it just a problem with requirements of this services or there’s an issue with encoding ?

    Regarding error code -22 there’s a detailed explanation which explains how we should increment PTS and DTS values.

    In which cases calculating PTS and DTS values are necessary ?

    And by the way what are these PTS and DTS ? After reading many posts and Understanding PTS and DTS in video frames accepted answer I still do not understand.

  • Encoding H.264 CBR videos with FFmpeg

    3 février 2018, 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 !