Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Canvas to Video is very slow on Safari Lion/Mountain Lion

I'm not really sure what is causing this but in the current stable version of safari on OSX 10.7.X I'm only seeing 3-4 frames rendered. I downloaded the lastest safari beta and it seems like they improved it, but its still dropping a large amount of frames.

Here is an demo that should be viewed in Safari on Lion:

http://jsfiddle.net/JEKAh/1/

Please respond if you know why or what is going on

edit: still is a problem on mountain lion

like image 832
Chad Scira Avatar asked Mar 29 '12 16:03

Chad Scira


1 Answers

It turns out that this bug is related to the transfer encoding of the video files. If you are sending the video with Content-Ranges you will see this issue in safari. But if you send the video using Transfer-Encoding: chunked... it will work fine

I used a simple node server to test this: https://gist.github.com/3746561/c303f84866542c4a6ec2956ecf158cb9f492a7a2

-- edit

the above is only a fix for Lion, it appears that Safari Mountain Lion is unable to render frames from a video that is sent using a chunked transfer encoding, a side affect of this is also massive safari memory leaks... I ran a video being piped for canvas for 2 mins and the Safari Web Content process shot up to 12GB of real mem used. -_-

-- edit

after additional research i have found the original issue with standard video to canvas in a recent nightly webkit 537.3 and have confirmed that currently in webkit 537.11 these issues no longer exist... so all i can do is hope that apple updates safari soon including the webkit fixes

-- edit

this is now fixed in OSX 10.9 :)

like image 86
Chad Scira Avatar answered Oct 24 '22 02:10

Chad Scira