Recherche avancée

Médias (1)

Mot : - Tags -/biomaping

Autres articles (68)

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

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

Sur d’autres sites (6641)

  • 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];
  • 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.

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