Recherche avancée

Médias (1)

Mot : - Tags -/école

Autres articles (38)

  • Gestion générale des documents

    13 mai 2011, par

    MédiaSPIP ne modifie jamais le document original mis en ligne.
    Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
    Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)

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

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (5650)

  • How can i stream through ffmpeg a canvas generated in Node.js to youtube/any other rtmp server ?

    10 octobre 2020, par DDC

    i wanted to generate some images in Node.JS, compile them to a video and stream them to youtube. To generate the images i'm using the node-canvas module. This sounds simple enough, but i wanted to generate the images continuously, and stream the result in realtime. I'm very new to this whole thing, and what i was thinking about doing, after reading a bunch of resources on the internet was :

    


      

    1. Open ffmpeg with spawn('ffmpeg', ...args), setting the output to the destination rtmp server
    2. 


    3. Generate the image in the canvas
    4. 


    5. Convert the content of the canvas to a buffer, and write it to the ffmpeg process through stdin
    6. 


    7. Enjoy the result on Youtube
    8. 


    


    But it's not as simple as that, is it ? I saw people sharing their code involving client-side JS running on the browser, but i wanted it to be a Node app so that i could run it from a remote VPS.
Is there a way for me to do this without using something like p5 in my browser and capturing the window to restream it ?
Is my thought process even remotely adequate ? For now i don't really care about performance/resources usage. Thanks in advance.

    


    EDIT :

    


    I worked on it for a bit, and i couldn't get it to work...
This is my code :

    


    const { spawn } = require('child_process');
const { createCanvas } = require('canvas');
const fs = require('fs');


const canvas = createCanvas(1920, 1080);
const ctx = canvas.getContext('2d');
const ffmpeg = spawn("ffmpeg",
    ["-re", "-f", "png_pipe", "-vcodec", "png", "-i", "pipe:0", "-vcodec", "h264", "-re", "-f", "flv", "rtmp://a.rtmp.youtube.com/live2/key-i-think"],
    { stdio: 'pipe' })

const randomColor = (depth) => Math.floor(Math.random() * depth)
const random = (min, max) => (Math.random() * (max - min)) + min;

let i = 0;
let drawSomething = function () {
    ctx.strokeStyle = `rgb(${randomColor(255)}, ${randomColor(255)}, ${randomColor(255)})`
    let x1 = random(0, canvas.width);
    let x2 = random(0, canvas.width);
    let y1 = random(0, canvas.height);
    let y2 = random(0, canvas.height);
    ctx.moveTo(x1, y1);
    ctx.lineTo(x2, y2);
    ctx.stroke();

    let out = canvas.toBuffer();
    ffmpeg.stdin.write(out)
    i++;
    if (i >= 30) {
        ffmpeg.stdin.end();
        clearInterval(int)
    };
}

drawSomething();
let int = setInterval(drawSomething, 1000);



    


    I'm not getting any errors, neither i am getting any video data from it. I have set up an rtmp server that i can connect to, and then get the stream with VLC, but i don't get any video data. Am i doing something wrong ? I Looked around for a while, and i can't seem to find anyone that tried this, so i don't really have a clue...

    


    EDIT 2 :
Apparently i was on the right track, but my approach just gave me like 2 seconds of "good" video and then it started becoming blocky and messy. i think that, most likely, my method of generating images is just too slow. I'll try to use some GPU accelerated code to generate the images, instead of using the canvas, which means i'll be doing fractals all the time, since i don't know how to do anything else with that. Also, a bigger buffer in ffmpeg might help too

    


  • RTMP Disconnects quickly when the stream is turned on and No index.m3u8 files are being generated in the assigned directory [closed]

    23 avril, par Kartik Salve
    23/4/2025 09:52:58 9408 [INFO] [rtmp connect] id=7K1RWSO1 ip=::1 app=live args={"app":"live","flashVer":"LNX 9,0,124,2","tcUrl":"rtmp://localhost:1935/live","fpad":false,"capabilities":15,"audioCodecs":4071,"videoCodecs":252,"videoFunction":1}
23/4/2025 09:52:58 9408 [INFO] [rtmp play] Join stream. id=7K1RWSO1 streamPath=/live/test  streamId=1 
23/4/2025 09:52:59 9408 [INFO] [rtmp play] Close stream. id=7K1RWSO1 streamPath=/live/test streamId=1
23/4/2025 09:52:59 9408 [INFO] [rtmp disconnect] id=7K1RWSO1


    


    These are the logs, ffmpeg pushes the stream in a different folder when tried manually.

    


      

    • I tried changing the location of my file outside of oneDrive to avoid any permission conflicts.
    • 


    • Manually checked if FFmpeg is correct with this command : C:\ffmpeg\bin\ffmpeg.exe -i rtmp://localhost/live/test -c:v copy -c:a aac -f hls -hls_time 2 -hls_list_size 5 -hls_flags delete_segments output/index.m3u8
    • 


    • Downgraded NMS to a stable version.
    • 


    


  • h264 : Move start code search functions into separate source files.

    21 juillet 2014, par Ben Avison
    h264 : Move start code search functions into separate source files.
    

    This permits re-use with parsers for codecs which use similar start codes.

    Signed-off-by : Luca Barbato <lu_zero@gentoo.org>

    • [DH] configure
    • [DH] libavcodec/Makefile
    • [DH] libavcodec/arm/Makefile
    • [DH] libavcodec/arm/h264dsp_init_arm.c
    • [DH] libavcodec/arm/startcode.h
    • [DH] libavcodec/arm/startcode_armv6.S
    • [DH] libavcodec/h264_parser.c
    • [DH] libavcodec/h264dsp.c
    • [DH] libavcodec/h264dsp.h
    • [DH] libavcodec/startcode.c
    • [DH] libavcodec/startcode.h