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??
Asked
Active
Viewed 125 times
0
-
If you need to convert videos [Handbrake is a good open-source utility](https://handbrake.fr/). – Andy Aug 19 '21 at 12:19
-
Actually I meant converting through backends(like in nodejs) not with some software.. – sahil aktar Aug 19 '21 at 12:24
-
Why make your life harder? Just get all the videos and batch convert them. – Andy Aug 19 '21 at 12:30
-
Companies requirement not my own website.. – sahil aktar Aug 19 '21 at 12:33
1 Answers
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
-
For the frontend do i need to have the normal ffmpeg library installed? – sahil aktar Aug 24 '21 at 12:38
-
for the frontend you can either co with https://github.com/Kagami/ffmpeg.js/ or https://github.com/ffmpegwasm/ffmpeg.wasm – Tobias S. Aug 24 '21 at 12:50