Recherche avancée

Médias (0)

Mot : - Tags -/tags

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

Autres articles (64)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (7336)

  • FFmpeg CRF control using x264 vs libvpx-vp9

    19 octobre 2016, par igon

    I have some experience using ffmpeg with x264 and I wanted to do a comparison with libvpx-vp9. I tested a simple single pass encoding of a raw video, varying the crf settings and presets both with x264 and libvpx-vp9. I am new to libvpx and I followed this and this carefully but I might have still specified wrong combination of parameters since the results I get do not make much sense to me.

    For x264 I did :

    ffmpeg -i test_video.y4m -c:v libx264 -threads 1 -crf <crf> -preset <preset> -y output.mkv
    </preset></crf>

    and obtained the following results :

    codec  , settings                        , time        , PSNR      ,bitrate
    libx264,['-crf', '20', '-preset', 'fast'],13.1897280216, 42.938337 ,15728
    libx264,['-crf', '20', '-preset', 'medium'],16.80494689, 42.879753 ,15287
    libx264,['-crf', '20', '-preset', 'slow'],25.1142120361, 42.919206 ,15400
    libx264,['-crf', '30', '-preset', 'fast'],8.79047083855, 37.975141 ,4106
    libx264,['-crf', '30', '-preset', 'medium'],9.936599016, 37.713778 ,3749
    libx264,['-crf', '30', '-preset', 'slow'],13.0959510803, 37.569511 ,3555

    This makes sense to me, given a crf value you get a value of PSNR and changing the preset can decrease the bitrate but increase the time to encode.

    For libvpx-vp9 I did :

    ffmpeg -i test_video.y4m -c:v libvpx-vp9 -threads 1 -crf <crf> -cpu-used <effort> -y output.mkv
    </effort></crf>

    First of all I thought from tutorials online that the -cpu-used option is equivalent to -preset in x264. Is that correct ? If so what is the difference with -quality ? Furthermore since the range goes from -8 to 8 I assumed that negative values where the fast options while positive values the slowest. Results I get are very confusing though :

    codec     , settings                      , time        , PSNR     ,bitrate
    libvpx-vp9,['-crf', '20', '-cpu-used', '-2'],19.6644911766,32.54317,571
    libvpx-vp9,['-crf', '20', '-cpu-used', '0'],176.670887947,32.69899,564
    libvpx-vp9,['-crf', '20', '-cpu-used', '2'],20.0206270218,32.54317,571
    libvpx-vp9,['-crf', '30', '-cpu-used', '-2'],19.7931578159,32.54317,571
    libvpx-vp9,['-crf', '30', '-cpu-used', '0'],176.587754965,32.69899,564
    libvpx-vp9,['-crf', '30', '-cpu-used', '2'],19.8394429684,32.54317,571

    Bitrate is very low and PSNR seems unaffected by the crf setting (and very low compared to x264). The -cpu-used setting has very minimal impact and also seems that -2 and 2 are the same option.. What am I missing ? I expected libvpx to take more time to encode (which is definitely true) but at the same time higher quality transcodes. What parameters should I use to
    have a fair comparison with x264 ?

    Edit : Thanks to @mulvya and this doc I figured that to work in crf mode with libvpx I have to add -b:v 0. I re-ran my tests and I get :

       codec     , settings                                 , time        , PSNR     ,bitrate
    libvpx-vp9,['-crf', '20', '-b:v', '0', '-cpu-used', '-2'],57.6835780144,45.111158,17908
    libvpx-vp9,['-crf', '20', '-b:v', '0', '-cpu-used', '0'] ,401.360313892,45.285367,17431
    libvpx-vp9,['-crf', '20', '-b:v', '0', '-cpu-used', '2'] ,57.4941239357,45.111158,17908
    libvpx-vp9,['-crf', '30', '-b:v', '0', '-cpu-used', '-2'],49.175855875,42.588178,11085
    libvpx-vp9,['-crf', '30', '-b:v', '0', '-cpu-used', '0'] ,347.158324957,42.782194,10935
    libvpx-vp9,['-crf', '30', '-b:v', '0', '-cpu-used', '2'] ,49.1892938614,42.588178,11085

    PSNR and bitrate went up significantly by adding -b:v 0

  • FFmpeg CRF control using x264 vs libvpx-vp9

    19 octobre 2016, par igon

    I have some experience using ffmpeg with x264 and I wanted to do a comparison with libvpx-vp9. I tested a simple single pass encoding of a raw video, varying the crf settings and presets both with x264 and libvpx-vp9. I am new to libvpx and I followed this and this carefully but I might have still specified wrong combination of parameters since the results I get do not make much sense to me.

    For x264 I did :

    ffmpeg -i test_video.y4m -c:v libx264 -threads 1 -crf <crf> -preset <preset> -y output.mkv
    </preset></crf>

    and obtained the following results :

    codec  , settings                        , time        , PSNR      ,bitrate
    libx264,['-crf', '20', '-preset', 'fast'],13.1897280216, 42.938337 ,15728
    libx264,['-crf', '20', '-preset', 'medium'],16.80494689, 42.879753 ,15287
    libx264,['-crf', '20', '-preset', 'slow'],25.1142120361, 42.919206 ,15400
    libx264,['-crf', '30', '-preset', 'fast'],8.79047083855, 37.975141 ,4106
    libx264,['-crf', '30', '-preset', 'medium'],9.936599016, 37.713778 ,3749
    libx264,['-crf', '30', '-preset', 'slow'],13.0959510803, 37.569511 ,3555

    This makes sense to me, given a crf value you get a value of PSNR and changing the preset can decrease the bitrate but increase the time to encode.

    For libvpx-vp9 I did :

    ffmpeg -i test_video.y4m -c:v libvpx-vp9 -threads 1 -crf <crf> -cpu-used <effort> -y output.mkv
    </effort></crf>

    First of all I thought from tutorials online that the -cpu-used option is equivalent to -preset in x264. Is that correct ? If so what is the difference with -quality ? Furthermore since the range goes from -8 to 8 I assumed that negative values where the fast options while positive values the slowest. Results I get are very confusing though :

    codec     , settings                      , time        , PSNR     ,bitrate
    libvpx-vp9,['-crf', '20', '-cpu-used', '-2'],19.6644911766,32.54317,571
    libvpx-vp9,['-crf', '20', '-cpu-used', '0'],176.670887947,32.69899,564
    libvpx-vp9,['-crf', '20', '-cpu-used', '2'],20.0206270218,32.54317,571
    libvpx-vp9,['-crf', '30', '-cpu-used', '-2'],19.7931578159,32.54317,571
    libvpx-vp9,['-crf', '30', '-cpu-used', '0'],176.587754965,32.69899,564
    libvpx-vp9,['-crf', '30', '-cpu-used', '2'],19.8394429684,32.54317,571

    Bitrate is very low and PSNR seems unaffected by the crf setting (and very low compared to x264). The -cpu-used setting has very minimal impact and also seems that -2 and 2 are the same option.. What am I missing ? I expected libvpx to take more time to encode (which is definitely true) but at the same time higher quality transcodes. What parameters should I use to
    have a fair comparison with x264 ?

    Edit : Thanks to @mulvya and this doc I figured that to work in crf mode with libvpx I have to add -b:v 0. I re-ran my tests and I get :

       codec     , settings                                 , time        , PSNR     ,bitrate
    libvpx-vp9,['-crf', '20', '-b:v', '0', '-cpu-used', '-2'],57.6835780144,45.111158,17908
    libvpx-vp9,['-crf', '20', '-b:v', '0', '-cpu-used', '0'] ,401.360313892,45.285367,17431
    libvpx-vp9,['-crf', '20', '-b:v', '0', '-cpu-used', '2'] ,57.4941239357,45.111158,17908
    libvpx-vp9,['-crf', '30', '-b:v', '0', '-cpu-used', '-2'],49.175855875,42.588178,11085
    libvpx-vp9,['-crf', '30', '-b:v', '0', '-cpu-used', '0'] ,347.158324957,42.782194,10935
    libvpx-vp9,['-crf', '30', '-b:v', '0', '-cpu-used', '2'] ,49.1892938614,42.588178,11085

    PSNR and bitrate went up significantly by adding -b:v 0

  • Adding FFMPEG Layer to HLS streaming causes video playback issues

    25 juin 2023, par Moe

    I have been searching a lot about HLS streaming and have succeeded to create a simple HLS streaming server with nodejs, the problem now is I need to add a layer of ffmpeg encoding to the .ts chunks before streaming to the user, without this layer everything works fine and on my server only 3 requests are seen :

    &#xA;

    manifest.m3u8&#xA;output_000.ts&#xA;output_000.ts&#xA;output_001.ts&#xA;output_002.ts&#xA;

    &#xA;

    But then when I add a simple ffmpeg layer that literally copies everything from the ts file and output the stream (I will add of course dynamic filters to each request, thats why I need this ffmpeg layer), the player goes insane and request the whole video in just 5 seconds or something :

    &#xA;

    manifest.m3u8&#xA;output_000.ts&#xA;output_000.ts&#xA;output_001.ts&#xA;output_002.ts&#xA;output_001.ts&#xA;output_003.ts&#xA;output_002.ts&#xA;...&#xA;output_095.ts&#xA;

    &#xA;

    I have also notices that the numbers aren't increasing uniformly and suspect this is part of the issue, I have tried adding more ffmpeg options to not do anything to the .ts files that are being fed to it as they are a part of a bigger video.

    &#xA;

    Here's my NodeJS server (NextJS API route) :

    &#xA;

    &#xA;const fs = require(`fs`);&#xA;const path = require(`path`);&#xA;const {exec, spawn} = require(`child_process`);&#xA;const pathToFfmpeg = require(`ffmpeg-static`);&#xA;&#xA;export default function handler(req, res) {&#xA;  &#xA;    const { filename } = req.query;&#xA;    console.log(filename);&#xA;    const filePath = path.join(process.cwd(), &#x27;public&#x27;, &#x27;stream&#x27;, `${filename}`);&#xA;    const inputStream = fs.createReadStream(filePath);&#xA;&#xA;    // first check if that is ts file..&#xA;    if(filename.indexOf(`.ts`) != -1){&#xA;  &#xA;      const ffmpegProcess = spawn(pathToFfmpeg, [&#xA;        &#x27;-f&#x27;, `mpegts`,&#xA;        &#x27;-i&#x27;, &#x27;pipe:0&#x27;, // specify input as pipe&#xA;        &#x27;-c&#x27;, &#x27;copy&#x27;, &#xA;        &#x27;-avoid_negative_ts&#x27;, &#x27;0&#x27;,&#xA;        `-map_metadata`, `0`,  // copy without re-encoding&#xA;        &#x27;-f&#x27;, &#x27;mpegts&#x27;, // output format&#xA;        &#x27;pipe:1&#x27;        // specify output as pipe&#xA;      ], {&#xA;        stdio: [&#x27;pipe&#x27;, &#x27;pipe&#x27;, &#x27;pipe&#x27;] // enable logging by redirecting stderr to stdout&#xA;      });&#xA;      res.status(200);&#xA;      res.setHeader(&#x27;Content-Type&#x27;, &#x27;application/vnd.apple.mpegurl&#x27;);&#xA;      res.setHeader(&#x27;Cache-Control&#x27;, &#x27;no-cache&#x27;);&#xA;      res.setHeader(&#x27;Access-Control-Allow-Origin&#x27;, &#x27;*&#x27;);&#xA; &#xA;&#xA;      // ffmpegProcess.stderr.pipe(process.stdout); // log stderr to stdout&#xA;  &#xA;      inputStream.pipe(ffmpegProcess.stdin);&#xA;      ffmpegProcess.stdout.pipe(res);&#xA;  &#xA;      ffmpegProcess.on(&#x27;exit&#x27;, (code) => {&#xA;        if (code !== 0) {&#xA;          console.error(`ffmpeg process exited with code ${code}`);&#xA;        }&#xA;      });&#xA;    }else{&#xA;      // if not then stream whatever file as it is&#xA;      res.status(200);&#xA;      res.setHeader(&#x27;Content-Type&#x27;, &#x27;application/vnd.apple.mpegurl&#x27;);&#xA;      inputStream.pipe(res);&#xA;    }&#xA;  }&#xA;

    &#xA;

    I have tried to feed the request's player appropriate headers but that didn't work, I have also tried to add the '-re' option to the ffmpeg encoder itself and hoped for minimal performance hits, but that also caused playback issue due to being too slow.

    &#xA;