Recherche avancée

Médias (1)

Mot : - Tags -/ticket

Autres articles (31)

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • L’utiliser, en parler, le critiquer

    10 avril 2011

    La première attitude à adopter est d’en parler, soit directement avec les personnes impliquées dans son développement, soit autour de vous pour convaincre de nouvelles personnes à l’utiliser.
    Plus la communauté sera nombreuse et plus les évolutions seront rapides ...
    Une liste de discussion est disponible pour tout échange entre utilisateurs.

Sur d’autres sites (5624)

  • Error : spawn process ffmpeg ChildProcessError

    10 juin 2019, par Karnon

    I wanted to make a program like OBS simply.

    My ideal code behavior is to create a child process in Node.js and execute FFMPEG commands to send a webcam stream to yourtube live RTMP server. However, the actual behavior is caused by an error in the child-process-promise module used in node.js.

    I’ve checked several questions, but I don’t have enough experience to understand them, and I hope there’s a clear solution.

    I guess it was because I couldn’t find the command address of FFMPEG in the Node environment. Or is calling from the socket environment a problem ?

    I checked that the FFMPEG command works in a Windows prompt environment.

    ※ Note : FFMPEG environment variables are registered.

    Environment : Window10, node.js, ffmpeg

    The code took advantage of a simple WebSocket example.

    When I first investigated, I thought that the only way to do this was to use "fluent-effmpeg."

    I tried "fluent-ffmpeg" but I couldn’t get my laptop webcam up and running in Windows environments as a parameter for the "fluent-ffmppeg" command.

    I’ve also thought about using WebRTC, but I think it’s not for personal use because it’s a P2P connection. (I also saw how to connect a peer connection to a WebRTC server like Janus, but I didn’t have enough references to understand it.)

    Below is the code of the problem.

    const SocketIO = require("socket.io");
    const ffmpeg = require("fluent-ffmpeg");
    const spawn = require("child-process-promise").spawn;

    module.exports = server => {
     const io = SocketIO(server, { path: "/socket.io" });

     io.on("connection", socket => {
       const req = socket.request;
       const ip = req.headers["x-forwarded-for"] || req.connection.remoteAddress;
       console.log("새로운 클라이언트 접속!", ip, socket.id, req.ip);
       socket.on("disconnect", () => {
         console.log("클라이언트 접속해제", ip, socket.id);
         clearInterval(socket.interval);
       });
       socket.on("error", error => {
         console.error(error);
       });
       socket.on("reply", data => {
         console.log(data);
         ffmpeg_command();
       });
     });

     function ffmpeg_command() {
       let arg = [
         "-f",
         "lavfi",
         "-i",
         "anullsrc=r=16000:cl=mono",
         "-f",
         "dshow",
         "-ac",
         "2",
         "-i",
         "video='HP Truevision HD'",
         "-s",
         "1280x720",
         "-r",
         "10",
         "-vcodec",
         "libx264",
         "-pix_fmt",
         "yuv420p",
         "-preset",
         "ultrafast",
         "-r",
         "25",
         "-g",
         "20",
         "-b:v",
         "2500k",
         "-codec:a",
         "libmp3lame",
         "-ar",
         "44100",
         "-threads",
         "6",
         "-b:a",
         "11025",
         "-bufsize",
         "512k",
         "-f",
         "flv",
         "rtmp://a.rtmp.youtube.com/live2/8dfu-69k0-dxyw-896q"
       ];
       spawn("ffmpeg", arg).catch(e => {
         console.log(e);
       });
     }
    };

    Here’s the error : The expected result is that your webcam is working and YouTube live streaming is successful.

    { ChildProcessError: `ffmpeg -f lavfi -i anullsrc=r=16000:cl=mono -f dshow -ac 2 -i video='HP Truevision HD' -s 1280x720 -r 10 -vcodec libx264 -pix_fmt yuv420p -preset ultrafast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 6 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/8dfu-69k0-dxyw-896q` failed with code 1
       at ChildProcess.<anonymous> (C:\Users\Tricky\Desktop\Work\ESC\ESC_temp\node_modules\child-process-promise\lib\index.js:132:23)
       at ChildProcess.emit (events.js:182:13)
       at ChildProcess.cp.emit (C:\Users\Tricky\Desktop\Work\ESC\ESC_temp\node_modules\child-process-promise\node_modules\cross-spawn\lib\enoent.js:40:29)
       at maybeClose (internal/child_process.js:962:16)
       at Socket.stream.socket.on (internal/child_process.js:381:11)
       at Socket.emit (events.js:182:13)
       at Pipe._handle.close (net.js:606:12)
     name: 'ChildProcessError',
     code: 1,
     childProcess:
      ChildProcess {
        _events: { error: [Function], close: [Function] },
        _eventsCount: 2,
        _maxListeners: undefined,
        _closesNeeded: 3,
        _closesGot: 3,
        connected: false,
        signalCode: null,
        exitCode: 1,
        killed: false,
        spawnfile: 'ffmpeg',
        _handle: null,
        spawnargs:
         [ 'ffmpeg',
           '-f',
           'lavfi',
           '-i',
           'anullsrc=r=16000:cl=mono',
           '-f',
           'dshow',
           '-ac',
           '2',
           '-i',
           'video=\'HP Truevision HD\'',
           '-s',
           '1280x720',
           '-r',
           '10',
           '-vcodec',
           'libx264',
           '-pix_fmt',
           'yuv420p',
           '-preset',
           'ultrafast',
           '-r',
           '25',
           '-g',
           '20',
           '-b:v',
           '2500k',
           '-codec:a',
           'libmp3lame',
           '-ar',
           '44100',
           '-threads',
           '6',
           '-b:a',
           '11025',
           '-bufsize',
           '512k',
           '-f',
           'flv',
           'rtmp://a.rtmp.youtube.com/live2/8dfu-69k0-dxyw-896q' ],
        pid: 18928,
        stdin:
         Socket {
           connecting: false,
           _hadError: false,
           _handle: null,
           _parent: null,
           _host: null,
           _readableState: [ReadableState],
           readable: false,
           _events: [Object],
           _eventsCount: 1,
           _maxListeners: undefined,
           _writableState: [WritableState],
           writable: false,
           allowHalfOpen: false,
           _sockname: null,
           _pendingData: null,
           _pendingEncoding: '',
           server: null,
           _server: null,
           [Symbol(asyncId)]: 132,
           [Symbol(lastWriteQueueSize)]: 0,
           [Symbol(timeout)]: null,
           [Symbol(kBytesRead)]: 0,
           [Symbol(kBytesWritten)]: 0 },
        stdout:
         Socket {
           connecting: false,
           _hadError: false,
           _handle: null,
           _parent: null,
           _host: null,
           _readableState: [ReadableState],
           readable: false,
           _events: [Object],
           _eventsCount: 2,
           _maxListeners: undefined,
           _writableState: [WritableState],
           writable: false,
           allowHalfOpen: false,
           _sockname: null,
           _pendingData: null,
           _pendingEncoding: '',
           server: null,
           _server: null,
           write: [Function: writeAfterFIN],
           [Symbol(asyncId)]: 133,
           [Symbol(lastWriteQueueSize)]: 0,
           [Symbol(timeout)]: null,
           [Symbol(kBytesRead)]: 0,
           [Symbol(kBytesWritten)]: 0 },
        stderr:
         Socket {
           connecting: false,
           _hadError: false,
           _handle: null,
           _parent: null,
           _host: null,
           _readableState: [ReadableState],
           readable: false,
           _events: [Object],
           _eventsCount: 2,
           _maxListeners: undefined,
           _writableState: [WritableState],
           writable: false,
           allowHalfOpen: false,
           _sockname: null,
           _pendingData: null,
           _pendingEncoding: '',
           server: null,
           _server: null,
           write: [Function: writeAfterFIN],
           [Symbol(asyncId)]: 134,
           [Symbol(lastWriteQueueSize)]: 0,
           [Symbol(timeout)]: null,
           [Symbol(kBytesRead)]: 1615,
           [Symbol(kBytesWritten)]: 0 },
        stdio: [ [Socket], [Socket], [Socket] ],
        emit: [Function] },
     stdout: undefined,
     stderr: undefined }
    </anonymous>
  • Node.js Error : spawn process ffmpeg ChildProcessError

    12 juin 2019, par Karnon

    I wanted to make a program like OBS simply.

    My ideal code behavior is to create a child process in Node.js and execute FFMPEG commands to send a webcam stream to yourtube live RTMP server. However, the actual behavior is caused by an error in the child-process-promise module used in node.js.

    I’ve checked several questions, but I don’t have enough experience to understand them, and I hope there’s a clear solution.

    I guess it was because I couldn’t find the command address of FFMPEG in the Node environment. Or is calling from the socket environment a problem ?

    I checked that the FFMPEG command works in a Windows prompt environment.

    ※ Note : FFMPEG environment variables are registered.

    Environment : Window10, node.js, ffmpeg

    The code took advantage of a simple WebSocket example.

    When I first investigated, I thought that the only way to do this was to use "fluent-effmpeg."

    I tried "fluent-ffmpeg" but I couldn’t get my laptop webcam up and running in Windows environments as a parameter for the "fluent-ffmppeg" command.

    I’ve also thought about using WebRTC, but I think it’s not for personal use because it’s a P2P connection. (I also saw how to connect a peer connection to a WebRTC server like Janus, but I didn’t have enough references to understand it.)

    Below is the code of the problem.

    const SocketIO = require("socket.io");
    const ffmpeg = require("fluent-ffmpeg");
    const spawn = require("child-process-promise").spawn;

    module.exports = server => {
     const io = SocketIO(server, { path: "/socket.io" });

     io.on("connection", socket => {
       const req = socket.request;
       const ip = req.headers["x-forwarded-for"] || req.connection.remoteAddress;
       console.log("새로운 클라이언트 접속!", ip, socket.id, req.ip);
       socket.on("disconnect", () => {
         console.log("클라이언트 접속해제", ip, socket.id);
         clearInterval(socket.interval);
       });
       socket.on("error", error => {
         console.error(error);
       });
       socket.on("reply", data => {
         console.log(data);
         ffmpeg_command();
       });
     });

     function ffmpeg_command() {
       let arg = [
         "-f",
         "lavfi",
         "-i",
         "anullsrc=r=16000:cl=mono",
         "-f",
         "dshow",
         "-ac",
         "2",
         "-i",
         "video='HP Truevision HD'",
         "-s",
         "1280x720",
         "-r",
         "10",
         "-vcodec",
         "libx264",
         "-pix_fmt",
         "yuv420p",
         "-preset",
         "ultrafast",
         "-r",
         "25",
         "-g",
         "20",
         "-b:v",
         "2500k",
         "-codec:a",
         "libmp3lame",
         "-ar",
         "44100",
         "-threads",
         "6",
         "-b:a",
         "11025",
         "-bufsize",
         "512k",
         "-f",
         "flv",
         "rtmp://a.rtmp.youtube.com/live2/8dfu-69k0-dxyw-896q"
       ];
       spawn("ffmpeg", arg).catch(e => {
         console.log(e);
       });
     }
    };

    Here’s the error : The expected result is that your webcam is working and YouTube live streaming is successful.

    { ChildProcessError: `ffmpeg -f lavfi -i anullsrc=r=16000:cl=mono -f dshow -ac 2 -i video='HP Truevision HD' -s 1280x720 -r 10 -vcodec libx264 -pix_fmt yuv420p -preset ultrafast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 6 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/8dfu-69k0-dxyw-896q` failed with code 1
       at ChildProcess.<anonymous> (C:\Users\Tricky\Desktop\Work\ESC\ESC_temp\node_modules\child-process-promise\lib\index.js:132:23)
       at ChildProcess.emit (events.js:182:13)
       at ChildProcess.cp.emit (C:\Users\Tricky\Desktop\Work\ESC\ESC_temp\node_modules\child-process-promise\node_modules\cross-spawn\lib\enoent.js:40:29)
       at maybeClose (internal/child_process.js:962:16)
       at Socket.stream.socket.on (internal/child_process.js:381:11)
       at Socket.emit (events.js:182:13)
       at Pipe._handle.close (net.js:606:12)
     name: 'ChildProcessError',
     code: 1,
     childProcess:
      ChildProcess {
        _events: { error: [Function], close: [Function] },
        _eventsCount: 2,
        _maxListeners: undefined,
        _closesNeeded: 3,
        _closesGot: 3,
        connected: false,
        signalCode: null,
        exitCode: 1,
        killed: false,
        spawnfile: 'ffmpeg',
        _handle: null,
        spawnargs:
         [ 'ffmpeg',
           '-f',
           'lavfi',
           '-i',
           'anullsrc=r=16000:cl=mono',
           '-f',
           'dshow',
           '-ac',
           '2',
           '-i',
           'video=\'HP Truevision HD\'',
           '-s',
           '1280x720',
           '-r',
           '10',
           '-vcodec',
           'libx264',
           '-pix_fmt',
           'yuv420p',
           '-preset',
           'ultrafast',
           '-r',
           '25',
           '-g',
           '20',
           '-b:v',
           '2500k',
           '-codec:a',
           'libmp3lame',
           '-ar',
           '44100',
           '-threads',
           '6',
           '-b:a',
           '11025',
           '-bufsize',
           '512k',
           '-f',
           'flv',
           'rtmp://a.rtmp.youtube.com/live2/8dfu-69k0-dxyw-896q' ],
        pid: 18928,
        stdin:
         Socket {
           connecting: false,
           _hadError: false,
           _handle: null,
           _parent: null,
           _host: null,
           _readableState: [ReadableState],
           readable: false,
           _events: [Object],
           _eventsCount: 1,
           _maxListeners: undefined,
           _writableState: [WritableState],
           writable: false,
           allowHalfOpen: false,
           _sockname: null,
           _pendingData: null,
           _pendingEncoding: '',
           server: null,
           _server: null,
           [Symbol(asyncId)]: 132,
           [Symbol(lastWriteQueueSize)]: 0,
           [Symbol(timeout)]: null,
           [Symbol(kBytesRead)]: 0,
           [Symbol(kBytesWritten)]: 0 },
        stdout:
         Socket {
           connecting: false,
           _hadError: false,
           _handle: null,
           _parent: null,
           _host: null,
           _readableState: [ReadableState],
           readable: false,
           _events: [Object],
           _eventsCount: 2,
           _maxListeners: undefined,
           _writableState: [WritableState],
           writable: false,
           allowHalfOpen: false,
           _sockname: null,
           _pendingData: null,
           _pendingEncoding: '',
           server: null,
           _server: null,
           write: [Function: writeAfterFIN],
           [Symbol(asyncId)]: 133,
           [Symbol(lastWriteQueueSize)]: 0,
           [Symbol(timeout)]: null,
           [Symbol(kBytesRead)]: 0,
           [Symbol(kBytesWritten)]: 0 },
        stderr:
         Socket {
           connecting: false,
           _hadError: false,
           _handle: null,
           _parent: null,
           _host: null,
           _readableState: [ReadableState],
           readable: false,
           _events: [Object],
           _eventsCount: 2,
           _maxListeners: undefined,
           _writableState: [WritableState],
           writable: false,
           allowHalfOpen: false,
           _sockname: null,
           _pendingData: null,
           _pendingEncoding: '',
           server: null,
           _server: null,
           write: [Function: writeAfterFIN],
           [Symbol(asyncId)]: 134,
           [Symbol(lastWriteQueueSize)]: 0,
           [Symbol(timeout)]: null,
           [Symbol(kBytesRead)]: 1615,
           [Symbol(kBytesWritten)]: 0 },
        stdio: [ [Socket], [Socket], [Socket] ],
        emit: [Function] },
     stdout: undefined,
     stderr: undefined }
    </anonymous>
  • FFMpeg and max bitrate

    26 septembre 2019, par Aurelien Stride

    For a personal project, using AV1 codec, I have a bitrate constraint for a video to 88kbps, with choosen video bitrate at 66kbps and mono audio bitrate at 22kbps.

    I currently use this command :

    ffmpeg -i input.mp4 -c:v libaom-av1 -strict -2 -b:v 66150 -c:a libfdk_aac -ar 22050 -b:a 22050 -ac 1 -maxrate 66150 -bufsize 66150 -vf scale=720:-1 -movflags +faststart output.mp4

    However, my final video has a 95kbps bitrate :

    Duration : 00:01:09.73, start : 0.000000, bitrate : 95 kb/s

    Stream #0:0(und) : Video : av1 (Main) (av01 / 0x31307661), yuv420p(tv, progressive), 720x302, 69 kb/s, 24 fps, 24 tbr, 12288 tbn, 12288 tbc (default)

    Stream #0:1(und) : Audio : aac (LC) (mp4a / 0x6134706D), 22050 Hz, mono, fltp, 22 kb/s (default)

    Is there a method to validate my need ? Is it normal that 66+22>88kbps ?

    Regards,

    EDIT 1 : as @Gyan suggested, I’ve tried to reduce -bufsize parameter, but I still have a too high bitrate. The most working way is to set video bitrate -b:v to 50kbps, but it gives poorer image...

    ffmpeg -i input.mp4 -c:v libaom-av1 -strict -2 -b:v 50k -c:a libfdk_aac -ar 22050 -b:a 22050 -ac 1 -minrate 33075 -maxrate 66150 -bufsize 44100 -vf scale=-1:360 -movflags +faststart -threads 1 output.mp4

    Any idea to limit overhead, if overhead is in cause ?