Recherche avancée

Médias (1)

Mot : - Tags -/copyleft

Autres articles (44)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

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

Sur d’autres sites (8131)

  • Recording a webpage stream with multiple requests using PhantomJS & ffmpeg to /dev/stdout leads to ffmpeg error

    2 septembre 2016, par Allisson Ferreira

    First of all, sorry for my english.

    I’m in a quest for days. I’ve researched everywhere and I couldn’t find an answer to my problem.

    I’m using Nodejs, Phantomjs and ffmpeg in this scenary :

    • An user enters the site, login with facebook and he can ask for a video with his name and some random photos (gathered by /me/ & sent via JSON POST) ;
    • Node receive the user data, creates a child process (PhantomJS + ffmpeg) and awaits for a response to send the video URL to the user.

    When I run a single instance of this request, everything is working fine. BUT, when two or more users make the request, only one video is sent and the others process end up in a ffmpeg stream error.

    I think the reason is that all the ffmpeg processes are using the same place (/dev/stdout). Since one process is already using it, the others enters in a "can’t access" error. But it is a assumption, I don’t know how /dev/stdout really works.

    Here are my codes. (I have removed some lines and renamed some variables for better understanding, sorry for any mistake)

    index.js :

    var generateVideo = 'phantomjs phantom.js '+videoID+' '+userID+' | ffmpeg -vcodec png -f image2pipe -r 30 -i - -pix_fmt yuv420p public/videos/'+userID+'/'+videoID+'.mp4 -y';

    childProcess.exec(generateVideo, function(err, stdout, stderr) {
       var json    = {};
       json.video  = '/videos/'+userID+'/'+videoID+'.mp4';
       res.send(json);
    });

    phantom.js :

    var page            = require('webpage').create();
    page.viewportSize   = { width: 1366, height: 768 };
    page.settings.resourceTimeout = 10000;

    var args            = require('system').args;
    var videoID         = args[1];
    var userID          = args[2];

    page.open('http://localhost:3000/recordvideo/'+videoID, 'post', function(status){
       var frame       = 0;
       var target_fps  = 30;
       var maxframes   = page.evaluate(function () {
                           return getTotalDurationInSeconds();
                       }) * target_fps;

       setInterval(function(){
           page.render('/dev/stdout', { format: "png" });
           if( frame >= maxframes ){
               phantom.exit();
           }
           frame++;
       }, (1000 / target_fps));
    });

    And the error :

    [Error: Command failed: /bin/sh -c phantomjs phantom.js XXXXXXXX XXXXXXXX | ffmpeg -vcodec png -f image2pipe -r 30 -i - -pix_fmt yuv420p public/videos/XXXXXXXX/XXXXXXXX.mp4 -y
    www-0 ffmpeg version N-80901-gfebc862 Copyright (c) 2000-2016 the FFmpeg developers
    www-0   built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
    www-0   configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libfreetype --enable-gnutls --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvidstab
    www-0   libavutil      55. 28.100 / 55. 28.100
    www-0   libavcodec     57. 48.101 / 57. 48.101
    www-0   libavformat    57. 41.100 / 57. 41.100
    www-0   libavdevice    57.  0.102 / 57.  0.102
    www-0   libavfilter     6. 47.100 /  6. 47.100
    www-0   libavresample   3.  0.  0 /  3.  0.  0
    www-0   libswscale      4.  1.100 /  4.  1.100
    www-0   libswresample   2.  1.100 /  2.  1.100
    www-0   libpostproc    54.  0.100 / 54.  0.100
    www-0 [png @ 0x3d7c4a0] Invalid PNG signature 0x46726F6D20506861.
    www-0 [image2pipe @ 0x3d72780] decoding for stream 0 failed
    www-0 [image2pipe @ 0x3d72780] Could not find codec parameters for stream 0 (Video: png, none(pc)): unspecified size
    www-0 Consider increasing the value for the 'analyzeduration' and 'probesize' options
    www-0 Input #0, image2pipe, from 'pipe:':
    www-0   Duration: N/A, bitrate: N/A
    www-0     Stream #0:0: Video: png, none(pc), 30 tbr, 30 tbn, 30 tbc
    www-0 [buffer @ 0x3d81540] Unable to parse option value "0x0" as image size
    www-0 [buffer @ 0x3d81540] Unable to parse option value "-1" as pixel format
    www-0 [buffer @ 0x3d81540] Unable to parse option value "0x0" as image size
    www-0 [buffer @ 0x3d81540] Error setting option video_size to value 0x0.
    www-0 [graph 0 input from stream 0:0 @ 0x3d72600] Error applying options to the filter.
    www-0 Error opening filters!
    www-0 ]

    I really hope that I can find an answer here !
    And sorry if there already is an answer for this. But I researched for days.

    Thank you in advance !

  • Java - RTSP save snapshot from Stream Packets

    9 août 2016, par Guerino Rodella

    I’m developing an application which requests snapshots to DVR and IP Cameras. The device I’m working on just offer RTSP requests to do so. Then I implemented the necessary RTSP methods to start receiving the stream packets and I started receiving then via UDP connection established. My doubt is, how can I save the received data to a jpeg file ? Where’s the begging and end of the image bytes received ?

    I searched a lot libraries which implement this type of service in Java, like Xuggler ( which it’s maintained no more ), javacpp-presets - has ffmpeg and opencv libraries included - I had some environment problems with it. If someone know an easy and good one which saves snapshots from the streams, let me know.

    My code :

    final long timeout = System.currentTimeMillis() + 3000;

    byte[] fullImage = new byte[ 1024 * 1024 ];
    DatagramSocket udpSocket = new DatagramSocket( 8000 );
    int lastByte = 0;

    // Skip first 2 packets because I think they are HEADERS
    // Since I don't know what they mean, I just print then in hexa
    for( int i = 0; i < 2; i++ ){

       byte[] buffer = new byte[ 1024 ];
       DatagramPacket dataPacket = new DatagramPacket( buffer, buffer.length );
       udpSocket.receive( dataPacket );

       int dataLenght = dataPacket.getLength();
       buffer = Arrays.copyOf( buffer, dataLenght );

       System.out.println( "RECEIVED[" + DatatypeConverter.printHexBinary( buffer ) + " L: " + dataLenght );

    }

    do{

       byte[] buffer = new byte[ 1024 ];
       DatagramPacket dataPacket = new DatagramPacket( fullImage, fullImage.length );
       udpSocket.receive( dataPacket );

       System.out.println( "RECEIVED: " + new String( fullImage ) );

       for( int i = 0; i < buffer.length; i++ ){
           fullImage[ i + lastByte ] = buffer[ i ];
           lastByte ++;

       }

    } while( System.currentTimeMillis() < timeout );
    // I know this timeout is wrong, I should stop after getting full image bytes

    The output :

    RECEIVED : 80E0000100004650000000006742E01FDA014016C4 L : 21
    RECEIVED : 80E00002000046500000000068CE30A480 L : 17
    RECEIVED : Tons of data from the streaming...
    RECEIVED : Tons of data from the streaming...
    RECEIVED : Tons of data from the streaming...
    [...]

    As you might suppose, the image I’m saving into a file is not readable because I’m doing it wrong. I think the header provide me some info about the next packets the server will sent me telling the start and the end of the image from the streaming. But I don’t understood them. Someone know how to solve it ? Any tips are welcome !

  • streaming webcam via rtp protocol

    18 août 2016, par vasu gupta

    i am trying to stream and receive my webcam feed on two terminal on same laptop.For this purpose I am using the following commands :-

    foo.sdp :

    SDP:
    v=0
    o=- 0 0 IN IP4 127.0.0.1
    s=No Name
    c=IN IP4 127.0.0.1
    t=0 0
    a=tool:libavformat 55.2.100
    m=video 1235 RTP/AVP 96
    a=rtpmap:96 H264/90000
    a=fmtp:96 packetization-mode=1

    Transmitting :

    ffmpeg -re -i /dev/video0 -r 24 -b 50k -s 858x500 -f mulaw -f rtp rtp://127.0.0.1:3000> foo.sdp

    Receiving :

    ffplay -i foo.sdp

    While transmission seems to be working fine , but when i am using receiving command I am getting en error :

    Protocol not on whitelist 'file,crypto'!/0  
    foo.sdp: Invalid data found when processing input