Recherche avancée

Médias (1)

Mot : - Tags -/publishing

Autres articles (92)

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

  • D’autres logiciels intéressants

    12 avril 2011, par

    On ne revendique pas d’être les seuls à faire ce que l’on fait ... et on ne revendique surtout pas d’être les meilleurs non plus ... Ce que l’on fait, on essaie juste de le faire bien, et de mieux en mieux...
    La liste suivante correspond à des logiciels qui tendent peu ou prou à faire comme MediaSPIP ou que MediaSPIP tente peu ou prou à faire pareil, peu importe ...
    On ne les connais pas, on ne les a pas essayé, mais vous pouvez peut être y jeter un coup d’oeil.
    Videopress
    Site Internet : (...)

Sur d’autres sites (7140)

  • FFMPEG/DASH-LL creates audio and video chunks at different rates ; player is confused (404 errors)

    26 mai 2021, par Danny

    I'm trying to create a MPEG-DASH "live" stream from a static file to test various low latency modes. The DASH muxer in FFmpeg creates two AdaptationSets, one for video chunks and one for audio chunks.

    


    However, the audio and video chunk files are not created at the same rate (should they be ?). ie, here stream0 are the video chunks and stream1 are the audio chunks. After a few seconds of running, the webroot directory contains :

    


    chunk-stream0-00001.m4s  chunk-stream1-00001.m4s  
chunk-stream0-00002.m4s  chunk-stream1-00002.m4s  
chunk-stream0-00003.m4s  chunk-stream1-00003.m4s  
chunk-stream0-00004.m4s  chunk-stream1-00004.m4s  
                         chunk-stream1-00005.m4s  
                         chunk-stream1-00006.m4s  
                         chunk-stream1-00007.m4s  
                         chunk-stream1-00008.m4s  
                         chunk-stream1-00009.m4s  
master.mpd  
init-stream0.m4s  
init-stream1.m4s  


    


    The stream doesn't load (or play) on either dash.js or shaka-player and there are lots of 404 (Not Found) errors for the video chunks. The player is requesting chunks from both stream0 and stream1 in sequence, ie, stream0-001 + stream1-001, then stream0-002 + stream1-002 and so on.

    


    But since stream0 only goes from 001 to 004, there are lots of 404 errors as it tries to load stream0-005 through 009.

    


    The gap gets wider after letting FFmpeg run for a while. eg, stream0 is 62 to 75 but stream1 is 174 to 187. Reloading the player page at this point fails with dash.all.debug.js:15615 [2055][FragmentController] No video bytes to push or stream is inactive. and shows 404 errors stream0 chunk 188 (which doesn't exist yet !)

    


    enter image description here

    


    The FFmpeg command was adopted from DASH streaming from the top-down :

    


    ffmpeg -re -i /mnt/swdevel/TestStreams/H264/ThreeHourMovie.mp4 \
-c:v libx264 -x264-params keyint=120:scenecut=0 -b:v 1M -c:a copy \
-f dash -dash_segment_type mp4 \
 -seg_duration 2 \
 -target_latency 3 \
 -frag_type duration \
 -frag_duration 0.2 \
 -window_size 10 \
 -extra_window_size 3 \
 -streaming 1 \
 -ldash 1 \
 -use_template 1 \
 -use_timeline 0 \
 -write_prft 1 \
 -fflags +nobuffer+flush_packets \
 -format_options "movflags=+cmaf" \
 -utc_timing_url "/pelican/testPlayers/time.php" \
 master.mpd


    


    And the dash.js player code is very simple :

    


    const srcUrl = "../ottWebRoot/playerTest/master.mpd"; 

var player = dashjs.MediaPlayer().create();

let autoPlay = false;
player.initialize(document.querySelector("#videoTagId"), srcUrl, autoPlay);

player.updateSettings(
{
    streaming :
    {
        lowLatencyEnabled : true,
        liveDelay : 2,
        jumpGaps : true,
        jumpLargeGaps : true,
        smallGapLimit : 1.5,
    }
});


    


    To provide the UTCTiming element in the manifest, the small time.php URL returns a UTC time from the web server :

    


    <?php
    print gmdate("Y-m-d\TH:i:s\Z");
?>


    


    (It also shows 404 errors for the latest stream1/audio chunk, that's likely a different problem)

    


    I'm not sure what to try next. Any and suggestions greatly appreciated.

    


    EDIT I

    


    The suggestion by @Anonymous Coward to change the key interval improved things a lot. The chunks for stream0 and stream1 are in lock-step and have identical sequence numbers.

    


    However, there are still many 404 errors, both on initial page load (without pressing play) and during playback.

    


    I ran watch -n 1 ls -lt code> and compared side-by-side to the errors in the browser console.  It&#x27;s hard to compare but it <em>looks</em> like the browser is trying to fetch files "on the play edge" which haven&#x27;t yet been created by FFmpeg.  See the pic below.

    &#xA;

    How do I instruct the browser to wait just a bit more before fetching the edge chunks ?

    &#xA;

    enter image description here

    &#xA;

    EDIT II

    &#xA;

    Using shaka-player instead of dash.js plays properly without 404 errors. Configured as :

    &#xA;

        player.configure(&#xA;    {&#xA;        streaming: &#xA;        {&#xA;            lowLatencyMode: true,&#xA;            inaccurateManifestTolerance: 0,&#xA;            rebufferingGoal: 0.1,&#xA;        }&#xA;        &#xA;    });&#xA;

    &#xA;

    Client

    &#xA;

      &#xA;
    • MacOS 10.12
    • &#xA;

    • dash.js latest 3.2.2
    • &#xA;

    • Chrome 79, Safari 12, FireFox v ?
    • &#xA;

    &#xA;

    Server

    &#xA;

      &#xA;
    • Apache 2.4.37
    • &#xA;

    • PHP 7.2.4 (for time function only)
    • &#xA;

    • Centos 8
    • &#xA;

    &#xA;

    (For reference, here is the mpd file generated by FFmpeg)

    &#xA;

    &lt;?xml version="1.0" encoding="utf-8"?>&#xA;<mpd xmlns="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="dynamic" minimumupdateperiod="PT500S" availabilitystarttime="2021-05-24T14:50:00.263Z" publishtime="2021-05-24T15:22:45.335Z" timeshiftbufferdepth="PT50.0S" maxsegmentduration="PT2.0S" minbuffertime="PT5.0S">&#xA;    <programinformation>&#xA;    </programinformation>&#xA;    <servicedescription>&#xA;        <latency target="3000" referenceid="0"></latency>&#xA;    </servicedescription>&#xA;    <period start="PT0.0S">&#xA;        <adaptationset contenttype="video" startwithsap="1" segmentalignment="true" bitstreamswitching="true" framerate="24/1" maxwidth="1280" maxheight="682" par="15:8" lang="und">&#xA;            <resync dt="200000" type="0"></resync>&#xA;            <representation mimetype="video/mp4" codecs="avc1.64081f" bandwidth="1000000" width="1280" height="682" sar="1023:1024">&#xA;                <producerreferencetime inband="true" type="captured" wallclocktime="2021-05-24T14:50:00.263Z" presentationtime="0">&#xA;                    <utctiming schemeiduri="urn:mpeg:dash:utc:http-xsdate:2014" value="/pelican/testPlayers/time.php"></utctiming>&#xA;                </producerreferencetime>&#xA;                <resync dt="5000000" type="1"></resync>&#xA;                <segmenttemplate timescale="1000000" duration="2000000" availabilitytimeoffset="1.800" availabilitytimecomplete="false" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startnumber="1">&#xA;                </segmenttemplate>&#xA;            </representation>&#xA;        </adaptationset>&#xA;        <adaptationset contenttype="audio" startwithsap="1" segmentalignment="true" bitstreamswitching="true" lang="und">&#xA;            <resync dt="200000" type="0"></resync>&#xA;            <representation mimetype="audio/mp4" codecs="mp4a.40.2" bandwidth="116317" audiosamplingrate="48000">&#xA;                <audiochannelconfiguration schemeiduri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"></audiochannelconfiguration>&#xA;                <producerreferencetime inband="true" type="captured" wallclocktime="2021-05-24T14:50:00.306Z" presentationtime="0">&#xA;                    <utctiming schemeiduri="urn:mpeg:dash:utc:http-xsdate:2014" value="/pelican/testPlayers/time.php"></utctiming>&#xA;                </producerreferencetime>&#xA;                <resync dt="21333" type="1"></resync>&#xA;                <segmenttemplate timescale="1000000" duration="2000000" availabilitytimeoffset="1.800" availabilitytimecomplete="false" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startnumber="1">&#xA;                </segmenttemplate>&#xA;            </representation>&#xA;        </adaptationset>&#xA;    </period>&#xA;    <utctiming schemeiduri="urn:mpeg:dash:utc:http-xsdate:2014" value="/pelican/testPlayers/time.php"></utctiming>&#xA;</mpd>&#xA;

    &#xA;

  • Losing audio quality when merging multiple videos with FFmpeg

    30 mai 2021, par Charly

    I am trying to merge multiple videos (a few seconds each) into one, using FFmpeg.

    &#xA;

    Merging all at once

    &#xA;

    I first tried merging all videos with one FFmpeg command, but it only seems to work with up to a certain amount of videos. On my Raspberry Pi 4 (2BG RAM), it worked for 16 videos and broke (ran out of memory ?) while merging 36 videos (command and ouput below)

    &#xA;

    ffmpeg -i 1Rbrdn1Xp.mp4 -i G7eYqdFPb.mp4 -i -Xo-6ABm3.mp4 -i 6As9IlqbW.mp4 -i tz9tVKFA-.mp4&#xA;-i MS6DHZoJE.mp4 -i CeJYs99-G.mp4 -i Hsv5X48IC.mp4 -i Gm_DtjNU4.mp4 -i PZytbInZL.mp4&#xA;-i qsIJuvKO2.mp4 -i c5wxGk_Fx.mp4 -i j4K1qA7ih.mp4 -i AIpVWuhGV.mp4 -i yiLk0snSh.mp4&#xA;-i q1zmytaXZ.mp4 -i VRwQvLxaW.mp4 -i 0_3yLrokH.mp4 -i fW28LPQsk.mp4 -i La6WsGeE8.mp4&#xA;-i FlroQnCHq.mp4 -i c7SiL_qSU.mp4 -i aaGTUMJXD.mp4 -i hvXYBaCSM.mp4 -i CMDaFrWM4.mp4&#xA;-i _YAGDRyQN.mp4 -i RQXyshs_o.mp4 -i 96pKlIZxW.mp4 -i HVOOeCUYG.mp4 -i pJFxq7BTx.mp4&#xA;-i VxMJQqbK5.mp4 -i mkgbViPTI.mp4 -i zrjj93b5c.mp4 -i AL9oG1F36.mp4 -i IsUnC0NPb.mp4&#xA;-i Qhj2bhab9.mp4 -y -filter_complex concat=n=36:v=1:a=1 -vsync 2 kn-dQSN-v.mp4&#xA;

    &#xA;

    ffmpeg version 4.1.6-1~deb10u1&#x2B;rpt1 Copyright (c) 2000-2020 the FFmpeg developers&#xA;  built with gcc 8 (Raspbian 8.3.0-6&#x2B;rpi1)&#xA;(...)&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;1Rbrdn1Xp.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : isom&#xA;    minor_version   : 512&#xA;    compatible_brands: isomiso2avc1mp41&#xA;    encoder         : Lavf58.20.100&#xA;  Duration: 00:00:08.08, start: 0.000000, bitrate: 602 kb/s&#xA;    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 533 kb/s, 57.62 fps, 60 tbr, 15360 tbn, 120 tbc (default)&#xA;    Metadata:&#xA;      handler_name    : VideoHandler&#xA;    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 22050 Hz, mono, fltp, 64 kb/s (default)&#xA;    Metadata:&#xA;      handler_name    : SoundHandler&#xA;Input #1, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;G7eYqdFPb.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : isom&#xA;    minor_version   : 512&#xA;    compatible_brands: isomiso2avc1mp41&#xA;    encoder         : Lavf58.20.100&#xA;  Duration: 00:00:21.00, start: 0.000000, bitrate: 310 kb/s&#xA;    Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 229 kb/s, 59.09 fps, 60 tbr, 15360 tbn, 120 tbc (default)&#xA;    Metadata:&#xA;      handler_name    : VideoHandler&#xA;    Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 22050 Hz, mono, fltp, 72 kb/s (default)&#xA;    Metadata:&#xA;      handler_name    : SoundHandler&#xA;(...)&#xA;Stream mapping:&#xA;  Stream #0:0 (h264) -> concat:in0:v0&#xA;  Stream #0:1 (aac) -> concat:in0:a0&#xA;  Stream #1:0 (h264) -> concat:in1:v0&#xA;  Stream #1:1 (aac) -> concat:in1:a0&#xA;(...)&#xA;  concat:out:v0 -> Stream #0:0 (libx264)&#xA;  concat:out:a0 -> Stream #0:1 (aac)&#xA;Press [q] to stop, [?] for help&#xA;[libx264 @ 0x17cb5e0] using SAR=1/1   0kB time=-577014:32:22.77 bitrate=  -0.0kbits/s speed=N/A    &#xA;[libx264 @ 0x17cb5e0] using cpu capabilities: ARMv6 NEON&#xA;[libx264 @ 0x17cb5e0] profile High, level 3.2&#xA;[libx264 @ 0x17cb5e0] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00&#xA;(...)&#xA;Output #0, mp4, to &#x27;kn-dQSN-v.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : isom&#xA;    minor_version   : 512&#xA;    compatible_brands: isomiso2avc1mp41&#xA;    encoder         : Lavf58.20.100&#xA;    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 60 fps, 15360 tbn, 60 tbc (default)&#xA;    Metadata:&#xA;      encoder         : Lavc58.35.100 libx264&#xA;    Side data:&#xA;      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1&#xA;    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 22050 Hz, mono, fltp, 69 kb/s (default)&#xA;    Metadata:&#xA;      encoder         : Lavc58.35.100 aac&#xA;frame=15952 fps= 52 q=31.0 size=   10240kB time=00:04:33.02 bitrate= 307.3kbits/s speed=0.844x&#xA;[h264 @ 0x3472d80] get_buffer() failed40kB time=00:04:33.02 bitrate= 307.3kbits/s speed=0.844x    &#xA;[h264 @ 0x3472d80] thread_get_buffer() failed&#xA;[h264 @ 0x3472d80] decode_slice_header error&#xA;[h264 @ 0x3472d80] no frame!&#xA;Error while decoding stream #15:0: Invalid data found when processing input&#xA;[h264 @ 0x34f54d0] get_buffer() failed&#xA;[h264 @ 0x34f54d0] thread_get_buffer() failed&#xA;[h264 @ 0x34f54d0] decode_slice_header error&#xA;[h264 @ 0x34f54d0] no frame!&#xA;[h264 @ 0x3472d80] get_buffer() failed&#xA;[h264 @ 0x3472d80] thread_get_buffer() failed&#xA;(...)&#xA;Error while decoding stream #15:0: Invalid data found when processing input&#xA;[h264 @ 0x3472d80] reference picture missing during reorder&#xA;[h264 @ 0x3472d80] Missing reference picture, default is 65660&#xA;[h264 @ 0x34c4540] mmco: unref short failure&#xA;[h264 @ 0x34f54d0] get_buffer() failed08kB time=00:04:45.37 bitrate= 316.0kbits/s speed=0.845x    &#xA;[h264 @ 0x34f54d0] thread_get_buffer() failed&#xA;[h264 @ 0x34f54d0] decode_slice_header error&#xA;[h264 @ 0x34f54d0] no frame!&#xA;[h264 @ 0x3472d80] decode_slice_header error&#xA;[h264 @ 0x3472d80] no frame!&#xA;Error while decoding stream #15:0: Invalid data found when processing input&#xA;[h264 @ 0x34f54d0] mmco: unref short failure&#xA;Error while decoding stream #15:0: Invalid data found when processing input&#xA;[h264 @ 0x3472d80] get_buffer() failed&#xA;[h264 @ 0x3472d80] thread_get_buffer() failed&#xA;[h264 @ 0x3472d80] decode_slice_header error&#xA;[h264 @ 0x3472d80] no frame!&#xA;Error while decoding stream #15:0: Invalid data found when processing input&#xA;[h264 @ 0x3472d80] get_buffer() failed&#xA;[h264 @ 0x3472d80] thread_get_buffer() failed&#xA;[h264 @ 0x3472d80] decode_slice_header error&#xA;[h264 @ 0x3472d80] no frame!&#xA;[h264 @ 0x34f54d0] reference picture missing during reorder&#xA;    Last message repeated 1 times&#xA;[h264 @ 0x34f54d0] Missing reference picture, default is 65708&#xA;    Last message repeated 1 times&#xA;Error while decoding stream #15:0: Invalid data found when processing input&#xA;[h264 @ 0x34dccb0] reference picture missing during reorder&#xA;[h264 @ 0x34dccb0] Missing reference picture, default is 65716&#xA;[h264 @ 0x3472d80] mmco: unref short failure&#xA;[h264 @ 0x34f54d0] decode_slice_header error&#xA;[h264 @ 0x34f54d0] no frame!&#xA;Error while decoding stream #15:0: Invalid data found when processing inputbits/s speed=0.845x    &#xA;[h264 @ 0x3480010] get_buffer() failed&#xA;[h264 @ 0x3480010] thread_get_buffer() failed&#xA;[h264 @ 0x3480010] decode_slice_header error&#xA;[h264 @ 0x3480010] no frame!&#xA;[h264 @ 0x34c4540] decode_slice_header error&#xA;[h264 @ 0x34c4540] no frame!&#xA;Error while decoding stream #15:0: Invalid data found when processing input&#xA;[h264 @ 0x3480010] mmco: unref short failure&#xA;Error while decoding stream #15:0: Invalid data found when processing input&#xA;[h264 @ 0x34c4540] get_buffer() failed&#xA;[h264 @ 0x34c4540] thread_get_buffer() failed&#xA;[h264 @ 0x34c4540] decode_slice_header error&#xA;[h264 @ 0x34c4540] no frame!&#xA;Error while decoding stream #15:0: Invalid data found when processing input&#xA;[h264 @ 0x34c4540] get_buffer() failed&#xA;[h264 @ 0x34c4540] thread_get_buffer() failed&#xA;[h264 @ 0x34c4540] decode_slice_header error&#xA;[h264 @ 0x34c4540] no frame!&#xA;[h264 @ 0x34f54d0] decode_slice_header error&#xA;[h264 @ 0x34f54d0] no frame!&#xA;Error while decoding stream #15:0: Invalid data found when processing input&#xA;[h264 @ 0x3480010] reference picture missing during reorder&#xA;    Last message repeated 1 times&#xA;[h264 @ 0x3480010] Missing reference picture, default is 65772&#xA;    Last message repeated 1 times&#xA;Error while decoding stream #15:0: Invalid data found when processing input&#xA;[h264 @ 0x3472d80] reference picture missing during reorder&#xA;[h264 @ 0x3472d80] Missing reference picture, default is 65780&#xA;[h264 @ 0x34c4540] mmco: unref short failure&#xA;av_interleaved_write_frame(): Cannot allocate memory&#xA;[mp4 @ 0x295c7e0] Application provided duration: 3689347710924763697 / timestamp: 6291454 is out of range for mov/mp4 format&#xA;Segmentation fault&#xA;

    &#xA;

    Merging videos 2 by 2

    &#xA;

    I then tried gradually merging videos into one, using multiple FFmpeg commands.

    &#xA;

    # Pseudocode&#xA;final = merge(clip1, clip2)&#xA;final = merge(final, clip3)&#xA;final = merge(final, clip4)&#xA;final = merge(final, clip5)&#xA;...&#xA;

    &#xA;

    with each command, looking like this :

    &#xA;

    ffmpeg -i 1Rbrdn1Xp.mp4 -i G7eYqdFPb.mp4 -y -filter_complex concat=n=2:v=1:a=1 -vsync 2 UMVDl9jki.mp4&#xA;

    &#xA;

    ffmpeg -i UMVDl9jki.mp4 -i -Xo-6ABm3.mp4 -y -filter_complex concat=n=2:v=1:a=1 -vsync 2 azE1Uombp.mp4&#xA;

    &#xA;

    This works but there is a loss in audio quality on the first clips, and it is slowly improving over time. I am guessing this is due to the first videos being merged more times than the last ones. You can see this effect happen in this video (weird artefacts in the voice).

    &#xA;


    &#xA;

    So, am I doing something wrong ?
    &#xA;Is there a way of merging a lot of videos, without running out of memory or worsening the audio quality ?

    &#xA;

  • python serve mp4 files securely [closed]

    4 juin 2021, par mariam_gvikvarxar

    I am building video serving service on python (django framework). The main requirement is that users should not be able to see mp4 direct link.

    &#xA;

    I was thinking about generating .ts files with subprocess using ffmpeg

    &#xA;

    like this :

    &#xA;

    import subprocess&#xA;&#xA;infile = &#x27;video.ts&#x27;&#xA;outfile = &#x27;video.mp4&#x27;&#xA;&#xA;subprocess.run([&#x27;ffmpeg&#x27;, &#x27;-i&#x27;, infile, outfile])&#xA;

    &#xA;

    but as I guess it will take a lot of resources (in a RAM) if multiple users try to watch videos

    &#xA;

    How would you solve this problem if you were me ?

    &#xA;

    thanks in advance

    &#xA;