Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (86)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

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

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (12383)

  • Overlaying a text stream on a video stream with ffmpeg in Node.js

    16 mai 2023, par Tchoune

    I am creating a streaming system with Node.js that uses ffmpeg to send video and text streams to a local RTMP server, then combines those streams and sends them to Twitch.

    


    I'm using canvas to create a text image with a transparent background, and I need to change that text every time a new video in the playlist starts.

    


    Currently in stream I see only the video stream of my video and not the text. But if I go via VLC to see each more separate, I see them

    


    However, I'm running into a problem where the text stream doesn't appear in the final video stream on Twitch. In addition, I get the following error message :

    


    Combine stderr: [NULL @ 0x1407069f0] Unable to find a suitable output format for 'rtmp://live.twitch.tv/app/streamKey'
rtmp://live.twitch.tv/app/streamKey: Invalid argument


    


    Here is my current Node.js code :

    


    
const createTextImage = (runner) => {
    return new Promise((resolve, reject) => {
        const canvas = createCanvas(1920, 1080);
        const context = canvas.getContext('2d');

        // Fill the background with transparency
        context.fillStyle = 'rgba(0,0,0,0)';
        context.fillRect(0, 0, canvas.width, canvas.height);

        // Set the text options
        context.fillStyle = '#ffffff';
        context.font = '24px Arial';
        context.textAlign = 'start';
        context.textBaseline = 'middle';

        // Draw the text
        context.fillText(`Speedrun by ${runner}`, canvas.width / 2, canvas.height / 2);

        // Define the images directory
        const imagesDir = path.join(__dirname, 'images', 'runners');

        // Ensure the images directory exists
        fs.mkdirSync(imagesDir, { recursive: true });

        // Define the file path
        const filePath = path.join(imagesDir, runner + '.png');

        // Create the write stream
        const out = fs.createWriteStream(filePath);

        // Create the PNG stream
        const stream = canvas.createPNGStream();

        // Pipe the PNG stream to the write stream
        stream.pipe(out);

        out.on('finish', () => {
            console.log('The PNG file was created.');
            resolve();
        });

        out.on('error', reject);
    });
}
const streamVideo = (video) => {
    ffmpegLibrary.ffprobe(video.video, function (err, metadata) {
        if (err) {
            console.error(err);
            return;
        }
        currentVideoDuration = metadata.format.duration;

        // Annulez le délai précédent avant d'en créer un nouveau
        if (nextVideoTimeoutId) {
            clearTimeout(nextVideoTimeoutId);
        }

        // Déplacez votre appel setTimeout ici
        nextVideoTimeoutId = setTimeout(() => {
            console.log('Fin de la vidéo, passage à la suivante...');
            nextVideo();
        }, currentVideoDuration * 1000 + 10000);
    })


    ffmpegVideo = childProcess.spawn('ffmpeg', [
        '-nostdin', '-re', '-f', 'concat', '-safe', '0', '-i', 'playlist.txt',
        '-vcodec', 'libx264',
        '-s', '1920x1080',
        '-r', '30',
        '-b:v', '5000k',
        '-acodec', 'aac',
        '-preset', 'veryfast',
        '-f', 'flv',
        `rtmp://localhost:1935/live/video` // envoie le flux vidéo au serveur rtmp local
    ]);

    createTextImage(video.runner).then(() => {
        ffmpegText = childProcess.spawn('ffmpeg', [
            '-nostdin', '-re',
            '-loop', '1', '-i', `images/runners/${video.runner}.png`, // Utilise l'image créée par Puppeteer
            '-vcodec', 'libx264rgb', // Utilise le codec PNG pour conserver la transparence
            '-s', '1920x1080',
            '-r', '30',
            '-b:v', '5000k',
            '-acodec', 'aac',
            '-preset', 'veryfast',
            '-f', 'flv',
            `rtmp://localhost:1935/live/text` // envoie le flux de texte au serveur rtmp local
        ]);

        ffmpegText.stdout.on('data', (data) => {
            console.log(`text stdout: ${data}`);
        });

        ffmpegText.stderr.on('data', (data) => {
            console.error(`text stderr: ${data}`);
        });
    }).catch(error => {
        console.error(`Erreur lors de la création de l'image de texte: ${error}`);
    });

    ffmpegCombine = childProcess.spawn('ffmpeg', [
        '-i', 'rtmp://localhost:1935/live/video',
        '-i', 'rtmp://localhost:1935/live/text',
        '-filter_complex', '[0:v][1:v]overlay=main_w-overlay_w:0',
        '-s', '1920x1080',
        '-r', '30',
        '-vcodec', 'libx264',
        '-b:v', '5000k',
        '-acodec', 'aac',
        '-preset', 'veryfast',
        '-f', 'flv',
        `rtmp://live.twitch.tv/app/${twitchStreamKey}` // envoie le flux combiné à Twitch
    ]);

    ffmpegVideo.stdout.on('data', (data) => {
        console.log(`video stdout: ${data}`);
    });

    ffmpegVideo.stderr.on('data', (data) => {
        console.error(`video stderr: ${data}`);
    });

    ffmpegCombine.stdout.on('data', (data) => {
        console.log(`Combine stdout: ${data}`);
    });

    ffmpegCombine.stderr.on('data', (data) => {
        console.error(`Combine stderr: ${data}`);
    });

    ffmpegCombine.on('close', (code) => {
        console.log(`ffmpeg exited with code ${code}`);
        if (currentIndex >= playlist.length) {
            console.log('End of playlist');
            currentIndex = 0;
        }
    });
}



    


    Locally I use nginx with rtmp module to manage multi-streams and combined into one to send to twitch

    


    In NGINX it's my nginx.conf for module :

    


    rtmp {
    server {
        listen 1935; # le port pour le protocole RTMP
        
        application live {
            live on; # active le streaming en direct
            record off; # désactive l'enregistrement du flux
    
            # définit l'endroit où les flux doivent être envoyés
            push rtmp://live.twitch.tv/app/liveKey;
        }
    
        application text {
            live on; # active le streaming en direct
            record off; # désactive l'enregistrement du flux
        }
    }
}


    


    I have checked that the codecs, resolution and frame rate are the same for both streams. I am also overlaying the text stream on top of the video stream with the -filter_complex command, but I am not sure if it works correctly.

    


    Does each stream have to have the same parameters ?

    


    I would like to know if anyone has any idea what could be causing this problem and how to fix it. Should I use a different format for the output stream to Twitch ? Or is there another approach I should consider for layering a dynamic text stream over a video stream ?

    


    Also, I'm wondering if I'm handling updating the text stream correctly when the video changes. Currently, I create a new text image with Canvas every time the video changes, then create a new ffmpeg process for the text stream. Is this the right approach, or is there a better way to handle this ?

    


    Thanks in advance for any help or advice.

    


  • hevc transcoded video not playing in safari

    9 juin 2023, par zuccy

    I transcoded a video with ffmpeg to hevc using the below command.

    


    ffmpeg -i input.mp4 -c:v libx265 -crf 23 -preset medium -x265-params keyint=60 -c:a aac -b:a 128k -f hls -hls_time 10 -hls_segment_type fmp4 -hls_playlist_type vod -tag:v hvc1  -single_file 1 playlist.m3u8


    


    ffmpeg version : 5.0.1

    


    The output is playing fine in chrome but not in safari.

    


    I found from apple support community that fmp4 should work fine in safari. I tried with different tags, presets and x265 params but I can't make it work.

    


    I want the output to be hevc hls and it should be playable in safari and chrome. Any help is really appreciated.

    


  • Missing ffmpeg in deployed application

    30 décembre 2017, par Dexstrum

    I have created a python GUI which utilizes ffmpy and tkinter. It works fine running in PyCharm and also in py2app’s alias mode. After I deployed it using py2app and ran the program, it loaded up, but nothing happened. After doing some digging, I found that the error was ’ffmpeg executable is missing.’

    I tried using pyinstaller to remedy the issue, but the application did not even run.

    The warning.txt output file gave me this :

    missing module named org - imported by copy
    missing module named _sha512 - imported by hashlib
    missing module named _sha256 - imported by hashlib
    missing module named _md5 - imported by hashlib
    missing module named _sha - imported by hashlib
    missing module named 'org.python' - imported by pickle, xml.sax
    missing module named _subprocess - imported by subprocess
    missing module named msvcrt - imported by subprocess, getpass, youtube_dl.utils
    missing module named riscosenviron - imported by os
    missing module named riscospath - imported by os
    missing module named riscos - imported by os
    missing module named ce - imported by os
    missing module named _emx_link - imported by os
    missing module named os2 - imported by os
    missing module named nt - imported by os, ntpath
    missing module named 'urllib.parse' - imported by pafy.util, youtube_dl.compat, pafy.backend_internal, pafy.backend_shared, pafy.playlist
    missing module named _winreg - imported by mimetypes, urllib, winreg, platform
    missing module named OverrideFrom23 - imported by Carbon.Res
    missing module named SOCKS - imported by ftplib
    missing module named rourl2path - imported by urllib
    missing module named _dummy_threading - imported by dummy_threading
    missing module named 'urllib.error' - imported by pafy.pafy, pafy.util, youtube_dl.compat, pafy.backend_shared
    missing module named 'urllib.request' - imported by pafy.g, youtube_dl.compat, pafy.backend_shared
    missing module named ElementC14N - imported by xml.etree.ElementTree
    missing module named 'java.lang' - imported by platform, xml.sax._exceptions
    missing module named _xmlplus - imported by xml
    missing module named sgi - imported by pty
    missing module named vms_lib - imported by platform
    missing module named java - imported by platform
    missing module named winreg.HKEY_LOCAL_MACHINE - imported by winreg, platform
    missing module named winreg.CloseKey - imported by winreg, platform
    missing module named winreg.QueryValueEx - imported by winreg, platform
    missing module named winreg.OpenKeyEx - imported by winreg, platform
    missing module named win32pipe - imported by platform
    missing module named netbios - imported by uuid
    missing module named win32wnet - imported by uuid
    missing module named lazy_extractors - imported by youtube_dl.extractor
    missing module named Crypto - imported by youtube_dl.downloader.hls
    missing module named xattr - imported by youtube_dl.utils
    missing module named 'dbm.ndbm' - imported by future.moves.dbm.ndbm
    missing module named gdbm - imported by anydbm, future.moves.dbm.gnu
    missing module named 'dbm.gnu' - imported by future.moves.dbm.gnu
    missing module named 'dbm.dumb' - imported by future.moves.dbm.dumb
    missing module named bsddb3 - imported by bsddb
    missing module named _pybsddb - imported by bsddb, bsddb.db
    missing module named 'test.support' - imported by future.moves.test.support
    missing module named reprlib.recursive_repr - imported by reprlib, future.backports.misc
    missing module named _thread.get_ident - imported by _thread, future.backports.misc
    missing module named _datetime - imported by future.backports.datetime
    missing module named 'urllib.response' - imported by youtube_dl.compat

    I am not sure where to go from here. I don’t know how to include ffmpeg into the deployed application, and when I include the modules in the setup.py file it throws me a different error. Is there a reason why the py2app is not deploying the application with ffmpeg ?