Recherche avancée

Médias (91)

Autres articles (30)

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

  • 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 (...)

  • 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, (...)

Sur d’autres sites (2637)

  • How to use FFMPEG -vframe in wordpress creates jpg then clean filename to have only single dot ?

    18 mars 2019, par Mr.AX

    What is the best way to output jpg file from video file using FFMPEG avoiding file name to contain double dots resulting file being treated as non existent ?

    My goal is to create a clean alternative solution to avoid making jpg extension file having double dots in its created filename, from its original video file (such as mp4). Below is the coding I’m currently using for video uploading via ffmpeg, creating an extra thumbnail file from its video file :

    // get the videos uploaded
    foreach ($videos as $video) {
       if ($profile_author_id == $userid || current_user_can('level_10')) {
           $imagebuttons = '<span class="edit-buttons"><span class="icon button-delete icon-cancel rad3"></span></span>';
       }

       echo '<div class="profile-video-thumb-wrapper"><div class="profile-img-thumb profile-video-thumb rad3" style="background: url('.$video->guid.'.jpg) center no-repeat; background-size: cover;">';
       echo    $imagebuttons;

       if(get_post_meta($video->ID, 'processing', true) &amp;&amp; !is_video_processing_running(get_post_meta($video->ID, 'processing', true))) {
           delete_post_meta($video->ID, 'processing');
           unlink(get_post_meta($video->ID, "original_file", true));
           delete_post_meta($video->ID, 'original_file');

       }
       $file_path = get_attached_file($video->ID);
       $file_path_thumb = $file_path.".jpg";
       if(!file_exists($file_path_thumb)) {
           $output = shell_exec("/usr/local/bin/ffmpeg -i $file_path");
           $videoresizeheight = get_option("videoresizeheight") ? get_option("videoresizeheight") : '400';
           $comd = "/usr/local/bin/ffmpeg -y -i \"$file_path\" -f mjpeg -vframes 1 -ss 00:00:03.000 -vf scale=".$videoresizeheight.":-1 \"$file_path_thumb\" 2>&amp;1";
           shell_exec($comd);
       }

       if(get_post_meta($video->ID, 'processing', true)) {
           if ($profile_author_id == $userid || current_user_can('level_10')) {
               echo '<span class="video-processing rad3">'._d('this video is still processing',1269).'</span>';
               echo '<img data-original-url="'.get_template_directory_uri().'/i/video-placeholder.svg" class="mobile-ready-img rad3" alt="'.get_the_title().'" data-responsive-img-url="'.get_template_directory_uri().'/i/video-placeholder-mobile.svg" style='max-width: 300px; max-height: 300px' />';
           }
       } else {
           echo '<div></div>([^a-zA-Z0-9])/", "", $video->post_title).'" class="video-player-lightbox text-center hide" itemprop="video" itemscope itemtype="http://schema.org/VideoObject">';
           echo    '';
           echo    '';
           echo    '<video height="100%" width="100%" controls="controls">';
           echo        '<source src="'.$video->guid.'" type="video/mp4">';
           echo        _d("Your browser does not support the video tag.",1270);
           echo    '</source></video> ';
           echo '</div>';

           echo '<a href="#'.preg_replace("></a>([^a-zA-Z0-9])/", "", $video->post_title).'" rel="profile-video">';
           echo    '<img src="http://stackoverflow.com/feeds/tag/src" style='max-width: 300px; max-height: 300px' />"'.$video->guid.'.jpg" class="hide" />';
           echo    '<img src="http://stackoverflow.com/feeds/tag/&#039;.get_template_directory_uri().&#039;/i/video-placeholder.svg" class="video-image-play" style='max-width: 300px; max-height: 300px' />';
           echo '';
       }

       echo '<div class="clear"></div></div>'."\n";
    }
    if(count($videos) > 0) {
       echo '<div class="clear10"></div>';
    }

    One of the solution is to add and change

    $file_path_v = $file_path
    echo str_replace('.', '_', $file_path_v);
    $file_path_thumb = pathinfo('$file_path_v.\".jpg\";')

    but how would I change the line that suppose to display its thumbnail at :

    echo '';

    I would like some pointers if anyone can have the cleanest solution to work around it ?

  • 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

  • Python ImageIO : Too many open files

    23 avril 2016, 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