Recherche avancée

Médias (1)

Mot : - Tags -/bug

Autres articles (59)

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

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

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (6105)

  • ffmpeg command never work in lambda function using nodejs [closed]

    4 décembre 2022, par Santosh swain

    I am trying to implement FFmpeg video streaming functionality such as Instagram countdown functionality. In this code, first of all, I get records(URLs) from the s3 bucket and then split them according to my need, and then create the command and execute it with exec() belonging to childe_process. in this, I am trying to store the out in some specific folder in lambda function but it was never stored. I thought lambda does allow to write files locally so I am trying to do the direct upload on the s3 bucket by using the stdout parameter of exec()'s callback. guys, please help to do that. I have a question lambda does allow to write content in its local folder ? or if not allow then whats the way to do that thing ? I just share my code please guide me.

    


    
    // dependencies
var AWS = require('aws-sdk');
var s3 = new AWS.S3();
var { exec } = require('child_process');
var path = require('path')
var AWS_ACCESS_KEY = '';
var AWS_SECRET_ACCESS_KEY = '';
var fs = require('fs')

s3 = new AWS.S3({
    accessKeyId: AWS_ACCESS_KEY,
    secretAccessKey: AWS_SECRET_ACCESS_KEY
});

exports.handler = async function (event, context) {

    var bucket_name = "sycu-game";
    var bucketName = "sycu-test";

    //CREATE OVERLAY AND BG_VALUE PATH TO GET VALUE FROM S3
    const bgValue = (event.Records[0].bg_value).split('/');
    const overlayImage = (event.Records[0].overlay_image_url).split('/');


    var s3_bg_value = bgValue[3] + "/" + bgValue[4];
    var s3_overlay_image = overlayImage[4] + "/" + overlayImage[5] + "/" + overlayImage[6];
    const signedUrlExpireSeconds = 60 * 5;


    //RETREIVE BG_VALUE FROM S3 AND CREATE URL FOR FFMPEG INPUT VALUE
    var bg_value_url = s3.getSignedUrl('getObject', {
        Bucket: bucket_name,
        Key: s3_bg_value,
        Expires: signedUrlExpireSeconds
    });
    bg_value_url = bg_value_url.split("?");
    bg_value_url = bg_value_url[0];


    //RETREIVE OVERLAY IMAGE FROM S3 AND CREATE URL FOR FFMPEG INPUT VALUE   
    var overlay_image_url = s3.getSignedUrl('getObject', {
        Bucket: bucket_name,
        Key: s3_overlay_image,
        Expires: signedUrlExpireSeconds
    });
    overlay_image_url = overlay_image_url.split("?");
    overlay_image_url = overlay_image_url[0];


    //MANUAL ASSIGN VARIABLE FOR FFMPEG COMMAND 
    var command,
        ExtraTimerSec = event.Records[0].timer_seconds + 5,
        TimerSec = event.Records[0].timer_seconds + 1,
        BackgroundWidth = 1080,
        BackgroundHeight = 1920,
        videoPath = (__dirname + '/tmp/' + event.Records[0].name);
    console.log("path", videoPath)
    //TEMP DIRECTORY

    var videoPath = '/media/volume-d/generatedCountdownS3/tmp/' + event.Records[0].name
    var tmpFile = fs.createWriteStream(videoPath)
    //FFMPEG COMMAND 
    if (event.Records[0].bg_type == 2) {
        if (event.Records[0].is_rotate) {
            command = ' -stream_loop -1 -t ' + ExtraTimerSec + ' -i ' + bg_value_url + ' -i ' + overlay_image_url + ' -filter_complex "color=color=0x000000@0.0:s= ' + event.Records[0].resized_box_width + 'x' + event.Records[0].resized_box_height + ',drawtext=fontcolor=' + event.Records[0].time_text_color + ':fontsize=' + event.Records[0].time_text_size + ':x=' + event.Records[0].minute_x + ':y=' + event.Records[0].minute_y + ':text=\'%{eif\\:trunc(mod(((' + TimerSec + '-if(between(t, 0, 1),1,if(gte(t,' + TimerSec + '),' + TimerSec + ',t)))/60),60))\\:d\\:2}\',drawtext=fontcolor=' + event.Records[0].time_text_color + ':fontsize=' + event.Records[0].time_text_size + ':x=' + event.Records[0].second_x + ':y=' + event.Records[0].second_y + ':text=\'%{eif\\:trunc(mod(' + TimerSec + '-if(between(t, 0, 1),1,if(gte(t,' + TimerSec + '),' + TimerSec + ',t))\,60))\\:d\\:2}\'[txt]; [txt] rotate=' + event.Records[0].box_angle + '*PI/180:fillcolor=#00000000 [rotated];[0] scale=w=' + BackgroundWidth + ':h=' + BackgroundHeight + '[t];[1] scale=w=' + BackgroundWidth + ':h=' + BackgroundHeight + '[ot];[t][ot] overlay = :x=0 :y=0 [m1];[m1][rotated]overlay = :x=' + event.Records[0].flat_box_coordinate_x + ' :y=' + event.Records[0].flat_box_coordinate_x + ' [m2]" -map "[m2]" -pix_fmt yuv420p -t ' +
                ExtraTimerSec + ' -r 24 -c:a copy ' + videoPath + "";
        }
        else {
            command = ' -stream_loop -1 -t ' + ExtraTimerSec + ' -i ' + bg_value_url + ' -i ' + overlay_image_url + ' -filter_complex "color=color=0x000000@0.0:s= ' + event.Records[0].resized_box_width + 'x' + event.Records[0].resized_box_height + ',drawtext=fontcolor=' + event.Records[0].time_text_color + ':fontsize=' + event.Records[0].time_text_size + ':x=' + event.Records[0].minute_x + ':y=' + event.Records[0].minute_y + ':text=\'%{eif\\:trunc(mod(((' + TimerSec + '-if(between(t, 0, 1),1,if(gte(t,' + TimerSec + '),' + TimerSec + ',t)))/60),60))\\:d\\:2}\',drawtext=fontcolor=' + event.Records[0].time_text_color + ':fontsize=' + event.Records[0].time_text_size + ':x=' + event.Records[0].second_x + ':y=' + event.Records[0].second_y + ':text=\'%{eif\\:trunc(mod(' + TimerSec + '-if(between(t, 0, 1),1,if(gte(t,' + TimerSec + '),' + TimerSec + ',t))\,60))\\:d\\:2}\'[txt]; [txt] rotate=' + event.Records[0].box_angle + '*PI/180:fillcolor=#00000000 [rotated];[0] scale=w=' + BackgroundWidth + ':h=' + BackgroundHeight + '[t];[1] scale=w=' + BackgroundWidth + ':h=' + BackgroundHeight + '[ot];[t][ot] overlay = :x=0 :y=0 [m1];[m1][rotated]overlay = :x=' + event.Records[0].flat_box_coordinate_x + ' :y=' + event.Records[0].flat_box_coordinate_x + ' [m2]" -map "[m2]" -pix_fmt yuv420p -t ' +
                ExtraTimerSec + ' -r 24 -c:a copy ' + videoPath + "";
        }
    }
    var final_command = '/usr/bin/ffmpeg' + command;


    //COMMAND EXECUTE HERE

    await exec(final_command, function (err, stdout, stderr) {
        console.log("data is here")
        console.log('err:', err);
        console.log('stdout:', stdout);
        console.log('stderr:', stderr);
        const params = {
            Bucket: bucketName,
            Key: "countdown/output.mp4",
            Body: stdout,
        }
        s3.upload(params).promise().then(data => {
            console.log("data is here -->", data)
        });
    });
    var tmpFile = fs.createReadStream(videoPath)
    console.log('temp file data:', tmpFile.toString())
};


    


  • Anomalie #2728 : js de login déficient sous opera 11.64

    4 juin 2012, par cedric -

    tu es sûr qu’il n’y a pas un autre problème dans ton instance 3.1.0-dev (ou alors qu’elle ne traine pas un cache d’un js qui posait problème ?). Car il n’y a vraiment aucune différence entre les 2 branches sur ce sujet (aucune différence entre les 2 branches d’ailleurs, autre que le numéro de (...)

  • Decode and display an h264 stream in browser from websocket

    23 octobre 2020, par Jorge Garcia Dominguez

    I am trying to display the stream from a live rtp camera in a browser but I am having problems with that.
The signal have to be lossless so that's why I am using a ffmpeg pipe (H264 which can be lossless), streamed to a node script which serve the signal via websocket to the javascript client.
This is the pipe :

    


    ffmpeg -i rtsp://ipofthertsp -f rawvideo -b 800k -r 30 -framerate 10 -c:v libx264 -preset ultrafast -crf 0 http://127.0.0.1:8081/supersecret/


    


    The flow is as follows :

    


    rtp -> ffmpeg -> (http://127.0.0.1:8081) http-To-ws (ws ://127.0.0.1:8082) <- (ws) JavascriptClient

    &#xA;

    The bytes gets to the client but I don´t know how to handle it.

    &#xA;

        function opened() { &#xA;   &#xA;        // set up the websocket&#xA;        var url = &#x27;ws://127.0.0.1:8082&#x27;;&#xA;        ws = new WebSocket(url);&#xA;        ws.binaryType = "arraybuffer";&#xA;        ws.onmessage = function (event) {&#xA;&#xA;        var view   = new Uint8Array(event.data);&#xA;        console.log(&#x27;data \r\n&#x27;, event.data);&#xA;&#xA;            /* what to do from here to paint it*/&#xA;        };&#xA;    }&#xA;

    &#xA;

    And then, I'd like to paint it either in canvas, video... whatever.

    &#xA;

    Any clue ???

    &#xA;