Recherche avancée

Médias (1)

Mot : - Tags -/MediaSPIP

Autres articles (21)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

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

  • "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;

  • Why does my nginx endpoint streaming audio via ffmpeg fail with "An unexpected TLS packet was received"

    6 décembre 2020, par rajaman0

    I'm using nginx to proxy requests to a flask/gunicorn API. For most of my endpoints, it works perfectly - however, I have one endpoint which serves an audio response (through ffmpeg) which doesn't seem to work no matter what I try. Running everything through docker.

    &#xA;

    Here's my nginx config :

    &#xA;

    server {&#xA;  listen $PORT;&#xA;  root /usr/share/nginx/html;&#xA;  index index.html index.html;&#xA;&#xA;  access_log /var/log/nginx/reverse-access.log;&#xA;  error_log /var/log/nginx/reverse-error.log;&#xA;&#xA;  location / {&#xA;    try_files $uri /index.html =404;&#xA;  }&#xA;&#xA;  location /api/stream_audio_file {&#xA;    proxy_pass          http://backend;&#xA;    proxy_http_version  1.1;&#xA;    proxy_set_header    Connection "keep-alive";&#xA;    proxy_set_header    Host $host;&#xA;&#xA;    proxy_set_header    X-Real-IP $remote_addr;&#xA;    proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;&#xA;    proxy_set_header    X-Forwarded-Host $server_name;&#xA;  }&#xA;

    &#xA;

    Here's the core of the python code for http://backend/api/stream_audio_file (run through flask, gunicorn)

    &#xA;

    ffmpeg_options =  [&#x27;-i&#x27;, &#x27;https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3&#x27;]&#xA;ffmpeg_options &#x2B;= ["-f", "mp3"]&#xA;ffmpeg_options &#x2B;= ["-to", &#x27;00:00:02.000&#x27;]&#xA;ffmpeg_options &#x2B;= ["-vn"]&#xA;ffmpeg_options &#x2B;= ["-ab",  "256k"]&#xA;ffmpeg_options &#x2B;= ["-strict", "-2"]&#xA;ffmpeg_options &#x2B;= ["-loglevel", "trace"]&#xA;p = Popen(["ffmpeg"] &#x2B; ffmpeg_options &#x2B; ["-"],&#xA;                      stdout=PIPE)&#xA;max_bytes = 256000&#xA;output = p.stdout.read(max_bytes)&#xA;return Response(output, headers={&#xA;     "Content-Type": "audio/mp3",&#xA;     "icy-name": yt_info[&#x27;title&#x27;].encode(&#x27;latin-1&#x27;, &#x27;ignore&#x27;),&#xA;     "icy-bitrate": "256",&#xA;     "ice-audio-info": "bitrate=256",&#xA;     "Cache-Control": "no-cache"&#xA;})&#xA;

    &#xA;

    When I test out this endpoint, I've pasted the full ffmpeg logs here : https://pastebin.com/wMMpmL6M&#xA;Of import, it seems to fetch the mp3 url appropriately but fails with error :

    &#xA;

    [tls @ 0x555bf3011a80] An unexpected TLS packet was received.&#xA;https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3: I/O error&#xA;[out_0_0 @ 0x555bf302ab00] EOF on sink link out_0_0:default.&#xA;No more output streams to write to, finishing.&#xA;

    &#xA;

    I've tried quite a few things :

    &#xA;

      &#xA;
    1. This endpoint works without nginx. I tried querying just the endpoint running w/ just gunicorn, and responses are streamed back correctly. Thus the error HAS to be nginx related ?
    2. &#xA;

    3. The error being TLS related is confusing - I've tried setting up nginx w/ ssl on and adding certs, but that doesn't help / change the error in any way.
    4. &#xA;

    5. I've tried playing around with headers in both nginx and on the python side, following some of the examples here : https://www.nginx.com/resources/wiki/start/topics/examples/x-accel/. Doesn't work.
    6. &#xA;

    7. Response(stream_with_context(..) in flask doesn't work either.
    8. &#xA;

    9. Don't know much about nginx, but tried some other suggestions e.g. buffering / no buffering through nginx, etc, nothing seems to work :(.
    10. &#xA;

    11. When I ssh into my docker container, and run the same ffmpeg command ffmpeg -i https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3 -f mp3 -to 00:00:02.000 -vn -ab 256k -strict -2 -loglevel trace outside of the request context, it works !
    12. &#xA;

    13. Tried compiling ffmpeg with both openssl and gnutls, neither works. However : the openssl version fails w/&#xA;tls @ error:1408F1BB:SSL routines:ssl3_get_record:bad record type instead.
    14. &#xA;

    &#xA;

    Please let me know what other debugging info would be helpful / if anyone has any hypothesis I can test out.

    &#xA;

  • FFMPEG, macOS Catalina : "ffmpeg stderr : /private/tmp/com.apple.launchd.ID/org.macosforge.xquartz:0 : Operation not supported on socket"

    11 février 2021, par Bogdan Slyusarenko

    I'm trying to record selenium test run with FFMPEG, for automation testing of web extensions (selenium+js/ts).&#xA;FFMPEG initiated by command :

    &#xA;

        const { spawn } = require("child_process");&#xA;        ffmpeg = spawn("ffmpeg", [&#xA;          "-x265-params",&#xA;          "-f",&#xA;          "xcbgrab", &#xA;          "-video_size",&#xA;          "1280x1024", &#xA;          "-i",&#xA;          process.env.DISPLAY, // "/private/tmp/com.apple.launchd.ID/org.macosforge.xquartz:0"&#xA;          "-loglevel",&#xA;          "debug", &#xA;          "-y", &#xA;          "-pix_fmt",&#xA;          "yuv420p",&#xA;          videoPath, &#xA;        ]);&#xA;

    &#xA;

    Return constantly error,related to process.DISPLAY, I'm not sure why it's so :

    &#xA;

        ffmpeg stderr: /private/tmp/com.apple.launchd.W851FkeNXz/org.macosforge.xquartz:0: Operation not supported on socket&#xA;

    &#xA;

    Full debug login is :

    &#xA;

    ffmpeg stderr: ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers&#xA;ffmpeg stderr:   built with Apple clang version 12.0.0 (clang-1200.0.32.28)&#xA;ffmpeg stderr:   configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.1_9 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack&#xA;ffmpeg stderr: libavutil      56. 51.100 / 56. 51.100&#xA;ffmpeg stderr:   libavcodec     58. 91.100 / 58. 91.100&#xA;ffmpeg stderr:   libavformat    58. 45.100 / 58. 45.100&#xA;ffmpeg stderr:   libavdevice    58. 10.100 / 58. 10.100&#xA;ffmpeg stderr:   libavfilter     7. 85.100 /  7. 85.100&#xA;ffmpeg stderr:   libavresample   4.  0.  0 /  4.  0.  0&#xA;ffmpeg stderr:   libswscale      5.  7.100 /  5.  7.100&#xA;ffmpeg stderr:   libswresample   3.  7.100 /  3.  7.100&#xA;ffmpeg stderr:   libpostproc    55.  7.100 / 55.  7.100&#xA;ffmpeg stderr: Splitting the commandline.&#xA;ffmpeg stderr: Reading option &#x27;-x265-params&#x27; ...&#xA;ffmpeg stderr: matched as AVOption &#x27;x265-params&#x27; with argument &#x27;-f&#x27;.&#xA;ffmpeg stderr: Reading option &#x27;xcbgrab&#x27; ...&#xA;ffmpeg stderr: matched as output url.&#xA;ffmpeg stderr: Reading option &#x27;-video_size&#x27; ...&#xA;ffmpeg stderr: matched as AVOption &#x27;video_size&#x27; with argument &#x27;1280x1024&#x27;.&#xA;ffmpeg stderr: Reading option &#x27;-i&#x27; ... matched as input url with argument &#x27;/private/tmp/com.apple.launchd.W851FkeNXz/org.macosforge.xquartz:0&#x27;.&#xA;ffmpeg stderr: Reading option &#x27;-loglevel&#x27; ... matched as option &#x27;loglevel&#x27; (set logging level) with argument &#x27;debug&#x27;.&#xA;ffmpeg stderr: Reading option &#x27;-y&#x27; ...&#xA;ffmpeg stderr: matched as option &#x27;y&#x27; (overwrite output files) with argument &#x27;1&#x27;.&#xA;ffmpeg stderr: Reading option &#x27;-pix_fmt&#x27; ... matched as option &#x27;pix_fmt&#x27; (set pixel format) with argument &#x27;yuv420p&#x27;.&#xA;ffmpeg stderr: Reading option &#x27;/Volumes/MacHD2/Upprojects/TEST/log/Checkout-Google.com-Search-on-Google.mp4&#x27; ... matched as output url.&#xA;ffmpeg stderr: Finished splitting the commandline.&#xA;ffmpeg stderr: Parsing a group of options: global .&#xA;ffmpeg stderr: Applying option loglevel (set logging level) with argument debug.&#xA;ffmpeg stderr: Applying option y (overwrite output files) with argument 1.&#xA;ffmpeg stderr: Successfully parsed a group of options.&#xA;ffmpeg stderr: Parsing a group of options: input url /private/tmp/com.apple.launchd.W851FkeNXz/org.macosforge.xquartz:0.&#xA;ffmpeg stderr: Successfully parsed a group of options.&#xA;ffmpeg stderr: Opening an input file: /private/tmp/com.apple.launchd.W851FkeNXz/org.macosforge.xquartz:0.&#xA;ffmpeg stderr: [NULL @ 0x7fcf80016800] Opening &#x27;/private/tmp/com.apple.launchd.W851FkeNXz/org.macosforge.xquartz:0&#x27; for reading&#xA;ffmpeg stderr: [file @ 0x7fcf7f507a00] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;ffmpeg stderr: /private/tmp/com.apple.launchd.W851FkeNXz/org.macosforge.xquartz:0: Operation not supported on socket&#xA;&#xA;

    &#xA;

    Any feedback appreciated

    &#xA;