Recherche avancée

Médias (1)

Mot : - Tags -/école

Autres articles (61)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, 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 (...)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

Sur d’autres sites (7564)

  • Python ImageIO : Too many open files

    24 août 2017, par orbv12

    I am using imageio in python in order to open all video files in a directory and convert them to numpy arrays.

    Here is the script I am using :

     1 from __future__ import print_function
     2 from avi_to_numpy import *
     3 from os import listdir
     4 import numpy as np
     5 import imageio
     6      
     7 class_path = '../Diving/'
     8 max_frames = 16
     9 stride = 8
    10 videos = [vid for vid in listdir(class_path)]
    11 train = []
    12
    13 for vid in videos:
    14     print(str.format('Loading {}...', vid), end="")
    15     filename = class_path + vid
    16     reader = imageio.get_reader(filename, 'ffmpeg')
    17     frames = []
    18    
    19     for i, im in enumerate(reader):
    20         if len(frames) == max_frames:
    21             break
    22        
    23         if i % stride == 0:
    24             frames.append(im)
    25    
    26     reader.close()
    27     train.append(np.array(frames))
    28     print('done')        
    29
    30
    31 print(len(train))

    Eventually this script crashes with the following error output :

    Traceback (most recent call last):
     File "load_class_test.py", line 16, in <module>
       reader = imageio.get_reader(filename, 'ffmpeg')
     File "/usr/local/lib/python2.7/site-packages/imageio/core/functions.py", line 111, in get_reader
       return format.get_reader(request)
     File "/usr/local/lib/python2.7/site-packages/imageio/core/format.py", line 158, in get_reader
       return self.Reader(self, request)
     File "/usr/local/lib/python2.7/site-packages/imageio/core/format.py", line 207, in __init__
       self._open(**self.request.kwargs.copy())
     File "/usr/local/lib/python2.7/site-packages/imageio/plugins/ffmpeg.py", line 260, in _open
       self._initialize()
     File "/usr/local/lib/python2.7/site-packages/imageio/plugins/ffmpeg.py", line 326, in _initialize
       stdout=sp.PIPE, stderr=sp.PIPE)
     File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
       errread, errwrite)
     File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1223, in _execute_child
       errpipe_read, errpipe_write = self.pipe_cloexec()
     File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1175, in pipe_cloexec
       r, w = os.pipe()
    OSError: [Errno 24] Too many open files
    </module>

    I am closing the Reader object from imageio. It seems as if the files opened by ffmpeg are not being closed properly.

    Is there an obvious step I am missing here ? Am I closing the files properly ?

    EDIT : Found temporary solution. Opened a new issue on github.

    I was able to resolve the issue by uncommenting the following lines of code from ’imageio/plugins/ffmpeg.py’ :

    381         def _close_streams(self):
    382             for std in (self._proc.stdin,
    383                         self._proc.stdout,
    384                         self._proc.stderr):
    385                 try:
    386                     std.close()
    387                 except Exception:  # pragma: no cover
    388                     pass

    I then added a call to the above function in _close(self) :

    271         def _close(self):
    272             self._terminate(0.05)  # Short timeout
    273             self._close_streams()
    274             self._proc = None

    I am not sure what the side effects of doing this are, but it provides a solution for me.

    Here is the link to the issue : https://github.com/imageio/imageio/issues/145

  • OpenCV-C++ VideoCapture fails to open video files

    9 août 2017, par Akihiko

    Recently I upgraded my OS from Ubuntu Precise Saucy (13.10) to Trusty (14.04). After this upgrade, cv::VideoCapture became not working properly. The program aborts when reading a video file. For example,

    int main(int argc, char**argv)
    {
     cv::VideoCapture vin("sample/vout2l.avi");
    ...

    Executing this program, it aborts with a message :

    *** Error in `./cv2-videoread.out': malloc(): memory corruption: 0x0000000000e3eff0 ***
    Abort (core dumped)

    The backtrace looks like :

    [New LWP 15586]
    [New LWP 15587]
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    Core was generated by `./cv2-videoread.out'.
    Program terminated with signal SIGABRT, Aborted.
    #0  0x00007ff953e61c37 in raise () from /lib/x86_64-linux-gnu/libc.so.6
    (gdb) bt
    #0  0x00007ff953e61c37 in raise () from /lib/x86_64-linux-gnu/libc.so.6
    #1  0x00007ff953e65028 in abort () from /lib/x86_64-linux-gnu/libc.so.6
    #2  0x00007ff953e9e2a4 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
    #3  0x00007ff953eabe26 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
    #4  0x00007ff953eac1ab in ?? () from /lib/x86_64-linux-gnu/libc.so.6
    #5  0x00007ff953eadba4 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
    #6  0x00007ff953eaf7d2 in posix_memalign () from /lib/x86_64-linux-gnu/libc.so.6
    #7  0x00007ff94fa640fe in av_malloc () from /usr/lib/x86_64-linux-gnu/libavutil.so.52
    #8  0x00007ff94fa641b1 in av_strdup () from /usr/lib/x86_64-linux-gnu/libavutil.so.52
    #9  0x00007ff94fa5e5db in av_dict_set ()
     from /usr/lib/x86_64-linux-gnu/libavutil.so.52
    #10 0x00007ff954738574 in CvCapture_FFMPEG::open(char const*) ()
     from /usr/lib/libopencv_highgui.so.2.4
    #11 0x00007ff954738719 in cvCreateFileCapture_FFMPEG ()
     from /usr/lib/libopencv_highgui.so.2.4
    #12 0x00007ff95473aac9 in cvCreateFileCapture_FFMPEG_proxy(char const*) ()
     from /usr/lib/libopencv_highgui.so.2.4
    ---Type <return> to continue, or q <return> to quit---
    #13 0x00007ff954722d89 in cvCreateFileCapture ()
     from /usr/lib/libopencv_highgui.so.2.4
    #14 0x00007ff954723045 in cv::VideoCapture::open(std::string const&amp;) ()
     from /usr/lib/libopencv_highgui.so.2.4
    #15 0x00007ff95472315c in cv::VideoCapture::VideoCapture(std::string const&amp;) ()
     from /usr/lib/libopencv_highgui.so.2.4
    #16 0x0000000000401281 in main (argc=1, argv=0x7fff1f938388) at cv2-videoread.cpp:30
    (gdb)
    </return></return>

    NOTE : cv::VideoCapture vin(... is 30th line.

    Before upgrading the OS, this code was working with the same input file.

    From the backtrace, it seems that the trouble happens at CvCapture_FFMPEG and libavutil. I upgraded the packages ffmpeg libavutil-dev libavutil51 libavutil52 but they were already up-to-date.
    Also, OpenCV packages are up-to-date (I checked libopencv-core-dev libopencv-core2.4 libopencv-dev libopencv-highgui-dev libopencv-highgui2.4).

    I also tested OpenCV built from source, but got the same results.

    Do you have ideas to figure this out ?

  • rmdec : add missing brackets to compound statement

    25 juillet 2017, par Sean McGovern
    rmdec : add missing brackets to compound statement
    

    Accidentally left out of 95ce02b35d3d1bb16111031df1d82a6e4d894d36.

    • [DBH] libavformat/rmdec.c