Recherche avancée

Médias (91)

Autres articles (106)

  • 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

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (8685)

  • ValueError : I/O operation on closed file when making animation

    3 juillet 2018, par user3851187

    I am using matplotlib and ffmpeg to do some animations. I usually code on a remote server because the code runs faster ; we are having some issues making animations on the remote server. Here is an example of code that works perfectly on my local mac but does not work remotely.

    import matplotlib as mpl
    mpl.use('agg')
    import matplotlib as mpl
    from matplotlib import animation
    import pylab

    def init():
       pylab.plot(pylab.arange(10), [0]*10)

    def redraw(frame):
       pylab.plot(pylab.arange(10), pylab.arange(10) * frame)

    fig = pylab.figure()
    ani = animation.FuncAnimation(fig, redraw, frames=10, interval=1000, init_func=init)
    ani.save('animation.mp4')

    I get the animation I want on my local machine (macOS Sierra). When I run it on the remote host (Debian GNU/Linux 8 (jessie)), I get the following error message after 5 frames

    Traceback (most recent call last):
     File "animation.py", line 14, in <module>
       ani.save('animation.mp4')
     File "/usr/local/lib/python2.7/dist-packages/matplotlib/animation.py", line 1200, in save
       writer.grab_frame(**savefig_kwargs)
     File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__
       self.gen.throw(type, value, traceback)
     File "/usr/local/lib/python2.7/dist-packages/matplotlib/animation.py", line 241, in saving
       self.finish()
     File "/usr/local/lib/python2.7/dist-packages/matplotlib/animation.py", line 367, in finish
       self.cleanup()
     File "/usr/local/lib/python2.7/dist-packages/matplotlib/animation.py", line 405, in cleanup
       out, err = self._proc.communicate()
     File "/usr/local/lib/python2.7/dist-packages/subprocess32.py", line 724, in communicate
       stdout, stderr = self._communicate(input, endtime, timeout)
     File "/usr/local/lib/python2.7/dist-packages/subprocess32.py", line 1535, in _communicate
       orig_timeout)
     File "/usr/local/lib/python2.7/dist-packages/subprocess32.py", line 1591, in _communicate_with_poll
       register_and_append(self.stdout, select_POLLIN_POLLPRI)
     File "/usr/local/lib/python2.7/dist-packages/subprocess32.py", line 1570, in register_and_append
       poller.register(file_obj.fileno(), eventmask)
    ValueError: I/O operation on closed file
    </module>

    My local machine uses matplotlib version 2.0.0 ; the remote machine uses matplotlib version 2.2.2

    On my local machine I have ffmpeg version 3.2.4

    $ ffmpeg -version
    ffmpeg version 3.2.4 Copyright (c) 2000-2017 the FFmpeg developers
    built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
    configuration: --prefix=/usr/local/Cellar/ffmpeg/3.2.4 --enable-shared -
    -enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables
    --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-vda
    libavutil      55. 34.101 / 55. 34.101
    libavcodec     57. 64.101 / 57. 64.101
    libavformat    57. 56.101 / 57. 56.101
    libavdevice    57.  1.100 / 57.  1.100
    libavfilter     6. 65.100 /  6. 65.100
    libavresample   3.  1.  0 /  3.  1.  0
    libswscale      4.  2.100 /  4.  2.100
    libswresample   2.  3.100 /  2.  3.100
    libpostproc    54.  1.100 / 54.  1.100

    On the remote host i have ffmpeg version 4.0.1

    ffmpeg -version
    ffmpeg version 4.0.1 Copyright (c) 2000-2018 the FFmpeg developers
    built with gcc 4.9.2 (Debian 4.9.2-10+deb8u1)
    configuration: --prefix=/usr/local
    libavutil      56. 14.100 / 56. 14.100
    libavcodec     58. 18.100 / 58. 18.100
    libavformat    58. 12.100 / 58. 12.100
    libavdevice    58.  3.100 / 58.  3.100
    libavfilter     7. 16.100 /  7. 16.100
    libswscale      5.  1.100 /  5.  1.100
    libswresample   3.  1.100 /  3.  1.100

    If I recall correctly I installed ffmpeg locally through homebrew ; I have the anaconda distribution of python. On the remote machine we have the default version of python that comes with Jessie ; I’m not sure how the sysadmin installed ffmpeg.

    I am by no means an expert on ffmpeg, but I have generally never had issues with making animations in matplotlib on my local machine and I would really like to be able to make videos more quickly on the remote machine. Any help would be appreciated !

    Edit
    On the remote machine, the animation works if I use avconv as the writer instead of ffmpeg. I installed avconv locally...which led me to get the same ffmpeg issues locally (probably due to updating shared dependencies). However, I uninstalled ffmpeg and reinstalled it with x264 codec enables Animations in ipython (jupyter) notebook - ValueError : I/O operation on closed file

  • Difference between ffmpeg and avconv for rawvideo image2pipe

    15 août 2016, par NHDaly

    I’m not sure why, but avconv does not seem to be piping raw video like I would expect.

    I’m trying pipe a video from ffmpeg into python (eventually I want to read from x11grab, not a video file). It works just fine on my Macbook using ffmpeg, but when I use avconv on Debian Jessie, the stream cuts off early !

    Here’s my basic python, which is following this guide :

    input_resolution_shape = (1280,800,3)
    input_bytes = reduce(mul, input_resolution_shape, 1)
    print input_bytes

    # Prints 3072000

    import subprocess as sp
    command = [ FFMPEG_BIN,   # This is either "avconv" or "ffmpeg".
               '-i', 'test_video.mp4',
               '-f', 'image2pipe',
               '-pix_fmt', 'rgb24',
               '-vcodec', 'rawvideo', '-']
    pipe = sp.Popen(command, stdout = sp.PIPE, bufsize=10**8)

    import numpy
    for _ in range(100):  # read 100 frames
       # read 1280*800*3 bytes (= 1 frame)
       raw_image = pipe.stdout.read(input_bytes)
       # transform the byte read into a numpy array
       image = numpy.fromstring(raw_image, dtype='uint8')
       if image.size != 0:
           print image.size

           # Prints 1015808

    On the mac, the image.size printed is the same as the input_bytes, 3072000. But on debian, it’s 1015808. Any ideas why that could be happening ?

    Interestingly, 3072000/1015808 is just about 3 :

    In [1]:    3072000./1015808.
    Out[1]:    3.024193548387097
  • How to wrap an h.264 file as mp4 on iOS

    27 octobre 2016, par buildsucceeded

    I have a bare h.264 file (from a raspberry pi camera), and I’d like to wrap it as an mp4. I don’t need to play it, edit it, add or remove anything, or access the pixels.

    Lots of people have asked about compiling ffmpeg for iOS, or streaming live data. But given the lack of easy translation between the ffmpeg command line and its iOS build, it’s very difficult for me to figure out how to implement this simple command :

    ffmpeg -i input.h264 -vcodec copy out.mp4

    I don’t specifically care whether this happens via ffmpeg, avconv, or AVFoundation (or something else). It just seems like it should be not-this-hard to do on a device.