
Recherche avancée
Autres articles (28)
-
Publier sur MédiaSpip
13 juin 2013Puis-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 -
Création définitive du canal
12 mars 2010, parLorsque 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 (...) -
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)
Sur d’autres sites (3478)
-
How to "merge" thousands of m4s files with ffmpeg ?
16 septembre 2021, par Dirty_DozenI've downloaded a segmented stream which contains thousands of m4s files for audio and video. I have the mpd and init files. How can i merge these with ffmpeg ? Unfortunately I can't work it out from the ffmpeg manual regarding concat.


I'm using Windows 10.


-
ffmpeg command never work in lambda function using nodejs [closed]
4 décembre 2022, par Santosh swainI 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())
};



-
Remove parts of a video automagically without reencode ?
21 août 2022, par SamI'm looking for a way to remove automatically the opening and ending parts of a video (credits) without reencode.


If you need an example, take Game of Thrones : I'd need a way to automatically remove the GoT opening (with the theme music) and the ending part (with the credits and the HBO logo part).


FFmpeg can do that, but the cut has to be manual and happens only at keyframes... which isn't precise enough for me.


I thought that maybe there is a tool that allows to scan a video, and remove a part between two input frames (the start of opening frame, the end of opening frame)... etc, same thing for Ending.


Thanks for the help !