Recherche avancée

Médias (91)

Autres articles (81)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

Sur d’autres sites (11072)

  • How can I merge intro.mp4, image.png, music.mp3 in one command ?

    10 décembre 2020, par Dtomper

    Hi I want to make a simple music video where an intro plays then an image shows up while the song is playing in the background.

    


    I have this command that mixes the song and the image, all I need now is the intro playing at the beginning :

    


    ffmpeg -r 1 -loop 1 -y -i image.png -i music.mp3 -c:a copy -r 1 -vcodec libx264 -shortest mix.mp4


    


  • 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);
}


    


  • Unable to use Multithread for librosa melspectrogram

    15 avril 2019, par Raven Cheuk

    I have over 1000 audio files (it’s just a initial development, in the future, there will be even more audio files), and would like to convert them to melspectrogram.

    Since my workstation has a Intel® Xeon® Processor E5-2698 v3, which has 32 threads, I would like to use multithread to do my job.

    My code

    import os
    import librosa
    from librosa.display import specshow
    from natsort import natsorted
    import numpy as np
    import sys
    # Libraries for multi thread
    from multiprocessing.dummy import Pool as ThreadPool
    import subprocess
    pool = ThreadPool(20)

    songlist = os.listdir('../opensmile/devset_2015/')
    songlist= natsorted(songlist)

    def get_spectrogram(song):
       print("start")
       y, sr = librosa.load('../opensmile/devset_2015/' + song)

       ## Add some function to cut y
       y_list = y
       ##

       for i, y_i in enumerate([y_list]): # can remove for loop if no audio is cut
           S = librosa.feature.melspectrogram(y=y, sr=sr, n_mels=128,fmax=8000)
           try:
               np.save('./Test/' + song + '/' + str(i), S)
           except:
               os.makedirs('./Test/' + song)
               np.save('./Test/' + song + '/' + str(i), S)
           print("done saving")

    pool.map(get_spectrogram, songlist)

    My Problem

    However, my script freezes after finished the first conversion.

    To debug what’s going on, I commented out S = librosa.feature.melspectrogram(y=y, sr=sr, n_mels=128,fmax=8000) and replace it by S=0.
    Then the multi-thread code works fine.

    What’s wrong with the librosa.feature.melspectrogram function ? Does it not support multi-thread ? Or is it a problem of ffmpeg ? (When using librosa, it asks me to install ffmpeg before.)