Recherche avancée

Médias (1)

Mot : - Tags -/musée

Autres articles (52)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-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

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

  • Automated installation script of MediaSPIP

    25 avril 2011, par

    To overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
    You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
    The documentation of the use of this installation script is available here.
    The code of this (...)

Sur d’autres sites (5860)

  • What do I need in order to save animation videos from matplotlib in mp3 format ?

    27 juin 2022, par DarthMalloc

    I am using python3.8 on Linux Mint 19.3, and I am trying to save an animation created by a cellular automata model in matplotlib. My actual code for the model is private, but it uses the same code for saving the animation as the code shown below, which is a slight modification of one of the examples shown in the official matplotlib documentation :

    


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

fig, ax = plt.subplots()


def f(x, y):
    return np.sin(x) + np.cos(y)

x = np.linspace(0, 2 * np.pi, 120)
y = np.linspace(0, 2 * np.pi, 100).reshape(-1, 1)

fig, ax = plt.subplots()


    
ims = []
for i in range(60):
    x += np.pi / 15.
    y += np.pi / 20.
    im = ax.imshow(f(x, y), animated=True)
    if i == 0:
        ax.imshow(f(x, y))  # show an initial one first
    ims.append([im])

ani = animation.ArtistAnimation(fig, ims, interval=50, blit=True,
                                    repeat_delay=1000)

    # To save the animation, use e.g.
    #
    # ani.save("movie.mp4")
    #
    # or
    #
writer = animation.FFMpegWriter(fps=15, metadata=dict(artist='Me'), bitrate=1800)
ani.save("movie.mp3", writer=writer)


    


    When executed, the code produces this error :

    


        MovieWriter stderr:&#xA;    Output file #0 does not contain any stream&#xA;&#xA;    Traceback (most recent call last):&#xA;      File "/usr/local/lib/python3.8/dist-packages/matplotlib/animation.py", line 234, in saving&#xA;        yield self&#xA;      File "/usr/local/lib/python3.8/dist-packages/matplotlib/animation.py", line 1093, in save&#xA;        writer.grab_frame(**savefig_kwargs)&#xA;      File "/usr/local/lib/python3.8/dist-packages/matplotlib/animation.py", line 351, in grab_frame&#xA;        self.fig.savefig(self._proc.stdin, format=self.frame_format,&#xA;      File "/usr/local/lib/python3.8/dist-packages/matplotlib/figure.py", line 3046, in savefig&#xA;        self.canvas.print_figure(fname, **kwargs)&#xA;      File "/usr/local/lib/python3.8/dist-packages/matplotlib/backend_bases.py", line 2319, in print_figure&#xA;        result = print_method(&#xA;      File "/usr/local/lib/python3.8/dist-packages/matplotlib/backend_bases.py", line 1648, in wrapper&#xA;        return func(*args, **kwargs)&#xA;      File "/usr/local/lib/python3.8/dist-packages/matplotlib/_api/deprecation.py", line 415, in wrapper&#xA;        return func(*inner_args, **inner_kwargs)&#xA;      File "/usr/local/lib/python3.8/dist-packages/matplotlib/backends/backend_agg.py", line 486, in print_raw&#xA;        fh.write(renderer.buffer_rgba())&#xA;    BrokenPipeError: [Errno 32] Broken pipe&#xA;&#xA;    During handling of the above exception, another exception occurred:&#xA;&#xA;    Traceback (most recent call last):&#xA;      File "/home/justin/animation_test.py", line 36, in <module>&#xA;        ani.save("movie.mp3", writer=writer)&#xA;      File "/usr/local/lib/python3.8/dist-packages/matplotlib/animation.py", line 1093, in save&#xA;        writer.grab_frame(**savefig_kwargs)&#xA;      File "/usr/lib/python3.8/contextlib.py", line 131, in __exit__&#xA;        self.gen.throw(type, value, traceback)&#xA;      File "/usr/local/lib/python3.8/dist-packages/matplotlib/animation.py", line 236, in saving&#xA;        self.finish()&#xA;      File "/usr/local/lib/python3.8/dist-packages/matplotlib/animation.py", line 342, in finish&#xA;        self._cleanup()  # Inline _cleanup() once cleanup() is removed.&#xA;      File "/usr/local/lib/python3.8/dist-packages/matplotlib/animation.py", line 373, in _cleanup&#xA;        raise subprocess.CalledProcessError(&#xA;    subprocess.CalledProcessError: Command &#x27;[&#x27;ffmpeg&#x27;, &#x27;-f&#x27;, &#x27;rawvideo&#x27;, &#x27;-vcodec&#x27;, &#x27;rawvideo&#x27;, &#x27;-s&#x27;, &#x27;640x480&#x27;, &#x27;-pix_fmt&#x27;, &#x27;rgba&#x27;, &#x27;-r&#x27;, &#x27;15&#x27;, &#x27;-loglevel&#x27;, &#x27;error&#x27;, &#x27;-i&#x27;, &#x27;pipe:&#x27;, &#x27;-vcodec&#x27;, &#x27;h264&#x27;, &#x27;-pix_fmt&#x27;, &#x27;yuv420p&#x27;, &#x27;-b&#x27;, &#x27;1800k&#x27;, &#x27;-metadata&#x27;, &#x27;artist=Me&#x27;, &#x27;-y&#x27;, &#x27;movie.mp3&#x27;]&#x27; returned non-zero exit status 1.&#xA;</module>

    &#xA;

    I have looked at posts on similar queries concerning matplotlib animations, but none have specifically included the error Output file #0 does not contain any stream. I have little experience with ffmpeg, so I am wondering what might be missing.

    &#xA;

  • Revision 30993 : on force les dernières versions, notamment pour bonux, sinon ça crée des ...

    18 août 2009, par vincent@… — Log

    on force les dernières versions, notamment pour bonux, sinon ça crée des gros bugs

  • Streaming with ffmpeg

    15 juillet 2014, par jakebird451

    I am using ffmpeg to encode a video from a non-mp4 format to an mp4 format. My goal is to provide the video while its encoding to the client (http link). The link is provided with cherrpypy using python. To perform the encoding, I use the subprocess.Popen command and redirect the output to a pipe. Providing the file live to a browser is fine, however finding how to encode the video though ffmpeg to get my desired result is not going so well.

    The only command I found so far that even works is : ffmpeg -i {inputfile} -nostats -frag_duration 3600 -f mp4 -. This command "works", the audio is flawless however the video is encoded to what looks like 4x (or 2x) the speed of the original video. So I have been experimenting with commands to see if I can fix the video defect but so far I have yet to fix the same problem. I have been attempting to inject the -vcodec libx264 command, still the same problem.

    To assist in troubleshooting my problem, I decided to also save the stream to a file. Playing the recorded file yields the same effect. However, interestingly enough, playing the video though VLC and Windows Media Player fixes the video problem and the video plays perfectly fine. Sound and all. It just seems as though the html5 player (with Google Chrome) does not like however I am packing the video. It seems as thought Google Chrome and my encoded file do not play well together.

    Continuing with the streaming issue, breaking the encoding process still shows the video encoding just fine in VLC and in Windows Media Player. Well, it plays the video just fine up to until I pressed ctrl-c of course. So it seems that maybe it is not the encoding that is the problem, but either :

    1. It is a problem with the header for the generated mp4 file
    2. Google Chome is disregarding the frame rate specified in the file and mandating, say, 60 fps or even 120 ? (which would cause the fast forwarding effect)

    The webpage that I am using to show the video is dynamically created and is formed using the template below :

       
           
       
       
           <video controls="controls">
               <source src="{link}"></source>
               Your browser sux. Fix it.
           </video>
       

    The {title} and {link} components are substituted with the corresponding components. If anyone has any suggestions on how to troubleshoot this problem I would be more than willing to listen. As of right now, I am stuck on how to progress with the current state of this issue.