Recherche avancée

Médias (0)

Mot : - Tags -/signalement

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

Autres articles (65)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (8685)

  • Révision 19175 : Corrections CSS :

    29 mars 2012, par cedric -

    class edition sur le body toujours a la fin pour permettre d’avoir le meme selecteur css selon qu’elle est ajoutee cote serveur ou client

    meta viewport pour iTruc

    preciser des min-width sur le body pour que les iTruc ne se trompent pas au calcul de largeur de (...)

  • How do i play an HLS stream when playlist.m3u8 file is constantly being updated ?

    3 janvier 2021, par Adnan Ahmed

    I am using MediaRecorder to record chunks of my live video in webm format from MediaStream and converting these chunks to .ts files on the server using ffmpeg and then updating my playlist.m3u8 file with this code :

    


    function generateM3u8Playlist(fileDataArr, playlistFp, isLive, cb) {
    var durations = fileDataArr.map(function(fd) {
        return fd.duration;
    });
    var maxT = maxOfArr(durations);

    var meta = [
        '#EXTM3U',
        '#EXT-X-VERSION:3',
        '#EXT-X-MEDIA-SEQUENCE:0',
        '#EXT-X-ALLOW-CACHE:YES',
        '#EXT-X-TARGETDURATION:' + Math.ceil(maxT),
    ];

    fileDataArr.forEach(function(fd) {
        meta.push('#EXTINF:' + fd.duration.toFixed(2) + ',');
        meta.push(fd.fileName2);
    });

    if (!isLive) {
        meta.push('#EXT-X-ENDLIST');
    }

    meta.push('');
    meta = meta.join('\n');

    fs.writeFile(playlistFp, meta, cb);
}


    


    Here fileDataArr holds information for all the chunks that have been created.

    


    After that i use this code to create a hls server :

    


    var runStreamServer = (function(streamFolder) {
    var executed = false;
    return function(streamFolder) {
        if (!executed) {
            executed = true;
            var HLSServer = require('hls-server')
            var http = require('http')

            var server = http.createServer()
            var hls = new HLSServer(server, {
                path: '/stream', // Base URI to output HLS streams
                dir: 'C:\\Users\\Work\\Desktop\\live-stream\\webcam2hls\\videos\\' + streamFolder // Directory that input files are stored
            })
            console.log("We are going to stream from folder:" + streamFolder);
            server.listen(8000);
            console.log('Server Listening on Port 8000');
        }
    };
})();


    


    The problem is that if i stop creating new chunks and then use the hls server link :
http://localhost:8000/stream/playlist.m3u8 then the video plays in VLC but if i try to play during the recording it keeps loading the file but does not play. I want it to play while its creating new chunks and updating playlist.m3u8. The quirk in generateM3u8Playlist function is that it adds '#EXT-X-ENDLIST' to the playlist file after i have stopped recording.
The software is still in production so its a bit messy code. Thank you for any answers.

    


    The client side that generates blobs is as follows :

    


    var mediaConstraints = {
            video: true,
            audio:true
        };
navigator.getUserMedia(mediaConstraints, onMediaSuccess, onMediaError);
function onMediaSuccess(stream) {
            console.log('will start capturing and sending ' + (DT / 1000) + 's videos when you press start');
            var mediaRecorder = new MediaStreamRecorder(stream);

            mediaRecorder.mimeType = 'video/webm';

            mediaRecorder.ondataavailable = function(blob) {
                var count2 = zeroPad(count, 5);
                // here count2 just creates a blob number 
                console.log('sending chunk ' + name + ' #' + count2 + '...');
                send('/chunk/' + name + '/' + count2 + (stopped ? '/finish' : ''), blob);
                ++count;
            };
        }
// Here we have the send function which sends our blob to server:
        function send(url, blob) {
            var xhr = new XMLHttpRequest();
            xhr.open('POST', url, true);

            xhr.responseType = 'text/plain';
            xhr.setRequestHeader('Content-Type', 'video/webm');
            //xhr.setRequestHeader("Content-Length", blob.length);

            xhr.onload = function(e) {
                if (this.status === 200) {
                    console.log(this.response);
                }
            };
            xhr.send(blob);
        }


    


    The code that receives the XHR request is as follows :

    


    var parts = u.split('/');
        var prefix = parts[2];
        var num = parts[3];
        var isFirst = false;
        var isLast = !!parts[4];

        if ((/^0+$/).test(num)) {
            var path = require('path');
            shell.mkdir(path.join(__dirname, 'videos', prefix));
            isFirst = true;
        }

        var fp = 'videos/' + prefix + '/' + num + '.webm';
        var msg = 'got ' + fp;
        console.log(msg);
        console.log('isFirst:%s, isLast:%s', isFirst, isLast);

        var stream = fs.createWriteStream(fp, { encoding: 'binary' });
        /*stream.on('end', function() {
            respond(res, ['text/plain', msg]);
        });*/

        //req.setEncoding('binary');

        req.pipe(stream);
        req.on('end', function() {
            respond(res, ['text/plain', msg]);

            if (!LIVE) { return; }

            var duration = 20;
            var fd = {
                fileName: num + '.webm',
                filePath: fp,
                duration: duration
            };
            var fileDataArr;
            if (isFirst) {
                fileDataArr = [];
                fileDataArrs[prefix] = fileDataArr;
            } else {
                var fileDataArr = fileDataArrs[prefix];
            }
            try {
                fileDataArr.push(fd);
            } catch (err) {
                fileDataArr = [];
                console.log(err.message);
            }
            videoUtils.computeStartTimes(fileDataArr);

            videoUtils.webm2Mpegts(fd, function(err, mpegtsFp) {
                if (err) { return console.error(err); }
                console.log('created %s', mpegtsFp);

                var playlistFp = 'videos/' + prefix + '/playlist.m3u8';

                var fileDataArr2 = (isLast ? fileDataArr : lastN(fileDataArr, PREV_ITEMS_IN_LIVE));

                var action = (isFirst ? 'created' : (isLast ? 'finished' : 'updated'));

                videoUtils.generateM3u8Playlist(fileDataArr2, playlistFp, !isLast, function(err) {
                    console.log('playlist %s %s', playlistFp, (err ? err.toString() : action));
                });
            });


            runStreamServer(prefix);
        }


    


  • how to install ffmpeg in cpanel

    30 janvier 2012, par Ajay Chthri

    i'm using dedicated server(linux) so i need to install ffmpeg in cpanel so here ffmpeg i found in Main >> Software >> Install a Perl Module but i writing script in php so how can i install ffmpeg phpperl

    when i'am trying to install ffmpeg in perl module i get this response

    Checking C compiler....C compiler (/usr/bin/cc) OK (cached Tue Jan 17 19:16:31 2012)....Done
    CPAN fallback is disabled since /var/cpanel/conserve_memory exists, and cpanm is available.
    Method: Using Perl Expect, Installer: cpanm
    You have make /usr/bin/make
    Falling back to HTTP::Tiny 0.009
    You have /bin/tar: tar (GNU tar) 1.15.1
    You have /usr/bin/unzip
    You have Cpanel::HttpRequest 2.1
    Testing connection speed...(using fast method)...Done
    Ping:2 (ticks) Testing connection speed to cpan.knowledgematters.net using pureperl...(28800.00 bytes/s)...Done
    Ping:2 (ticks) Testing connection speed to cpan.develooper.com using pureperl...(22233.33 bytes/s)...Done
    Ping:2 (ticks) Testing connection speed to cpan.schatt.com using pureperl...(32750.00 bytes/s)...Done
    Ping:3 (ticks) Testing connection speed to cpan.mirror.facebook.net using pureperl...(14050.00 bytes/s)...Done
    Ping:2 (ticks) Testing connection speed to cpan.mirrors.hoobly.com using pureperl...(5150.00 bytes/s)...Done
    Five usable mirrors located
    Ping:0 (ticks) Testing connection speed to 208.109.109.239 using pureperl...(28950.00 bytes/s)...Done
    Ping:2 (ticks) Testing connection speed to 208.82.118.100 using pureperl...(19300.00 bytes/s)...Done
    Ping:1 (ticks) Testing connection speed to 69.50.192.73 using pureperl...(19300.00 bytes/s)...Done
    Three usable fallback mirrors located
    Mirror Check passed for cpan.schatt.com (/index.html)
    Searching on cpanmetadb ...
    Fetching http://cpanmetadb.cpanel.net/v1.0/package/Video::FFmpeg?cpanel_version=11.30.5.6&cpanel_tier=release (connected:0).......(request attempt 1/12)...Using dns cache file /root/.HttpRequest/cpanmetadb.cpanel.net......searching for mirrors (mirror search attempt 1/3)......5 usable mirrors located. (less then expected)......mirror search success......connecting to 208.74.123.82...@208.74.123.82......connected......receiving...100%......request success......Done
    Searching Video::FFmpeg on cpanmetadb (http://cpanmetadb.cpanel.net/v1.0/package/Video::FFmpeg?cpanel_version=11.30.5.6&cpanel_tier=release) ...
    Fetching http://cpanmetadb.cpanel.net/v1.0/package/Video::FFmpeg?cpanel_version=11.30.5.6&cpanel_tier=release (connected:1).......(request attempt 1/12)...@208.74.123.82......connected......receiving...100%......request success......Done
    Source: fastest CPAN mirror ... --> Working on Video::FFmpeg
    Fetching http://cpan.schatt.com//authors/id/R/RA/RANDOMMAN/Video-FFmpeg-0.47.tar.gz ... Fetching http://cpan.schatt.com/authors/id/R/RA/RANDOMMAN/Video-FFmpeg-0.47.tar.gz (connected:1).......(request attempt 1/12)...Resolving cpan.schatt.com...(resolve attempt 1/65)......connecting to 66.249.128.125...@66.249.128.125......connected......receiving...25%...50%...75%...100%......request success......Done
    OK
    Unpacking Video-FFmpeg-0.47.tar.gz
    Video-FFmpeg-0.47/
    Video-FFmpeg-0.47/Changes
    Video-FFmpeg-0.47/FFmpeg.xs
    Video-FFmpeg-0.47/MANIFEST
    Video-FFmpeg-0.47/META.yml
    Video-FFmpeg-0.47/Makefile.PL
    Video-FFmpeg-0.47/README
    Video-FFmpeg-0.47/lib/
    Video-FFmpeg-0.47/lib/Video/
    Video-FFmpeg-0.47/lib/Video/FFmpeg/
    Video-FFmpeg-0.47/lib/Video/FFmpeg/AVFormat.pm
    Video-FFmpeg-0.47/lib/Video/FFmpeg/AVStream/
    Video-FFmpeg-0.47/lib/Video/FFmpeg/AVStream/Audio.pm
    Video-FFmpeg-0.47/lib/Video/FFmpeg/AVStream/Subtitle.pm
    Video-FFmpeg-0.47/lib/Video/FFmpeg/AVStream/Video.pm
    Video-FFmpeg-0.47/lib/Video/FFmpeg/AVStream.pm
    Video-FFmpeg-0.47/lib/Video/FFmpeg.pm
    Video-FFmpeg-0.47/ppport.h
    Video-FFmpeg-0.47/t/
    Video-FFmpeg-0.47/t/Video-FFmpeg.t
    Video-FFmpeg-0.47/test
    Video-FFmpeg-0.47/test.mp4
    Video-FFmpeg-0.47/typemap
    Entering Video-FFmpeg-0.47
    Checking configure dependencies from META.yml
    META.yml not found or unparsable. Fetching META.yml from search.cpan.org
    Fetching http://search.cpan.org/meta/Video-FFmpeg-0.47/META.yml (connected:1).......(request attempt 1/12)...Resolving search.cpan.org...(resolve attempt 1/65)......connecting to 199.15.176.161...@199.15.176.161......connected......receiving...100%......request success......Done
    Configuring Video-FFmpeg-0.47 ... Running Makefile.PL
    Perl v5.10.0 required--this is only v5.8.8, stopped at Makefile.PL line 1.
    BEGIN failed--compilation aborted at Makefile.PL line 1.
    N/A
    ! Configure failed for Video-FFmpeg-0.47. See /home/.cpanm/build.log for details.
    Perl Expect failed with non-zero exit status: 256

    All available perl module install methods have failed  

    guide me how can i install ffmpeg in cPanel

    Thanks for advance.