Recherche avancée

Médias (0)

Mot : - Tags -/clipboard

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (91)

  • Le plugin : Gestion de la mutualisation

    2 mars 2010, par

    Le plugin de Gestion de mutualisation permet de gérer les différents canaux de mediaspip depuis un site maître. Il a pour but de fournir une solution pure SPIP afin de remplacer cette ancienne solution.
    Installation basique
    On installe les fichiers de SPIP sur le serveur.
    On ajoute ensuite le plugin "mutualisation" à la racine du site comme décrit ici.
    On customise le fichier mes_options.php central comme on le souhaite. Voilà pour l’exemple celui de la plateforme mediaspip.net :
    < ?php (...)

  • Configuration spécifique d’Apache

    4 février 2011, par

    Modules spécifiques
    Pour la configuration d’Apache, il est conseillé d’activer certains modules non spécifiques à MediaSPIP, mais permettant d’améliorer les performances : mod_deflate et mod_headers pour compresser automatiquement via Apache les pages. Cf ce tutoriel ; mode_expires pour gérer correctement l’expiration des hits. Cf ce tutoriel ;
    Il est également conseillé d’ajouter la prise en charge par apache du mime-type pour les fichiers WebM comme indiqué dans ce tutoriel.
    Création d’un (...)

  • Création définitive du canal

    12 mars 2010, par

    Lorsque votre demande est validée, vous pouvez alors procéder à la création proprement dite du canal. Chaque canal est un site à part entière placé sous votre responsabilité. Les administrateurs de la plateforme n’y ont aucun accès.
    A la validation, vous recevez un email vous invitant donc à créer votre canal.
    Pour ce faire il vous suffit de vous rendre à son adresse, dans notre exemple "http://votre_sous_domaine.mediaspip.net".
    A ce moment là un mot de passe vous est demandé, il vous suffit d’y (...)

Sur d’autres sites (2384)

  • ffplay startup time proportional to specified framerate

    17 décembre 2019, par bremen_matt

    I am playing a video over http using ffplay. The call I am using looks like this :

    ffplay -framerate 30 -fflags nobuffer -flags low_delay -autoexit -i http://localhost:8880

    The video is an H.264 encoding where (my understanding is a bit unclear here) it is something like a "raw" H.264 stream without timestamps.

    My primary concern is to get video displayed with low latency. In that regard, the video is fine.

    The issue is with the framerate and with the startup time.

    The video source is emitting frames as soon as they are processed, so the frame rate is not constant. However, my experience is that as long as you specify a framerate larger than the max achievable frame rate of the source, then the viewer still looks fine. On the flipside, if the video source starts emitting frames at 60 fps, but I specify a framerate of 30, then the delay just sort of builds up in ffplay to the point where after 10 seconds, the video is 20 seconds behind. So the first question would be whether there is a way to get ffplay to use a variable framerate. The behavior I am looking for is "display a frame as soon as it is received over http".

    In light of the aforementioned issue, the approach I have been taking is to simply specify a high framerate, which seems to work. However, there is an issue with this approach in the form of startup time. When I set the framerate to 10, the ffplay window starts in approx 3 seconds, but then quickly starts accruing a lag (so I can’t do this). When I set the framerate to 100, the ffplay window takes 30 seconds (literally 30 seconds) to start, but then will not have any lag.

    I have seen that ffmpeg has a vsync option that on the surface seems like it would allow you to set a variable framerate. However, ffplay doesn’t seem to recognize this. I would also be willing to pipe the output of ffmpeg to a different window (I am running Ubuntu 18.04) if that is what must be done, but I would prefer not to have to recompile ffplay.

  • Live streaming : node-media-server + Dash.js configured for real-time low latency

    7 juillet 2021, par Maoration

    We're working on an app that enables live monitoring of your back yard.&#xA;Each client has a camera connected to the internet, streaming to our public node.js server.

    &#xA;&#xA;

    I'm trying to use node-media-server to publish an MPEG-DASH (or HLS) stream to be available for our app clients, on different networks, bandwidths and resolutions around the world.

    &#xA;&#xA;

    Our goal is to get as close as possible to live "real-time" so you can monitor what happens in your backyard instantly.

    &#xA;&#xA;

    The technical flow already accomplished is :

    &#xA;&#xA;

      &#xA;
    1. ffmpeg process on our server processes the incoming camera stream (separate child process for each camera) and publishes the stream via RTSP on the local machine for node-media-server to use as an 'input' (we are also saving segmented files, generating thumbnails, etc.). the ffmpeg command responsible for that is :

      &#xA;&#xA;

      -c:v libx264 -preset ultrafast -tune zerolatency -b:v 900k -f flv rtmp://127.0.0.1:1935/live/office

    2. &#xA;

    3. node-media-server is running with what I found as the default configuration for 'live-streaming'

      &#xA;&#xA;

      private NMS_CONFIG = {&#xA;server: {&#xA;  secret: &#x27;thisisnotmyrealsecret&#x27;,&#xA;},&#xA;rtmp_server: {&#xA;  rtmp: {&#xA;    port: 1935,&#xA;    chunk_size: 60000,&#xA;    gop_cache: false,&#xA;    ping: 60,&#xA;    ping_timeout: 30,&#xA;  },&#xA;  http: {&#xA;    port: 8888,&#xA;    mediaroot: &#x27;./server/media&#x27;,&#xA;    allow_origin: &#x27;*&#x27;,&#xA;  },&#xA;  trans: {&#xA;    ffmpeg: &#x27;/usr/bin/ffmpeg&#x27;,&#xA;    tasks: [&#xA;      {&#xA;        app: &#x27;live&#x27;,&#xA;        hls: true,&#xA;        hlsFlags: &#x27;[hls_time=2:hls_list_size=3:hls_flags=delete_segments]&#x27;,&#xA;        dash: true,&#xA;        dashFlags: &#x27;[f=dash:window_size=3:extra_window_size=5]&#x27;,&#xA;      },&#xA;    ],&#xA;  },&#xA;},&#xA;

      &#xA;&#xA;

      } ;

    4. &#xA;

    5. As I understand it, out of the box NMS (node-media-server) publishes the input stream it gets in multiple output formats : flv, mpeg-dash, hls.&#xA;with all sorts of online players for these formats I'm able to access and the stream using the url on localhost. with mpeg-dash and hls I'm getting anything between 10-15 seconds of delay, and more.

    6. &#xA;

    &#xA;&#xA;


    &#xA;&#xA;

    My goal now is to implement a local client-side mpeg-dash player, using dash.js and configure it to be as close as possible to live.

    &#xA;&#xA;

    my code for that is :

    &#xA;&#xA;

    &#xD;&#xA;
    &#xD;&#xA;
    &#xD;&#xA;&#xD;&#xA;    &#xD;&#xA;        &#xD;&#xA;        &#xD;&#xA;    &#xD;&#xA;    &#xD;&#xA;        <div>&#xD;&#xA;            <video autoplay="" controls=""></video>&#xD;&#xA;        </div>&#xD;&#xA;        <code class="echappe-js">&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/dashjs/3.0.2/dash.all.min.js&quot;&gt;&lt;/script&gt;&#xD;&#xA;&#xD;&#xA;        &lt;script&gt;&amp;#xD;&amp;#xA;            (function(){&amp;#xD;&amp;#xA;                // var url = &quot;https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd&quot;;&amp;#xD;&amp;#xA;                var url = &quot;http://localhost:8888/live/office/index.mpd&quot;;&amp;#xD;&amp;#xA;                var player = dashjs.MediaPlayer().create();&amp;#xD;&amp;#xA;                &amp;#xD;&amp;#xA;                &amp;#xD;&amp;#xA;&amp;#xD;&amp;#xA;                // config&amp;#xD;&amp;#xA;                targetLatency = 2.0;        // Lowering this value will lower latency but may decrease the player&amp;#x27;s ability to build a stable buffer.&amp;#xD;&amp;#xA;                minDrift = 0.05;            // Minimum latency deviation allowed before activating catch-up mechanism.&amp;#xD;&amp;#xA;                catchupPlaybackRate = 0.5;  // Maximum catch-up rate, as a percentage, for low latency live streams.&amp;#xD;&amp;#xA;                stableBuffer = 2;           // The time that the internal buffer target will be set to post startup/seeks (NOT top quality).&amp;#xD;&amp;#xA;                bufferAtTopQuality = 2;     // The time that the internal buffer target will be set to once playing the top quality.&amp;#xD;&amp;#xA;&amp;#xD;&amp;#xA;&amp;#xD;&amp;#xA;                player.updateSettings({&amp;#xD;&amp;#xA;                    &amp;#x27;streaming&amp;#x27;: {&amp;#xD;&amp;#xA;                        &amp;#x27;liveDelay&amp;#x27;: 2,&amp;#xD;&amp;#xA;                        &amp;#x27;liveCatchUpMinDrift&amp;#x27;: 0.05,&amp;#xD;&amp;#xA;                        &amp;#x27;liveCatchUpPlaybackRate&amp;#x27;: 0.5,&amp;#xD;&amp;#xA;                        &amp;#x27;stableBufferTime&amp;#x27;: 2,&amp;#xD;&amp;#xA;                        &amp;#x27;bufferTimeAtTopQuality&amp;#x27;: 2,&amp;#xD;&amp;#xA;                        &amp;#x27;bufferTimeAtTopQualityLongForm&amp;#x27;: 2,&amp;#xD;&amp;#xA;                        &amp;#x27;bufferToKeep&amp;#x27;: 2,&amp;#xD;&amp;#xA;                        &amp;#x27;bufferAheadToKeep&amp;#x27;: 2,&amp;#xD;&amp;#xA;                        &amp;#x27;lowLatencyEnabled&amp;#x27;: true,&amp;#xD;&amp;#xA;                        &amp;#x27;fastSwitchEnabled&amp;#x27;: true,&amp;#xD;&amp;#xA;                        &amp;#x27;abr&amp;#x27;: {&amp;#xD;&amp;#xA;                            &amp;#x27;limitBitrateByPortal&amp;#x27;: true&amp;#xD;&amp;#xA;                        },&amp;#xD;&amp;#xA;                    }&amp;#xD;&amp;#xA;                });&amp;#xD;&amp;#xA;&amp;#xD;&amp;#xA;                console.log(player.getSettings());&amp;#xD;&amp;#xA;&amp;#xD;&amp;#xA;                setInterval(() =&gt; {&amp;#xD;&amp;#xA;                  console.log(&amp;#x27;Live latency= &amp;#x27;, player.getCurrentLiveLatency());&amp;#xD;&amp;#xA;                  console.log(&amp;#x27;Buffer length= &amp;#x27;, player.getBufferLength(&amp;#x27;video&amp;#x27;));&amp;#xD;&amp;#xA;                }, 3000);&amp;#xD;&amp;#xA;&amp;#xD;&amp;#xA;                player.initialize(document.querySelector(&quot;#videoPlayer&quot;), url, true);&amp;#xD;&amp;#xA;&amp;#xD;&amp;#xA;            })();&amp;#xD;&amp;#xA;&amp;#xD;&amp;#xA;        &lt;/script&gt;&#xD;&#xA;    &#xD;&#xA;

    &#xD;&#xA;

    &#xD;&#xA;

    &#xD;&#xA;&#xA;&#xA;

    with the online test video (https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd) I see that the live latency value is close to 2 secs (but I have no way to actually confirm it. it's a video file streamed. in my office I have a camera so I can actually compare latency between real-life and the stream I get).&#xA;however when working locally with my NMS, it seems this value does not want to go below 20-25 seconds.

    &#xA;&#xA;

    Am I doing something wrong ? any configuration on the player (client-side html) I'm forgetting ?&#xA;or is there a missing configuration I should add on the server side (NMS) ?

    &#xA;

  • How to HLS-live-stream incoming batches of individual frames, "appending" to a m3u8 playlist in real time, with ffmpeg ?

    20 novembre 2024, par Rob

    My overall goal :

    &#xA;&#xA;

    Server-side :

    &#xA;&#xA;

      &#xA;
    • I have batches of sequential, JPEG-encoded frames (8-16) arriving from time to time, generated at roughly 2 FPS.
    • &#xA;

    • I would like to host an HLS live stream, where, when a new batch of frames arrives, I encode those new frames as h264 .ts segments with ffmpeg, and have the new .ts segments automatically added to an HLS stream (e.g. .m3u8 file).
    • &#xA;

    &#xA;&#xA;

    Client/browser-side :

    &#xA;&#xA;

      &#xA;
    • When the .m3u8 is updated, I would like the video stream being watched to simply "continue", advancing from the point where new .ts segments have been added.
    • &#xA;

    • I do not need the user to scrub backwards in time, the client just needs to support live observation of the stream.
    • &#xA;

    &#xA;&#xA;

    &#xA;&#xA;

    My current approach :

    &#xA;&#xA;

    Server-side :

    &#xA;&#xA;

    To generate the "first" few segments of the stream, I'm attempting the below (just command-line for now to get ffmpeg working right, but ultimately will be automated via a Python script) :

    &#xA;&#xA;

    For reference, I'm using ffmpeg version 3.4.6-0ubuntu0.18.04.1.

    &#xA;&#xA;

    ffmpeg -y -framerate 2 -i /frames/batch1/frame_%d.jpg \&#xA;       -c:v libx264 -crf 21 -preset veryfast -g 2 \&#xA;       -f hls -hls_time 4 -hls_list_size 4 -segment_wrap 4 -segment_list_flags &#x2B;live video/stream.m3u8&#xA;

    &#xA;&#xA;

    where the /frames/batch1/ folder contains a sequence of frames (e.g. frame_01.jpg, frame_02.jpg, etc...). This already doesn't appear to work correctly, because it keeps adding #EXT-X-ENDLIST to the end of the .m3u8 file, which as I understand is not correct for a live HLS stream - here's what that generates :

    &#xA;&#xA;

    #EXTM3U&#xA;#EXT-X-VERSION:3&#xA;#EXT-X-TARGETDURATION:4&#xA;#EXT-X-MEDIA-SEQUENCE:0&#xA;#EXTINF:4.000000,&#xA;stream0.ts&#xA;#EXTINF:4.000000,&#xA;stream1.ts&#xA;#EXTINF:2.000000,&#xA;stream2.ts&#xA;#EXT-X-ENDLIST&#xA;

    &#xA;&#xA;

    I can't figure out how to suppress #EXT-X-ENDLIST here - this is problem #1.

    &#xA;&#xA;

    Then, to generate subsequent segments (e.g. when new frames become available), I'm trying this :

    &#xA;&#xA;

    ffmpeg -y -framerate 2 -start_number 20 -i /frames/batch2/frame_%d.jpg \&#xA;       -c:v libx264 -crf 21 -preset veryfast -g 2 \&#xA;       -f hls -hls_time 4 -hls_list_size 4 -segment_wrap 4 -segment_list_flags &#x2B;live video/stream.m3u8&#xA;

    &#xA;&#xA;

    Unfortunately, this does not work the way I want it to. It simply overwrites stream.m3u8, does and does not advance #EXT-X-MEDIA-SEQUENCE, it does not index the new .ts files correctly, and it also includes the undesirable #EXT-X-ENDLIST - this is the output of that command :

    &#xA;&#xA;

    #EXTM3U&#xA;#EXT-X-VERSION:3&#xA;#EXT-X-TARGETDURATION:4&#xA;#EXT-X-MEDIA-SEQUENCE:0&#xA;#EXTINF:4.000000,&#xA;stream0.ts&#xA;#EXTINF:4.000000,&#xA;stream1.ts&#xA;#EXTINF:3.000000,&#xA;stream2.ts&#xA;#EXT-X-ENDLIST&#xA;

    &#xA;&#xA;

    Fundamentally, I can't figure out how to "append" to an existing .m3u8 in a way that makes sense for HLS live streaming. That's essentially problem #2.

    &#xA;&#xA;

    For hosting the stream, I'm using a simple Flask app - which appears to be working the way I intend - here's what I'm doing for reference :

    &#xA;&#xA;

    @app.route(&#x27;/video/&#x27;)&#xA;def stream(file_name):&#xA;    video_dir = &#x27;./video&#x27;&#xA;    return send_from_directory(directory=video_dir, filename=file_name)&#xA;

    &#xA;&#xA;

    Client-side :

    &#xA;&#xA;

    I'm trying HLS.js in Chrome - basically boils down to this :

    &#xA;&#xA;

    <video></video>&#xA;&#xA;...&#xA;&#xA;<code class="echappe-js">&lt;script src=&quot;https://cdn.jsdelivr.net/npm/hls.js@latest&quot;&gt;&lt;/script&gt;&#xA;&lt;script&gt;&amp;#xA;   var video = document.getElementById(&amp;#x27;video1&amp;#x27;);&amp;#xA;   if (Hls.isSupported()) {&amp;#xA;     var hls = new Hls();&amp;#xA;     hls.loadSource(&amp;#x27;/video/stream.m3u8&amp;#x27;);&amp;#xA;     hls.attachMedia(video);&amp;#xA;     hls.on(Hls.Events.MANIFEST_PARSED, function() {&amp;#xA;       video.play();&amp;#xA;     });&amp;#xA;   }&amp;#xA;   else if (video.canPlayType(&amp;#x27;application/vnd.apple.mpegurl&amp;#x27;)) {&amp;#xA;     video.src = &amp;#x27;/video/stream.m3u8&amp;#x27;;&amp;#xA;     video.addEventListener(&amp;#x27;loadedmetadata&amp;#x27;, function() {&amp;#xA;       video.play();&amp;#xA;     });&amp;#xA;   }&amp;#xA;&lt;/script&gt;   &#xA;

    &#xA;&#xA;

    I'd like to think that what I'm trying to do doesn't require a more complex approach than what I'm trying above, but since what I'm trying to far definitely isn't working, I'm starting to think I need to come at this from a different angle. Any ideas on what I'm missing ?

    &#xA;&#xA;

    Edit :

    &#xA;&#xA;

    I've also attempted the same (again in Chrome) with video.js, and am seeing similar behavior - in particular, when I manually update the backing stream.m3u8 (with no #EXT-X-ENDLIST tag), videojs never picks up the new changes to the live stream, and just buffers/hangs indefinitely.

    &#xA;&#xA;

    <video class="video-js vjs-default-skin" muted="muted" controls="controls">&#xA;    <source type="application/x-mpegURL" src="/video/stream.m3u8">&#xA;</source></video>&#xA;&#xA;...&#xA;&#xA;<code class="echappe-js">&lt;script&gt;&amp;#xA;    var player = videojs(&amp;#x27;video1&amp;#x27;);&amp;#xA;    player.play();&amp;#xA;&lt;/script&gt;&#xA;

    &#xA;&#xA;

    For example, if I start with this initial version of stream.m3u8 :

    &#xA;&#xA;

    #EXTM3U&#xA;#EXT-X-PLAYLIST-TYPE:EVENT&#xA;#EXT-X-VERSION:3&#xA;#EXT-X-TARGETDURATION:8&#xA;#EXT-X-MEDIA-SEQUENCE:0&#xA;#EXTINF:4.000000,&#xA;stream0.ts&#xA;#EXTINF:4.000000,&#xA;stream1.ts&#xA;#EXTINF:2.000000,&#xA;stream2.ts&#xA;

    &#xA;&#xA;

    and then manually update it server-side to this :

    &#xA;&#xA;

    #EXTM3U&#xA;#EXT-X-PLAYLIST-TYPE:EVENT&#xA;#EXT-X-VERSION:3&#xA;#EXT-X-TARGETDURATION:8&#xA;#EXT-X-MEDIA-SEQUENCE:3&#xA;#EXTINF:4.000000,&#xA;stream3.ts&#xA;#EXTINF:4.000000,&#xA;stream4.ts&#xA;#EXTINF:3.000000,&#xA;stream5.ts&#xA;

    &#xA;&#xA;

    the video.js control just buffers indefinitely after only playing the first 3 segments (stream*.ts 0-2), which isn't what I'd expect to happen (I'd expect it to continue playing stream*.ts 3-5 once stream.m3u8 is updated and video.js makes a request for the latest version of the playlist).

    &#xA;