Recherche avancée

Médias (91)

Autres articles (75)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

Sur d’autres sites (8291)

  • play video with secure link in laravel ffmpeg

    1er mars 2023, par abc abc

    I convert my video file to m3u8 with ffmpeg and upload in download host.
I have no problem when I want to display Blade in Laravel without a secure link.

    


    Now, I am asking my friends to help me display those videos using a safe link, something like this link :

    


    https://dl4.your-domain.com/stream.m3u8?path=path-to-your-video-of-m3u8&expires=1677764366&signature=3e302aedefa62b4414beba4957927afa

    


    I did it myself without a secure link and got the output.
These are the routes I defined :

    


    Route::get('/video/secret/{key}', function ($key) {
    return Storage::disk('secrets')->download('29/' . $key);
})->name('video.key');
 
Route::get('/video/{playlist}', function ($playlist) {
    return FFMpeg::dynamicHLSPlaylist()
        ->fromDisk('static')
        ->open("stream/video/29/{$playlist}")
        ->setKeyUrlResolver(function ($key) {
            return route('video.key', ['key' => $key]);
        })
        ->setMediaUrlResolver(function ($mediaFilename) {
            return Storage::disk('static')->url("stream/video/29/{$mediaFilename}");
        })
        ->setPlaylistUrlResolver(function ($playlistFilename) {
            return route('video.playlist', ['playlist' => $playlistFilename]);
        });
})->name('video.playlist');


    


    This is the source of the video :

    


    <code class="echappe-js">&lt;script src=&quot;https://cdn.rawgit.com/video-dev/hls.js/18bb552/dist/hls.min.js&quot;&gt;&lt;/script&gt;&#xA;    &lt;script&gt;&amp;#xA;        document.addEventListener(&amp;#x27;DOMContentLoaded&amp;#x27;, () =&gt; {&amp;#xA;            const source = &quot;{{ route(&amp;#x27;video.playlist&amp;#x27;, [&amp;#x27;playlist&amp;#x27; =&gt; &amp;#x27;29.m3u8&amp;#x27;]) }}&quot;;&amp;#xA;            const video = document.querySelector(&amp;#x27;#video&amp;#x27;);&amp;#xA; &amp;#xA;            const defaultOptions = {};&amp;#xA; &amp;#xA;            if (!Hls.isSupported()) {&amp;#xA;                video.src = source;&amp;#xA;                var player = new Plyr(video, defaultOptions);&amp;#xA;            } else {&amp;#xA;                // For more Hls.js options, see https://github.com/dailymotion/hls.js&amp;#xA;                const hls = new Hls();&amp;#xA;                hls.loadSource(source);&amp;#xA; &amp;#xA;                // From the m3u8 playlist, hls parses the manifest and returns&amp;#xA;                        // all available video qualities. This is important, in this approach,&amp;#xA;                        // we will have one source on the Plyr player.&amp;#xA;                       hls.on(Hls.Events.MANIFEST_PARSED, function (event, data) {&amp;#xA; &amp;#xA;                           // Transform available levels into an array of integers (height values).&amp;#xA;                          const availableQualities = hls.levels.map((l) =&gt; l.height)&amp;#xA;                      availableQualities.unshift(0) //prepend 0 to quality array&amp;#xA; &amp;#xA;                          // Add new qualities to option&amp;#xA;                    defaultOptions.quality = {&amp;#xA;                        default: 0, //Default - AUTO&amp;#xA;                        options: availableQualities,&amp;#xA;                        forced: true,&amp;#xA;                        onChange: (e) =&gt; updateQuality(e),&amp;#xA;                    }&amp;#xA;                    // Add Auto Label&amp;#xA;                    defaultOptions.i18n = {&amp;#xA;                        qualityLabel: {&amp;#xA;                            0: &amp;#x27;Auto&amp;#x27;,&amp;#xA;                        },&amp;#xA;                    }&amp;#xA; &amp;#xA;                    hls.on(Hls.Events.LEVEL_SWITCHED, function (event, data) {&amp;#xA;                      var span = document.querySelector(&quot;.plyr__menu__container [data-plyr=&amp;#x27;quality&amp;#x27;][value=&amp;#x27;0&amp;#x27;] span&quot;)&amp;#xA;                      if (hls.autoLevelEnabled) {&amp;#xA;                        span.innerHTML = `AUTO (${hls.levels[data.level].height}p)`&amp;#xA;                      } else {&amp;#xA;                        span.innerHTML = `AUTO`&amp;#xA;                      }&amp;#xA;                    })&amp;#xA; &amp;#xA;                     // Initialize new Plyr player with quality options&amp;#xA;                     var player = new Plyr(video, defaultOptions);&amp;#xA;                 });&amp;#xA; &amp;#xA;            hls.attachMedia(video);&amp;#xA;                window.hls = hls;&amp;#xA;            }&amp;#xA; &amp;#xA;            function updateQuality(newQuality) {&amp;#xA;              if (newQuality === 0) {&amp;#xA;                window.hls.currentLevel = -1; //Enable AUTO quality if option.value = 0&amp;#xA;              } else {&amp;#xA;                window.hls.levels.forEach((level, levelIndex) =&gt; {&amp;#xA;                  if (level.height === newQuality) {&amp;#xA;                    console.log(&quot;Found quality match with &quot; &amp;#x2B; newQuality);&amp;#xA;                    window.hls.currentLevel = levelIndex;&amp;#xA;                  }&amp;#xA;                });&amp;#xA;              }&amp;#xA;            }&amp;#xA;        });&amp;#xA;    &lt;/script&gt;&#xA;

    &#xA;

    But these work without secure links and signatures.&#xA;I want to create a secure link using token, signature and expires for each part of the video.&#xA;It means to close the direct access on the download host and to access the video files only through Laravel.&#xA;Thank you if anyone knows how to help.

    &#xA;

    Something similar to the following link to display the video :

    &#xA;

    https://dl4.your-domain.com/stream.m3u8?path=path-to-your-video-of-m3u8&expires=1677764366&signature=3e302aedefa62b4414beba4957927afa

    &#xA;

  • How to cut out first 5 seconds with youtube_dl and ffmpeg in python

    23 février 2021, par SvenXP

    i have a python script to download and save a MP3 and i would like to add code to cut out 5 seconds from the beginning of the MP3.

    &#xA;

    def download():&#xA;    ydl_opts = {&#xA;        &#x27;format&#x27;: &#x27;bestaudio/best&#x27;,&#xA;        &#x27;outtmpl&#x27;: &#x27;c:/MP3/%(title)s.%(ext)s&#x27;,&#xA;        &#x27;cookiefile&#x27;: &#x27;cookies.txt&#x27;,&#xA;        &#x27;postprocessors&#x27;: [{&#xA;            &#x27;key&#x27;: &#x27;FFmpegExtractAudio&#x27;,&#xA;            &#x27;preferredcodec&#x27;: &#x27;mp3&#x27;,&#xA;            &#x27;preferredquality&#x27;: &#x27;192&#x27;,&#xA;        }],&#xA;    }&#xA;    with youtube_dl.YoutubeDL(ydl_opts) as ydl:&#xA;        ydl.download([inpYTLinkSong.get()])&#xA;

    &#xA;

    I found some code for command line to cut x seconds :

    &#xA;

    ffmpeg -ss 00:00:15.00 -i "OUTPUT-OF-FIRST URL" -t 00:00:10.00 -c copy out.mp4

    &#xA;

    So i think i have to get the -ss part into the postprocessor part in my script, something like :

    &#xA;

    &#x27;postprocessors&#x27;: [{&#xA;        &#x27;key&#x27;: &#x27;FFmpegExtractAudio&#x27;,&#xA;        &#x27;preferredcodec&#x27;: &#x27;mp3&#x27;,&#xA;        &#x27;preferredquality&#x27;: &#x27;192&#x27;,&#xA;        &#x27;ss&#x27;:&#x27;00:00:05.00&#x27;&#xA;    }],&#xA;

    &#xA;

    But of course its not working with 'ss' or 'duration' (found in ffmpeg docu).

    &#xA;

    So any ideas what i have to put there instead of 'ss' ?

    &#xA;

  • Php to play mp4 as ts file [on hold]

    6 août 2019, par Aha

    Deas,

    I need to ask if i can play mp4 video as a segment ( ts files) with 3 quilty 360p 480p and 720p

    For exmaple if i uploaded mp4 file to my server and when any client play this video play as a segments like ts file and when use download manager he is cant download the orginal mp4 just 1 segments of .ts file can you please inform me the vest solution to get this done