OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Adaptative bitrate streaming (DASH, HLS...) VS Node Streams

  • Thread starter Thread starter ElJackiste
  • Start date Start date
E

ElJackiste

Guest
In Node.js, streams can be used easily to deliver a media content by chunks (as a video for example).

It is also possible to use an adaptative bitrate streaming method like DASH or Http Live Streaming by breaking down segments of the media to send. It looks like it is recommended to implement this second method over the first one in the case of a videos delivery streaming platform.

I would like to know why and what's the difference in terms of benefits and disadvantages to implement an adaptative bitrate streaming method instead of using Node.js native streams for a video streaming app ?

EDIT : Example of using Node.js streams to deliver a media content by chunks :

Code:
var videoStream = fs.createReadStream(path, { start, end });
res.writeHead(206, {
  "Content-Range": `bytes ${start}-${end}/${size}`,
  "Accept-Ranges": "bytes"
});
videoStream.pipe(res);

<p>In Node.js, <a href="https://nodejs.org/api/stream.html" rel="nofollow noreferrer">streams</a> can be used easily to deliver a media content by chunks (as a video for example).</p>
<p>It is also possible to use an adaptative bitrate streaming method like DASH or Http Live Streaming by breaking down segments of the media to send. It looks like it is recommended to implement this second method over the first one <strong>in the case of a videos delivery streaming platform</strong>.</p>
<p>I would like to know why and what's the difference in terms of benefits and disadvantages to implement an adaptative bitrate streaming method instead of using Node.js native streams for a video streaming app ?</p>
<p><strong>EDIT</strong> : Example of using Node.js streams to deliver a media content by chunks :</p>
<pre class="lang-js prettyprint-override"><code>var videoStream = fs.createReadStream(path, { start, end });
res.writeHead(206, {
"Content-Range": `bytes ${start}-${end}/${size}`,
"Accept-Ranges": "bytes"
});
videoStream.pipe(res);
</code></pre>
 
Top