Recherche avancée

Médias (1)

Mot : - Tags -/biomaping

Autres articles (25)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

  • Automated installation script of MediaSPIP

    25 avril 2011, par

    To overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
    You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
    The documentation of the use of this installation script is available here.
    The code of this (...)

Sur d’autres sites (4584)

  • 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];
  • FFMPEG reporting EOF for network connection every so often, why ?

    23 juillet 2015, par Alex

    I have the code as follows

       av_open_input_file("rtsp://.....);
       while(av_read_packet() >= 0) {
         // do something with the packet
       }

    The problem is I am only able to receive, say, 100-200 packets and then av_read_packet returns EOF error. So I have to reconnect and start getting frames again.

    I wonder if I can set some options to av_open_input_file() (or maybe use some other API) so that the connection wouldn’t drop that often.

    Thank you