Recherche avancée

Médias (1)

Mot : - Tags -/biomaping

Autres articles (89)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Mediabox : ouvrir les images dans l’espace maximal pour l’utilisateur

    8 février 2011, par

    La visualisation des images est restreinte par la largeur accordée par le design du site (dépendant du thème utilisé). Elles sont donc visibles sous un format réduit. Afin de profiter de l’ensemble de la place disponible sur l’écran de l’utilisateur, il est possible d’ajouter une fonctionnalité d’affichage de l’image dans une boite multimedia apparaissant au dessus du reste du contenu.
    Pour ce faire il est nécessaire d’installer le plugin "Mediabox".
    Configuration de la boite multimédia
    Dès (...)

  • 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 (8154)

  • "Cannot read property 'url' of undefined" even though it's already defined

    28 novembre 2020, par Levi Stancz

    I'm making a Discord music Bot and I'm having trouble with an error saying

    


    TypeError: Cannot read property 'url' of undefined


    


    I tried console logging it and it showed me the url, so I don't understand what is the problem with my code.

    


    Here's my code :

    


    //musicBOT
const Discord = require('discord.js');
const client = new Discord.Client();
const ytdl = require('ytdl-core');
const mcPrefix = '.';

const queue = new Map();

client.on('ready', () => console.log('Music bot ready!'));

client.on('message', async message => {
    if(message.author.bot) return;
    if(!message.content.startsWith(mcPrefix)) return;

    const args = message.content.substring(mcPrefix.length).split(" ");
    const serverQueue = queue.get(message.guild.id);

    if(message.content.startsWith(`${mcPrefix}play`)) {

        const voiceChannel = message.member.voice.channel;
        if(!voiceChannel) return message.channel.send("Hang-szobában kell lenned zenelejátszáshoz.");
        const permissions = voiceChannel.permissionsFor(message.client.user);
        if(!permissions.has('CONNECT')) return message.channel.send("Nincs jogosultságom csatlakozni a hangszobához.");
        if(!permissions.has('SPEAK')) return message.channel.send("Nincs jogosultságom megszólalni ebben a hangszobában.");

        const songInfo = await ytdl.getInfo(args[1])
        const song = {
            title: songInfo.title,
            url: songInfo.videoDetails.video_url
        }

        if(!serverQueue) {
            const queueConstruct = {
                textChannel: message.channel,
                voiceChannel: voiceChannel,
                connection: null,
                songs: [],
                volume: 5,
                playing: true
            }
            queue.set(message.guild.id, queueConstruct)

            queueConstruct.songs.push(song)

            try{
                var connection = await voiceChannel.join();
                message.channel.send(`${song.title} lejátszása.`)
                queueConstruct.connection = connection
                play(message.guild, queueConstruct.songs[0])
            }catch(e){
                console.log(`Hiba csatlakozás közben itt: ${e}`);
                queue.delete(message.guild.id)
                return message.channel.send(`Hiba volt a csatlakozás közben itt: ${e}`)
            }
        } else{
            serverQueue.songs.push(song)
            return message.channel.send(`**${song.title}** hozzáadva a lejátszási listához.`)
        }
        return undefined
        

        
    }else if (message.content.startsWith(`${mcPrefix}stop`)) {
        if(!message.member.voice.channel) return message.channel.send("Hang-szobában kell lenned ahhoz, hogy leállítsd a zenét.")
        if(!serverQueue) return message.channel.send("There is nothing playing")
        serverQueue.songs= []
        serverQueue.connection.dispatcher.end()
        message.channel.send("Sikeresen megálltottad a zenét.")
        return undefined
    }else if(message.content.startsWith(`${mcPrefix}skip`)){
        if(!message.member.voice.channel) return message.channel.send("Hang-szobában kell lenned a skip parancshoz.")
        if(!serverQueue) return message.channel.send("There is nothing playing")
        serverQueue.connection.dispatcher.end()
        message.channel.send("Zene továbbléptetve.")
        message.channel.send(`${song.title} játszása.`)
        
        return undefined
    }

    function play(guild, song) {
        const serverQueue = queue.get(guild.id)
    
        if(!serverQueue.songs){
            serverQueue.voiceChannel.leave()
            queue.delete(guild.id)
            return
        }
    
        const dispatcher = serverQueue.connection.play(ytdl(song.url))
            .on('finish', () => {
                serverQueue.songs.shift()
                play(guild, serverQueue.songs[0])
            })
            .on('error', error => {
                console.log(error)
            })
            dispatcher.setVolumeLogarithmic(serverQueue.volume / 5)
    }

})
//musicBOT


    


    and here is the full error :

    


    const dispatcher = serverQueue.connection.play(ytdl(songInfo.url))&#xA;                                                                     ^&#xA;TypeError: Cannot read property &#x27;url&#x27; of undefined&#xA;    at play (C:\Users\Levi\Desktop\Discord BOT Javascript\bot.js:97:70)&#xA;    at StreamDispatcher.<anonymous> (C:\Users\Levi\Desktop\Discord BOT Javascript\bot.js:100:17)&#xA;    at StreamDispatcher.emit (node:events:388:22)&#xA;    at finish (node:internal/streams/writable:734:10)&#xA;    at processTicksAndRejections (node:internal/process/task_queues:80:21)&#xA;</anonymous>

    &#xA;

    I started searching on the internet but found nothing about it, I guess my basic javascript knowledge is just not enough.

    &#xA;

  • ffmpeg hangs when muxing longer videos

    11 août 2020, par 492357816

    I am using ffmpeg with Janus WebRTC server for muxing video conference recordings. For video conferences under approximaately 5 minutes duration, existing code works well. If the source files are longer than that the process appears to hang without returning either an error or a completed file.&#xA;Any advice/suggestions would be most welcome.

    &#xA;

        var recordingsPath = exports.recordingsPath;&#xA;    var videoRecordingPath = `${recordingsPath}/${filename}-video.mjr`;&#xA;    var audioRecordingPath = `${recordingsPath}/${filename}-audio.mjr`;&#xA;    var videoOutputPath = `${recordingsPath}/${filename}-output1.mp4`;&#xA;    var audioOutputPath = `${recordingsPath}/${filename}-output1.wav`;&#xA;    var finalOutputPath = `${recordingsPath}/${filename}-final.mp4`;&#xA;    var rawConverterPath = "/opt/janus/bin/janus-pp-rec";&#xA;    var audioRecordingByteSize = exports.getFileSizeInBytes(audioRecordingPath);&#xA;    var audioIsValid = audioRecordingByteSize > 8;&#xA;&#xA;    if (audioIsValid) {&#xA;        //turn audio and video mjr files into .wav and mp4 respectively&#xA;        exports.runBashSync([ rawConverterPath, videoRecordingPath, videoOutputPath]);&#xA;        exports.runBashSync([ rawConverterPath, audioRecordingPath, audioOutputPath]);&#xA;        return exports.mergeMp4AndWav(&#xA;            audioOutputPath, videoOutputPath, finalOutputPath&#xA;        ).then(function(result) {&#xA;            // remove source data for audio &amp; video&#xA;            exports.runBashSync([ "rm", audioOutputPath]);&#xA;            exports.runBashSync([ "rm", videoOutputPath]);&#xA;            exports.runBashSync([ "rm", audioRecordingPath]);&#xA;            exports.runBashSync([ "rm", videoRecordingPath]);&#xA;        });&#xA;    } else {&#xA;        // handle cases where audio is not available&#xA;        feedback("no audio");&#xA;        return new Promise(function(resolve) {&#xA;            exports.runBashSync([ rawConverterPath, videoRecordingPath, finalOutputPath], true);&#xA;            if (Number.isInteger(audioRecordingByteSize)) {&#xA;                exports.runBashSync([ "rm", audioRecordingPath]);&#xA;            }&#xA;            exports.runBashSync([ "rm", videoRecordingPath]);&#xA;            resolve(true);&#xA;        });&#xA;    }&#xA;};&#xA;&#xA;exports.joinMp4s = function(mp4Filenames, outputPath) {&#xA;    feedback("joining mp4s");&#xA;    if (mp4Filenames.length === 1) {&#xA;        feedback("single-stream case");&#xA;        exports.runBashSync(["mv", mp4Filenames[0], outputPath]);&#xA;        return new Promise(function(resolve) { resolve(true); });&#xA;    }&#xA;    feedback("multi-stream case");&#xA;    var joinCmd = ["ffmpeg"];&#xA;    mp4Filenames.forEach(function(filename) {&#xA;        joinCmd.push(`-i ${filename}`);&#xA;    });&#xA;    joinCmd.push("-strict -2");&#xA;    var totalHeight = 960;&#xA;    var totalWidth = 1280;&#xA;&#xA;    joinCmd.push(`-filter_complex "color=size=${totalWidth}x${totalHeight}:c=Black [base];`);&#xA;&#xA;    // var numStrms = mp4Filenames.length;&#xA;    var streamsPattern = exports.setStreamsPattern(mp4Filenames);&#xA;    var strmHeight = streamsPattern.height;&#xA;    var strmWidth = streamsPattern.width;&#xA;    var strmDmns = `${strmWidth}x${strmHeight}`;&#xA;    feedback("streamDimensions: " &#x2B; strmDmns);&#xA;&#xA;    var i;&#xA;    for (i = 0; i &lt; mp4Filenames.length; i&#x2B;&#x2B;) {&#xA;        joinCmd.push(`[${i}:v] setpts=PTS-STARTPTS, scale=${strmDmns} [temp${i}];`);&#xA;    }&#xA;    for (i = 0; i &lt; mp4Filenames.length; i&#x2B;&#x2B;) {&#xA;        var xCoord;&#xA;        var yCoord;&#xA;        if (i === 0) {&#xA;            xCoord = streamsPattern.coords[i].xCoord;&#xA;            yCoord = streamsPattern.coords[i].yCoord;&#xA;            joinCmd.push(`[base][temp${i}] overlay=shortest=1:x=${xCoord}:y=${yCoord} [tmp${i &#x2B; 1}];`);&#xA;            // joinCmd.push(`[base][temp${i}] overlay=shortest=1 [tmp${i &#x2B; 1}];`);&#xA;        } else {&#xA;            var cmd = `[tmp${i}][temp${i}] overlay=shortest=1`;&#xA;            xCoord = streamsPattern.coords[i].xCoord;&#xA;            yCoord = streamsPattern.coords[i].yCoord;&#xA;&#xA;            if (xCoord) { cmd &#x2B;= ":x=" &#x2B; xCoord; }&#xA;            if (yCoord) { cmd &#x2B;= ":y=" &#x2B; yCoord; }&#xA;&#xA;            if (i &#x2B; 1 !== mp4Filenames.length) { cmd &#x2B;= ` [tmp${i &#x2B; 1}];`; }&#xA;            joinCmd.push(cmd);&#xA;        }&#xA;    }&#xA;&#xA;    joinCmd.push(`" ${outputPath}`);&#xA;    feedback("join command: " &#x2B; joinCmd);&#xA;    return exports.runBashAsync(joinCmd).then(function(result) {&#xA;&#xA;        mp4Filenames.forEach(function(filename) {&#xA;            feedback("removing: " &#x2B; filename);&#xA;            exports.runBashSync(`rm ${filename}`);&#xA;        });&#xA;    });&#xA;};&#xA;&#xA;

    &#xA;

  • (Folderwide) Bulk conversion in ffmpeg to a H264 codec

    5 mars 2021, par Habboman

    So I was trying to get a hang of ffmpeg but I am not very good at it. I am trying to get all .mkv files converted to .m4v with a H264 codec. From another project I know that the h264_cuvid decoder worked perfectly well for my needs. I also checked via ffmpeg -decoders that I wrote it correctly. So the windows-batchfile (I frankenstein-ed together from other forums) looks like this :

    &#xA;

    for %%a in ("*.mkv") do ffmpeg -i "%%a" -c:v h264_cuvid -preset fast -crf 20 -b:v 128k "newfiles\%%~na.m4v"&#xA;pause&#xA;

    &#xA;

    What I get is sadly only :

    &#xA;

    &#xA;

    unknown encoder 'h264_cuvid'

    &#xA;

    &#xA;

    How do I solve this ?

    &#xA;

    If it is easier to start from scratch following is what I am trying to achieve

    &#xA;

    I am pretty new to this whole conversion/coding thing. I got a raspberry pi as a homeserver for my video files. Sadly it can only direct stream correctly encoded files (H.264), otherwise the Pi is trying to encode the videos itself (what causes buffering). So I am trying to find a solution to throw my whole library into a folder and convert it to a usable format.

    &#xA;