Second Try on Augmented Reality

8 03 2011

The previous code i had used was too unstable, it crashes more often than it runs. So searched for a better version of toolkit code and started a code from the scratch rather than using the simplar code. This time the code was much more stable and was able to display more files than the previous version.

[kml_flashembed publishmethod=”static” fversion=”8.0.0″ movie=”http://dreamzalive.net/wp-content/AR/AugmentedReality_v1.swf” width=”400″ height=”300″ targetclass=”flashmovie”]

Get Adobe Flash player

[/kml_flashembed]

The Marker is available here

Update: Fixed problem which prevented the model from displaying in web server. Now a torus should be visible once the marker is shown.





Encoding of images to videos and Upload to web using PHP

29 12 2010

Web programming was never my cup of coffee. Its been always a black-box, which works just some how and should not be tested how :D. As part of my assignments, i was given the “black-box” task of converting a set of images into video, as if that is not enough also have to connect some how to youtube and upload the the account of the users choice.

The best part being all of this needs to be done in Silverlight. This was the first time i was getting to know we could even do programming in silverlight :D. So with the task assigned it was time to execute the unknown. After a bit of consultation with the programmers best friend “the Google”, figured out its easier to use PHP for this process rather than Silverlight. Also Silverlight does integrate with well with PHP .

The encode i chose for the my assignment was the FFMPEG. The advantage of this program other than it being free is that, its cross platform compatible and also all the features of the program can be accessed and manipulated via command line. This is the feature i plan to use as i dint have much time to go into actual video encoding programming. In-order to make sure the images are read in the correct sequence to make into video, the images get named in a specified sequence. Mostly numbers starting from 0, 1 and so on. This is easier to be read from ffmpeg command line method.

The following code can be used to convert images to videos

ffmpeg -r 10 -b 1800 -i %03d.<image_extension> <video_name>.<video_extension>

Where 10 specifies the frame rate , 1800 denotes the bit rate and the images are read in the sequence of 000.jpg or 000.png etc to 001.jpg , 002.jpg etc. This simple one line code would provide with the video in the folder in the same folder.

Next was the video uploading part.  Zend framework provides excellent support when it comes to Video processing with YouTube. The installation of the frameworks is also pretty straightforward.

 

Step 1: Download Zend Framework

Step 2: Add the path of the Zend library to the “php.ini”

Step 3: Enable openssl.dll in “php.ini”

Step 4: Restart server.

And that would be only step up required to install Zend. The samples present along with the Zend provide the code for video upload to YouTube.