
Recherche avancée
Médias (1)
-
The pirate bay depuis la Belgique
1er avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
Autres articles (73)
-
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...) -
MediaSPIP en mode privé (Intranet)
17 septembre 2013, parÀ partir de la version 0.3, un canal de MediaSPIP peut devenir privé, bloqué à toute personne non identifiée grâce au plugin "Intranet/extranet".
Le plugin Intranet/extranet, lorsqu’il est activé, permet de bloquer l’accès au canal à tout visiteur non identifié, l’empêchant d’accéder au contenu en le redirigeant systématiquement vers le formulaire d’identification.
Ce système peut être particulièrement utile pour certaines utilisations comme : Atelier de travail avec des enfants dont le contenu ne doit pas (...) -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.
Sur d’autres sites (9697)
-
Node.js : ffmpeg command not waiting for other ffmpeg command promise to be resolved
11 mars 2024, par Imker WarzeI am trying to node.js program, in which fluent-ffmpeg first converts an input-mp4-file to an mp3 file and after that fluent-ffmpeg command should trim the mp3 file (for example only 0:12 - 0:48).
I am using promises for that but it seems like that the trimFile() method is not waiting for the promise to be resolved. I have the following code :


// data = [stream, duration, trimStartTime, res, name]
async function convertMP4ToMP3(data) {
 var name = data[4];
 let inputFilePath = `./temp/${name}.mp3`
 return new Promise((resolve, reject) => {
 ffmpeg()
 .input(`./temp/${name}.mp4`)
 .output(`./temp/${name}.mp3`)
 .audioCodec('libmp3lame')
 .on('error', reject)
 .run();
 console.log("convertMP4toMP3 DONE!\n");
 resolve(data.concat([inputFilePath]));
 });
}

// data = [stream, duration, trimStartTime, res, name, inputFilePath]
async function trimFile(data) {
 console.log("trimming starting");
 return new Promise((resolve, reject) => {
 setTimeout(() => {
 let duration = data[1];
 if (duration > 0) {
 let trimStartTime = data[2];
 let inputFilePath = data[5];

 var dotIndex = inputFilePath.lastIndexOf(".");
 var outputFilePath = inputFilePath.substring(0, dotIndex) + "_t" + inputFilePath.substring(dotIndex);
 
 const trim = new ffmpeg({source: inputFilePath});
 trim
 .setStartTime(trimStartTime)
 .setDuration(duration)
 .on("start", function(commandLine) {
 console.log("Spawned ffmpeg with: " + commandLine)
 })
 .on('end', function(err) {
 if (!err) {
 console.log('trimming Done');
 }
 })
 .on('error', function(err) {
 console.log('error in trimFile(): ', err);
 })
 .saveToFile(outputFilePath);
 
 } 
 resolve(data);
 }, "100"); // explanation underneath
 });
}



If I execute the following code :


func1(data)
 .then(func2)
 .then(convertMP4ToMP3)
 .then(trimFile)



The trimfile() method says : Invalid argument. If I change the timeout to 6000 instead of 100. It works. I was spectating the files in the filesystem and saw, that convert sometimes is not done before trimFile is executed. Can someone explain, why the trimFile() is not waiting for the resolve() ?


I also tried :


// data = [stream, duration, trimStartTime, res, name]
async function convertMP4ToMP3(data) {
 var name = data[4];
 let inputFilePath = `./temp/${name}.mp3`
 return new Promise((resolve, reject) => {
 ffmpeg()
 .input(`./temp/${name}.mp4`)
 .output(`./temp/${name}.mp3`)
 .audioCodec('libmp3lame')
 .on('error', reject)
 .on('end', resolve)
 .run();
 console.log("convertMP4toMP3 DONE!\n");
 });
}



But first this doesnt work neither and second thus I can not pass the string inputFilePath to the trimfile() method (because .on('end', resolve(data.concat([inputFilePath]))) does not work for me).


-
ffmpeg append an audio file to another audio file at position of every 10 seconds
28 décembre 2018, par manoj kumarI want to append an audio file into another audio file at position of every 10 seconds through FFMPEG.
- ads.mp3 length 2 seconds (advertisement audio file)
- original.mp3 length xxxx seconds
- so output file could be as following
file appending terms
original.mp3 after 10 seconds append ads.mp3 for 2 seconds then
again original.mp3 for 10 seconds append ads.mp3 for 2 seconds then
again original.mp3 for 10 seconds append ads.mp3 for 2 seconds then
again original.mp3 for 10 seconds ...... so long till end of
original.mp3 file.Thanks
-
Recalculate the position of a larger object to re-align two different sized objects after rotation
26 août 2022, par CRAIGI have 2 images I am placing on top of a 1080X1920 canvas.


One is a rectangle that is 800x400 and it is sitting on the 1080X1920 canvas with top left coordinates of x=140 and y=1200




Then I have another image that is the same size of the canvas 1080X1920, but also has a rectangle on it at the exact same coordinates as the first rectangle. I am overlaying this 1080X1920 image at x=0 and y=0 on the canvas so that the rectangle already in this image lines up perfectly with the rectangle that is already placed on the canvas.




My problem is, I need to apply a rotation to both of these and the black and red rectangles need to match up in positioning AFTER the rotation is applied. Could be any rotation, but let's say it is a 15 degree rotation.


When each element is placed on the canvas and then the 15 degree rotation is applied, the rectangles no longer align because of the difference in image size and the offset in rotation as they both rotate around the center point which looks to be my only option in this case.




So I am hoping to sort out a formula I can use that would rectify the positioning of the 1080X1920 image so that the object already embedded in that image lines up with separately overlaid image.


There are of course other ways to deal with this problem, but right now, they would make things quite a bit more difficult, so I wanted to see if this was possible to calculate first.


I have tried several ways to calculate this, but am not super mathematically proficient, so I am grasping at straws at best.


Oh and because I am not extremely mathematically proficient, any dumbing-down of mathematical terms is appreciated. ;)


Oh and possibly this post answers this question, but I can't wrap my head around whether or not it does, so if someone can let me know if it does, I will try harder to understand and apply it to my particular case.


How to recalculate the coordinates of a point after scaling and rotation ?