Recherche avancée

Médias (91)

Autres articles (83)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La 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 (...)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

Sur d’autres sites (5629)

  • MoviePy error : failed to read the first frame of video file ****. That might mean that the file is corrupted

    14 juillet 2022, par Udit Hari Vashisht

    I am trying to reverse a video using MoviePy. My code is as under : -

    


    from moviepy.editor import VideoFileClip
from moviepy.video.fx.all import time_mirror

clip = VideoFileClip("udit.mp4")

clip = clip.fx(time_mirror)

clip.write_videofile("reversed.mp4")


    


    But, when I run it I get the following error :-

    


    Traceback (most recent call last):&#xA;  File "/Users/uditvashisht/projects/experiments/script.py", line 6, in <module>&#xA;    clip = clip.fx(time_mirror)&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/Clip.py", line 212, in fx&#xA;    return func(self, *args, **kwargs)&#xA;  File "", line 2, in time_mirror&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/decorators.py", line 54, in requires_duration&#xA;    return f(clip, *a, **k)&#xA;  File "", line 2, in time_mirror&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/decorators.py", line 29, in apply_to_mask&#xA;    newclip = f(clip, *a, **k)&#xA;  File "", line 2, in time_mirror&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/decorators.py", line 41, in apply_to_audio&#xA;    newclip = f(clip, *a, **k)&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/video/fx/time_mirror.py", line 13, in time_mirror&#xA;    return self.fl_time(lambda t: self.duration - t, keep_duration=True)&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/Clip.py", line 187, in fl_time&#xA;    return self.fl(lambda gf, t: gf(t_func(t)), apply_to,&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/Clip.py", line 136, in fl&#xA;    newclip = self.set_make_frame(lambda t: fun(self.get_frame, t))&#xA;  File "", line 2, in set_make_frame&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/decorators.py", line 14, in outplace&#xA;    f(newclip, *a, **k)&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/video/VideoClip.py", line 644, in set_make_frame&#xA;    self.size = self.get_frame(0).shape[:2][::-1]&#xA;  File "", line 2, in get_frame&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/decorators.py", line 89, in wrapper&#xA;    return f(*new_a, **new_kw)&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/Clip.py", line 93, in get_frame&#xA;    return self.make_frame(t)&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/Clip.py", line 136, in <lambda>&#xA;    newclip = self.set_make_frame(lambda t: fun(self.get_frame, t))&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/Clip.py", line 187, in <lambda>&#xA;    return self.fl(lambda gf, t: gf(t_func(t)), apply_to,&#xA;  File "", line 2, in get_frame&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/decorators.py", line 89, in wrapper&#xA;    return f(*new_a, **new_kw)&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/Clip.py", line 93, in get_frame&#xA;    return self.make_frame(t)&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/video/io/VideoFileClip.py", line 113, in <lambda>&#xA;    self.make_frame = lambda t: self.reader.get_frame(t)&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/video/io/ffmpeg_reader.py", line 184, in get_frame&#xA;    result = self.read_frame()&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/moviepy/video/io/ffmpeg_reader.py", line 133, in read_frame&#xA;    raise IOError(("MoviePy error: failed to read the first frame of "&#xA;OSError: MoviePy error: failed to read the first frame of video file udit.mp4. That might mean that the file is corrupted. That may also mean that you are using a deprecated version of FFMPEG. On Ubuntu/Debian for instance the version in the repos is deprecated. Please update to a recent version from the website&#xA;</lambda></lambda></lambda></module>

    &#xA;

    I have tried the code on both Mac and Windows PC. The other functionality of MoviePy works fine, but I am not able to reverse the video. Both of my systems have ImageMagick and FFMPEG installed.

    &#xA;

  • MoviePy, using a gif as an ImageClip ?

    13 avril 2018, par Slake

    Using a gif inside an ImageClip doesn’t work, is it a normal behavior ?

    The code

    #!/usr/bin/env python
    from moviepy.editor import *

    video = VideoFileClip('./video.mp4')
    watermark = (ImageClip("./my.gif")
                           .set_duration(10))

    watermaked = CompositeVideoClip([video, watermark], size=video.size)
    watermaked.write_videofile('./gif_output.mp4', fps=30, threads=1)

    .

    The error

    ValueError: could not broadcast input array from shape (150,150) into shape (150,150,3)

    .

    The stack error

    Traceback (most recent call last):
     File "./gif_test.py", line 9, in <module>
       watermaked.write_videofile('./gif_output.mp4', fps=30, threads=1)
     File "", line 2, in write_videofile
     File "/Library/Python/2.7/site-packages/moviepy/decorators.py", line 54, in requires_duration
       return f(clip, *a, **k)
     File "", line 2, in write_videofile
     File "/Library/Python/2.7/site-packages/moviepy/decorators.py", line 137, in use_clip_fps_by_default
       return f(clip, *new_a, **new_kw)
     File "", line 2, in write_videofile
     File "/Library/Python/2.7/site-packages/moviepy/decorators.py", line 22, in convert_masks_to_RGB
       return f(clip, *a, **k)
     File "/Library/Python/2.7/site-packages/moviepy/video/VideoClip.py", line 349, in write_videofile
       progress_bar=progress_bar)
     File "/Library/Python/2.7/site-packages/moviepy/video/io/ffmpeg_writer.py", line 209, in ffmpeg_write_video
       fps=fps, dtype="uint8"):
     File "/Library/Python/2.7/site-packages/tqdm/_tqdm.py", line 833, in __iter__
       for obj in iterable:
     File "/Library/Python/2.7/site-packages/moviepy/Clip.py", line 475, in generator
       frame = self.get_frame(t)
     File "", line 2, in get_frame
     File "/Library/Python/2.7/site-packages/moviepy/decorators.py", line 89, in wrapper
       return f(*new_a, **new_kw)
     File "/Library/Python/2.7/site-packages/moviepy/Clip.py", line 95, in get_frame
       return self.make_frame(t)
     File "/Library/Python/2.7/site-packages/moviepy/video/compositing/CompositeVideoClip.py", line 110, in make_frame
       f = c.blit_on(f, t)
     File "/Library/Python/2.7/site-packages/moviepy/video/VideoClip.py", line 611, in blit_on
       return blit(img, picture, pos, mask=mask, ismask=self.ismask)
     File "/Library/Python/2.7/site-packages/moviepy/video/tools/drawing.py", line 45, in blit
       new_im2[yp1:yp2, xp1:xp2] = blitted
    ValueError: could not broadcast input array from shape (150,150) into shape (150,150,3)
    </module>
  • Anomalie #2115 (Nouveau) : Pas de moderation si syndication désactivée

    3 juin 2011, par guytarr °

    Si la syndication automatique est désactivée dans la configuration des contenus du site, que l’on ajoute un site, on fait apparaitre les options de modérations des liens issus de la syndication. On ne devrait pas, car si on a le malheur de cliquer sur valider pour ces options de modération, la (...)