different video levels is giving errors and short freezes

nedr
Posts: 10
Joined: Fri Aug 18, 2017 12:30 pm

different video levels is giving errors and short freezes

Postby nedr » Thu Dec 07, 2017 3:38 pm

I want to use different video files with different framerate, the so called levels. The videos are playing and you can change the quality but it has a strange bug. When playing the video, it freezes in the beginning for a couple of time. I opened the console of my browser and loaded the video again. I noticed that the video is freezing when a error is logged about the mediasource is not supported. I got this message three times and I got 3 video(levels)...
When I don't use levels and just use one video file, I don't have this problem. After searching a lot, and try to fix it on my domain, I tried the example on your website (https://forgejs.org/samples/video-controls) and noticed the same message in the console log.

The log with the message is in the browser Firefox, but I noticed the freezes also in Safari and Edge. (chrome not tested yet)

I also noticed when using a .mpd url it is also working great... so it has something to do with the levels I think, because with a .mpd you have just one url.

As workaround I am trying to find out how to make .mpd because I want to allow different quality... but how :roll:

User avatar
rroux
ForgeJS Team
Posts: 146
Joined: Wed Oct 26, 2016 12:19 pm

Re: different video levels is giving errors and short freezes

Postby rroux » Fri Dec 08, 2017 10:25 am

Hi nedr,

Thanks for your report!
Yeah I noticed the same issue with multi levels video (like 4 different mp4 files).
This does not happen with *.mpd because it's mpeg-dash encoded.
If you want to create *.mpd you have to learn how to "dashify" your video streams.
I personally don't know how to do this but I guess that there's a lot of documentation and software available online to achieve this?

Some results I found on google :

https://bitmovin.com/mp4box-dash-conten ... tion-x264/
https://blog.streamroot.io/encode-multi ... layers-22/
https://github.com/slederer/DASHEncoder

The ForgeJS team is also working on implementing HLS (HTTP Live Streaming) that is like dash in some ways but Apple proprietary.
https://en.wikipedia.org/wiki/HTTP_Live_Streaming

Have a nice day!
- Raphaël

nedr
Posts: 10
Joined: Fri Aug 18, 2017 12:30 pm

Re: different video levels is giving errors and short freezes

Postby nedr » Fri Dec 08, 2017 10:31 am

Thanks rroux, I will try .mpd!
but is this bug fixxable of the levels? :roll:

User avatar
rroux
ForgeJS Team
Posts: 146
Joined: Wed Oct 26, 2016 12:19 pm

Re: different video levels is giving errors and short freezes

Postby rroux » Fri Dec 08, 2017 12:50 pm

Hi nedr,

but is this bug fixxable of the levels?


This is possible I guess but this needs a deep investigation of the issue.
Video is a difficult thing to handle, our video class is like a home made solution for multi quality and it is not as efficient as the dash solution is.
Maybe in the future we will try to find a library that can handle this very properly, I don't know...
If you find something about it, do not hesitate to share with us ;)
- Raphaël

nedr
Posts: 10
Joined: Fri Aug 18, 2017 12:30 pm

Re: different video levels is giving errors and short freezes

Postby nedr » Sat Dec 09, 2017 1:11 am

I will!! Thx :D

nedr
Posts: 10
Joined: Fri Aug 18, 2017 12:30 pm

Re: different video levels is giving errors and short freezes

Postby nedr » Mon Dec 11, 2017 11:32 am

I now know how to make .mpd files yeah! On pc everything is working now with different quality, but on mobile devices it is not :?
After searching on the web I found out that dash.js needs MSE support of the browser. And on my iPad Safari and Chrome are not working. Did not test android tablets yet...
Is there maybe some kind off workaround for this problem? playing mp4 on mobile and tablets and mpd on other devices for example? :roll:

User avatar
rroux
ForgeJS Team
Posts: 146
Joined: Wed Oct 26, 2016 12:19 pm

Re: different video levels is giving errors and short freezes

Postby rroux » Mon Dec 11, 2017 4:41 pm

Hey,

You can't set different media source depending on the device.
The thing you can do is having two configuration files and have two strategies on viewer instantiation.
If you are on desktop you load config-desktop.json and if you are on mobile you load config-mobile.json
It is the only workaround I have in mind right now :)

Hope this helps, have a nice day !
- Raphaël

nedr
Posts: 10
Joined: Fri Aug 18, 2017 12:30 pm

Re: different video levels is giving errors and short freezes

Postby nedr » Tue Dec 12, 2017 12:15 pm

Thank you for pointing me in the right direction. I found a solution: check if MSE is supported, else different config:

Code: Select all

if (window.MediaSource) {
     var viewer = new FORGE.Viewer("container360", "config.json");
} else {
     var viewer = new FORGE.Viewer("container360", "config2.json");
}

User avatar
rroux
ForgeJS Team
Posts: 146
Joined: Wed Oct 26, 2016 12:19 pm

Re: different video levels is giving errors and short freezes

Postby rroux » Tue Dec 12, 2017 1:14 pm

If it solves your issue, that is the best way to go at the moment ;)
Thanks for sharing!
- Raphaël

User avatar
rroux
ForgeJS Team
Posts: 146
Joined: Wed Oct 26, 2016 12:19 pm

Re: different video levels is giving errors and short freezes

Postby rroux » Wed Dec 13, 2017 4:17 pm

Hi nedr,

I think you can try something else for your different video sources depending of the user device.
On every levels you can specify a device setting based on what we detect in the FORGE.Device class.
So if you want to set a different source depending on the media source availability you can do the following :

  1. "levels": [
  2.     { "url": "video-0.mp4", "device": { "mediaSource": true } },
  3.     { "url": "video-1.mp4", "device": { "mediaSource": false }  },
  4. ]


I think it will improve the maintainability of you config.json if you have only one to maintain :)
Take a look at the FORGE.Device documentation to see what you can check with the device options !
http://releases.forgejs.org/latest/doc/ ... evice.html

You can set complex scenarios but it is not documented at all for now.
Feel free to ask if you have specific use cases!

Hope this helps !
- Raphaël

Who is online

Users browsing this forum: No registered users and 1 guest