Recherche avancée

Médias (91)

Autres articles (57)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

  • (Dés)Activation de fonctionnalités (plugins)

    18 février 2011, par

    Pour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
    SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
    Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
    MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...)

Sur d’autres sites (10007)

  • How to hide/disable ffmpeg erros when using OpenCV (python) ?

    29 septembre 2013, par Mehran

    I'm using OpenCV python to capture a video.
    This is my code

    import cv2

    cap = cv2.VideoCapture("vid.mp4")
    while True:
       flag, frame =  cap.read()

       if not flag:
           cv2.imshow('video', frame)

       if cv2.waitKey(10) == 27:
           break

    When a frame is not ready it produces an error like this

    enter image description here

    or

    Truncating packet of size 2916 to 1536
    [h264 @ 0x7ffa4180be00] AVC: nal size 2912
    [h264 @ 0x7ffa4180be00] AVC: nal size 2912
    [h264 @ 0x7ffa4180be00] no frame!

    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ffa41803000] stream 0, offset 0x14565: partial file

    I wanted to find a way to hide this error ! I guess that this error is being produced by ffmpeg. Is there any way to hide or disable it ?

    This error is produced when I call cap.read(). And I also tried to wrap it with try ... except ... but it doesn't work because it doesn't throw any exceptions.

  • Variable size for ffmpeg filter

    15 novembre 2013, par DrakaSAN

    I am creating a bunch of script to easily use ffmpeg.

    All my scripts now work, but a lot of value are hardcoded, which make them wanting exact size for the video (854x240, size of my tests videos)

    A good example is better than long explanation :

    ffmpeg -i 0.mp4 -vf "
    scale=854/2:-1 [low];
    color=c=black@1.0:s=854x240:r=29.97:d=30.0 [bg];
    movie=1.mp4, scale=854/2:-1 [high];
    [bg][high] overlay=0:0 [bgh];
    [bgh][low] overlay=854/2:-1" leftright.mp4

    It take 0.mp4 and 1.mp4 and put them side by side in the same video. But the dimension value are hardcoded. But it work.

    I know I can use iw and ih as "input width" and "input height" for the first scale filter, but when I try to put anything else as dimension for the color background, it just throw me a error :

    Unable to parse option value "iw:ih" as image size
    Unable to parse option value "iw:240" as image size
    Unable to parse option value "860*2:240" as image size

    and I end up to put 1720x240 again, which is really bad.

    Is there a way to bypass this, or to put input-dependent value ?

    Edit :

    Starting with video 1.mp4 (854x240) and 2.mp4 (520x520) (example value), put them side by side in out.mp4 (which in this case will have the dimension max(height)x(2xmax(width)), so in this case 854x1040), with black background.

     ax
    <---->
    .____.^
    |    ||
    |  1 ||
    |    ||ay
    |    ||
    |____|V

       bx
    <-------->
    .________.^
    |   2    ||by
    |________|V

    Will end up as

    ay>ax
    bx>by

       bx        bx
    <--------><-------->
    xx.____.xxxxxxxxxxxx^
    xx|    |xxxxxxxxxxxx|
    xx|  1 |xx.________.|
    xx|    |xx|    2   ||ay
    xx|    |xx|________||
    xx|____|xxxxxxxxxxxxV
  • 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 ?