Here is a simple Actionscript class that calculates the sunrise and sunset time for given date and coordinates ( latitude , longitude ) . It's based on the algorithm I found on National Oceanic & Atmospheric Administration , and implemented in AS.
It seems to generate accurate results, but I have not tested it extensively..
It needs some improvements (like DST, and solar noon calculation), and I should improve it soon I hope ;).
I'd like to put up an example of usage using google maps in the next few days if I'll have some time for it..
SunriseSunsetCalculator.as
czwartek, 18 marca 2010
wtorek, 9 marca 2010
mp4 h.264 netstream buffering problem
As I was creating a simple video queue class to pre-buffer the video content, I couldn't get the videos to play until the whole movie loaded, the "NetStream.Buffer.Full" was triggered when whole movie downloaded. Setting different values of bufferTime on stream object didn't helped.
The problem as it occurred after some googling, was the encoding. I used h.264 mp4's for all my videos, and in my ignorance I didn't know they act differently from plain old flv.
For h.264 encoded videos to buffer properly "the "moov atom" needs to be located at the beginning of the file. ", as I just discovered in David Hassoun's article "Exploring Flash Player support for high-definition H.264 video and AAC audio" (page 2)
The tools the author pointed to fix the problem are:
Just a quick note from the battlefield ;)
The problem as it occurred after some googling, was the encoding. I used h.264 mp4's for all my videos, and in my ignorance I didn't know they act differently from plain old flv.
For h.264 encoded videos to buffer properly "the "moov atom" needs to be located at the beginning of the file. ", as I just discovered in David Hassoun's article "Exploring Flash Player support for high-definition H.264 video and AAC audio" (page 2)
The tools the author pointed to fix the problem are:
- QTIndexSwapper (Adobe AIR app by Renaun Erickson)
- qt-faststart.c (command-line app by Mike Melanson)
Just a quick note from the battlefield ;)
Subskrybuj:
Posty (Atom)