Answer the question
In order to leave comments, you need to log in
How to support more formats in webplayer?
Introduction:
There is some service that involves working with videos of different formats. As well as playing them online. For simplicity, let's say that this is a YouTube clone (it's not, but it doesn't matter).
That is, you can upload a video of an arbitrary format there and expect the opportunity to view it online.
The HTML-5 player ( <video>
) works quite well in this role, but it supports very few formats. As far as I understand, only mp4, webm and ogg are more or less supported.
At the same time, I would like to have support for avi, mkv (specifically, there were problems with audio (as far as I can tell, the ac3 codec is not supported by browsers)) and other things.
The only solution I found at the moment is to transcode the video to compatible codecs, for example in webm:
ffmpeg -y \
-progress - \
-fflags \
+genpts \
-i input.avi \
-c:v libvpx \
-c:a libvorbis \
output.webm
ffmpeg -y \
-progress - \
-fflags \
+genpts \
-i input.avi \
-c:v copy \
-c:a aac \
output.mp4
Answer the question
In order to leave comments, you need to log in
Well, faster only if you reduce the quality. For example, the -ultrafast parameter
In general, all services render videos for themselves, only then they are available for upload
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question