
Recherche avancée
Autres articles (99)
-
Amélioration de la version de base
13 septembre 2013Jolie 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 (...) -
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ; -
Configuration spécifique pour PHP5
4 février 2011, parPHP5 est obligatoire, vous pouvez l’installer en suivant ce tutoriel spécifique.
Il est recommandé dans un premier temps de désactiver le safe_mode, cependant, s’il est correctement configuré et que les binaires nécessaires sont accessibles, MediaSPIP devrait fonctionner correctement avec le safe_mode activé.
Modules spécifiques
Il est nécessaire d’installer certains modules PHP spécifiques, via le gestionnaire de paquet de votre distribution ou manuellement : php5-mysql pour la connectivité avec la (...)
Sur d’autres sites (12825)
-
Fluent ffmpeg not running synchronously
14 mai 2022, par sciencaholicI am writing a program where I need to process a video multiple times using ffmpeg. The ffmpeg codes (below) are inside a 'then' statement of a promise.



ffmpeg(path)
 .size('640x?')
 .aspect('1:1')
 .autopad('#682BAB')
 .saveToFile(`${userDirPath}/11-${userFileName}`)
 .on('end', () => {
 ffmpeg()
 .input('test-11-start.mp4')
 .mergeAdd(`${userDirPath}/11-${userFileName}`)
 .mergeAdd('test-11-end.mp4')
 .mergeToFile(`${userDirPath}/11-final-${userFileName}`, 'temp/')
 .on('end', () => console.log('FFmpeg done!'));
 });




There is another ffmpeg function after this (same, but with a different aspect ratio) and then, a 'then' statement with some other functions.



The problem is that this ffmpeg function runs asynchronously, and the next statements (which use the resulting file of ffmpeg func) are executed before it finishes executing and so I want it to run synchronously. I've tried async await (below) but it still runs asynchronously. What is wrong with code ?



async function ffmpegMerge() {
 try {
 await ffmpeg(path)
 .size('640x?')
 .aspect('1:1')
 .autopad('#682BAB')
 .saveToFile(`${userDirPath}/11-${userFileName}`)
 .on('end', () => {
 ffmpeg()
 .input(`test-11-start.mp4`)
 .mergeAdd(`${userDirPath}/11-${userFileName}`)
 .mergeAdd(`test-11-end.mp4`)
 .mergeToFile(`${userDirPath}/11-final-${userFileName}.mp4`, 'temp/')
 .on('end', () => console.log('FFmpeg done!'));
 })
 }
 catch (err) {
 return Promise.reject(new Error(err));
 }
}



-
Overlay a video and an image over a background video and shift that background video's position to the right
4 août 2023, par sybrI'm currently working on a way to improve my production process for the videos that I'm making. I usually edit videos using two folders full of clips. Being able to automate putting these together in Premiere would save me a lot of time.


I'm using the FFMpegCORE C# library, as well as Xabe.FFMpeg to achieve what I'm trying to do, and I've currently reached the point of creating two separate videos using the clips I mentioned earlier.


The final step that I need to solve is to overlay the overlay video (overlay.mp4) over the background video (background.mp4), add an overlay image to add a clean divider (overlay.png) between the edges of the videos, and to somehow shift the position of the background video 33% to the right (background.mp4).


This is the script I've come up with so far :


ffmpeg -i overlay.mp4 -i background.mp4 -i overlay.png -filter_complex \ 
"[1:v]scale=608:1080[a]; [0:v]pad=1920:1080[b]; [b][a]overlay[out]; \
[out][2:v]overlay[out]; [0][1]amix[a];" \
-map [out] -map [a] -c:v libx264 -crf 30 -pix_fmt yuv420p -y output.mp4



Is there a way to shift the background video to the right ? Or should I manually edit the video files ?


Would love some help here, also eager to learn more about FFmpeg, so some explanation would be highly appreciated !


Edit :


Just found the solution, padding the background video for 33% and then cropping the final out back to 1920x1080 seemed to do the trick !


ffmpeg -i overlay.mp4 -i background.mp4 -i overlay.png -filter_complex "[1:v]scale=608:1080[a]; [0:v]pad=2560:0:x=1920:y=1080[b]; [b][a]overlay[out]; [out][2:v]overlay[out]; [out]crop=1920:1080:0:0[out]; [0][1]amix[a];" -map [out] -map [a] -c:v libx264 -crf 30 -pix_fmt yuv420p -y output.mp4



-
merge multiple ffmpeg commands into one line to make the whole process faster
8 septembre 2020, par user1hjgjhgjhggjhgI want to merge multiple commands into one so that whole processing time would be fastest. What I am doing so far is


- 

-
A video file is uploaded from a webform and and server upload into a temp directory.


if (move_uploaded_file($_FILES[$param]['tmp_name'], $filePath)) {


 return $filePath;
 }



-
add black borders around the video(through ffmpeg command) - video uploads again to a directory


$command_new = "ffmpeg -i $filePath -vf 'scale=720:1280:force_original_aspect_ratio=decrease,pad=720:1280:(ow-iw)/2:(oh-ih)/2,setsar=1' $video_file";
 exec($command_new);



-
optimizing the video(ffmpeg command) - video uploads again to a directory


$cmd_new = "ffmpeg -i $video_file -c:v libx264 -crf 28 $optimizeResultFile";



-
merging the uploaded file with the existing video file present in the database into one and uploading that file into directory(through ffmpeg command)


$command_new = "ffmpeg -i $optimizeResultFile -i $second_video_path -filter_complex '[0:v]pad=iw*2:ih[int];[int][1:v]overlay=W/2:0[vid]' -map [vid] -c:v libx264 -crf 23 -preset veryfast $videomerge";



-
//add custom sound in that final merged video


$cmd_new = "ffmpeg -i $videomerge -i $audio -c:v copy -c:a aac -shortest -map 0:v:0 -map 1:a:0 $with_new_audio";















Is it possible to do all at one command and not in multiple commands. This process takes 1 min to upload a final file. want to make it faster


-