Recherche avancée

Médias (91)

Autres articles (49)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (5026)

  • ffmpeg command gives error when used in python

    3 juillet 2018, par Yaser Sakkaf

    When I run this command from the shell it works perfectly.

    ffmpeg -nostdin -i /data/binil/v2t_final/output/cnbctv18/2018_07_02_14_38_30/tmp/merged.avi -ss 00:00:00 -vcodec h264 -vf fps=25 -to 00:6:43 /data/binil/v2t_final/output/cnbctv18/2018_07_02_14_38_30/1/1.avi

    But the same thing when I do in python it gives error :

    import sys
    import os

    INPUT_DIR = sys.argv[1]
    INPUT_VIDEO = sys.argv[2]
    OUTPUT_PATH = sys.argv[3]
    SOURCE = sys.argv[4]
    DATE = sys.argv[5]

    INPUT = INPUT_DIR+"sorted_result.txt"
    COUNT=1
    initial="00:00:00"

    with open(INPUT,"r") as f:
     for line in f.readlines():
       OUT_DIR = OUTPUT_PATH+str(COUNT)
       directory = os.path.abspath(OUT_DIR)
       print('OUT DIR',OUT_DIR)
       print('directory',directory)
       try:
         os.mkdir(directory)
       except:
         pass
       cmd_1 = "ffmpeg -nostdin -i "+INPUT_VIDEO+" -ss " +initial+ " -vcodec h264 -vf fps=25 -to " +line+ " " +OUT_DIR+"/"+str(COUNT)+".avi"
    os.system(cmd_1)
       COUNT += 1
       initial=line

    I cant understand the problem :

    The error is as follows :

    ffmpeg version 4.0-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2018 the FFmpeg developers
     built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
     configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-libxml2 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg
     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
     libpostproc    55.  1.100 / 55.  1.100
    Trailing options were found on the commandline.
    Input #0, avi, from '/data/binil/v2t_final/output/cnbctv18/2018_07_02_14_38_30/tmp/merged.avi':
     Metadata:
       encoder         : Lavf58.12.100
     Duration: 01:00:50.23, start: 0.000000, bitrate: 1334 kb/s
       Stream #0:0: Video: h264 (High) (H264 / 0x34363248), yuv420p(progressive), 512x288 [SAR 1:1 DAR 16:9], 1001 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc
       Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, fltp, 639 kb/s
    At least one output file must be specified
    sh: line 1: /data/binil/v2t_final/output/cnbctv18/2018_07_02_14_38_30/1/1.avi: Permission denied

    Please help.
    This is some dummy text I am writing because it looks like stack overflow does not accept less description and more code. Please don’t mind these sentences. I cant believe that I am still writing this and it is still requesting me to add some more description. I am still doing it. Don’t know till what extent do I have to write. I hope this much is enough.

  • ffmpeg error or success

    3 juillet 2018, par user1867151

    I have a file sample.aif on which I want to apply the below filters :

    1. Trim sample to a maximum duration of 2 seconds

    2. Compression applied with settings : threshold 0.1,ratio=2,attack=5

    3. 20 milliseconds fade out at end .

    I am running the below ffmpeg command : ffmpeg -i kick.aif -af atrim=0:120 -af acompressor=threshold=0.1:ratio=2:attack=5 -af afade=d=0.02 kick.ogg 2>error.out

    When I check the return code I see it is 0 however my error. Out file has the below output :

    cat error.out
    ffmpeg version 2.8.14-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg developers
     built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.9) 20160609
     configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
     libavutil      54. 31.100 / 54. 31.100
     libavcodec     56. 60.100 / 56. 60.100
     libavformat    56. 40.101 / 56. 40.101
     libavdevice    56.  4.100 / 56.  4.100
     libavfilter     5. 40.101 /  5. 40.101
     libavresample   2.  1.  0 /  2.  1.  0
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  2.101 /  1.  2.101
     libpostproc    53.  3.100 / 53.  3.100
    Guessed Channel Layout for  Input Stream #0.0 : stereo
    Input #0, aiff, from 'kick.aif':
     Duration: 00:00:01.54, start: 0.000000, bitrate: 3072 kb/s
       Stream #0:0: Audio: pcm_f32be (fl32 / 0x32336C66), 48000 Hz, 2 channels, flt, 3072 kb/s
    Output #0, ogg, to 'kick.ogg':
     Metadata:
       encoder         : Lavf56.40.101
       Stream #0:0: Audio: vorbis (libvorbis), 48000 Hz, stereo, fltp
       Metadata:
         encoder         : Lavc56.60.100 libvorbis
    Stream mapping:
     Stream #0:0 -> #0:0 (pcm_f32be (native) -> vorbis (libvorbis))
    Press [q] to stop, [?] for help
    size=       6kB time=00:00:01.52 bitrate=  33.9kbits/s
    video:0kB audio:2kB subtitle:0kB other streams:0kB global headers:4kB muxing overhead: 175.053040%

    I am absolutely new to ffmpeg. Can someone tell me where I am going wrong ?

    Many thanks in advance.

  • 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