
Recherche avancée
Autres articles (22)
-
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 -
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
-
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 (7341)
-
Processing video frame by frame in AWS Lambda with Node.js and FFmpeg [closed]
29 décembre 2023, par AviatoI am working on a project where I need to process video frames one at a time in an AWS Lambda function using Node.js. My goal is to avoid storing all frames in memory or the filesystem due to resource constraints. I plan to use the fluent-ffmpeg library or ffmpeg from child processes for video processing.


In the past, I used OpenCV to process videos and frames without writing the frames on the disk or storing all the frames at once on the memory itself. But now as I am using node js, its a little hard to set up the code using ffmpeg, etc.


Here is a small snippet from what I did with opencv :-


import cv2

cap = cv2.VideoCapture(video_file)

out = cv2.VideoWriter('output.mp4', fourcc, fps, (width, height))

def generate_frame():
 while cap.isOpened():
 code, frame = cap.read()
 if code:
 yield frame
 else:
 print("completed")
 break

for i, frame in enumerate(generate_frame()):
 # Now we can process the video frames directly and write them on the output opencv
 out.write(editing_frames)



Additionally, I intend to leverage image processing libraries like Sharp and the Canvas API to edit individual frames before assembling the final video. I am looking for help in handling video frames efficiently within the constraints of AWS Lambda.


Any insights, code snippets, or recommendations would be greatly appreciated. Thank you !


-
Is there a faster way to generate video from pixel arrays using python and ffmpeg ?
8 mai 2019, par devneal17I’ve found a few sources which use python and ffmpeg to generate video from pixel arrays by passing the
-f rawvideo
flag 1 2. However, this is very slow for high-definition video since each individual pixel must be piped into ffmpeg.In fact this is provably wasteful, as I’ve found that 2.5Gb of pixel arrays generates about 80Kb of video. I’ve also chanced upon some examples where javascript can render high quality animations in near-real time 1, which makes me even more suspicious that I’m doing something wrong.
Is there a way to do this more efficiently, perhaps by piping the differences between pixel arrays into ffmpeg rather than the pixels themselves ?
(edit) This is the line I’m using. Most executions take the
else
path that follows. -
FFmpeg : Concatenated clips extracted using -ss and -t, hang or go out of sync while playing
20 juillet 2013, par YogiI have a set of movies in different formats, and I am trying to extract small clips from these source movies, and concatenate them into one movie.
My workflow has been the following :
-
Convert all the source movies to the same format (width, height, fps, codec)T the scale and pad options are so that all movies oare of the same size, even if their aspect ratio is different.
fmpeg -i $infile -vcodec libx264 -strict -2 -vf scale=iw*sar*min(${MAX_WIDTH}/(iw*sar)\,${MAX_HEIGHT}/ih):ih*min(${MAX_WIDTH}/(iw*sar)\,${MAX_HEIGHT}/ih),pad=${MAX_WIDTH}:${MAX_HEIGHT}:(ow-iw)/2:(oh-ih)/2 -b:v 500k -b:a 64k -movflags +faststart -g 10 -r 25 ${outbasename}.mp4
-
extract clips :
ffmpeg -ss $starttime -t $duration -i $in_file -vcodec copy -acodec copy $out_file
-
Then finally combine clips by first making a concat_list.txt file which contains the list of clips to be concatenated, and their duration, and then using ffmpegs's concat demux :
ffmpeg -f concat -i concat_list.txt -c copy -movflags +faststart $oname
The problem I am facing is that many of the final videos hang or go out of sync, somewhere in the middle of playing. I have tried using mjpeg as the codec, but I still get the same behavior. I can play the individual extracted clips, and then all seem to play fine in most players. Does anybody know what I am doing wrong ? I am using ffmpeg version 1.2.1.
-