Recherche avancée

Médias (3)

Mot : - Tags -/spip

Autres articles (79)

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

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

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

Sur d’autres sites (8822)

  • live streaming Buffer data to Rtmp server using ffmpeg with nodejs ?

    13 février 2023, par ashutosh karn
    const ondata = chunk => {
    
    console.log(chunk) //Giving - Buffer 00 00 00 1c 66 74 79 70 64 61..........

    Streaming(chunk,"rtmps://live-api-s.facebook.com:443/rtmp/FB-108963845678778")

    //Streaming function is given below in the next Block.

   
    
  };


    


    i have a function named ondata. who is continuously giving buffer data like this :-

    


    


    ( actually this a buffer of .MP4 file.)

    


    


    <buffer 00="00" 1c="1c" 66="66" 74="74" 79="79" 70="70" 64="64" 61="61" 73="73" 68="68" 69="69" 6f="6f" 36="36" 76="76" 63="63" 31="31" 6d="6d" 34="34" 02="02" ca="ca" 6c="6c" df="df" e2="e2" 16334="16334" more="more" bytes="bytes"></buffer>

    &#xA;

    <buffer 14="14" 75="75" dd="dd" ea="ea" 7a="7a" 72="72" ef="ef" df="df" 4f="4f" 24="24" cb="cb" 83="83" c3="c3" 85="85" a3="a3" 17="17" 60="60" 26="26" 87="87" 74="74" 0b="0b" 49="49" e4="e4" 6f="6f" 09="09" 65="65" ae="ae" c8="c8" 6c="6c" 7d="7d" 0e="0e" 02="02" b1="b1" 6b="6b" 4a="4a" 63="63" 61="61" ab="ab" d9="d9" 44="44" 22="22" 62="62" 3c="3c" f6="f6" 0d="0d" 8c="8c" c9="c9" b7="b7" 16334="16334" more="more" bytes="bytes"></buffer>

    &#xA;

    Now I want to stream this buffer data to RTMP Server using FFMPEG

    &#xA;

    so I doing this :-

    &#xA;

    const child_process = require(&#x27;child_process&#x27;);&#xA;&#xA;   var Streaming = function (chunk, Rtmp_Uri) {&#xA;&#xA;     ffmpeg_process = child_process.spawn(&#x27;ffmpeg&#x27;, [&#xA;        &#xA;         &#x27;-re&#x27;,&#xA;         &#x27;-i&#x27;, `${chunk}`,  //Buffer 00 00 00 1c 66 74 79 70 64 61..........&#xA;         &#x27;-stream_loop&#x27;,&#x27;-1&#x27;,&#xA;        &#x27;-f&#x27;, &#x27;flv&#x27;,&#xA;         &#x27;-profile:v&#x27;, &#x27;baseline&#x27;,&#xA;         &#x27;-pix_fmt&#x27;, &#x27;yuv420p&#x27;,&#xA;         &#x27;-c:a&#x27;, &#x27;aac&#x27;,&#xA;         &#x27;-acodec&#x27;, &#x27;mp3&#x27;,&#xA;        &#x27;-ar&#x27;, &#x27;44100&#x27;,&#xA;         &#x27;-b:a&#x27;, &#x27;128k&#x27;,&#xA;         &#x27;-vcodec&#x27;, &#x27;libx264&#x27;,&#xA;         &#x27;-bufsize&#x27;, &#x27;600k&#x27;,&#xA;         &#x27;-vb&#x27;, &#x27;400k&#x27;, &#xA;        &#x27;-maxrate&#x27;, &#x27;3000k&#x27;,&#xA;         &#x27;-preset&#x27;, &#x27;ultrafast&#x27;,&#xA;         &#x27;-r&#x27;, &#x27;30&#x27;,&#xA;         &#x27;-g&#x27;, &#x27;30&#x27;,&#xA;        Rtmp_Uri       //"rtmps://live-api-s.facebook.com:443/rtmp/FB-1089638456787788-0..&#xA;                          AbzJ3chy775fhjjjkW2";&#xA;     ]);&#xA;     return ffmpeg_process;&#xA;&#xA;}&#xA;

    &#xA;

    when I run this Streaming function nothing happens.

    &#xA;

    so can anyone tell me how to stream the buffer to the Rtmp server ? or any FFmpeg command that stream buffer data to rtmp server ?

    &#xA;

    Thanks in Advance.

    &#xA;

  • RTMP server can't stream video (only audio)

    20 janvier 2020, par Jeffrey

    I’m implementing an RTMP server right now, and everything’s been working except for video streaming. I can stream audio with no problems (using OBS to stream), and play it back via VLC. The problem is VLC plays the audio, but no video. What I’m doing right now is forwarding every audio and video message I receive from OBS, I grab the original payload (audio/video data) and put in a Type 0 Chunk, since I’ve seen pretty much every implementation do this. I don’t know if I’m missing some sort of processing that should be done on the video data.

    If I try to playback with ffmpeg (saving the RTMP stream to an flv file), then I get this output :

    [NULL @ 000001eb053ed440] missing picture in access unit with size 5209
    [AVBSFContext @ 000001eb053ecbc0] No start code is found.
    rtmp://192.168.1.2/app/publish: could not find codec parameters
    Input #0, flv, from 'rtmp://192.168.1.2/app/publish':
     Duration: N/A, start: 0.000000, bitrate: N/A
       Stream #0:0: Data: none
       Stream #0:1: Video: h264, none, 1k tbn
    Output #0, flv, to 'av.flv':
    Output file #0 does not contain any stream

    It says missing picture in access unit with size 5209, No start code is found, and could not find codec parameters. What am I missing here ? I know I’m forwarding the payload exactly as I’ve received it in my server, I even did a hash check on the video payload I’m receiving and the one I’m sending and it’s exactly the same. Any help would be greatly appreciated.

  • Workflow and data format for sending MediaRecorder output to express server

    30 avril 2021, par Max

    I've been trying to figure this out for a while but got lost between different ways of sending files and different data formats.

    &#xA;

    I am recording the stream of a canvas animation with MediaRecorder. As far as I understand this returns a blob with the video in binary format. Now I want to send this data to my express server and convert it to an h264 encoded mp4 file. My first impulse was to use ffmpeg on the server. Unfortunately I'm struggling with the details of the implementation. I am unsure on how to best transmit the data and in what format and how to feed it to ffmpeg.

    &#xA;

    This is what I have on the client side :

    &#xA;

    // Get stream from element&#xA;stream = element.captureStream(30)&#xA;&#xA;// Create media recorder with stream&#xA;const recorder = new MediaRecorder(stream)&#xA;&#xA;// Save to file&#xA;recorder.ondataavailable = ({ data }) => {&#xA;                &#xA;    const formData = new FormData()&#xA;    formData.append("file", data)&#xA;&#xA;    const options = {&#xA;        method: "POST",&#xA;        body: formData,&#xA;    }&#xA;&#xA;    fetch("http://localhost:3001/api/blob_to_mp4", options).then(&#xA;        (res) => {&#xA;            console.log(res)&#xA;        }&#xA;    )&#xA;}&#xA;

    &#xA;

    And this is what I have on the server side :

    &#xA;

    "use strict";&#xA;&#xA;const express = require("express");&#xA;const cors = require("cors");&#xA;const ffmpeg = require("fluent-ffmpeg");&#xA;const fs = require("fs");&#xA;&#xA;const port = process.env.PORT || 3001;&#xA;const app = express();&#xA;var command = ffmpeg();&#xA;&#xA;app.use(cors());&#xA;app.use(express.urlencoded({ extended: true }));&#xA;app.use(express.json());&#xA;&#xA;app.post("/api/blob_to_mp4", function (req, res) {&#xA;  var data = Buffer.from("");&#xA;&#xA;  // Add data&#xA;  req.on("data", function (chunk) {&#xA;    data = Buffer.concat([data, chunk]);&#xA;  });&#xA;&#xA;  // Full data available&#xA;  req.on("end", () => {&#xA;    req.rawBody = data;&#xA;  });&#xA;&#xA;  res.send("hello world");&#xA;});&#xA;&#xA;app.listen(port);&#xA;console.log(`Server running on port ${port}`);&#xA;

    &#xA;