Recherche avancée

Médias (2)

Mot : - Tags -/map

Autres articles (35)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

Sur d’autres sites (5800)

  • Is a any way of piping input to deepspeech under Linux ?

    24 octobre 2019, par Unreal Admin

    I am trying to continually stream audio from my IP camera to a server running deepspeech to decode the audio stream to text in realtime using FFMPEG.

    I am using the following command :

    $ffmpeg -i rtsp ://192.168.1.249:8080/h264_pcm.sdp -ar 16000 -ac 1 -acodec pcm_s16le -vn -f wav - |
    deepspeech —model deepspeech-0.5.1-models/output_graph.pbmm —alphabet deepspeech-0.5.1-models/alphabet.txt —lm deepspeech-0.5.1-models/lm.binary —trie deepspeech-0.5.1-models/trie —audio -

    Deepspeech : FileNotFoundError : [Errno 2] No such file or directory : ’-’

    deepspeech doesn’t like the ’—audio -’ specifier.

    Is there any way of achieving the above goal using this approach ? Perhaps deepspeech just isn’t designed to do this ?

    Are there any other suggestions as to how this might be achieved ?

    ffmpeg can be directed to write a .wav file. Deepspeech and transcode this file. But I wish to continually stream and transcode the audio.

  • AJAX upload file with progres + FFMPEG progress

    24 octobre 2019, par Сергей Барахтенко

    The task is to implement the following :
    1. On the page there is a form for downloading a file, the file should be loaded asynchronously, without rebooting with the help of AJAX and displaying the upload progress
    2. If the file is successfully downloaded, send a command to the server, which should check the queue, and if the queue is empty, inform the client that the processing of the file has begun, then start the processing itself
    3. If processing has begun, then show the progress of this processing

    What did you manage to implement
    File upload was successfully implemented, after a successful upload, the server issues a line with the status successfully, and the full path of the downloaded file

    Upload JS snippet

    $.ajax({
       url: 'api/upload/load',
       type: 'post',
       data: fd,
       contentType: false,
       processData: false,
       xhr: function() {
           var xhr = new window.XMLHttpRequest();
           xhr.upload.addEventListener("progress", function(evt) {
               if (evt.lengthComputable) {
                   var percent = Math.ceil((evt.loaded / evt.total) * 100);
                   console.log(percent) // Upload progress
               }
           }, false);
           return xhr;
       },
       success: function(data){
           var response = JSON.parse(data);
           if(response.status == 'success'){
               //if upload success, run command
               startConversion(response.path)
           }
       }
    });

    Reponse from api/upload/load

    {"status":"success","path":"<path>"}
    </path>

    In the AJAX script, I do a check : if the response.status == ’success’, then we call the startConversion function, which takes the full path of the newly loaded file as an argument. This function sends another AJAX request to the server, where the queue check is in progress.

    startConversion JS Snippet

    function startConversion(path){
       $.ajax({
           url: '/api/upload/conversion',
           type: 'POST',
           data: { path: path },
           success: function(data){
               var response = JSON.parse(data);
               // if response.status == 'start', run checkConversion function
           }
       })

    Code /api/upload/conversion

    $queue = $this->model->getQueue();
    if($queue &lt; 5){
       // If queue is empty, notify browser
       $output = array('progress' => 'start');
       echo json_encode($output);
       // Then start shell_ecxec
       $cmd = 'some_command';
       shell_exec('ffmpeg.exe -i ' . $path . ' ' . $cmd . ' 1>log.txt 2>&amp;1 ');
    } else {
       $output = array('progress' => 'waiting');
       echo json_encode($output);
    }

    Here, for some reason, a message is already not being displayed stating that processing has begun (echo before $cmd)

    Full link

    And here the most interesting begins. It would seem that it would be possible in the method to success call the check on the status of the processing (start, queue or an error) and if the processing began to call the third function, which, again AJAX, polls the server returns the progress of the processing

    But in reality, the following happens : as soon as the second function sends the request, nothing is returned in response, but processing is in progress, and in the console it shows the status of the request - PENDING. As soon as the server completes processing, a response is issued from the server that the queue is empty and you can start processing the progress, although the processing has already been completed

    There are suggestions that further execution of the script is blocked by the command shell_exec() until the end of her work
    Also, it is not clear to me why the response from the server is not issued when the echo is clearly registered in it, and why the browser is waiting for the complete completion of the work shel_exec() because after it, the code does not have one. What should be done, that is, as if according to the logic of things and by the code, the server should give an answer in the form of a JSON string, the browser should show that the request has completed with the status of 200, and the server, in the meantime, should start the conversion, but for some reason this does not happen...

  • avcodec/v210dec : add support for frame and slice threading

    25 novembre 2019, par Limin Wang
    avcodec/v210dec : add support for frame and slice threading
    

    1, Test server configure :
    [root@localhost ]# cat /proc/cpuinfo |grep "model name"
    model name : Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz
    model name : Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz
    ...

    [root@localhost ]# free -h
    total used free shared buff/cache available
    Mem : 102G 1.1G 100G 16M 657M 100G
    Swap : 4.0G 0B 4.0G

    2, Test result :
    encode the v210 input data for testing :
    ./ffmpeg -y -i 4k_422.ts -c:v v210 -vframes 10 test.avi

    master :
    ./ffmpeg -y -threads 1 -stream_loop 1000 -i ./test.avi -benchmark -f null -
    frame=10010 fps= 60 q=-0.0 Lsize=N/A time=00:38:26.30 bitrate=N/A speed=13.7x
    video:5240kB audio:432432kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead : unknown
    bench : utime=101.869s stime=66.181s rtime=167.996s
    bench : maxrss=186552kB

    patch applied :
    ./ffmpeg -y -threads 2 -thread_type slice -stream_loop 1000 -i ./test.avi -benchmark -f null -
    frame=10010 fps= 72 q=-0.0 Lsize=N/A time=00:38:26.30 bitrate=N/A speed=16.5x
    video:5240kB audio:432432kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead : unknown
    bench : utime=103.562s stime=74.858s rtime=139.599s
    bench : maxrss=188616kB

    ./ffmpeg -y -threads 2 -thread_type frame -stream_loop 1000 -i ./test.avi -benchmark -f null -
    frame=10010 fps= 85 q=-0.0 Lsize=N/A time=00:38:26.30 bitrate=N/A speed=19.6x
    video:5240kB audio:432432kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead : unknown
    bench : utime=114.310s stime=92.685s rtime=117.693s
    bench : maxrss=231896kB

    Signed-off-by : Limin Wang <lance.lmwang@gmail.com>
    Signed-off-by : Michael Niedermayer <michael@niedermayer.cc>

    • [DH] libavcodec/v210dec.c
    • [DH] libavcodec/v210dec.h