
Recherche avancée
Médias (1)
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
Autres articles (74)
-
Use, discuss, criticize
13 avril 2011, parTalk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
A discussion list is available for all exchanges between users. -
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)
Sur d’autres sites (3683)
-
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


-