Recherche avancée

Médias (0)

Mot : - Tags -/optimisation

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

Autres articles (105)

  • Monitoring de fermes de MediaSPIP (et de SPIP tant qu’à faire)

    31 mai 2013, par

    Lorsque l’on gère plusieurs (voir plusieurs dizaines) de MediaSPIP sur la même installation, il peut être très pratique d’obtenir d’un coup d’oeil certaines informations.
    Cet article a pour but de documenter les scripts de monitoring Munin développés avec l’aide d’Infini.
    Ces scripts sont installés automatiquement par le script d’installation automatique si une installation de munin est détectée.
    Description des scripts
    Trois scripts Munin ont été développés :
    1. mediaspip_medias
    Un script de (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (10005)

  • FFmpeg - generate x264 CBR video transport stream with C-API

    6 juillet 2020, par ZeroDefect

    Using various posts sprinkled around the Internet, including this one here on SO, I've been able to understand how to use the FFmpeg cli to generate a CBR video bitrate using the x264 codec (wrapped in an MPEG-2 transport stream). Note : I'm concerned with the video bitrate - nothing else.

    


    ffmpeg -i cbr_test_file_input.mp4 -c:v libx264 -pix_fmt yuv420p -b:v 6000000 -preset fast -tune film -g 25 -x264-params vbv-maxrate=6000:vbv-bufsize=6000:force-cfr=1:nal-hrd=cbr -flags +ildct+ilme x264_cbr_test_output.ts


    


    However, I'm trying to approach this from an FFmpeg C-API point of view. I'm having issues. I've knocked together some code to try do something very similar to what is being done in the FFmpeg CLI. I can generate a transport stream of what I think should be CBR, but the profile of the video bitrate is very different from what I thought was the FFmpeg cli equivalent :

    


    The initialisation of the AVCodecContext looks something like :

    


          av_dict_set(&amp;pDict, "preset", "faster", 0);&#xA;      av_dict_set(&amp;pDict, "tune", "film", 0);&#xA;      av_dict_set_int(&amp;pDict, "rc-lookahead", 25, 0);&#xA;&#xA;      pCdcCtxOut->width = pCdcCtxIn->width;&#xA;      pCdcCtxOut->height = pCdcCtxIn->height;&#xA;      pCdcCtxOut->pix_fmt = AV_PIX_FMT_YUV420P;&#xA;      pCdcCtxOut->gop_size = 25;&#xA;&#xA;      // Going for 6Mbit/s&#xA;      pCdcCtxOut->bit_rate = 6000000;&#xA;      //pCdcCtxOut->rc_min_rate = pCdcCtxOut->bit_rate;&#xA;      pCdcCtxOut->rc_max_rate = pCdcCtxOut->bit_rate;&#xA;      pCdcCtxOut->rc_buffer_size = pCdcCtxOut->bit_rate;&#xA;      pCdcCtxOut->rc_initial_buffer_occupancy = static_cast<int>((pCdcCtxOut->bit_rate * 9) / 10);&#xA;&#xA;      std::string strParams = "vbv-maxrate="&#xA;                              &#x2B; std::to_string(pCdcCtxOut->bit_rate / 1000)&#xA;                              &#x2B; ":vbv-bufsize="&#xA;                              &#x2B; std::to_string(pCdcCtxOut->bit_rate / 1000)&#xA;                              &#x2B; ":force-cfr=1:nal-hrd=cbr";&#xA;&#xA;      av_dict_set(&amp;pDict, "x264-params", strParams.c_str(), 0);&#xA;&#xA;      pCdcCtxOut->field_order = AV_FIELD_TT;&#xA;      pCdcCtxOut->flags = (AV_CODEC_FLAG_INTERLACED_DCT | AV_CODEC_FLAG_INTERLACED_ME | AV_CODEC_FLAG_CLOSED_GOP);&#xA;&#xA;      // WARN: Make some assumptions here!&#xA;      pCdcCtxOut->time_base = AVRational{1,25};&#xA;      pCdcCtxOut->framerate = AVRational{25,1};&#xA;      pCdcCtxOut->sample_aspect_ratio = AVRational{64,45};&#xA;</int>

    &#xA;

    The output graphs appear very different :

    &#xA;

    FFmpeg CLI output

    &#xA;

    Above is the FFmpeg CLI output - video bitrate holds fairly steady.

    &#xA;

    enter image description here

    &#xA;

    Above is the output of my sample application - some significant dips in the video bitrate.

    &#xA;

    I've taken this a step further and created a git repo consisting of :

    &#xA;

      &#xA;
    • Code of sample application
    • &#xA;

    • Test input file (.mp4)
    • &#xA;

    • Outputs (.ts file) of tests
    • &#xA;

    • Graphs of output bitrates.
    • &#xA;

    &#xA;

  • Reducing the bit rate is dropping the audio stream [closed]

    19 février 2013, par user977505

    I'm a newbie to the ffmpeg, x264 commands and conversion. So please bear w/ me.

    I've a H.264 content w/ very high bit rate and I'm using ffmepg, x264 commands to reduce the bit rate. The bit rate is getting reduced but the problem is the output doesn't have the audio stream anymore.

    Here are the commands, I'm using :

    ffmpeg.exe  -i King_Maker_Leader.mp4 -pix_fmt yuv420p -vf scale=1024:576 -r 24 \
      -f yuv4mpegpipe - | x264.exe  —bitrate 1664 —demuxer y4m \
      —preset slow —ref 3 —threads 6 —thread-input —no-scenecut \
      —no-interlaced —stats King_Maker_Leader.stats —vbv-bufsize 3328000 \
      —vbv-maxrate 1996 —pass 1 —output NUL —profile main —level 3.1 —sar 1:1 \
      —tune film —keyint 96 -
    

    ffmpeg.exe -i King_Maker_Leader.mp4 -pix_fmt yuv420p -vf scale=1024:576 \
    -r 24 -f yuv4mpegpipe - | x264.exe —bitrate 1664 —demuxer y4m \
    —preset slow —ref 3 —threads 6 —thread-input —no-scenecut \
    —no-interlaced —stats King_Maker_Leader.stats —vbv-bufsize 3328000 \
    —vbv-maxrate 1996 —pass 2 —output King_Maker_Leader_generated.mp4 \
    —profile main —level 3.1 —sar 1:1 —tune film —keyint 96 -

    I cannot figure out what is wrong with the above commands.

    I'm attaching the partial logs from pass 2 command that show the input has two streams (video and audio) and the output has only video stream.

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#39;..\yathrakkarude_sathruka.mp4&#39;:
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf54.6.101
     Duration: 00:01:00.37, start: 0.000000, bitrate: 8587 kb/s
       Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 720x576 [
    SAR 16:11 DAR 20:11], 8073 kb/s, 25 fps, 25 tbr, 25k tbn, 50 tbc
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 508
    kb/s
       Metadata:
         handler_name    : SoundHandler
    Output #0, yuv4mpegpipe, to &#39;pipe:&#39;:
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf54.25.104
       Stream #0:0(eng): Video: rawvideo (I420 / 0x30323449), yuv420p, 1024x576 [SA
    R 45:44 DAR 20:11], q=2-31, 200 kb/s, 90k tbn, 24 tbc
       Metadata:
         handler_name    : VideoHandler
    Stream mapping:
     Stream #0:0 -> #0:0 (h264 -> rawvideo)
    Press [q] to stop, [?] for help
    [yuv4mpegpipe @ 016d5800] Encoder did not produce proper pts, making some up.
    y4m [info]: 1024x576p 45:44 @ 24/1 fps (cfr)
    x264 [info]: using SAR=1/1
    x264 [warning]: VBV buffer (2000000) > level limit (14000)
    x264 [info]: using cpu capabilities: MMX2 SSE2Fast FastShuffle SSEMisalign LZCNT
  • Reducing the bit rate is dropping the audio stream [closed]

    19 février 2013, par user977505

    I'm a newbie to the ffmpeg, x264 commands and conversion. So please bear w/ me.

    I've a H.264 content w/ very high bit rate and I'm using ffmepg, x264 commands to reduce the bit rate. The bit rate is getting reduced but the problem is the output doesn't have the audio stream anymore.

    Here are the commands, I'm using :

    ffmpeg.exe  -i King_Maker_Leader.mp4 -pix_fmt yuv420p -vf scale=1024:576 -r 24 \
      -f yuv4mpegpipe - | x264.exe  —bitrate 1664 —demuxer y4m \
      —preset slow —ref 3 —threads 6 —thread-input —no-scenecut \
      —no-interlaced —stats King_Maker_Leader.stats —vbv-bufsize 3328000 \
      —vbv-maxrate 1996 —pass 1 —output NUL —profile main —level 3.1 —sar 1:1 \
      —tune film —keyint 96 -
    

    ffmpeg.exe -i King_Maker_Leader.mp4 -pix_fmt yuv420p -vf scale=1024:576 \
    -r 24 -f yuv4mpegpipe - | x264.exe —bitrate 1664 —demuxer y4m \
    —preset slow —ref 3 —threads 6 —thread-input —no-scenecut \
    —no-interlaced —stats King_Maker_Leader.stats —vbv-bufsize 3328000 \
    —vbv-maxrate 1996 —pass 2 —output King_Maker_Leader_generated.mp4 \
    —profile main —level 3.1 —sar 1:1 —tune film —keyint 96 -

    I cannot figure out what is wrong with the above commands.

    I'm attaching the partial logs from pass 2 command that show the input has two streams (video and audio) and the output has only video stream.

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#39;..\yathrakkarude_sathruka.mp4&#39;:
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf54.6.101
     Duration: 00:01:00.37, start: 0.000000, bitrate: 8587 kb/s
       Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 720x576 [
    SAR 16:11 DAR 20:11], 8073 kb/s, 25 fps, 25 tbr, 25k tbn, 50 tbc
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 508
    kb/s
       Metadata:
         handler_name    : SoundHandler
    Output #0, yuv4mpegpipe, to &#39;pipe:&#39;:
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf54.25.104
       Stream #0:0(eng): Video: rawvideo (I420 / 0x30323449), yuv420p, 1024x576 [SA
    R 45:44 DAR 20:11], q=2-31, 200 kb/s, 90k tbn, 24 tbc
       Metadata:
         handler_name    : VideoHandler
    Stream mapping:
     Stream #0:0 -> #0:0 (h264 -> rawvideo)
    Press [q] to stop, [?] for help
    [yuv4mpegpipe @ 016d5800] Encoder did not produce proper pts, making some up.
    y4m [info]: 1024x576p 45:44 @ 24/1 fps (cfr)
    x264 [info]: using SAR=1/1
    x264 [warning]: VBV buffer (2000000) > level limit (14000)
    x264 [info]: using cpu capabilities: MMX2 SSE2Fast FastShuffle SSEMisalign LZCNT