Recherche avancée

Médias (1)

Mot : - Tags -/MediaSPIP 0.2

Autres articles (79)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

  • 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

Sur d’autres sites (5547)

  • RTP packets detected as UDP

    8 juillet 2024, par fritz

    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. 


    3. How to handle SDP answer when the RTP endpoint is pushing to ffmpeg which doesn't send an answer back.
    4. 


    



    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();
    });


    


  • Streaming MP4 frames to HTML5, what am I doing wrong ?

    5 septembre 2014, par mczarnek

    Currently I am generating a MP4 Bitstream using Intel’s Media SDK library, which uses ffmpeg underneath the covers. I can generate a mp4 file, and play it and it works.

    However, when I try to stream that mp4 across the network, it doesn’t play within the HTML5 video player, as tested within Chrome, Firefox, or IE.

    This much is sent back and forth across the network :

    Sent by Chrome:
    GET / HTTP/1.1
    Host: localhost:8085
    Connection: keep-alive
    User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.102 Safari/537.36
    Accept-Encoding: identity;q=1, *;q=0
    Accept: */*
    Accept-Language: en-US,en;q=0.8
    Range: bytes=0-

    From my video player:
    HTTP/1.1 200 OK
    Server: Microsoft-HTTPAPI/2.0
    Date: Thu, 09 Jan 2014 17:28:14 GMT
    Content-type: video/mp4

    After this, I send a newline, and all the video frames, one after another, while listening to see if I receive anything back from the browser.

    Then nothing happens. Any suggestions to get this playing video ? Thank you !

  • Recording screencast using ffmpeg produces audio that is out of sync with the video

    7 décembre 2014, par AgilE

    I’m on Fedora 20. I got it pre-compiled from the repo.

    I use the follow command to record screencasts :

    ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 30 -s 1366x768 -i :0.0 -acodec pcm_s16le -vcodec libx264 -preset ultrafast -crf 0 -threads 0 filename.mkv

    The audio is perfectly synced with the video at the beginning. However, as the video progresses, the audio starts lagging behind severely (say a lag of more than 4 seconds). I’ve included a sample output that ffmpeg shows while recording a video.

    ffmpeg version 2.1.3 Copyright (c) 2000-2013 the FFmpeg developers
     built on Jan 25 2014 15:11:42 with gcc 4.8.2 (GCC) 20131212 (Red Hat 4.8.2-7)
     configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-frei0r --enable-gnutls --enable-libass --enable-libcdio --enable-libcelt --enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopencv --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
     libavutil      52. 48.101 / 52. 48.101
     libavcodec     55. 39.101 / 55. 39.101
     libavformat    55. 19.104 / 55. 19.104
     libavdevice    55.  5.100 / 55.  5.100
     libavfilter     3. 90.100 /  3. 90.100
     libavresample   1.  1.  0 /  1.  1.  0
     libswscale      2.  5.101 /  2.  5.101
     libswresample   0. 17.104 /  0. 17.104
     libpostproc    52.  3.100 / 52.  3.100
    Guessed Channel Layout for  Input Stream #0.0 : stereo
    Input #0, alsa, from 'pulse':
     Duration: N/A, start: 1391533629.323015, bitrate: 1536 kb/s
       Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
    [x11grab @ 0x153ad80] device: :0.0 -> display: :0.0 x: 0 y: 0 width: 1366 height: 768
    [x11grab @ 0x153ad80] shared memory extension found
    Input #1, x11grab, from ':0.0':
     Duration: N/A, start: 1391533629.365274, bitrate: 1007124 kb/s
       Stream #1:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1366x768, 1007124 kb/s, 30 tbr, 1000k tbn, 30 tbc
    [swscaler @ 0x1520460] deprecated pixel format used, make sure you did set range correctly
    No pixel format specified, yuv444p for H.264 encoding chosen.
    Use -pix_fmt yuv420p for compatibility with outdated media players.
    [libx264 @ 0x1551420] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
    [libx264 @ 0x1551420] profile High 4:4:4 Predictive, level 3.2, 4:4:4 8-bit
    [libx264 @ 0x1551420] 264 - core 138 r2363 c628e3b - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=0 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=0 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=cqp mbtree=0 qp=0
    Output #0, matroska, to 'testing.mkv':
     Metadata:
       encoder         : Lavf55.19.104
       Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv444p, 1366x768, q=-1--1, 1k tbn, 30 tbc
       Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16, 1536 kb/s
    Stream mapping:
     Stream #1:0 -> #0:0 (rawvideo -> libx264)
     Stream #0:0 -> #0:1 (pcm_s16le -> pcm_s16le)
    Press [q] to stop, [?] for help
    [swscaler @ 0x1520460] Warning: data is not aligned! This can lead to a speedloss
    frame=  213 fps= 27 q=-1.0 Lsize=    3572kB time=00:00:08.00 bitrate=3653.6kbits/s    
    video:2025kB audio:1501kB subtitle:0 global headers:0kB muxing overhead 1.291094%
    [libx264 @ 0x1551420] frame I:1     Avg QP: 0.00  size:692585
    [libx264 @ 0x1551420] frame P:212   Avg QP: 0.00  size:  6509
    [libx264 @ 0x1551420] mb I  I16..4: 100.0%  0.0%  0.0%
    [libx264 @ 0x1551420] mb P  I16..4: 47.2%  0.0%  0.0%  P16..4:  0.1%  0.0%  0.0%  0.0%  0.0%    skip:52.8%
    [libx264 @ 0x1551420] coded y,u,v intra: 0.7% 0.7% 0.7% inter: 0.1% 0.1% 0.1%
    [libx264 @ 0x1551420] i16 v,h,dc,p: 100%  0%  0%  0%
    [libx264 @ 0x1551420] kb/s:2335.32

    Is there something I’m missing ?