Recherche avancée

Médias (91)

Autres articles (45)

  • Use, discuss, criticize

    13 avril 2011, par

    Talk 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.

  • MediaSPIP Player : problèmes potentiels

    22 février 2011, par

    Le lecteur ne fonctionne pas sur Internet Explorer
    Sur Internet Explorer (8 et 7 au moins), le plugin utilise le lecteur Flash flowplayer pour lire vidéos et son. Si le lecteur ne semble pas fonctionner, cela peut venir de la configuration du mod_deflate d’Apache.
    Si dans la configuration de ce module Apache vous avez une ligne qui ressemble à la suivante, essayez de la supprimer ou de la commenter pour voir si le lecteur fonctionne correctement : /** * GeSHi (C) 2004 - 2007 Nigel McNie, (...)

  • MediaSPIP Player : les contrôles

    26 mai 2010, par

    Les contrôles à la souris du lecteur
    En plus des actions au click sur les boutons visibles de l’interface du lecteur, il est également possible d’effectuer d’autres actions grâce à la souris : Click : en cliquant sur la vidéo ou sur le logo du son, celui ci se mettra en lecture ou en pause en fonction de son état actuel ; Molette (roulement) : en plaçant la souris sur l’espace utilisé par le média (hover), la molette de la souris n’exerce plus l’effet habituel de scroll de la page, mais diminue ou (...)

Sur d’autres sites (4599)

  • Exception in Tkinter callback while saving animation with matplotlib

    24 août 2017, par paul

    I’m a little hesitant about asking this, since there seem to be many "Exception in Tkinter callback" questions, but I cannot find one that fits the problem I have here.

    I am trying to save an MP4 animation (of a percolation simulation) using matplotlib with ffmpeg. The code works fine on my home laptop, but not on my work PC. It also works fine if I replace the anim.save line with plt.show(), but I do want to save the animation. I’m using Python 3.5.2 on Ubuntu 17.04 (and I have ffmpeg installed).

    Here is the error :

    >>> Exception in Tkinter callback
    Traceback (most recent call last):
     File "/usr/lib/python3.5/tkinter/__init__.py", line 1558, in __call__
       return self.func(*args)
     File "/usr/lib/python3.5/tkinter/__init__.py", line 604, in callit
       func(*args)
     File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_tkagg.py", line 373, in idle_draw
       self.draw()
     File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_tkagg.py", line 354, in draw
       FigureCanvasAgg.draw(self)
     File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_agg.py", line 474, in draw
       self.figure.draw(self.renderer)
     File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 62, in draw_wrapper
       draw(artist, renderer, *args, **kwargs)
     File "/usr/lib/python3/dist-packages/matplotlib/figure.py", line 1165, in draw
       self.canvas.draw_event(renderer)
     File "/usr/lib/python3/dist-packages/matplotlib/backend_bases.py", line 1809, in draw_event
       self.callbacks.process(s, event)
     File "/usr/lib/python3/dist-packages/matplotlib/cbook.py", line 563, in process
       proxy(*args, **kwargs)
     File "/usr/lib/python3/dist-packages/matplotlib/cbook.py", line 430, in __call__
       return mtd(*args, **kwargs)
     File "/usr/lib/python3/dist-packages/matplotlib/animation.py", line 661, in _start
       self._init_draw()
     File "/usr/lib/python3/dist-packages/matplotlib/animation.py", line 1221, in _init_draw
       self._draw_frame(next(self.new_frame_seq()))
    StopIteration

    The code producing the error is :

    def percolate():

       # initialize an instance of the Percolator class
       perc = Percolator(1, 100, 0.1)

       # initialize the image
       fig, ax = plt.subplots()
       im = plt.imshow(perc.states)

       anim = animation.FuncAnimation(fig, perc.update, perc.update_iter, repeat=False, fargs=(im, ), save_count=perc.n**2)
       anim.save("perc.mp4")

    I can reproduce the code for the Percolator class if necessary, but that part is working fine. It has two functions : update_iter, a generator function that yields True as long as the animation should continue, and update, which takes (the result of the iterator and) im as inputs, and its last two lines are

    im.set_array(self.states)
    return im,

    UPDATE :

    Here’s an MWE.

    import numpy as np
    import matplotlib.pyplot as plt
    from matplotlib import animation


    class Percolator:

       def __init__(self):
           self.i = 0
           self.states = np.zeros((10, 10))
           self.end = False

       def update(self, garbage=None, im=None):
           self.i += 1
           if self.i == 10:
               self.end = True
           im.set_array(self.states)
           return im,

       def update_iter(self):
           while self.end == False:
               yield True

    def percolate():

       perc = Percolator()
       fig, ax = plt.subplots()
       im = plt.imshow(perc.states)

       anim = animation.FuncAnimation(fig, perc.update, perc.update_iter, repeat=False, \
                                      fargs=(im, ), save_count=100)

       anim.save("perc.gif", writer="imagemagick")

    In this example, the Percolator class doesn’t do anything interesting - it sets up a 10x10 grid of 0s, and each call to its update function sets the image to the same 10x10 grid.

    If the frames attribute of FuncAnimation is set to 50 (say), rather than to perc.update_iter, then there is no error and the image is saved correctly. So the problem seems to be with my generator function. I want to use the generator function because I want to keep creating new frames until some condition on perc.states is met - here, boringly, I’ve just asked it to keep going for 10 iterations.

    System details : Python 3.5.3, matplotlib 2.0.0, Ubuntu 17.04.

    UPDATE 2 :

    Same problem after upgrading to matplotlib 2.0.2. Also, printing some output along the way reveals that the error occurs at the end of the iterations. In fact, if update_iter is changed to :

    def update_iter(self):
       print(self.end)
       while self.end == False:
           yield True

    ... then the output is :

    False
    False
    False
    False
    False
    False
    False
    False
    False
    False
    False
    True
    >>> True
    Exception in Tkinter callback
    Traceback (most recent call last):
    etc.
  • How to extract frames from a video at browser using javascript ? [on hold]

    13 septembre 2018, par Hrisheekesh R

    Problem Statement :

    1. User picks a video to upload
    2. 20 screenshots at random timestamps at the video is captured inside the browser
    3. The screenshots are sent to a server.

    Is there a way to capture the frames inside a browser ?

  • What fourcc should I use when encoding mp4 videos with VP9 ?

    15 juin 2020, par Jamie

    My goal is to write an mp4 video using the cv2 Python library, which itself depends on ffmpeg. What code should I use as the fourcc parameter, i.e., :

    



    fourcc = cv2.VideoWriter_fourcc(*'????')