Recherche avancée

Médias (1)

Mot : - Tags -/portrait

Autres articles (56)

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
    Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

Sur d’autres sites (8766)

  • ffmpeg reading from pipe to pipe doesn't work

    28 octobre 2022, par greg

    I'm trying to read audio data from one stream to other passing it through ffmpeg process.

    


    Process? CreateStream()
{
    return Process.Start(new ProcessStartInfo
    {
        FileName = @"sources\ffmpeg",
        Arguments = @"-hide_banner -i pipe:0 -f mp3 pipe:1",
        UseShellExecute = false,
        RedirectStandardInput = true,
        RedirectStandardOutput = true
    });
}


    


    For this i use OutputDataReceived event :

    


    private void Ffmpeg_OutputDataReceived(object sender, DataReceivedEventArgs e)
{
    if (e.Data != null)
    {
        var bytes = Encoding.Unicode.GetBytes(e.Data);

        //writing data to another stream
    }
}


    


    But it falls at the end (even if i only getting data from input stream standart output without writing it it to output stream) with :

    


    


    Input #0, matroska,webm, from 'pipe:0' :
Metadata :
encoder : google/video-file
Duration : 00:03:13.12, start : -0.007000, bitrate : N/A
Stream #0:0(eng) : Audio : opus, 48000 Hz, stereo, fltp (default)
Stream mapping :
Stream #0:0 -> #0:0 (opus (native) -> mp3 (libmp3lame))
Output #0, mp3, to 'pipe:1' :
Metadata :
TSSE : Lavf59.27.100
Stream #0:0(eng) : Audio : mp3, 48000 Hz, stereo, fltp (default)
Metadata :
encoder : Lavc59.37.100 libmp3lame
size= 2969kB time=00:03:09.99 bitrate= 128.0kbits/s speed=47.5x

    


    


    


    av_interleaved_write_frame() : Invalid argument
Last message repeated 4 times

    


    


    


    Error writing trailer of pipe:1 : Invalid argument
size= 2997kB time=00:03:11.91 bitrate= 127.9kbits/s speed=47.4x
video:0kB audio:2999kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead : unknown

    


    


    


    Error closing file pipe:1 : Invalid argument
Conversion failed !

    


    


    It works well when i reading data from stream to file, what means that input data is valid :

    


    Arguments = @"-hide_banner -i pipe:0 -f mp3 output.mp3"


    


    main function code (it is the same for all examples) :

    


    async Task Do() 
{
    using (var ffmpeg = CreateStream())
    {
        if (ffmpeg == null) return;

        ffmpeg.OutputDataReceived += Ffmpeg_OutputDataReceived;

        using (var audioStream = GetInputStream())
        {
            ffmpeg.BeginOutputReadLine();
            await audioStream.CopyToAsync(ffmpeg.StandardInput.BaseStream);
            ffmpeg.StandardInput.Close();
        }
    }
}


    


  • Unhandled stream error in pipe : write EPIPE in Node.js

    13 juillet 2020, par Michael Romanenko

    The idea is to serve screenshots of RTSP video stream with Express.js server. There is a continuously running spawned openRTSP process in flowing mode (it's stdout is consumed by another ffmpeg process) :

    



    function spawnProcesses (camera) {
  var openRTSP = spawn('openRTSP', ['-c', '-v', '-t', camera.rtsp_url]),
      encoder = spawn('ffmpeg', ['-i', 'pipe:', '-an', '-vcodec', 'libvpx', '-r', 10, '-f', 'webm', 'pipe:1']);

  openRTSP.stdout.pipe(encoder.stdin);

  openRTSP.on('close', function (code) {
    if (code !== 0) {
      console.log('Encoder process exited with code ' + code);
    }
  });

  encoder.on('close', function (code) {
    if (code !== 0) {
      console.log('Encoder process exited with code ' + code);
    }
  });

  return { rtsp: openRTSP, encoder: encoder };
}

...

camera.proc = spawnProcesses(camera);


    



    There is an Express server with single route :

    



    app.get('/cameras/:id.jpg', function(req, res){
  var camera = _.find(cameras, {id: parseInt(req.params.id, 10)});
  if (camera) {
    res.set({'Content-Type': 'image/jpeg'});
    var ffmpeg = spawn('ffmpeg', ['-i', 'pipe:', '-an', '-vframes', '1', '-s', '800x600', '-f', 'image2', 'pipe:1']);
    camera.proc.rtsp.stdout.pipe(ffmpeg.stdin);
    ffmpeg.stdout.pipe(res);
  } else {
    res.status(404).send('Not found');
  }
});

app.listen(3333);


    



    When i request http://localhost:3333/cameras/1.jpg i get desired image, but from time to time app breaks with error :

    



    stream.js:94
  throw er; // Unhandled stream error in pipe.
        ^
Error: write EPIPE
    at errnoException (net.js:901:11)
    at Object.afterWrite (net.js:718:19)


    



    Strange thing is that sometimes it successfully streams image to res stream and closes child process without any error, but, sometimes, streams image and falls down.

    



    I tried to create on('error', ...) event handlers on every possible stream, tried to change pipe(...) calls to on('data',...) constructions, but could not succeed.

    



    My environment : node v0.10.22, OSX Mavericks 10.9.

    



    UPDATE :

    



    I wrapped spawn('ffmpeg',... block with try-catch :

    



    app.get('/cameras/:id.jpg', function(req, res){
....
    try {
      var ffmpeg = spawn('ffmpeg', ['-i', 'pipe:', '-an', '-vframes', '1', '-s', '800x600', '-f', 'image2', 'pipe:1']);
      camera.proc.rtsp.stdout.pipe(ffmpeg.stdin);
      ffmpeg.stdout.pipe(res);
    } catch (e) {
      console.log("Gotcha!", e);
    }
....
});


    



    ... and this error disappeared, but log is silent, it doesn't catch any errors. What's wrong ?

    


  • Unhandled stream error in pipe : write EPIPE in Node.js

    28 novembre 2013, par Michael Romanenko

    The idea is to serve screenshots of RTSP video stream with Express.js server. There is a continuously running spawned openRTSP process in flowing mode (it's stdout is consumed by another ffmpeg process) :

    function spawnProcesses (camera) {
     var openRTSP = spawn('openRTSP', ['-c', '-v', '-t', camera.rtsp_url]),
         encoder = spawn('ffmpeg', ['-i', 'pipe:', '-an', '-vcodec', 'libvpx', '-r', 10, '-f', 'webm', 'pipe:1']);

     openRTSP.stdout.pipe(encoder.stdin);

     openRTSP.on('close', function (code) {
       if (code !== 0) {
         console.log('Encoder process exited with code ' + code);
       }
     });

     encoder.on('close', function (code) {
       if (code !== 0) {
         console.log('Encoder process exited with code ' + code);
       }
     });

     return { rtsp: openRTSP, encoder: encoder };
    }

    ...

    camera.proc = spawnProcesses(camera);

    There is an Express server with single route :

    app.get('/cameras/:id.jpg', function(req, res){
     var camera = _.find(cameras, {id: parseInt(req.params.id, 10)});
     if (camera) {
       res.set({'Content-Type': 'image/jpeg'});
       var ffmpeg = spawn('ffmpeg', ['-i', 'pipe:', '-an', '-vframes', '1', '-s', '800x600', '-f', 'image2', 'pipe:1']);
       camera.proc.rtsp.stdout.pipe(ffmpeg.stdin);
       ffmpeg.stdout.pipe(res);
     } else {
       res.status(404).send('Not found');
     }
    });

    app.listen(3333);

    When i request http://localhost:3333/cameras/1.jpg i get desired image, but from time to time app breaks with error :

    stream.js:94
     throw er; // Unhandled stream error in pipe.
           ^
    Error: write EPIPE
       at errnoException (net.js:901:11)
       at Object.afterWrite (net.js:718:19)

    Strange thing is that sometimes it successfully streams image to res stream and closes child process without any error, but, sometimes, streams image and falls down.

    I tried to create on('error', ...) event handlers on every possible stream, tried to change pipe(...) calls to on('data',...) constructions, but could not succeed.

    My environment : node v0.10.22, OSX Mavericks 10.9.

    UPDATE :

    I wrapped spawn('ffmpeg',... block with try-catch :

    app.get('/cameras/:id.jpg', function(req, res){
    ....
       try {
         var ffmpeg = spawn('ffmpeg', ['-i', 'pipe:', '-an', '-vframes', '1', '-s', '800x600', '-f', 'image2', 'pipe:1']);
         camera.proc.rtsp.stdout.pipe(ffmpeg.stdin);
         ffmpeg.stdout.pipe(res);
       } catch (e) {
         console.log("Gotcha!", e);
       }
    ....
    });

    ... and this error disappeared, but log is silent, it doesn't catch any errors. What's wrong ?