Convert a HLS Stream in MP4 with Javascript

434 Views Asked by At

I need the client to download a live streaming .flv/.m3u8 from an external cdn and for the client to convert it to mp4.

Everything needs to be done with javascript, do you have any ideas? I specify that it has to be done client side.
I use this code to download the file, but I have no idea how to convert it to mp4 directly while downloading

Code:

function downloadFile(url) {
  const link = document.createElement('a');
  link.href = url;
  link.download = url.split('/').pop();
  document.body.appendChild(link);
  link.click();
  document.body.removeChild(link);
}
const url = 'https://getsamplefiles.com/download/flv/sample-1.flv';
downloadFile(url);
0

There are 0 best solutions below