
Recherche avancée
Autres articles (111)
-
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Script d’installation automatique de MediaSPIP
25 avril 2011, parAfin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
La documentation de l’utilisation du script d’installation (...) -
Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs
12 avril 2011, parLa manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.
Sur d’autres sites (8359)
-
Tests : Replace jQuery#size() with #jQuery.length
10 février 2015, par jzaeffererTests : Replace jQuery#size() with #jQuery.length
Apparently newer jQuery versions are removing size(), since length has
been around fover, use that instead. -
mpeg4videodec : only allow a positive length
22 avril 2015, par Andreas Cadhalpun -
How to duplicate an audio file or trim it to a specific length in ffmpeg ?
21 octobre 2023, par Руслан ЛысенкоI want to combine a video file (with audio) and an audio file together to get one output file.


Most importantly, I need to do the following.


If the length of the video file is longer, then you need to increase the length of the audio file to this length.


If the audio file is longer than the video file, then make the audio file shorter to match the length of the video.


Example :


Video 2 minutes 5 seconds


Audio 1 minute -> duplicated to 2 minutes 5 seconds.


If


Video 1 minute


Audio 2 minutes 5 seconds -> trimmed to 1 minute.


But, I can't even increase the length of the audio file.


export async function overlayAudio(id: number, music: Music) {
 console.log('start')
 const videoPath = path.join(__dirname, `../../../uploads/movie/${id}/result/movie/predfinal.mp4`);
 
 if (music === null) {
 return videoPath.match(/\\uploads(.*)/)[0];
 } else {
 const audioPath = path.join(__dirname, `../../../${music.audio}`);
 const outputVideoPath = path.join(__dirname, `../../../uploads/movie/${id}/result/movie/output.mp4`);
 const matchPath = outputVideoPath.match(/\\uploads(.*)/);
 const cmd = `ffmpeg -i ${videoPath} -i ${audioPath} -filter_complex "[0:a]volume=1[a];[1:a]volume=0.2[b];[b]apad[looped_audio];[a][looped_audio]amix=inputs=2:duration=longest" -c:v copy -c:a aac -strict experimental -shortest ${outputVideoPath}`;

 try {
 await execPromise(cmd);
 console.log('end!')
 return matchPath[0];
 } catch (error) {
 console.error('Error:', error);
 throw error;
 }
 }
}