Recherche avancée

Médias (1)

Mot : - Tags -/net art

Autres articles (63)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

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

Sur d’autres sites (9620)

  • ffmpeg disconnects from the HTTP server

    29 janvier 2017, par Frédéric Lopes

    I am facing to a problem that I cannot solve for days now and cannot find any answer over internet..

    I am currently working on a live streaming & IoT project through internet in order to access to indoor items and see through a webcam. I am using Node.js for the server side and using a mpeg1video decoder working with WebSocket (https://github.com/phoboslab/jsmpeg).

    All the server side (HTTP + WebSocket server) and client side are working properly (I see the clients connecting and waiting for sockets) but when I try to stream a video (or a camera) ffmpeg is not keeping the connection with my HTTP server, the connection is established but it is disconnected 1 second after being connected... Here is the terminal outputs gathered :

    if( process.argv.length < 4 ) {
       console.log(
           'Usage: \n' +
           'node stream-server.js [ ]'
       );
       process.exit();
    }

    var STREAM_PORT = process.argv[2] || 8080,
           WEBSOCKET_PORT = process.argv[3] || 8081,
           STREAM_MAGIC_BYTES = 'jsmp'; // Must be 4 bytes

    var width = 320,
           height = 240;

    // Websocket Server
    var socketServer = new (require('ws').Server)({port: WEBSOCKET_PORT});
    socketServer.on('connection', function(socket) {
       // Send magic bytes and video size to the newly connected socket
       // struct { char magic[4]; unsigned short width, height;}
       var streamHeader = new Buffer(8);
       streamHeader.write(STREAM_MAGIC_BYTES);
       streamHeader.writeUInt16BE(width, 4);
       streamHeader.writeUInt16BE(height, 6);
       socket.send(streamHeader, {binary:true});

       console.log('New WebSocket Connection ('+socketServer.clients.length+' total)');

       socket.on('close', function(code, message){
           console.log( 'Disconnected WebSocket ('+socketServer.clients.length+' total)' );
       });
    });

    socketServer.broadcast = function(data, opts) {
       for( var i in this.clients ) {
           if (this.clients[i].readyState == 1) {
               this.clients[i].send(data, opts);
           }
           else {
               console.log( 'Error: Client ('+i+') not connected.' );
           }
       }
    };

    // HTTP Server to accept incomming MPEG Stream
    var streamConnected = false;
    var streamServer = require('http').createServer(function(request, response) {
       response.connection.setTimeout(0);
       if(streamConnected) {
           response.end();
           return;
       }
       streamConnected = true;

       var params = request.url.substr(1).split('/');

       width = (params[0] || 320)|0;
       height = (params[1] || 240)|0;

       console.log(
           'Stream Connected: ' + request.socket.remoteAddress +
           ':' + request.socket.remotePort + ' size: ' + width + 'x' + height
       );

       request.on('data', function(data){
           socketServer.broadcast(data, {binary:true});
       });

       request.on('close', function(data){
           console.log("Stream disconnected");
           streamConnected = false;
       });

    }).listen(STREAM_PORT);

    console.log('Listening for MPEG Stream on http://127.0.0.1:'+STREAM_PORT+'/<width>/<height>');
    console.log('Awaiting WebSocket connections on ws://127.0.0.1:'+WEBSOCKET_PORT+'/');
    </height></width>

    Once the server running, I am using the command line to send my video to the http server :

    ffmpeg -f mp4 -i in.mp4 -f mpeg1video -r 30 http://127.0.0.1:8080

    Unfortunatelly, the connection is established for 1 seconde maximum and it disconnects right after.. I tried everything to keep it even setting a timeout to the request of ffmpeg.

    Thank you for those who are going to help me with this issue !

    UPDATE : Outputs gathered on the terminal

    1st is the output generated by ffmpeg :

    MacBook-Pro-de-Frederic: ffmpeg -f mp4 -i in.mp4 -f mpeg1video -r 30 http://127.0.0.1:8080
    ffmpeg version 3.2.2 Copyright (c) 2000-2016 the FFmpeg developers
     built with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
     configuration: --prefix=/Volumes/Ramdisk/sw --enable-gpl --enable-pthreads --enable-version3 --enable-libspeex --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-libgsm --enable-libvidstab --enable-libx265 --disable-doc --arch=x86_64 --enable-runtime-cpudetect
     libavutil      55. 34.100 / 55. 34.100
     libavcodec     57. 64.101 / 57. 64.101
     libavformat    57. 56.100 / 57. 56.100
     libavdevice    57.  1.100 / 57.  1.100
     libavfilter     6. 65.100 /  6. 65.100
     libswscale      4.  2.100 /  4.  2.100
     libswresample   2.  3.100 /  2.  3.100
     libpostproc    54.  1.100 / 54.  1.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'in.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf56.25.101
     Duration: 00:00:13.29, start: 0.000000, bitrate: 490 kb/s
       Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 300x198 [SAR 1:1 DAR 50:33], 489 kb/s, 22.73 fps, 22.73 tbr, 16k tbn, 45.45 tbc (default)
       Metadata:
         handler_name    : VideoHandler
    Output #0, mpeg1video, to 'http://127.0.0.1:8080':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf57.56.100
       Stream #0:0(und): Video: mpeg1video, yuv420p, 300x198 [SAR 1:1 DAR 50:33], q=2-31, 200 kb/s, 30 fps, 30 tbn, 30 tbc (default)
       Metadata:
         handler_name    : VideoHandler
         encoder         : Lavc57.64.101 mpeg1video
       Side data:
         cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
    Stream mapping:
     Stream #0:0 -> #0:0 (h264 (native) -> mpeg1video (native))
    Press [q] to stop, [?] for help
    frame=  398 fps=0.0 q=7.2 Lsize=     540kB time=00:00:13.23 bitrate= 334.2kbits/s dup=96 drop=0 speed=49.7x    
    video:540kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%

    2nd output, the prints of the Node.js script :

    MacBook-Pro-de-Frederic: node stream-server.js 8080 8081
    Listening for MPEG Stream on http://127.0.0.1:8080/<width>/<height>
    Awaiting WebSocket connections on ws://127.0.0.1:8081/
    New WebSocket Connection (1 total)
    Stream Connected: ::ffff:127.0.0.1:52444 size: 320x240
    Stream disconnected
    </height></width>

    As you can see, my server receives the stream from ffmpeg but is disconnected right after.. Thus, I cannot do any stream and I don’t understand why because there is not any error that appears..

    UPDATE 2 : TESTED ON RASPBERRYPI MODEL B+

    I tested all the code hereabove on raspberry pi (after 5h installing ffmpeg..) and launch the encoding with the terminal command hereafter and it works perfectly ! I am still wondering why it is not working properly on Mac ? Maybe a problem of compatibility between OSX and FFMPEG ? If someone has an answer or an idea of the solution to the problem on Macintosh, let me know !

    raspivid -t 0 -w 320 -h 240 -fps 20 -vf -o - | ffmpeg -y -i pipe:0 -s 320x240 -f video4linux2 -f mpeg1video -b 400k -r 30 http://127.0.0.1:8080

    Configuration used : Macbook Pro updated running Node.js 6.9.2 & ffmpeg 3.2.2.

    Frederic

  • OSError : [Errno 2] No such file or directory - code worked on new computer doesnt work on old one

    9 mars 2016, par Natasha Hoherchak

    I wrote a script to extract frames from a database I have stored on my computer desktop. I wrote the code on a different computer (new macbook pro 2016) as my computer’s harddrive died. I was finally able to restore my computer (and therefore returned the new computer I wrote the code on).

    I am trying to run the same script, completely unchanged and I keep getting this error : (The line btwn ** ATTENTION** is the printed command line.)

    --------------------------**********ATTENTION**********-------------------------
    ffmpeg -i /Desktop/UCF101/v_BaseballPitch_g01_c01.avi -ss 00:00:00.0 -vframes 1 BPout0.png
    --------------------------**********ATTENTION**********-------------------------
    Traceback (most recent call last):
     File "./Desktop/processing.py", line 50, in <module>
       processvideo('/Desktop/UCF101/v_BaseballPitch_g01_c01.avi')
     File "./Desktop/processing.py", line 47, in processvideo
       sp.check_output(args) #was cmdline
     File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 568, in check_output
       process = Popen(stdout=PIPE, *popenargs, **kwargs)
     File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 711, in __init__
       errread, errwrite)
     File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1308, in _execute_child
       raise child_exception
    OSError: [Errno 2] No such file or directory
    </module>

    Everything is in the same place as it was on the new computer where it was able to run successfully. Does anyone have any idea what it could be ? Could my version of python have anything to do with it ? Could it be a larger issue on my computer ? Any tips for debugging whats caused this error ? I’ve already printed the command (matches perfectly), used shlex.split("mycommandline"), checked my current directory in the script...

  • ffmpeg screen recording with camera overlay on OSX

    8 novembre 2015, par lockdoc

    I would like to use ffmpeg to record my desktop as well as my camera as an overlay on top of the desktop.

    So basically I will have two input sources that need to be recorded

    $ ffmpeg -f avfoundation -list_devices true -i ''
    [AVFoundation input device @ 0x7fded1c223e0] AVFoundation video devices:
    [AVFoundation input device @ 0x7fded1c223e0] [0] FaceTime HD Camera
    [AVFoundation input device @ 0x7fded1c223e0] [1] Capture screen 0
    [AVFoundation input device @ 0x7fded1c223e0] AVFoundation audio devices:
    [AVFoundation input device @ 0x7fded1c223e0] [0] Built-in Microphone

    From the above, I need [0] FaceTime HD Camera as an overlay and [1] Capture screen 0 as the main video.

    Is this even possible ?

    UPDATE (2015-10-06) :

    I found the following command from ffscreencast :

    ffmpeg \
    -f avfoundation -i "1" \
    -f avfoundation -r 30 -video_size 640x480 -i "0" \
    -c:v libx264 -crf 0 -preset ultrafast \
    -filter_complex 'overlay=main_w-overlay_w-10:main_h-overlay_h-10' "out.mkv"

    Unfortunately the output has a pretty slow framerate (i7 Macbook Pro 2014)

    Output #0, matroska, to 'out.mkv':
     Metadata:
    encoder         : Lavf56.40.101
    Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv420p, 3840x2400, q=-1--1, 1000k fps, 1k tbn, 1000k tbc (default)
    Metadata:
     encoder         : Lavc56.60.100 libx264
    Stream mapping:
     Stream #0:0 (rawvideo) -> overlay:main
     Stream #1:0 (rawvideo) -> overlay:overlay
     overlay -> Stream #0:0 (libx264)

    frame=  756 fps=9.1 q=-1.0 Lsize=  193660kB time=00:01:21.86 bitrate=19378.5kbits/s
    Press [q] to stop, [?] for help

    Anyone an idea of how to get a higher framerate ?
    My camera is only able to record at 30 frames per second, but the output seems to only have around 9 frames. Why the difference ?