Jump to content

Which video formats are supported by videojs library ?

Recommended Posts

I installed videojs library as it is writtem at this example
It works ok, and in backend be be uploaded and viewed on fronternd, but only for some video I tried to play

For some video I try to upload and to show I got error message:
The media could not be loaded, either because the server or network failed or because the format is not supported.

Properties of this file:
1.Metr saves.avi
File: /_diskE_Media/__Archieve/2018-12-31/__DOCS/VIDEOS/1.Metr saves.avi
Size: 47664 KB (46 MB)
Length: 00:02:53
Demuxer: lavf
Clip info
Name: 1.Metr saves.avi
Resolution: 720 x 400
Aspect ratio: 1.8
Format: mpeg4
Bitrate: 2227 kbps
Frames per second: 23.976000
Selected codec: mpeg4
Initial Audio Stream
Format: ac3
Bitrate: 448 kbps
Rate: 48000 Hz
Channels: 6
Selected codec: ac3
Audio Streams
Track 0
Language: <undefined>
Name: <undefined>
ID: 1

Reviewing the videojs.com site I did not find any information about which format it supports.
Actually I new very few about video formats. I know some extentions(like avi, mp4, mov etc...) and I know that with the same extention can be different formats.

If there is a way to extend list of supported formats and a way during upload to get error if this format is not supported?


Share this post

Link to post
Share on other sites

AVI is a container. The player needs to support AVI (so it knows how the file is built) as well as the underlying codecs used for the video and audio. Your video is MPEG4 and AC3, which should definitely be supported given how common they are.

It's more likely the "the server or network failed" part is what happened. Use your browser to watch network requests at the time the player tries to load the video, then verify (a) it was able to partially download anything and (b) if you try to open the URL yourself, like manually, like right-click Open or copy URL or something, that it works.

Share this post

Link to post
Share on other sites
It looks you are right, maybe that is server issue, at least with rather big files.

Could you please to look at it online by https://www.votes.nilov-sergey-demo-apps.tk/admin/page-content/edit/1 (it has credentials)

At the second tab “Images / Videos” there is possibility to upload images/videos.

Now it has 4 videos uploaded, first 3 are ok for view but last 1.Metr_saves.avi has 46mb in size I suppose that is why
I got error in JS console:
video.js:142 VIDEOJS: ERROR: (CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED) The media could not be loaded, either because the server or network failed or because the format is not supported. MediaError {code: 4, message: "The media could not be loaded, either because the …rk failed or because the format is not supported."}

But I am not sure, at least I uploaded the file on my OS (ubuntu)

That is laravel5/php7.2/apache2 app and in apache2 config I have options
memory_limit 2048M
upload_max_filesize 200M
post_max_size 200M

Could ypo please try to upload several video files of different type/size, set size for them and click save? If uploaded it would be accessible in listing below...


Share this post

Link to post
Share on other sites

If I had videos to test with I could try.

It is looking like AVI format isn't going to be commonly supported. If you want to allow people to upload it then you should transcode it on the server to something else more portable, like MP4.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.