Recherche avancée

Médias (1)

Mot : - Tags -/lev manovitch

Autres articles (106)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Librairies et logiciels spécifiques aux médias

    10 décembre 2010, par

    Pour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
    Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...)

Sur d’autres sites (5593)

  • Cannot open ".mp4" video files using OpenCV 2.4.3, Python 2.7 in Windows 7 machine

    28 décembre 2015, par tjmonsi

    I am currently working on a project that involves reading mp4 video files.
    The problem I encountered is that it using Python 2.7 (32 bit), OpenCV 2.4.3 (cv2.pyd) in a Windows 7 machine.

    The code snippet is as follows :

    try:
           video = cv2.VideoCapture("video.mp4")
    except:
           print "Could not open video file"
           raise
    print video.grab()

    "video.grab()" always returns false : meaning it doesn’t read the file "video.mp4"
    But when we try this :

    try:
           video = cv2.VideoCapture("video.avi")
    except:
           print "Could not open video file"
           raise
    print video.grab()

    "video.grab()" returns true : meaning it is able to read ".avi" files.

    Another is we have tried this same snippet on Linux and Mac and it seems to work fine, meaning it is able to read both mp4 files and avi files.

    This problem is similar to this problem and this problem. Both still don’t have a clear and workable answer.

    I would appreciate any help or workaround aside from just using Linux or Mac for programming this as I need this to work on all three systems.

  • Cannot open ".mp4" video files using OpenCV 2.4.3, Python 2.7 in Windows 7 machine

    24 octobre 2017, par TJ Monserrat

    I am currently working on a project that involves reading mp4 video files.
    The problem I encountered is that it using Python 2.7 (32 bit), OpenCV 2.4.3 (cv2.pyd) in a Windows 7 machine.

    The code snippet is as follows :

    try:
           video = cv2.VideoCapture("video.mp4")
    except:
           print "Could not open video file"
           raise
    print video.grab()

    "video.grab()" always returns false : meaning it doesn’t read the file "video.mp4"
    But when we try this :

    try:
           video = cv2.VideoCapture("video.avi")
    except:
           print "Could not open video file"
           raise
    print video.grab()

    "video.grab()" returns true : meaning it is able to read ".avi" files.

    Another is we have tried this same snippet on Linux and Mac and it seems to work fine, meaning it is able to read both mp4 files and avi files.

    This problem is similar to this problem and this problem. Both still don’t have a clear and workable answer.

    I would appreciate any help or workaround aside from just using Linux or Mac for programming this as I need this to work on all three systems.

  • Returning shell_exec as string PHP detecting BPM with soundtouch/soundstrech

    23 janvier 2016, par Jeff

    I am working on a php function used to upload a .wav to server (along with converting to mp3 and creating waveform image png) , and within the function I would like it to use soundtouch / soundstrech to detect the B.P.M. (Beats Per Minute). I know it will not be the most accurate but for my purposes it will be all I need.

    I was able to get the B.P.M. of a .wav file using soundtouch / soundstrech along with ffmpeg within a test.php file using deven’s php-bpm-detect wrapper But When I try to integrate it within my PHP function it returns the B.P.M. as zero.

    I am wondering if there is a simpler way to get the bpm as a string from the following shell exec without having to use a separate php library ?

    I would like to perform this and have it return as a string :

    $song_bpm = shell_exec('soundstretch ' . $file_path . ' -bpm');

    test.php (This works and returns the proper bpm :)

    <?php
    require "class.bpm.php";
    $wavfile = "38a2819c20.wav";
    $bpm_detect = new bpm_detect($wavfile);  
    $test = $bpm_detect->detectBPM();
    echo ' bpm of ' . $wavfile . ' is: ' . $test . ' ';
    ?>

    PHP Function : (returns bpm as zero)

    function upload_a_sound($user_id, $file_temp, $file_extn, $name, $uploader, $keywords) {
       $timecode = substr(md5(time()), 0, 10);
       $mp3name = 'beats/' . $timecode . '.mp3';
       $file_path = 'beats/' . $timecode . '.wav';
       move_uploaded_file($file_temp, $file_path);
       shell_exec('ffmpeg -i ' . $file_path . ' -vn -ar 44100 -ac 2 -ab 192k -f mp3 ' . $mp3name . '');
       require ('classAudioFile.php'); // This creates a spectogram .png file of .wav
       $AF = new AudioFile;
       $AF->loadFile($file_path);
       $AF->visual_width=200;
       $AF->visual_height=200;
       $AF->visual_graph_color="#c491db";
       $AF->visual_background_color="#000000";
       $AF->visual_grid=false;
       $AF->visual_border=false;
       $AF->visual_graph_mode=0;
       $AF->getVisualization ('images/song/' . $timecode . '.png');
       $imageloc = 'images/song/' . $timecode . '.png';
       require ('class.bpm.php'); //Deseven's class to get bpm,
       $bpm_detect = new bpm_detect($file_path);  
       $song_bpm = $bpm_detect->detectBPM(); //when used here this returns 0
       mysql_query("INSERT INTO `content` VALUES ('', '', '$name', '$uploader', '$keywords', '$file_path', '$imageloc', '$mp3name', '$song_bpm')"); // I will update this to mysqli soon, for now it works
    }

    I also found this which works, but not when I integrate it into my function :

    // create new files, because we don't want to override the old files
    $wavFile = $filename . ".wav";
    $bpmFile = $filename . ".bpm";

    //convert to wav file with ffmpeg
    $exec = "ffmpeg -loglevel quiet -i \"" . $filename . "\" -ar 32000 -ac 1 \"" . $wavFile . "\"";
    $output = shell_exec($exec);

    // now execute soundstretch with the newly generated wav file, write the result into a file
    $exec = "soundstretch \"" . $wavFile . "\" -bpm  2> " . $bpmFile;
    shell_exec($exec);

    // read and parse the file
    $output = file_get_contents($bpmFile);
    preg_match_all("!(?:^|(?<=\s))[0-9]*\.?[0-9](?=\s|$)!is", $output, $match);

    // don't forget to delete the new generated files
    unlink($wavFile);
    unlink($bpmFile);

    // here we have the bpm
    echo $match[0][2];