Recherche avancée

Médias (1)

Mot : - Tags -/lev manovitch

Autres articles (25)

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

Sur d’autres sites (3983)

  • ffmpeg - continuous file streaming over RTMP

    1er mai 2013, par Sébastien Renauld

    I've been looking around for a simple (or perhaps not-so-simple) walkaround for a problem I am having in my set up for a simple test case : video streaming over red5 media server.

    I have built a small-ish library of FLV files scraped from YouTube and managed to play them in succession with the following perl script :

    use Cwd;
    use strict;
    use warnings;
    use DBI;
    use DBD::mysql;

    our $db = DBI->connect();
    my $dst = "/home/seb/youtube/";
    sub streamFile {
       my $r = $db->prepare("SELECT name FROM music_flvs ORDER BY RAND() LIMIT 1");
       $r->execute();
       my @data = $r->fetchrow_array();
       my $filename = $data[0]
       my $t = `ffmpeg -re -i '${dst}${filename}' -ab 48k -ac 1 -vcodec libx264 -crf 30 -s "640x480" -acodec libfaac -ar 44100 -threads 4 -f flv 'rtmp://server/oflaDemo/music'`;
       return 1;
    }
    while (&streamFile()) {
    }

    This script does its purpose extremely well : it plays files one by one through ffmpeg. However, it does so with a crucial problem : it causes an Unpublish event every time it swaps songs, which causes all the clients to disconnect. I would like to prevent this. The event manifests itself in ActionScript as this :

    16:33:54:209 - Playback - NetStream.Play.UnpublishNotify
    16:33:54:209 - Playback - NetStream.Play.PublishNotify

    I have seen the concat demuxer and believe that it might somewhat help me. The question is pretty simple : what is the best way to make ffmpeg stream a playlist to a RTMP server without ever causing an Unpublish event ?

  • RTP packets detected as UDP

    28 février 2017, par user3172852

    Here is what I am trying to do :

    WebRTC endpoint > RTP Endpoint > ffmpeg > RTMP server.

    This is what my SDP file looks like.

    var cm_offer = "v=0\n" +
                 "o=- 3641290734 3641290734 IN IP4 127.0.0.1\n" +
                 "s=nginx\n" +
                 "c=IN IP4 127.0.0.1\n" +
                 "t=0 0\n" +
                 "m=audio 60820 RTP/AVP 0\n" +
                 "a=rtpmap:0 PCMU/8000\n" +
                 "a=recvonly\n" +
                 "m=video 59618 RTP/AVP 101\n" +
                 "a=rtpmap:101 H264/90000\n" +
                 "a=recvonly\n";

    What’s happening is that wireshark can detect the incoming packets at port 59618, but not as RTP packets but UDP packets. I am trying to capture the packets using ffmpeg with the following command :

    ubuntu@ip-132-31-40-100:~$ ffmpeg -i udp://127.0.0.1:59618 -vcodec copy stream.mp4
    ffmpeg version git-2017-01-22-f1214ad Copyright (c) 2000-2017 the FFmpeg developers
     built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
     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 --enable-libwavpack --enable-nvenc
     libavutil      55. 44.100 / 55. 44.100
     libavcodec     57. 75.100 / 57. 75.100
     libavformat    57. 63.100 / 57. 63.100
     libavdevice    57.  2.100 / 57.  2.100
     libavfilter     6. 69.100 /  6. 69.100
     libavresample   3.  2.  0 /  3.  2.  0
     libswscale      4.  3.101 /  4.  3.101
     libswresample   2.  4.100 /  2.  4.100
     libpostproc    54.  2.100 / 54.  2.100

    All I get is a blinking cursor and The stream.mp4 file is not written to disk after I exit (ctrl+c).

    So can you help me figure out :

    1. why wireshark cannot detect the packets as RTP (I suspect it has something to do with SDP)
    2. How to handle SDP answer when the RTP endpoint is pushing to ffmpeg which doesn’t send an answer back.

    Here is the entire code (hello world tutorial modified)

    /*
        * (C) Copyright 2014-2015 Kurento (http://kurento.org/)
        *
        * Licensed under the Apache License, Version 2.0 (the "License");
        * you may not use this file except in compliance with the License.
        * You may obtain a copy of the License at
        *
        *   http://www.apache.org/licenses/LICENSE-2.0
        *
        * Unless required by applicable law or agreed to in writing, software
        * distributed under the License is distributed on an "AS IS" BASIS,
        * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        * See the License for the specific language governing permissions and
        * limitations under the License.
        */

       function getopts(args, opts)
       {
         var result = opts.default || {};
         args.replace(
             new RegExp("([^?=&]+)(=([^&]*))?", "g"),
             function($0, $1, $2, $3) { result[$1] = decodeURI($3); });

         return result;
       };

       var args = getopts(location.search,
       {
         default:
         {
           ws_uri: 'wss://' + location.hostname + ':8433/kurento',
           ice_servers: undefined
         }
       });

       function setIceCandidateCallbacks(webRtcPeer, webRtcEp, onerror)
       {
         webRtcPeer.on('icecandidate', function(candidate) {
           console.log("Local candidate:",candidate);

           candidate = kurentoClient.getComplexType('IceCandidate')(candidate);

           webRtcEp.addIceCandidate(candidate, onerror)
         });

         webRtcEp.on('OnIceCandidate', function(event) {
           var candidate = event.candidate;

           console.log("Remote candidate:",candidate);

           webRtcPeer.addIceCandidate(candidate, onerror);
         });
       }


       function setIceCandidateCallbacks2(webRtcPeer, rtpEp, onerror)
       {
         webRtcPeer.on('icecandidate', function(candidate) {
           console.log("Localr candidate:",candidate);

           candidate = kurentoClient.getComplexType('IceCandidate')(candidate);

           rtpEp.addIceCandidate(candidate, onerror)
         });
       }


       window.addEventListener('load', function()
       {
         console = new Console();

         var webRtcPeer;
         var pipeline;
         var webRtcEpt;

         var videoInput = document.getElementById('videoInput');
         var videoOutput = document.getElementById('videoOutput');

         var startButton = document.getElementById("start");
         var stopButton = document.getElementById("stop");

         startButton.addEventListener("click", function()
         {
           showSpinner(videoInput, videoOutput);

           var options = {
             localVideo: videoInput,
             remoteVideo: videoOutput
           };


           if (args.ice_servers) {
            console.log("Use ICE servers: " + args.ice_servers);
            options.configuration = {
              iceServers : JSON.parse(args.ice_servers)
            };
           } else {
            console.log("Use freeice")
           }

           webRtcPeer = kurentoUtils.WebRtcPeer.WebRtcPeerSendrecv(options, function(error)
           {
             if(error) return onError(error)

             this.generateOffer(onOffer)
           });

           function onOffer(error, sdpOffer)
           {
             if(error) return onError(error)

             kurentoClient(args.ws_uri, function(error, client)
             {
               if(error) return onError(error);

               client.create("MediaPipeline", function(error, _pipeline)
               {
                 if(error) return onError(error);

                 pipeline = _pipeline;

                 pipeline.create("WebRtcEndpoint", function(error, webRtc){
                   if(error) return onError(error);

                   webRtcEpt = webRtc;

                   setIceCandidateCallbacks(webRtcPeer, webRtc, onError)

                   webRtc.processOffer(sdpOffer, function(error, sdpAnswer){
                     if(error) return onError(error);

                     webRtcPeer.processAnswer(sdpAnswer, onError);
                   });
                   webRtc.gatherCandidates(onError);

                   webRtc.connect(webRtc, function(error){
                     if(error) return onError(error);

                     console.log("Loopback established");
                   });
                 });



               pipeline.create("RtpEndpoint", function(error, rtp){
                   if(error) return onError(error);

                   //setIceCandidateCallbacks2(webRtcPeer, rtp, onError)


                   var cm_offer = "v=0\n" +
                         "o=- 3641290734 3641290734 IN IP4 127.0.0.1\n" +
                         "s=nginx\n" +
                         "c=IN IP4 127.0.0.1\n" +
                         "t=0 0\n" +
                         "m=audio 60820 RTP/AVP 0\n" +
                         "a=rtpmap:0 PCMU/8000\n" +
                         "a=recvonly\n" +
                         "m=video 59618 RTP/AVP 101\n" +
                         "a=rtpmap:101 H264/90000\n" +
                         "a=recvonly\n";



                   rtp.processOffer(cm_offer, function(error, cm_sdpAnswer){
                     if(error) return onError(error);

                     //webRtcPeer.processAnswer(cm_sdpAnswer, onError);
                   });
                   //rtp.gatherCandidates(onError);

                   webRtcEpt.connect(rtp, function(error){
                     if(error) return onError(error);

                     console.log("RTP endpoint connected to webRTC");
                   });
                 });









               });
             });
           }
         });
         stopButton.addEventListener("click", stop);


         function stop() {
           if (webRtcPeer) {
             webRtcPeer.dispose();
             webRtcPeer = null;
           }

           if(pipeline){
             pipeline.release();
             pipeline = null;
           }

           hideSpinner(videoInput, videoOutput);
         }

         function onError(error) {
           if(error)
           {
             console.error(error);
             stop();
           }
         }
       })


       function showSpinner() {
         for (var i = 0; i < arguments.length; i++) {
           arguments[i].poster = 'img/transparent-1px.png';
           arguments[i].style.background = "center transparent url('img/spinner.gif') no-repeat";
         }
       }

       function hideSpinner() {
         for (var i = 0; i < arguments.length; i++) {
           arguments[i].src = '';
           arguments[i].poster = 'img/webrtc.png';
           arguments[i].style.background = '';
         }
       }

       /**
        * Lightbox utility (to display media pipeline image in a modal dialog)
        */
       $(document).delegate('*[data-toggle="lightbox"]', 'click', function(event) {
         event.preventDefault();
         $(this).ekkoLightbox();
       });
  • Merge all .h264 files in directory in alphabetical order

    9 mars 2017, par nicolashahn

    I have a camera that records in 5 second clips with filenames that are timestamps :

    2017-03-08-09-54-27.334326-000000.h264
    2017-03-08-09-54-27.334326-000001.h264
    2017-03-08-09-54-27.334326-000002.h264
    2017-03-08-09-54-27.334326-000003.h264
    ...

    What is the easiest way to merge these in order into one video file on OSX ?