Recherche avancée

Médias (1)

Mot : - Tags -/MediaSPIP 0.2

Autres articles (76)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

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

  • Unable to read video streams on FFMPEG and send it to youTube RTMP server

    29 août 2024, par Rahul Bundele

    I'm trying to send two video stream from browser as array buffer (webcam and screen share video) to server via Web RTC data channels and want ffmpeg to add webcam as overlay on screen share video and send it to youtube RTMP server, the RTC connections are established and server does receives buffer , Im getting error in Ffmpeg..error is at bottom , any tips on to add overlay and send it to youtube RTMP server would be appreciated.

    


    Client.js

    


    `
const webCamStream = await navigator.mediaDevices.getUserMedia( video : true ,audio:true ) ;
const screenStream = await navigator.mediaDevices.getDisplayMedia( video : true ) ;

    


    const webcamRecorder = new MediaRecorder(webCamStream, { mimeType: 'video/webm' });
webcamRecorder.ondataavailable = (event) => {
    if (event.data.size > 0 && webcamDataChannel.readyState === 'open') {
        const reader = new FileReader();
        reader.onload = function () {
            const arrayBuffer = this.result;
            webcamDataChannel.send(arrayBuffer);
        };
        reader.readAsArrayBuffer(event.data);
    }
};
webcamRecorder.start(100);  // Adjust the interval as needed

// Send screen share stream data
const screenRecorder = new MediaRecorder(screenStream, { mimeType: 'video/webm' });
screenRecorder.ondataavailable = (event) => {
    if (event.data.size > 0 && screenDataChannel.readyState === 'open') {
        const reader = new FileReader();
        reader.onload = function () {
            const arrayBuffer = this.result;
            screenDataChannel.send(arrayBuffer);
        };
        reader.readAsArrayBuffer(event.data);
    }
};
screenRecorder.start(100); 


    


    `

    


    Server.js

    


    const youtubeRTMP = 'rtmp://a.rtmp.youtube.com/live2/youtube key';

// Create PassThrough streams for webcam and screen
const webcamStream = new PassThrough();
const screenStream = new PassThrough();

// FFmpeg arguments for processing live streams
const ffmpegArgs = [
  '-re',
  '-i', 'pipe:3',                  // Webcam input via pipe:3
  '-i', 'pipe:4',                  // Screen share input via pipe:4
  '-filter_complex',               // Complex filter for overlay
  '[0:v]scale=320:240[overlay];[1:v][overlay]overlay=10:10[out]',
  '-map', '[out]',                 // Map the output video stream
  '-c:v', 'libx264',               // Use H.264 codec for video
  '-preset', 'ultrafast',          // Use ultrafast preset for low latency
  '-crf', '25',                    // Set CRF for quality/size balance
  '-pix_fmt', 'yuv420p',           // Pixel format for compatibility
  '-c:a', 'aac',                   // Use AAC codec for audio
  '-b:a', '128k',                  // Set audio bitrate
  '-f', 'flv',                     // Output format (FLV for RTMP)
  youtubeRTMP                      // Output to YouTube RTMP server
];

// Spawn the FFmpeg process
const ffmpegProcess = spawn('ffmpeg', ffmpegArgs, {
  stdio: ['pipe', 'pipe', 'pipe', 'pipe', 'pipe']
});

// Pipe the PassThrough streams into FFmpeg
webcamStream.pipe(ffmpegProcess.stdio[3]);
screenStream.pipe(ffmpegProcess.stdio[4]);

ffmpegProcess.on('close', code => {
  console.log(`FFmpeg process exited with code ${code}`);
});

ffmpegProcess.on('error', error => {
  console.error(`FFmpeg error: ${error.message}`);
});

const handleIncomingData = (data, stream) => {
  const buffer = Buffer.from(data);
  stream.write(buffer);
};


    


    the server gets the video buffer via webrtc data channels

    


    pc.ondatachannel = event => {
        const dataChannel = event.channel;
        pc.dc = event.channel;
        pc.dc.onmessage = event => {
            // Spawn the FFmpeg process
            // console.log('Message from client:', event.data);
            const data = event.data;

            if (dataChannel.label === 'webcam') {
            handleIncomingData(data, webcamStream);
            } else if (dataChannel.label === 'screen') {
            handleIncomingData(data, screenStream);
            }
          
        };
        pc.dc.onopen = e=>{
            // recHead.innerText = "Waiting for user to send files"
            console.log("channel opened!")
        }
    };


    


    Im getting this error in ffmpeg

    


    [in#0 @ 0000020e585a1b40] Error opening input: Bad file descriptor
Error opening input file pipe:3.
Error opening input files: Bad file descriptor


    


  • ffmpeg compression commands to make diffrent video formats like youtube ?

    9 juillet 2022, par Sahll saharn

    I am trying to make a video streaming clone. suppose i got the raw video and wanted to compress in diff formats and store it into database so what command should i use to convert same video to multiple quality formats like in other streaming platforms 720p , 480p , 360p
suppose our raw file is input.mp4

    


  • Python PyQt5 and youtube-dl GUI console popping when converting to mp3 with ffmpeg [on hold]

    29 juin 2018, par Giblin

    I will be jumping right to the issue I am having for a while.
    I have built a GUI software with Python 3.6 with PyQt5 and the youtube-dl package for downloading audios.
    The software downloads files in mp4, 3gp, m4a and webm extensions with no problems at all and then, here comes the mp3 to change the balance for ever !
    So what it basically does, is that while it downloads it as mp3, by the time it converts it with ffmpeg (same issue with ffprobe), a console window pops right out of the GUI and does its magic.
    I have made all the necessary customizations in the code, such as to run the ffmpeg with verbose etc but it won’t go away.
    Changing the file extension from .py to .pyw doesn’t help either.
    I think it is more of a windows problem and not really a programming issue, so I thought maybe a bat script could always run it silent in the background when it pops ? And if so, I would appreciate a heads-up because I have no experience in bat scripting.
    Thanks in advance and sorry if I went on for too long.

    EDIT :

    Here’s the console I get during the convert when I download a URL as mp3 (this pops like that until it finishes the conversion to mp3 and then disappears) :

    FFMPEG Console

    And here’s the function with the options responsible for that (for other extensions, the code is similar with just few name changes but ffmpeg isn’t necessary for them in order to convert) :

    def youtubeMP3(self):
       options = {
           'format': 'bestaudio/best',
           'extractaudio': True,
           'audioformat': 'mp3',
           'outtmpl': self.location + '/%(title)s-%(id)s.%(ext)s',
           'quiet': True,
           'no_warnings': True,
           'nocheckcertificate': True,
           'progress_hooks': [self.hookMP3],
           'postprocessors': [{
               'key': 'FFmpegExtractAudio',
               'preferredcodec': 'mp3',
               'preferredquality': '192'
           }]
       }
       value = self.urlText.text()
       if value != "" and validators.url(value):
           with youtube_dl.YoutubeDL(options) as ydl:
               try:
                   ydl.download([value])
                   self.progressLabel.setText("The download was successful.")
                   self.urlText.clear()
                   time.sleep(5)
                   self.progressLabel.setText("")
               except:
                   self.progressLabel.setText("This video URL does not exist.")
                   self.urlText.clear()
                   time.sleep(5)
                   self.progressLabel.setText("")