Recherche avancée

Médias (91)

Autres articles (102)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • L’agrémenter visuellement

    10 avril 2011

    MediaSPIP est basé sur un système de thèmes et de squelettes. Les squelettes définissent le placement des informations dans la page, définissant un usage spécifique de la plateforme, et les thèmes l’habillage graphique général.
    Chacun peut proposer un nouveau thème graphique ou un squelette et le mettre à disposition de la communauté.

  • Possibilité de déploiement en ferme

    12 avril 2011, par

    MediaSPIP peut être installé comme une ferme, avec un seul "noyau" hébergé sur un serveur dédié et utilisé par une multitude de sites différents.
    Cela permet, par exemple : de pouvoir partager les frais de mise en œuvre entre plusieurs projets / individus ; de pouvoir déployer rapidement une multitude de sites uniques ; d’éviter d’avoir à mettre l’ensemble des créations dans un fourre-tout numérique comme c’est le cas pour les grandes plate-formes tout public disséminées sur le (...)

Sur d’autres sites (8056)

  • AVI to MP4 - ffmpeg conversion

    4 juin 2014, par Emmanuel Brunet

    I’m running a debian 7.5 machine with ffmpeg-2.2 installed following these instructions

    Issue

    I’m trying to display a mp4 video inside my browser. The original file has an AVI container format. I can successfully convert it to mp4 and the targetfile is readable (video + sound) with the totem movie player. So I thought everything would be OK displaying the bellow page

    HTML5 web page

       


    <video width="640" height="480" controls="controls">
     <source src="/path/to/output.mp4" type="video/mp4">
    <h3>Your browser does not support the video tag</h3>
    </source></video>

    Input probe

    $ ffprobe -show_streams input.avi

     Duration: 00:08:22.90, start: 0.000000, bitrate: 1943 kb/s
       Stream #0:0: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16p, 64 kb/s
       Stream #0:1: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 720x540 [SAR 1:1 DAR 4:3], 1870 kb/s, 29.97 fps, 25 tbr, 29.97 tbn, 25 tbc

    Convert

    $ ffmpeg -y -fflags +genpts -i input.avi -acodec copy -vcodec copy ouput.mp4

    Html browser

    Opening the above html file plays sound but no video is displayed.

    When I use other .mp4 files, videos succesfully displayed so I’m sure I face a conversion issue.

    Not : I’ve tryed a lot of other ffmpeg options but without success.

    Any idea ?

    Thanks in advance.

  • How to detect when a mp3 stops playing in ffmpeg

    23 mai 2021, par Jacob Shankman

    back yet again to ask this : I have a ost command for my discord bot. All it does is join the vc that the user is in, and plays a random choice of mp3's that I have as a list. It works fine. Except for when the song is over, it just stays there. Im wondering how to detect when ffmpeg has finished playing the mp3 so&#xA;I can execute a function to tell the bot to disconnect once it has finished. Here is the code for the command :

    &#xA;

    @client.command()&#xA;async def speak(message):&#xA;    voice_s = await message.author.voice.channel.connect()&#xA;    voice_s.play(discord.FFmpegPCMAudio(random.choice(speak_list)))&#xA;

    &#xA;

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

    &#xA;

    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 :

    &#xA;

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

    &#xA;

    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.

    &#xA;

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

    &#xA;

    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 !)

    &#xA;

    enter image description here

    &#xA;

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

    &#xA;

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

    &#xA;

    And the dash.js player code is very simple :

    &#xA;

    const srcUrl = "../ottWebRoot/playerTest/master.mpd"; &#xA;&#xA;var player = dashjs.MediaPlayer().create();&#xA;&#xA;let autoPlay = false;&#xA;player.initialize(document.querySelector("#videoTagId"), srcUrl, autoPlay);&#xA;&#xA;player.updateSettings(&#xA;{&#xA;    streaming :&#xA;    {&#xA;        lowLatencyEnabled : true,&#xA;        liveDelay : 2,&#xA;        jumpGaps : true,&#xA;        jumpLargeGaps : true,&#xA;        smallGapLimit : 1.5,&#xA;    }&#xA;});&#xA;

    &#xA;

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

    &#xA;

    &lt;?php&#xA;    print gmdate("Y-m-d\TH:i:s\Z");&#xA;?>&#xA;

    &#xA;

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

    &#xA;

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

    &#xA;

    EDIT I

    &#xA;

    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.

    &#xA;

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

    &#xA;

    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;