Recherche avancée

Médias (91)

Autres articles (8)

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

  • Participer à sa documentation

    10 avril 2011

    La documentation est un des travaux les plus importants et les plus contraignants lors de la réalisation d’un outil technique.
    Tout apport extérieur à ce sujet est primordial : la critique de l’existant ; la participation à la rédaction d’articles orientés : utilisateur (administrateur de MediaSPIP ou simplement producteur de contenu) ; développeur ; la création de screencasts d’explication ; la traduction de la documentation dans une nouvelle langue ;
    Pour ce faire, vous pouvez vous inscrire sur (...)

  • Déploiements possibles

    31 janvier 2010, par

    Deux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
    L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
    Version mono serveur
    La version mono serveur consiste à n’utiliser qu’une (...)

Sur d’autres sites (2853)

  • While ffmpeg convers via php website doesnt work

    29 octobre 2013, par Xenos Trojanowicz

    So im using

                   if ($success_msg)
               {
                   $tmp_parts = explode('.', $file['name']);
                   $ext = array_pop($tmp_parts);
                   $ext = strtolower($ext);
                   if($ext == "avi" && $convert_avi == true)
                       {
                           $convert_source = _VIDEOS_DIR_PATH.$new_name;
                           $conv_name = substr(md5($file['name'].rand(1,888)), 2, 10).".mp4";
                           $converted_file  = _VIDEOS_DIR_PATH.$conv_name;
                           $ffmpeg_command = 'ffmpeg -i '.$convert_source.'-acodec libfaac -vcodec libx264 -s 1280x720 -ar 44100 -async 44100 -r 29.970 -ac 2 -qscale 5 '.$converted_file;
                           echo exec($ffmpeg_command);
                           $sql = "UPDATE pm_temp SET url = '".$conv_name."' WHERE url = '".$new_name."' LIMIT 1";
                           $result = @mysql_query($sql);
                           unlink($convert_source);    
                       }
                   echo $success_msg;
               }

    This code to convert videos from avi to mp4 but i have another big issue when i upload big file let say 170 mb it converts about 25 minutes or so and while it converts website doesnt work for me.

    NOW I KNOW WHY WEBSITE DOESNT WORK :

    • its only for me becose system doesnt open extra slot to enter to website while it converts
    • i know how to solve this problem with cronjob but im afraid that if something goes wrong it will be biggest fail i ever had

    so im hopping that u guys will suggest something smart and easy to deal with this issue

  • {OpenAL(+FFmpeg)} How to queue variable size buffer due to ogg format ?

    11 février 2014, par user3293833

    (First of all, I may feel sorry about my poor English as it's not my native language.)

    I use FFmpeg to decode some audio file and play it with OpenAL by "stream"(i.e."queue" and "unqueue" function of OpenAL).

    When I use my program to play .ogg file, I find that it has a variable nb_samples.(due to ogg has variable bit rate ??) There are 128 B, 512 B and 1024 B of nb_samples. As a results, I must call alDeleteBuffers and alGenBuffers before I use alBufferSamplesSOFT(similar to alBufferData) because it would fail to call alBufferSamplesSOFT without recreate the buffer.
    Notes : alBufferSamplesSOFT is provided by OpenAL Soft. You can just see it as alBufferData.

    Nevertheless, I think it's foolish and inefficient if I do this. Is there is some smart method ? I paste the part of code :

    while (av_read_frame(...) == 0){
     avcodec_decode_audio4(...);
     swr_convert(...);  // to convert PCM format from FLTP to FLT
     alDeleteBuffers(1, theBuffers[?]);
     alGenBuffers(1, theBuffers[?]);
     alBufferSamplesSOFT(...);  // put those data into OpenAL buffer
    }

    if I don't do this, It would failed to update the OpenAL buffer. Is there any method to create a variable size buffer or a big size buffer ? Or is there any method to change the size of buffer ?

    Thanks for you guys.

  • NodeJS : Fail to write byte array input from webcam to ffmpeg spawn process

    23 mai 2024, par Thanesh Prabaghan

    I'm using NodeJS server to display an HTML page which has webcam option. Once user visited to my NodeJS server, it will serve html page. User can allow webcam option and see webcam view on the page.

    


    In the backend, I send webcam stream (byte array) using socket.io. I receive byte array successfully in backend with the help of socket.io. BUT MY PROBLEM IS, I can't pipe this byte array to the ffmpeg spawn process. I don't know how to properly pipe this data to the ffmpeg. Once it done, all my problem will be solved.

    


    On the other side, I have node-media-server as RTMP server to publish this stream to VLC player and other devices. Kindly help me to complete this task. I will attach all my code to this question. Kindly run this in your environment and answer the question.

    


    MY HTML PAGE

    


    &#xA;&#xA;  &#xA;    &#xA;      &#xA;&#xA;      &#xA;&#xA;      <code class="echappe-js">&lt;script src=&quot;https://cdn.socket.io/4.7.5/socket.io.min.js&quot; &amp;#xA;        integrity=&quot;integrity_code&quot; &amp;#xA;        crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;&#xA;    &#xA;    &#xA;      
    &#xA; &#xA;&#xA; &lt;script&gt;&amp;#xA;          const socket = io(&amp;#x27;http://localhost:8080/&amp;#x27;);&amp;#xA;          var video = document.getElementById(&quot;video&quot;);&amp;#xA;&amp;#xA;          if (navigator.mediaDevices.getUserMedia) {&amp;#xA;            navigator.mediaDevices.getUserMedia({ video: true, audio:true })&amp;#xA;            .then(function (stream) {&amp;#xA;              const recorder = new MediaRecorder(stream);&amp;#xA;&amp;#xA;              recorder.ondataavailable = event =&gt; {&amp;#xA;                socket.emit(&amp;#x27;VideoStream&amp;#x27;, event.data);&amp;#xA;              };&amp;#xA;              recorder.start(1000);      &amp;#xA;              video.srcObject = stream;&amp;#xA;            }).catch(function (error) {&amp;#xA;              console.log(&quot;Something went wrong!&quot;);&amp;#xA;            });&amp;#xA;         }  &amp;#xA;       &lt;/script&gt;&#xA; &#xA;&#xA;&#xA;

    &#xA;

    FFMPEG IMPLEMENTATION

    &#xA;

    const express = require(&#x27;express&#x27;);&#xA;const app = express();&#xA;const http = require(&#x27;http&#x27;);&#xA;const server = http.createServer(app);&#xA;const { Server } = require("socket.io");&#xA;const io = new Server(server);&#xA;const path = require(&#x27;node:path&#x27;); &#xA;const { spawn } = require(&#x27;node:child_process&#x27;);&#xA;&#xA;let cmd = spawn(&#x27;ffmpeg.exe&#x27;, [&#xA;    &#x27;-c:v&#x27;, &#x27;copy&#x27;, &#x27;-preset&#x27;, &#x27;ultrafast&#x27;, &#x27;-tune&#x27;, &#x27;zerolatency&#x27;,&#xA;    &#x27;-c:a&#x27;, &#x27;aac&#x27;, &#x27;-strict&#x27;, &#x27;-2&#x27;, &#x27;-ar&#x27;, &#x27;44100&#x27;, &#x27;-b:a&#x27;, &#x27;64k&#x27;,&#xA;    &#x27;-y&#x27;,&#xA;    &#x27;-use_wallclock_as_timestamps&#x27;, &#x27;1&#x27;,&#xA;    &#x27;-async&#x27;, &#x27;1&#x27;,&#xA;    &#x27;-flush_packets&#x27;, &#x27;1&#x27;,&#xA;    &#x27;-rtbufsize&#x27;, &#x27;1000&#x27;,&#xA;    &#x27;-bufsize&#x27;, &#x27;1000&#x27;,&#xA;    &#x27;-f&#x27;, &#x27;flv&#x27;,&#xA;     &#x27;-i&#x27;,&#x27;-&#x27;,&#xA;    &#x27;rtmp://localhost:1935&#x27;,&#xA;  ]);&#xA;&#xA;app.use(express.static(path.join(__dirname, &#x27;public&#x27;)));&#xA;&#xA;app.get(&#x27;/&#x27;, (req, res) => {&#xA;  res.sendFile(path.join(__dirname &#x2B; &#x27;index.html&#x27;));&#xA;});&#xA;&#xA;io.on(&#x27;connection&#x27;, (socket) => {&#xA;  socket.on("VideoStream", (data) => {&#xA;    cmd.stdin.write(data);&#xA;  });&#xA;});&#xA;&#xA;server.listen(8080, () => {&#xA;  console.log(&#x27;listening on *:8080&#x27;);&#xA;});&#xA;&#xA;```&#xA;**NODE MEDIA SERVER IMPLEMENTATION**&#xA;&#xA;```&#xA;const NodeMediaServer = require(&#x27;node-media-server&#x27;);&#xA;&#xA;const config = {&#xA;  rtmp: {&#xA;    port: 1935,&#xA;    chunk_size: 60000,&#xA;    gop_cache: true,&#xA;    ping: 30,&#xA;    ping_timeout: 60&#xA;  },&#xA;  http: {&#xA;    port: 8000,&#xA;    allow_origin: &#x27;*&#x27;&#xA;  }&#xA;};&#xA;&#xA;var nms = new NodeMediaServer(config)&#xA;nms.run();&#xA;```&#xA;&#xA;&#xA;

    &#xA;