Recherche avancée

Médias (29)

Mot : - Tags -/Musique

Autres articles (70)

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

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

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (7182)

  • Use Named Pipe (C++) to send images to FFMPEG

    10 décembre 2017, par user1829136

    I have the following code in C++ :

    #include <iostream>
    #include
    #include <iostream>     // std::cout
    #include <fstream>      // std::ifstream
    #include <vector>
    #include

    using namespace std;

    int main(int argc, const char **argv)
    {
       wcout &lt;&lt; "Creating an instance of a named pipe..." &lt;&lt; endl;

       // Create a pipe to send data
       HANDLE pipe = CreateNamedPipe(
           L"\\\\.\\pipe\\my_pipe", // name of the pipe
           PIPE_ACCESS_OUTBOUND, // 1-way pipe -- send only
           PIPE_TYPE_BYTE, // send data as a byte stream
           1, // only allow 1 instance of this pipe
           0, // no outbound buffer
           0, // no inbound buffer
           0, // use default wait time
           NULL // use default security attributes
       );

       if (pipe == NULL || pipe == INVALID_HANDLE_VALUE) {
           wcout &lt;&lt; "Failed to create outbound pipe instance.";
           // look up error code here using GetLastError()
           system("pause");
           return 1;
       }

       wcout &lt;&lt; "Waiting for a client to connect to the pipe..." &lt;&lt; endl;

       // This call blocks until a client process connects to the pipe
       BOOL result = ConnectNamedPipe(pipe, NULL);
       if (!result) {
           wcout &lt;&lt; "Failed to make connection on named pipe." &lt;&lt; endl;
           // look up error code here using GetLastError()
           CloseHandle(pipe); // close the pipe
           system("pause");
           return 1;
       }

       wcout &lt;&lt; "Sending data to pipe..." &lt;&lt; endl;

       //opening file
       ifstream infile;
       infile.open("E:/xmen.jpg",std::ios::binary);
       ofstream out("E:/lelel.jpg",std::ios::binary);

       infile.seekg(0,std::ios::end);
       size_t file_size_in_byte = infile.tellg();
       vector<char> file_vec;

       file_vec.resize(file_size_in_byte);

       infile.seekg(0,std::ios::beg);
       infile.read(&amp;file_vec[0],file_size_in_byte);

       out.write(&amp;file_vec[0],file_vec.size());

       wcout&lt;/ This call blocks until a client process reads all the data
       DWORD numBytesWritten = 0;
       result = WriteFile(
           pipe, // handle to our outbound pipe
           &amp;file_vec[0], // data to send
           61026, // length of data to send (bytes)
           &amp;numBytesWritten, // will store actual amount of data sent
           NULL // not using overlapped IO
       );


       if (result) {
           wcout &lt;&lt; "Number of bytes sent: " &lt;&lt; numBytesWritten &lt;&lt; endl;
       } else {
           wcout &lt;&lt; "Failed to send data." &lt;&lt; endl;
           // look up error code here using GetLastError()
       }

       // Close the pipe (automatically disconnects client too)
       CloseHandle(pipe);

       wcout &lt;&lt; "Done." &lt;&lt; endl;

       system("pause");
       return 0;
    }
    </char></vector></fstream></iostream></iostream>

    Which I use to create a named pipe \.\pipe\my_pipe, to which FFMPEG connects to, using the following command :

    64-static\bin\Video>ffmpeg.exe -loop 1 -s 4cif -f image2 -y -i \\.\pipe\\my_pipe

    -r 25 -vframes 250 -vcodec rawvideo -an eaeew.mov

    Output :

    ffmpeg version N-54233-g86190af Copyright (c) 2000-2013 the FFmpeg developers
     built on Jun 27 2013 16:49:12 with gcc 4.7.3 (GCC)
     configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib  libavutil      52. 37.101 / 52. 37.101
     libavcodec     55. 17.100 / 55. 17.100
     libavformat    55. 10.100 / 55. 10.100
     libavdevice    55.  2.100 / 55.  2.100
     libavfilter     3. 77.101 /  3. 77.101
     libswscale      2.  3.100 /  2.  3.100
     libswresample   0. 17.102 /  0. 17.102
     libpostproc    52.  3.100 / 52.  3.100
    [image2 @ 0000000003ee04a0] Could find no file with with path '\\.\pipe\\my_pipe
    ' and index in the range 0-4
    \\.\pipe\\my_pipe: No such file or directory

    I can see on my console that my C++ app received a connection, but I get the error above in FFMPEG. Can someone please advise ?

    EDIT 1
    Using the command below

    ffmpeg.exe -s 4cif -i \\.\pipe\my_pipe -r 25 -vframes 250 -vcodec rawvideo -an tess.mov

    I get the following output

    ffmpeg version N-54233-g86190af Copyright (c) 2000-2013 the FFmpeg developers
     built on Jun 27 2013 16:49:12 with gcc 4.7.3 (GCC)
     configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
     libavutil      52. 37.101 / 52. 37.101
     libavcodec     55. 17.100 / 55. 17.100
     libavformat    55. 10.100 / 55. 10.100
     libavdevice    55.  2.100 / 55.  2.100
     libavfilter     3. 77.101 /  3. 77.101
     libswscale      2.  3.100 /  2.  3.100
     libswresample   0. 17.102 /  0. 17.102
     libpostproc    52.  3.100 / 52.  3.100
    \\.\pipe\my_pipe: Invalid data found when processing input

    So, now it seems it was able to connect to the pipe but is not able to process the input.

  • spawn ffmpeg in nodejs and pipe to express's response

    18 décembre 2017, par ViGi

    i am spawning ffmpeg and pipe it’s output (the video stream i want) to express’s response object like this :

    app.get('/stream', (req, res) => {
       let _url = req.query.url;

       if(_url){  

           res.writeHead(200, {
               'Access-Control-Allow-Origin': '*',
               'Connection': 'Keep-Alive',
               'Content-Type': 'video/mp4'
           });

           // transcode rtsp input from ip-cam to mp4 file format (video: h.264 | audio: aac)
           let ffmpeg = child_process.spawn("ffmpeg",[
               "-probesize","2147483647",
               "-analyzeduration","2147483647",
               "-i", _url,
               "-vcodec","copy",
               "-f", "mp4",            
               "-movflags","frag_keyframe+empty_moov+faststart",
               "-frag_duration","3600",
               "pipe:1"              
           ]);        


           // redirect transcoded ip-cam stream to http response
           ffmpeg.stdout.pipe(res);

           // error logging
           ffmpeg.stderr.setEncoding('utf8');      
           ffmpeg.stderr.on('data', (data) => {
               console.log(data);
           });
       }
       else{
           res.end();
       }

    so far it’s working like a charm.
    however somewhere in there seems to be a cap. i can get only 3 streams running at the same time. when a 4th spawn occurs the 4th thread will block one of the cpu cores :

    htop of my raspberry pi 3

    and naturally the 4th stream does not reach the browser..
    has somebody any idea of what am i missing ?

    EDIT : it’s not tied to the fact that i am running the nodejs project on the raspberry pi. it also behaves the same way on my windows 10 machine

  • youtube-dl streaming to pipe, how to add container

    24 décembre 2017, par MetNP

    I use this command on raspberry-pi :

    youtube-dl -o- [youtubeurl] | omxplayer --no-keys pipe:0

    and it works great for 50% of youtube content. For non-working videos, omxplayer just won’t play it. It is not raspberry nor omxplayer specific problem. All players are ffmpeg based and for those videos the same problem can be achieved on any platform with ffplay or ffmpeg live transcode...

    When i download that kind of video separatelly :

    youtube-dl -o name.mp4 [url]
    ffplay name.mp4                   ... works OK
    cat name.mp4 | ffplay -           ... does NOT work (input stream not recognized well)

    Reason for this problem is well explained here. MP4 by itself is not good enough for streaming, and i want just to envelope it inside some TS or MKV or any container that will help player.

    Does someone have an idea how to do it ? Can youtube-dl be forced to do it itself, and can some middle ffmpeg command helps ?

    update : thanks to directions from Mulvya comment, it seems that all video works well with -f mp4 addition :

    youtube-dl -o- -f mp4 [youtubeurl] | omxplayer --no-keys pipe:0

    selecting specific format like -f 135+140 breaks pipe usability, and will not work except with some possible code changes. Until i reach some other problematic video content, it seems that -f mp4 solved everything.