Recherche avancée

Médias (2)

Mot : - Tags -/map

Autres articles (90)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

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

Sur d’autres sites (11040)

  • Input FFMPEG subprocess to FFMPEG RTMP stream in python ?

    12 mai 2021, par Guiso

    I managed to stream frames of a video to the RTMP server but I also want to stream the audio - for that I can't use the rawvideo format and now I don't know how many bytes are required for the ffmpeg video to send to the ffmpeg stream.

    


    If there is an easier way to do this I would much prefer it, I tried my best in making comments so that the code is understandable.

    


    WIDTH = 1152
HEIGHT = 720
RTMP = ""
#Returns frame of a video
def read_frame(process1, width, height):
    frame_size = width * height * 3 #<--- I don't know how many bytes should I ask for.
    in_bytes = process1.stdout.read(frame_size)
    if len(in_bytes) == 0:
        return []
    else:
        assert len(in_bytes) == frame_size
        frame = (
            np
            .frombuffer(in_bytes, np.uint8)
            .reshape([height, width, 3])
        )
    return frame


def getVideoOutput(in_filename):
    args = (
        ffmpeg
        .input(in_filename # Path to file
        ,loglevel="quiet"#Don't show ffmpegs logs
        )
        .output('pipe:', format='flv')#Outputs a pipe
        .compile()
    )
    return subprocess.Popen(args, stdout=subprocess.PIPE)

#Start stream
def startStream(width, height):
    args = (
        ffmpeg
        .input('pipe:', #Sats to ffmpeg that the input is a stream
        format='flv'#Format of the video
        ,r="30"#Sets average fps
        ,s='{}x{}'.format(width, height)#Set the width and height of the input
        ,loglevel="quiet" #Don't show ffmpegs logs 
        )
        .output(RTMP,vcodec="libx264",preset="ultrafast",acodec="aac",format="flv")
        .overwrite_output()
        .compile()
    )
    return subprocess.Popen(args, stdin=subprocess.PIPE)

#Writes frame to the stream
def write_frame(process2, frame):
    process2.stdin.write(
        frame
        .astype(np.uint8)
        .tobytes()
    )

#Gets frames from multiple videos
def getBytes():
    for video in os.listdir(".\\Videos"):#Loops through videos in the videos folder 
    #while True:
        #video = os.listdir(".\\Videos")[0]
        videoPath = os.path.join(pathlib.Path().absolute(),"Videos",video)
        pipe = getVideoOutput(videoPath) #Get a stream of bytes from the video
        while True:
            frame = read_frame(pipe,WIDTH,HEIGHT)#Get a frame
            if frame == []:#If the video ends Go to the next one
                break
            yield frame#return the frame


stream = startStream(WIDTH,HEIGHT)#Starts stream to server and outputs a subprocess
FrameGenerator = getBytes()#Start generator

while True:
    write_frame(stream,next(FrameGenerator))#infinite loop writes to the stream a frame


    


  • Discord bot stop playing music in random time of song

    25 janvier 2021, par Jusmejtr

    I have a discord to let me play a random song from the list.

    


    How bot works :
Bot IS connected to firestore Cloud (firebase) where i have economy data from my server. Price for playing random song is 75 coins.

    


    Everything worked as it should, but yesterday I used command, the bot started playing and after a while it stopped playing music and also no other commands worked, bot probably get freezed.

    


    I have no errors in the console until after a minute it showed me this error.

    


    https://pastebin.com/ay9gV75T

    


    The bot is hosted on Heroku and I also added this buildpack to ffmpeg in the settings.

    


    https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest

    


    This is my code :

    


    module.exports = {
    name: "buy-music",
    description: "buy a music",

    async execute(message, config, db){
        const PREFIX = (config.prefix);

        if(message.content === PREFIX + "buy music"){
            const ytdl = require("ytdl-core");
            message.delete();
            let uzivatel = message.author.tag;

            let voiceChannel = message.member.voice.channel;
            if(!voiceChannel) return message.reply("Musíš byť vo voice roomke");

            let cena = 75;
    
            db.collection('economy').doc(uzivatel).get().then(async (q) => {
                if(!q.exists) return message.reply("Nemáš vytvorený účet");
                var hodnota = q.data().money;
                if(hodnota < cena) return message.reply("Nemáš dostatok financií");

                db.collection('statusy').doc('music').get().then(async (asaj) => {
                    let stav = asaj.data().stav;
                    if(stav == "off"){
                        db.collection('statusy').doc('music').update({
                            "stav": "on",
                            "autor": message.author.tag,
                        });
                        hodnota -= cena;
                        db.collection('economy').doc(uzivatel).update({
                            'money': hodnota
                        });
                        function randomhraj(){
                            var pole = [
                     My YT links

                            ]
                            let rnd = Math.floor(Math.random() * pole.length);
                            let output = pole[rnd];
                            return output;
                        }
        
                        try{
                            var pripojenie = await voiceChannel.join();
                            message.reply(`Úspešne si si kúpil chuťovečku`);
                        }catch(error){
                            console.log(`Error pri pripajani do room (music join) ${error}`);
                        }
                        
                        const dispatcher = pripojenie.play(ytdl(randomhraj())).on("finish", async() => {
                            await voiceChannel.leave();
                            await db.collection('statusy').doc('music').update({
                                "stav": "off",
                                "autor": "nikto",
                            });
                        }).on("error", error => {
                            console.log(error)
                        })
                        dispatcher.setVolumeLogarithmic(5 / 5)
                    }else{
                        message.reply("Momentálne si hudbu kúpil niekto iný alebo ak si hudbu kúpil a chceš ju zastaviť použi príkaz *stop");
                    }
                    
                });
            });
    
        }else if(message.content === PREFIX + "stop"){
            message.delete();
            db.collection('statusy').doc('music').get().then((n) => {
                let kto = n.data().autor;
                let meno = message.author.tag;
                if(!message.member.voice.channel) return message.channel.send("Musíš byť vo voice roomke pre stopnutie hudby");
                if(kto == meno){
                    message.member.voice.channel.leave();
                    message.channel.send("Úspešne odpojený");
                    db.collection('statusy').doc('music').update({
                        "stav": "off",
                        "autor": "nikto",
                    });
                }else{
                    message.reply("Zastaviť hudbu môže len ten kto si ju kúpil");
                }
            });
        }
        
    }
}


    


  • Getting error "WebAssembly.Memory() : could not allocate memory" when running ffmpeg.wasm on android chrome browser

    27 juin 2022, par Ravi Kundu

    Error in detail :

    


    WebAssembly.Memory(): could not allocate memory
at https://*******/ffmpeg-core.js:22:82
at https://*******/ffmpeg.min.js:1:6506
at f (https://*******/ffmpeg.min.js:1:11322)
at Generator._invoke (https://*******/ffmpeg.min.js:1:11110)
at Generator.next (https://*******/ffmpeg.min.js:1:11747)
at i (https://*******/ffmpeg.min.js:1:4295)
at c (https://*******/ffmpeg.min.js:1:4498)


    


    Code for ffmpeg :

    


    const downloadWithFFMPEG = async () =>{
  const sourceBuffer = await fetch(recordingURL).then(r => r.arrayBuffer());
  await ffmpeg.load();
  await ffmpeg.FS(
    "writeFile",
    "input.webm",
    new Uint8Array(sourceBuffer, 0, sourceBuffer.byteLength)
  );
  await ffmpeg.run("-i", "input.webm", "-c", "copy", "output.mp4")
  const output = ffmpeg.FS("readFile", "output.mp4");
  var link = document.createElement('a')
  link.href = URL.createObjectURL(new Blob([output.buffer], { type: 'video/mp4;codecs=H264' }));
  link.download = this.data;
  link.click();
  recording = false;
}


    


    Brief about problem :
The error only comes for android chrome browser. The same code works fine on pc/laptop chrome.
Have also enabled Webassembly-thread on chrome ://flags for android browser as someone suggested me to do it but still same error. Can someone help me ?