How do I make video less laggy

Get help using Construct 2

Post » Fri Jul 08, 2016 7:03 am

Message: Deda can only post plain text URLS until they have 500 rep. 2 URLS modified. Why?
I followed tutorial on youtube about importing and playing video in construct 2 project. https://www.youtube.com/watch?v=0ctfhDWY5S0

All 3 formats are in ogv,mp4, and webm but video is laggy as hell, check here: http://korea.bitballoon.com
In chrome is hell, but in firefox is bit less.
B
7
S
1
Posts: 18
Reputation: 363

Post » Fri Jul 08, 2016 7:41 am

Firstly Construct 2 video plugin is useful for small videos, you can try to preload video, instead of autoplay to improve some lag.

but if you want to show video like your example page, consider uploading it to youtube and embed into construct 2.
B
9
S
2
Posts: 76
Reputation: 739

Post » Fri Jul 08, 2016 8:47 am

signupdemo wrote:Firstly Construct 2 video plugin is useful for small videos, you can try to preload video, instead of autoplay to improve some lag.

but if you want to show video like your example page, consider uploading it to youtube and embed into construct 2.

Same with preload :/
Embed youtoube video is not an option, since i need only video without all those buttons elements, links etc. on it.
B
7
S
1
Posts: 18
Reputation: 363

Post » Fri Jul 08, 2016 8:59 am

I'm afraid the best way to provide a fluid video is to reduce its overall quality, that is to say provide it in 480 p (a resolution of 720×480 pixels).
This will reduce the download size of your video and will make it easier to be read across all computers/browsers.

Once you have such a video, allowing only the user to play it once you have downloaded enough of the video to play it should also help out, as previously hinted.
With videos, preload does not work the same as with audio or layouts.
You have to "delay" the playing of your video until your reach

On playback event

"Can play": triggered when enough data is available to play at least a couple of frames, but there may not be enough data to play through to the end.
or
"Can play through": triggered when the browser determines that the load progress and transfer rate are sufficient for playback through to the end without stalling for buffering. However this is not a guarantee, since the transfer rate could drop or be cut off completely.

Using "Can play through" will make sure you have loaded the whole video.
But it requires to hold on on playing the video.
Once this event triggers, you may then want to provide your user with a play button of sorts allowing them to launch the video and experience it comfortably.
The user action is also required on certain devices, and some devices (like iPhone) WILL show the controls for the video anyway (because Apple).
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
293
S
117
G
96
Posts: 7,310
Reputation: 71,069

Post » Fri Jul 08, 2016 9:28 am

I tried both events and video always starts immediately :/
Never mind, i found in rex plugin option that disable youtube elements, but still video pauses when i click on it ><
B
7
S
1
Posts: 18
Reputation: 363

Post » Fri Jul 08, 2016 9:32 am

Change the autoplay property value. It won't start automatically.
Makes sure you are not using the "Play" action in a "On start of layout" event.

Do read the manual and learn what tools you have at your disposal.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
293
S
117
G
96
Posts: 7,310
Reputation: 71,069

Post » Fri Jul 08, 2016 9:51 am

Message: Deda can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Kyatric wrote:Change the autoplay property value. It won't start automatically.
Makes sure you are not using the "Play" action in a "On start of layout" event.

Do read the manual and learn what tools you have at your disposal.

Don't know what I'm doing wrong then.
http://puu.sh/pUswQ/3e437c529c.capx
B
7
S
1
Posts: 18
Reputation: 363

Post » Fri Jul 08, 2016 9:53 am

Deda wrote:
signupdemo wrote:Embed youtoube video is not an option, since i need only video without all those buttons elements, links etc. on it.


Youtube has bandwith. From there point of view, it is theire 'upload' speed. Wich is just uncomparable to the upload speed of a single user.

If you gooing to host this video yourself, you are limited to your own 'upload speed' / amount of users you want to serve. That is a simple calculation, and you gooing to be suprised about the small amount of bits that you can serve. Watch it, upload speed is usaly shown as Mega Bit / sec. Roughtly 10 times less than MegaByte /sec.

If you cant host on youtube, then encode the video towards what is possible (back to the 90tys) for you. Or find a host with a big bandwith (will cost you).

You can also, as suggested, totaly kill the autoplay. And make the user wait till its all loaded. (also back to the 90tys)
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Fri Jul 08, 2016 7:48 pm

Your Autoplay value is "Preload", once loaded, the video plays.
Moreover, you used the "Can play through" condition to execute the play action.

So very quickly, the video plays, as intended.

With video, in the start of layout, you want to set the source for your video, and possibly make it so that a user action is requested.
Using a button and setting Autoplay to No, this gives :
Image

By default the button is outside of the layout, when loading of the video is complete, it appears under the video and clicking it allows to play the video.
On my computer the video does not lag at all.

If it does on yours, consider profiling your program with the debugger and checking for errors in your browser as well, make sure you are using a up to date browser with up to date graphic card drivers and make sure your computer is powerful enough to be able to decode video and audio on the fly.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
293
S
117
G
96
Posts: 7,310
Reputation: 71,069

Post » Sat Jul 09, 2016 2:41 pm

Use SDK or cocoon?
I can not play any video in cocoon
B
27
S
7
Posts: 35
Reputation: 1,602


Return to How do I....?

Who is online

Users browsing this forum: 25games, Yahoo [Bot] and 8 guests