Recherche avancée

Médias (1)

Mot : - Tags -/copyleft

Autres articles (11)

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

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

  • Librairies et logiciels spécifiques aux médias

    10 décembre 2010, par

    Pour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
    Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...)

Sur d’autres sites (3477)

  • Problems transcoding GoToMeeting output using FFmpeg

    20 avril 2014, par user3466413

    I’m having a nightmare of a time transcoding output from GoToMeeting, recorded using the latest OS X version, to something web-playable. No matter what settings I use, I end up with time syncing problems, at least with this particular recording.

    The .mov file looks like this. Note that it’s variable framerate, and because it’s mostly just a screencast of a PowerPoint presentation with occasional mouse movement, the output should be VFR too to produce a small file yet still preserve occasional motion.

    $ ffmpeg -i original.mov
    ffmpeg version N-58273-g18df75f Copyright (c) 2000-2013 the FFmpeg developers
     built on Nov 19 2013 10:34:42 with Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
     configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libass --enable-libcelt --enable-libfaac --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-openssl --enable-libopus --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvo-aacenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --prefix=/usr/local
     libavutil      52. 53.100 / 52. 53.100
     libavcodec     55. 43.101 / 55. 43.101
     libavformat    55. 21.100 / 55. 21.100
     libavdevice    55.  5.100 / 55.  5.100
     libavfilter     3. 91.100 /  3. 91.100
     libswscale      2.  5.101 /  2.  5.101
     libswresample   0. 17.104 /  0. 17.104
     libpostproc    52.  3.100 / 52.  3.100
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f822980a000] decoding for stream 0 failed
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'original.mov':
     Metadata:
       major_brand     : qt
       minor_version   : 537199360
       compatible_brands: qt
       creation_time   : 2014-03-20 02:09:22
     Duration: 03:08:26.72, start: 0.000000, bitrate: 75 kb/s
       Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv), 1368x728 [SAR 1:1 DAR 171:91], 20 kb/s, 0.60 fps, 600 tbr, 600 tbn, 1200 tbc (default)
       Metadata:
         creation_time   : 2014-03-20 02:09:22
         handler_name    : Apple Alias Data Handler
       Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 16000 Hz, mono, fltp, 47 kb/s (default)
       Metadata:
         creation_time   : 2014-03-20 02:09:22
         handler_name    : Apple Alias Data Handler
       Stream #0:2(eng): Data: none (rtp  / 0x20707472), 6 kb/s
       Metadata:
         creation_time   : 2014-03-20 02:09:22
         handler_name    : Apple Alias Data Handler
       Stream #0:3(und): Data: none (rtp  / 0x20707472), 0 kb/s
       Metadata:
         creation_time   : 2014-03-20 02:09:22
         handler_name    : Apple Alias Data Handler

    The .mov file (which I unfortunately cannot publicly post) plays back properly in any application I use : VLC, Media Player Classic, and QuickTime. However, playing the transcoded output always exhibits the following symptoms :

    • Audio out of sync with what the video is showing, sometimes to the order of minutes off towards the end of this three hour recording
    • In the case of Media Player Classic, clicking a spot on the timeline actually moves the playhead to a spot on the timeline near where I clicked, but not directly on it.

    There are the arguments I’m using for a .mp4 encoding that is playable in all browsers that support H.264. Note that this is on Windows but Linux exhibits the same problems.

    ffmpeg.exe -y -i original.mov -i watermark.png -filter_complex "[0:v] crop=1184:720:178:6,scale=1184:720,setsar=1/1; [0:v][1:v] overlay=1242:648 [0:v]" -vcodec libx264 -acodec libvo_aacenc -q:a 80 -crf 30 -ac 1 -ar 16000 -strict -2 -profile:v baseline -level 3 outout.mkv

    The arguments, other than those that are self-explanatory or trivial :

    • -filter_complex : Crop excess letterboxing/pillarboxing from the video and set the aspect ratio to 1:1 for square pixels (something Safari needed), then overlay a watermark from a PNG and resize the output to 720p
    • -crf 30 : encode the video at constant quality, variable bitrate
    • -ac 1 -ar 16000 : encode with mono audio at 16 KHz
    • -strict -2 -profile:v baseline -level 3 : encode using FFmpeg’s "experimental" H.264 encoder using the Baseline level 3 profile for web compatibility

    Note that yes, this goes to an MKV container initially because, for some reason, encoding directly to a .mp4 container hangs FFmpeg. I then use -acodec copy -vcodec copy to copy the audio and video streams directly into a .mp4 container. Finally I pass the output through MP4Box to interleave it so it can be progressively downloaded.

    When transcoding, FFmpeg does drop frames, which I suspect is related to the problem, with output like this :

    FFmpeg: frame=  232 fps= 26 q=24.0 size=    5983kB time=00:32:44.57 bitrate=  24.9kbits/s dup=0 drop=1487

    When I then later attempt to mux it into the .mp4 container from this temporary .mkv container, I get a flood of warnings like this :

    [mp4 @ 0297cd00] Non-monotonous DTS in output stream 0:0; previous: 6341306, current: 6007024; changing to 6341307. This may result in incorrect timestamps in the output file.

    Now I wouldn’t be surprised if there is indeed some problem with the source file. However, if so, I need to definitively prove just how it’s broken.

    Any thoughts ?

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

  • Layer black & white video over background so black pixels are transparent in FFMPEG

    4 février 2018, par Dan Weaver

    I’m trying to blend a video containing black and white animated text over a static background image. I can successfully blend them but no matter what blend mode I use I can’t get the effect I want.

    I’m looking for an effect similar to Photoshop’s ’Add’ blend mode where the color values of each pixel are added together. This results in no change where the top layer (video) has black pixels, effectively making the black background appear transparent.

    This is what I’m trying to achieve :
    enter image description here

    ffmpeg -i text.mp4 -loop 1 -i image.jpg \
    -filter_complex 'blend=all_mode=addition' -t 1 result.mp4

    I tried all the modes of the blend filter but none of them produce this effect. I thought Addition would be the one to work but the resulting video has a pink tint. Maybe there is some mismatch between color channels ?

    How can I get the result I’m looking for ?