Recherche avancée

Médias (1)

Mot : - Tags -/bug

Autres articles (63)

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

Sur d’autres sites (6898)

  • 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

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