0

I am currently working on a website in which I want to show some videos. My problem is that the video format will be .asf format if I try .asf format nothing is shown in the webpage but if I use mp4 its working correctly. Can anyone suggests me how can I show .asf format and even I have to convert that .asf format to some other format like mp4 what will be the good library to do it??

sahil aktar
  • 101
  • 10

1 Answers1

2

You can convert .asf to .mp4 using software like ffmpeg. If you want to convert the videos on the frontend there are JavaScript implementations that enable you to use ffmpeg in the browser like ffmpeg.js

You use ffmpeg.js like you would use the commandline version. Example:

ffmpeg -i test1.asf -c:v libx264 -strict -2 test1.mp4

This would be done in ffmpeg.js with

const result = ffmpeg({
  MEMFS: [{name: "test.webm", data: testData}],
  arguments: ["-i", "test1.asf", "-c:v", "libx264", "-strict", "-2" , "test1.mp4"],
});

I copied those arguments from another example. You might want to change or add arguments to get better video quality.

There is also ffmpeg for node.js which might suit your case better. But in the backend you can also run the normal ffmpeg via cmd.

Tobias S.
  • 21,159
  • 4
  • 27
  • 45