Recherche avancée

Médias (0)

Mot : - Tags -/objet éditorial

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

Autres articles (54)

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

  • MediaSPIP Player : problèmes potentiels

    22 février 2011, par

    Le lecteur ne fonctionne pas sur Internet Explorer
    Sur Internet Explorer (8 et 7 au moins), le plugin utilise le lecteur Flash flowplayer pour lire vidéos et son. Si le lecteur ne semble pas fonctionner, cela peut venir de la configuration du mod_deflate d’Apache.
    Si dans la configuration de ce module Apache vous avez une ligne qui ressemble à la suivante, essayez de la supprimer ou de la commenter pour voir si le lecteur fonctionne correctement : /** * GeSHi (C) 2004 - 2007 Nigel McNie, (...)

Sur d’autres sites (11680)

  • Stream sent via FFMPEG (NodeJS) to RTMP (YouTube) not being received

    10 décembre 2024, par Qumber

    I am writing a very basic chrome extension that captures and sends video stream to a nodeJS server, which in turns sends it to Youtube live server.

    


    Here is my implementation of the backend which receives data via WebRTC and send to YT using FFMPEG :

    


    const express = require('express');
const cors = require('cors');
const { RTCPeerConnection, RTCSessionDescription } = require('@roamhq/wrtc');
const { spawn } = require('child_process');

const app = express();
app.use(express.json());
app.use(cors());

app.post('/webrtc', async (req, res) => {
  const peerConnection = new RTCPeerConnection();

  // Start ffmpeg process for streaming
  const ffmpeg = spawn('ffmpeg', [
    '-f', 'flv',
    '-i', 'pipe:0',
    '-c:v', 'libx264',
    '-preset', 'veryfast',
    '-maxrate', '3000k',
    '-bufsize', '6000k',
    '-pix_fmt', 'yuv420p',
    '-g', '50',
    '-f', 'flv',
    'rtmp://a.rtmp.youtube.com/live2/MY_KEY'
  ]);

  ffmpeg.on('error', (err) => {
    console.error('FFmpeg error:', err);
  });

  ffmpeg.stderr.on('data', (data) => {
    console.error('FFmpeg stderr:', data.toString());
  });

  ffmpeg.stdout.on('data', (data) => {
    console.log('FFmpeg stdout:', data.toString());
  });

  // Handle incoming tracks
  peerConnection.ontrack = (event) => {
    console.log('Track received:', event.track.kind);
    const track = event.track;

    // Stream the incoming track to FFmpeg
    track.onunmute = () => {
      console.log('Track unmuted:', track.kind);
      const reader = track.createReadStream();
      reader.on('data', (chunk) => {
        console.log('Forwarding chunk to FFmpeg:', chunk.length);
        ffmpeg.stdin.write(chunk);
      });
      reader.on('end', () => {
        console.log('Stream ended');
        ffmpeg.stdin.end();
      });
    };

    track.onmute = () => {
      console.log('Track muted:', track.kind);
    };
  };

  // Set the remote description (offer) received from the client
  await peerConnection.setRemoteDescription(new RTCSessionDescription(req.body.sdp));

  // Create an answer and send it back to the client
  const answer = await peerConnection.createAnswer();
  await peerConnection.setLocalDescription(answer);

  res.json({ sdp: peerConnection.localDescription });
});

app.listen(3000, () => {
  console.log('WebRTC to RTMP server running on port 3000');
});



    


    This is the output I get, but nothing gets sent to YouTube :

    


    

    FFmpeg stderr: ffmpeg version 7.0.2 Copyright (c) 2000-2024 the FFmpeg developers
  built with Apple clang version 15.0.0 (clang-1500.3.9.4)

FFmpeg stderr:   configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/7.0.2_1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,-ld_classic' --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --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-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon

FFmpeg stderr:   libavutil      59.  8.100 / 59.  8.100
  libavcodec     61.  3.100 / 61.  3.100
  libavformat    61.  1.100 / 61.  1.100
  libavdevice    61.  1.100 / 61.  1.100

FFmpeg stderr:   libavfilter    10.  1.100 / 10.  1.100
  libswscale      8.  1.100 /  8.  1.100
  libswresample   5.  1.100 /  5.  1.100
  libpostproc    58.  1.100 / 58.  1.100


    


    


    I do not understand what I am doing wrong. Any help would be appreciated.

    



    


    Optionally Here's the frontend code from the extension, which (to me) appears to be recording and sending the capture :

    


    popup.js & popup.html

    


    

    

    document.addEventListener('DOMContentLoaded', () => {
  document.getElementById('openCapturePage').addEventListener('click', () => {
    chrome.tabs.create({
      url: chrome.runtime.getURL('capture.html')
    });
  });
});

    


    &#xA;&#xA;&#xA;&#xA;  &#xA;  <code class="echappe-js">&lt;script src='http://stackoverflow.com/feeds/tag/popup.js'&gt;&lt;/script&gt;&#xA;&#xA;&#xA;&#xA;  

    StreamSavvy

    &#xA;

    &#xA;&#xA;&#xA;

    &#xD;&#xA;

    &#xD;&#xA;

    &#xD;&#xA;&#xA;

    capture.js & capture.html

    &#xA;

    &#xD;&#xA;
    &#xD;&#xA;
    let peerConnection;&#xA;&#xA;async function startStreaming() {&#xA;  try {&#xA;    const stream = await navigator.mediaDevices.getDisplayMedia({&#xA;      video: {&#xA;        cursor: "always"&#xA;      },&#xA;      audio: false&#xA;    });&#xA;&#xA;    peerConnection = new RTCPeerConnection({&#xA;      iceServers: [{&#xA;        urls: &#x27;stun:stun.l.google.com:19302&#x27;&#xA;      }]&#xA;    });&#xA;&#xA;    stream.getTracks().forEach(track => peerConnection.addTrack(track, stream));&#xA;&#xA;    const offer = await peerConnection.createOffer();&#xA;    await peerConnection.setLocalDescription(offer);&#xA;&#xA;    const response = await fetch(&#x27;http://localhost:3000/webrtc&#x27;, {&#xA;      method: &#x27;POST&#x27;,&#xA;      headers: {&#xA;        &#x27;Content-Type&#x27;: &#x27;application/json&#x27;&#xA;      },&#xA;      body: JSON.stringify({&#xA;        sdp: peerConnection.localDescription&#xA;      })&#xA;    });&#xA;&#xA;    const {&#xA;      sdp&#xA;    } = await response.json();&#xA;    await peerConnection.setRemoteDescription(new RTCSessionDescription(sdp));&#xA;&#xA;    console.log("Streaming to server via WebRTC...");&#xA;  } catch (error) {&#xA;    console.error("Error starting streaming:", error.name, error.message);&#xA;  }&#xA;}&#xA;&#xA;async function stopStreaming() {&#xA;  if (peerConnection) {&#xA;    // Stop all media tracks&#xA;    peerConnection.getSenders().forEach(sender => {&#xA;      if (sender.track) {&#xA;        sender.track.stop();&#xA;      }&#xA;    });&#xA;&#xA;    // Close the peer connection&#xA;    peerConnection.close();&#xA;    peerConnection = null;&#xA;    console.log("Streaming stopped");&#xA;  }&#xA;}&#xA;&#xA;document.addEventListener(&#x27;DOMContentLoaded&#x27;, () => {&#xA;  document.getElementById(&#x27;startCapture&#x27;).addEventListener(&#x27;click&#x27;, startStreaming);&#xA;  document.getElementById(&#x27;stopCapture&#x27;).addEventListener(&#x27;click&#x27;, stopStreaming);&#xA;});

    &#xD;&#xA;

    &#xA;&#xA;&#xA;&#xA;  &#xA;  <code class="echappe-js">&lt;script src='http://stackoverflow.com/feeds/tag/capture.js'&gt;&lt;/script&gt;&#xA;&#xA;&#xA;&#xA;  

    StreamSavvy Capture

    &#xA;

    &#xA;

    &#xA;&#xA;&#xA;

    &#xD;&#xA;

    &#xD;&#xA;

    &#xD;&#xA;&#xA;

    background.js (service worker)

    &#xA;

    &#xD;&#xA;
    &#xD;&#xA;
    chrome.runtime.onInstalled.addListener(() => {&#xA;  console.log("StreamSavvy Extension Installed");&#xA;});&#xA;&#xA;chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {&#xA;  if (message.type === &#x27;startStreaming&#x27;) {&#xA;    chrome.tabs.create({&#xA;      url: chrome.runtime.getURL(&#x27;capture.html&#x27;)&#xA;    });&#xA;    sendResponse({&#xA;      status: &#x27;streaming&#x27;&#xA;    });&#xA;  } else if (message.type === &#x27;stopStreaming&#x27;) {&#xA;    chrome.tabs.query({&#xA;      url: chrome.runtime.getURL(&#x27;capture.html&#x27;)&#xA;    }, (tabs) => {&#xA;      if (tabs.length > 0) {&#xA;        chrome.tabs.sendMessage(tabs[0].id, {&#xA;          type: &#x27;stopStreaming&#x27;&#xA;        });&#xA;        sendResponse({&#xA;          status: &#x27;stopped&#x27;&#xA;        });&#xA;      }&#xA;    });&#xA;  }&#xA;  return true; // Keep the message channel open for sendResponse&#xA;});

    &#xD;&#xA;

    &#xD;&#xA;

    &#xD;&#xA;&#xA;

  • Psychopy gives the ffmpeg error and does not play the videos

    17 août 2017, par I.Nuel

    I want to create an experiment with Psychopy in which I will present randomly video that participant will have to evaluate.

    I have created a routine with my MovieStim and my Rating response and a Loop with my conditions file (in which are my video files videoname.wmv).
    All my videos are in the same folder as my experiment.

    I have specified the MovieStim with a variable refering to my Loop’s column ($Stimulus).

    But when I run the experiment I have this message.

    Running: E:\Thèse ESPRIT\Approach_Aversion\Experience_AA\Approach_Aversion_lastrun.py
    pyo version 0.8.0 (uses single precision)
    WARNING:root:Warning: could not find imageio's ffmpeg executable:
    [Error 5] Accès refus: 'C:\\Program Files (x86)\\PsychoPy2\\lib\\site-packages\\imageio\\resources\\ffmpeg\\ffmpeg.win32.exe'
    Traceback (most recent call last):
     File "E:\Thèse ESPRIT\Approach_Aversion\Experience_AA\Approach_Aversion_lastrun.py", line 105, in <module>
       depth=0.0,
     File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.84.2-py2.7.egg\psychopy\contrib\lazy_import.py", line 120, in __call__
       return obj(*args, **kwargs)
     File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.84.2-py2.7.egg\psychopy\visual\movie3.py", line 124, in __init__
       self.loadMovie(self.filename)
     File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.84.2-py2.7.egg\psychopy\visual\movie3.py", line 170, in loadMovie
       self._mov = VideoFileClip(filename, audio=(1 - self.noAudio))
     File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\moviepy\video\io\VideoFileClip.py", line 55, in __init__
       reader = FFMPEG_VideoReader(filename, pix_fmt=pix_fmt)
     File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\moviepy\video\io\ffmpeg_reader.py", line 32, in __init__
       infos = ffmpeg_parse_infos(filename, print_infos, check_duration)
     File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\moviepy\video\io\ffmpeg_reader.py", line 237, in ffmpeg_parse_infos
       proc = sp.Popen(cmd, **popen_params)
     File "C:\Program Files (x86)\PsychoPy2\lib\subprocess.py", line 710, in __init__
       errread, errwrite)
     File "C:\Program Files (x86)\PsychoPy2\lib\subprocess.py", line 958, in _execute_child
       startupinfo)
    WindowsError: [Error 2] Le fichier spécifié est introuvable
    </module>

    It seems to be something wrong with the ffmpeg executable but I don’t understand what.

    Do you have any idea ?

    Thank you very much fo advance !

    Have a nice day.

    Ivane

  • Why storage access functions not working on android 10 API-29 ? error=13, Permission denied ?

    8 janvier 2021, par Rpatel
    &#xA;

    This example code is to create video from images and music.&#xA;Code running on till API level 28 but when I just upgrade to&#xA;Build version 29 then it starts crashing. I tried the most solution&#xA;but could not find the proper reason and solution.
    &#xA;Please let me know...

    &#xA;

    &#xA;

    2

    &#xA;

    021-01-08 19:48:16.045 18413-19578/com.example.photovideomaker E/audio: io&#xA;    java.io.IOException: Cannot run program "/data/user/0/com.example.photovideomaker/files/ffmpeg": error=13, Permission denied&#xA;        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1050)&#xA;        at java.lang.Runtime.exec(Runtime.java:698)&#xA;        at java.lang.Runtime.exec(Runtime.java:563)&#xA;        at com.example.photovideomaker.service.CreateVideoService.joinAudio(CreateVideoService.java:252)&#xA;        at com.example.photovideomaker.service.CreateVideoService.createVideo(CreateVideoService.java:89)&#xA;        at com.example.photovideomaker.service.CreateVideoService.onHandleIntent(CreateVideoService.java:83)&#xA;        at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:78)&#xA;        at android.os.Handler.dispatchMessage(Handler.java:107)&#xA;        at android.os.Looper.loop(Looper.java:214)&#xA;        at android.os.HandlerThread.run(HandlerThread.java:67)&#xA;     Caused by: java.io.IOException: error=13, Permission denied&#xA;        at java.lang.UNIXProcess.forkAndExec(Native Method)&#xA;        at java.lang.UNIXProcess.<init>(UNIXProcess.java:133)&#xA;        at java.lang.ProcessImpl.start(ProcessImpl.java:141)&#xA;        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)&#xA;        at java.lang.Runtime.exec(Runtime.java:698)&#xA0;&#xA;        at java.lang.Runtime.exec(Runtime.java:563)&#xA0;&#xA;        at com.example.photovideomaker.service.CreateVideoService.joinAudio(CreateVideoService.java:252)&#xA0;&#xA;        at com.example.photovideomaker.service.CreateVideoService.createVideo(CreateVideoService.java:89)&#xA0;&#xA;        at com.example.photovideomaker.service.CreateVideoService.onHandleIntent(CreateVideoService.java:83)&#xA0;&#xA;        at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:78)&#xA0;&#xA;        at android.os.Handler.dispatchMessage(Handler.java:107)&#xA0;&#xA;        at android.os.Looper.loop(Looper.java:214)&#xA0;&#xA;        at android.os.HandlerThread.run(HandlerThread.java:67)&#xA0;&#xA;</init>

    &#xA;

    &#xA;

    This function throwing the error "On Process.runtime"

    &#xA;

    &#xA;

    private void createVideo() {&#xA;        long startTime = System.currentTimeMillis();&#xA;        toatalSecond = (application.getSecond() * ((float) application.getSelectedImages().size())) - DEFAULT_FONT_SCALE;&#xA;        joinAudio();&#xA;        while (true) {&#xA;            if (ImageCreatorService.isImageComplate) {&#xA;                Log.e("image creation ", " complte");&#xA;&#xA;                break;&#xA;            }else {&#xA;                Log.e("image creation ", "not complte");&#xA;            }&#xA;        }&#xA;        Log.e("createVideo", "video create start");&#xA;        new File(FileUtils.TEMP_DIRECTORY, "video.txt").delete();&#xA;        for (int i = 0; i &lt; application.videoImages.size(); i&#x2B;&#x2B;) {&#xA;            appendVideoLog(String.format("file &#x27;%s&#x27;", application.videoImages.get(i)));&#xA;        }&#xA;&#xA;        File r0=new File(FileUtils.TEMP_DIRECTORY, "video.txt");&#xA;        String videoPath = new File(FileUtils.APP_DIRECTORY, getVideoName()).getAbsolutePath();&#xA;        String[] inputCode = application.getMusicData() != null ? new String[]{&#xA;                FileUtils.getFFmpeg(this), "-r",&#xA;                String.valueOf(BitmapDescriptorFactory.HUE_ORANGE / application.getSecond()),&#xA;                "-f", "concat", "-safe", "0", "-i", r0.getAbsolutePath(), "-i",&#xA;                audioFile.getAbsolutePath(), "-strict", "experimental", "-r", "30",&#xA;                "-t", String.valueOf(toatalSecond), "-c:v", "libx264", "-preset",&#xA;                "ultrafast", "-pix_fmt", "yuv420p", "-ac", "2", videoPath}&#xA;        : new String[]{FileUtils.getFFmpeg(this),&#xA;                "-r", String.valueOf(BitmapDescriptorFactory.HUE_ORANGE / application.getSecond()),&#xA;                "-f", "concat", "-i", r0.getAbsolutePath(), "-r", "30", "-c:v", "libx264", "-preset", "ultrafast", "-pix_fmt", "yuv420p", videoPath};&#xA;&#xA;        System.gc();&#xA;        Process process = null;&#xA;        try {&#xA;            process = Runtime.getRuntime().exec(inputCode);&#xA;            while (!Util.isProcessCompleted(process)) {&#xA;                BufferedReader reader = new BufferedReader(new InputStreamReader(process.getErrorStream()));&#xA;                while (true) {&#xA;                    String line = reader.readLine();&#xA;                    if (line != null) {&#xA;                        Log.e("process", line);&#xA;                        appendLog(line);&#xA;                        final int incr = durationToprogtess(line);&#xA;                        new Handler(Looper.getMainLooper()).post(new Runnable() {&#xA;                            public void run() {&#xA;                                if (receiver != null) {&#xA;                                    receiver.onVideoProgressUpdate(incr);&#xA;                                }&#xA;                            }&#xA;                        });&#xA;                        mBuilder.setProgress(100, ((int) ((75.0f * ((float) incr)) / 100.0f)) &#x2B; 25, false);&#xA;                        mNotifyManager.notify(1001, mBuilder.build());&#xA;                    }else {&#xA;                        break;&#xA;                    }&#xA;                }&#xA;            }&#xA;        } catch (IOException e) {&#xA;            e.printStackTrace();&#xA;        } finally {&#xA;            Util.destroyProcess(process);&#xA;        }&#xA;        mBuilder.setContentText("Video created :" &#x2B; FileUtils.getDuration(System.currentTimeMillis() - startTime)).setProgress(0, 0, false);&#xA;        mNotifyManager.notify(1001, mBuilder.build());&#xA;        try {&#xA;            long fileSize = new File(videoPath).length();&#xA;            String artist = getResources().getString(R.string.artist_name);&#xA;            ContentValues values = new ContentValues();&#xA;            values.put("_data", videoPath);&#xA;            values.put("_size", Long.valueOf(fileSize));&#xA;            values.put("mime_type", "video/mp4");&#xA;            values.put("artist", artist);&#xA;            values.put("duration", Float.valueOf(toatalSecond * 1000.0f));&#xA;            getContentResolver().insert(Media.getContentUriForPath(videoPath), values);&#xA;        } catch (Exception e2) {&#xA;            e2.printStackTrace();&#xA;        }&#xA;        try {&#xA;            sendBroadcast(new Intent("android.intent.action.MEDIA_SCANNER_SCAN_FILE", Uri.fromFile(new File(videoPath))));&#xA;        } catch (Exception e3) {&#xA;            e3.printStackTrace();&#xA;        }&#xA;&#xA;        buildNotification(videoPath);&#xA;        final String str = videoPath;&#xA;        new Handler(Looper.getMainLooper()).post(new Runnable() {&#xA;            public void run() {&#xA;                if (receiver != null) {&#xA;                    receiver.onVideoProgressUpdate(100);&#xA;                    receiver.onProgressFinish(str);&#xA;                }&#xA;            }&#xA;        });&#xA;        FileUtils.deleteTempDir();&#xA;       stopSelf();&#xA;    }&#xA;

    &#xA;

    I have tried checking the directory in storage and check mkdir is working or not but this function purely works for creating video from a collection of images, themes, and audio. as per android

    &#xA;