Recherche avancée

Médias (91)

Autres articles (40)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Possibilité de déploiement en ferme

    12 avril 2011, par

    MediaSPIP peut être installé comme une ferme, avec un seul "noyau" hébergé sur un serveur dédié et utilisé par une multitude de sites différents.
    Cela permet, par exemple : de pouvoir partager les frais de mise en œuvre entre plusieurs projets / individus ; de pouvoir déployer rapidement une multitude de sites uniques ; d’éviter d’avoir à mettre l’ensemble des créations dans un fourre-tout numérique comme c’est le cas pour les grandes plate-formes tout public disséminées sur le (...)

Sur d’autres sites (5132)

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

  • How can i use ffmpeg to add voice note to another mp3 at specific time , let everything play without reducing the original mp3

    29 juin 2020, par Adike maduabuchi

    I have used some code which does not give me what I want, I used PHP shell to execute the code

    


                 $var = 'ffmpeg -y -i ' . $voice_note_tag . ' -i ' . $original_music_path . '  -filter_complex "[0]asplit[a][b]; [a]atrim=duration=' . $time_come_vioce . ',volume=\'1-max(0*(t-1),0)\':eval=frame[pre];  [b]atrim=start=' . $time_come_vioce . ',asetpts=PTS-STARTPTS[song];  [song][1]amix=inputs=2:duration=first:dropout_transition=2[post]; [pre][post]concat=n=2:v=0:a=1[mixed]"  -map "[mixed]" ' . $output . ' 2>&1';
                            shell_exec($var);