
Recherche avancée
Médias (1)
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (48)
-
Personnaliser les catégories
21 juin 2013, parFormulaire de création d’une catégorie
Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
On peut modifier ce formulaire dans la partie :
Administration > Configuration des masques de formulaire.
Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...) -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...)
Sur d’autres sites (11253)
-
Python, grab frame number from FFMPEG
22 janvier 2021, par PyrometheousI'm using a script to compile an image sequence into a video.


def ffmpeg_image_sequence(image_sequence, video, fps, encoder):
 global task
 task = False
 path = os.path.dirname(os.path.realpath(image_sequence))
 image_format = {
 'png': '\%06d.png',
 'iff': '\%06d.tiff',
 'tif': '\%06d.tif',
 'jpg': '\%06d.jpg'
 }
 sequence = path + image_format[image_sequence[-3:]]
 output_options = {
 'crf': 20,
 'preset': 'slow',
 'movflags': 'faststart',
 'pix_fmt': 'yuv420p',
 'c:v': encoder,
 'b:v': '20M'
 }
 try:
 (
 ffmpeg
 .input(sequence, framerate=fps)
 .output(video, **output_options)
 ).run()
 except ffmpeg.Error as e:
 warning(str(e))
 task = True



I'm using wxPython for the GUI and ffmpeg for compiling the frames :


import wx
import ffmpeg



I'm running the above function in its own class so that it can be run in a different thread, allowing the statusbar to be updated with how much time has passed.


def wait(start, text):
 time.sleep(.05)
 time_running = round(time.time() - start)
 update_status_bar(main_window, text + ' (Time Elapsed: ' + seconds_to_str(time_running) + ')')



I'd like to replace this with ETA and percentage completed. The window that pops up when running the ffmpeg_image_sequence function displays the following information :


frame=1234 fps= 16 q=13.0 size= 56789kB time=00:38:48.36 bitrate=12345.6kbits/sec speed=0.681x



From what's printed to that window, I'd like to get the current frame= value to determine what percentage of the process is completed, then display something more like :


def wait(text, frame, number_of_frames):
 time.sleep(.05)
 current_frame = frame
 number_of_frames = number_of_files_in_dir - 1
 percentage = round(current_frame / number_of_frames, 1)
 update_status_bar(main_window, text + ' ' + percentage + '% ' + Completed)



With some math to calculate an ETA for completion as well.


So, is there a way to grab that output text from the ffmpeg and turn just that frame= number into a variable ?


-
FFmpeg error Unable to load FFMpeg during parallel encoding
1er janvier 2021, par DrJohnI'd like to build web service on the Laravel platform which allows users upload some videos on a server. During uploading video files I use ffmpeg to encode them and compress.
I can't install ffmpeg on my hosting and so I have downloaded packages and executable files from https://ffmpeg.org/download.html and locate them on my web directory. Then I make all steps to install ffmpeg in my Laravel project.
I try to upload a video file and it's OK. The time to upload and encode is about 20 seconds. During encoding of the first video file I try to upload the second. And the second video file falls with the error "Unable to load FFMpeg". But the first video file is encoded successfully. When the first encoding is completed and I repeat uploading the second file it encoded successfully as well.
So I think that ffmpeg can work only with only one file at the time and I can't build multi-user service.
Please help me to find solution.


Here is a peace of code which use to encode files :


try {
 $pub_path = Storage::disk('public')->getAdapter()->getPathPrefix();
 $videopath =$pub_path . $myusertheme->public_reference.'/'.$this->random_filename(25,'','mp4');
 //echo (Storage::disk('public')->getAdapter()->getPathPrefix().'<br />');
 echo ($videopath);
 $ffmpeg = \FFMpeg\FFMpeg::create([
 'ffmpeg.binaries' => "./usr/bin/ffmpeg",
 'ffprobe.binaries' => "./usr/bin/ffprobe",
 'timeout' => 3600, // The timeout for the underlying process
 'ffmpeg.threads' => 12, // The number of threads that FFMpeg should use
 'set_command_and_error_output_on_exception' => true,
 ]);
 $vid=$ffmpeg->open($request->file('videofile')->getRealPath());
 $vid->save(new \FFMpeg\Format\Video\X264('libmp3lame', 'libx264'), $videopath);

/*
 $videopath = $myusertheme->public_reference.'/'.$this->random_filename(25,'','mp4');
 //FFMpeg::fromDisk('local_root')
 $ffmpeg
 ->open($request->file('videofile')->getRealPath())
 ->export()
 ->onProgress(function ($percentage) {
 //echo ($percentage.'/n');
 if ($percentage===100)
 {

 $videopath = $this->random_filename(25,'','mp4');
 }})
 ->inFormat(new \FFMpeg\Format\Video\X264('libmp3lame', 'libx264'))
 ->toDisk('public')
 ->save($videopath);

*/

 } catch (EncodingException $exception) {
 $videopath = null;
 $command = $exception->getCommand();
 $errorLog = $exception->getErrorOutput();
 echo $errorLog;
 return \Response::json('Ошибка кодировки файла', 500);

 }



-
How to remove a flickering background image from a video using ffmpeg ?
25 janvier 2021, par AriI recorded lectures using OBS and uploaded them to Youtube. Later I found that the recorded videos flicker and show the underlying desktop image. The flickering really disturbs but it would be a huge effort to record everything from scratch.


I can extract the unwanted image from the video. Is there a way to identify this image (or parts of it) in the recorded videos and remove them ? Or somehow reduce the flickering ?
Here is an example of a flickering video.


I'm not very good with ffmpeg. I've tried to reduce the flicker with this


ffmpeg -i in.mp4 -vf "tblend=average,framestep=2,setpts=1*PTS" -r 10 out.mp4



It reduces the disco effect but leaves heavy shadows of the background image.


I also tried to identify the corrupted frames with something like this


ffmpeg -i in.mp4 -r 1 -loop 1 -i background.png -filter_complex "blend=difference:shortest=1,blackframe=30:20" -f null -



but I'm not sure if it is the right approach and how to continue from this.


I believe that my command reports the frames that match the image. I thought that it would be possible to replace those frames with white and then use blending to fill in the missing bits. Ideally I'd like to do all that with a single command. Any help is much appreciated !