Recherche avancée

Médias (1)

Mot : - Tags -/MediaSPIP

Autres articles (48)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • 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

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (9583)

  • How to convert a continues stream of images to h264 stream in realtime

    29 mars 2021, par Eytan Manor

    So basically I have a canvas, that keeps updating itself at a framerate of 24, and I would like to convert the sequence of images that it produces to H264. The ultimate goal is to send it to an RTMP server, but for now this will help me check if things are working properly before piping the output. The canvas API that I'm using (see node-canvas) allows me to capture a JPEG of the entire canvas surface at any given moment. Unfortunately, the input will only be submitted once I end the STDIN, which is not what I want. Instead of processing all the input in a batch, I would like to process incoming JPEGs as I go, so everything can be done live. This is the code snippet that I used to achieve the functionality in question (which unfortunately doesn't work) :

    


    // patches/canvas.js
const { Canvas } = require('canvas');
const execa = require('execa');
const $ffmpeg = require('ffmpeg-static');

Canvas.prototype.captureStream = function captureStream(frameRate = 24) {
  const refreshRate = 1000 / frameRate;

  const encoding = execa($ffmpeg, [
    '-f', 'image2pipe',
    '-r', frameRate,
    '-vcodec', 'mjpeg',
    '-s', `${this.width}x${this.height}`,
    '-i', '-',
    '-vcodec', 'libx264',
    '-preset', 'veryfast',
    '-crf', '18',
    '-pix_fmt', 'yuv420p',
    '-b:v', '500k',
    '-bufsize', '600k',
    '-vprofile', 'baseline',
    '-tune', 'zerolatency',
    '-g', '60',
    '-r', frameRate,
    '-s', `${this.width}x${this.height}`,
    '-f', 'rawvideo',
    '-',
  ], {
    stdio: 'pipe',
  });

  let lastFeed = Date.now();

  const feed = () => {
    const jpegStream = this.jpegStream();

    jpegStream.on('data', (data) => {
      encoding.stdin.push(data);
    });

    jpegStream.on('end', () => {
      const now = Date.now();
      const timeSpan = Math.max(refreshRate - (now - lastFeed), 0);
      lastFeed = now;

      setTimeout(feed, timeSpan);
    });
  };

  feed();

  return encoding.stdout;
};

module.exports = require('canvas');


    


    Any suggestions on how to make it work ?

    


  • Download billboard hot 100 (but only 50) mp3 files

    4 mars 2021, par Atlas

    Yo yo yo. I got this insane idea to get 50 of the billboard hot 100 songs, download them into mp3 files, and then put them on private online radio.

    


    Problem is, the way I do it doesn't download each file one by one, it puts all the music together in one mp3 file. Here's my code so far (terrible, I know... I just wanna throw this together really quickly)

    


    const { getChart } = require("billboard-top-100");
const ffmpeg = require("fluent-ffmpeg");
const { mkdir } = require("fs");
const ytdl = require("ytdl-core");
const YT = require("scrape-youtube").default;

getChart('hot-100', (err, chart) => {
    if(err) console.log(err);
    chart.songs.length = 50;
    for (var i = 0; i < chart.songs.length; i++) {
        var song = chart.songs[i];
        song.artist = song.artist.replace("Featuring", "feat.");
        var name = `${song.artist} - ${song.title}`;
        YT.search(name).then(res => {
            downloadVideo(res.videos[0].link, name).then(_ => { console.log(""); }).catch(console.log);
        }).catch(err => console.log(err));
    };
});

function downloadVideo(url, name) {
    return new Promise((resolve, reject) => {
        var stream = ytdl(url, { filter: "audioonly", quality: "highestaudio" });
        var start = Date.now();

        ffmpeg(stream)
            .audioBitrate(128)
            .save(`${__dirname}/${new Date().getWeek()}/${name}.mp3`)
            .on("end", _ => {
                console.log(`Downloaded "${name}.mp3" - Took ${(Date.now() - start) / 1000} seconds.`);
                resolve(`${name}.mp3`);
            })
            .on("error", _ => reject("something went wong"));
    });
}

Date.prototype.getWeek = function() {
  var onejan = new Date(this.getFullYear(),0,1);
  return Math.ceil((((this - onejan) / 86400000) + onejan.getDay()+1)/7);
}


    


  • avdevice/decklink_dec : mark get_frame_timecode and get_bmd_timecode static

    6 janvier 2021, par Christopher Degawa
    avdevice/decklink_dec : mark get_frame_timecode and get_bmd_timecode static
    

    The function is not used anywhere else and is causing mingw-w64 clang
    builds to fail with

    ffmpeg-git/libavdevice/decklink_dec.cpp:792:5 : error : no previous prototype for function 'get_bmd_timecode' [-Werror,-Wmissing-prototypes]
    int get_bmd_timecode(AVFormatContext *avctx, AVTimecode *tc, AVRational frame_rate, BMDTimecodeFormat tc_format, IDeckLinkVideoInputFrame *videoFrame)

    Signed-off-by : Christopher Degawa <ccom@randomderp.com>
    Signed-off-by : Marton Balint <cus@passwd.hu>

    • [DH] libavdevice/decklink_dec.cpp