Grey Shaders — mobile app

GreyShaders is a mobile application/tool available on the Google and Apple App Stores. It is a demo of several Greyscale Conversion Shaders applied to a test image.

Get it on Google Play

Comments are welcome! Share references and knowledge about color space conversion in the comments section below and I’ll continue to expand this post with relevant updates at the bottom of this post. Enjoy the app!

Humans sense pure Green as brighter than pure Red, and Red is sensed as brighter than Blue. Therefore when we create a greyscale image based on a source color image we derive most of the brightness from the Green channel of the source image, followed by the Red channel, and finally the Blue channel contributes the least to the brightness of the converted image.

This weighted-conversion from color to greyscale can be done using several algorithms that approximate the perceived brightnesses of colors. Some algorithms do a better job of selecting the appropriate greyscale tone to represent the colors in the original image.

The Grey Shader app demonstrates several popular conversion algorithms. Users can toggle between the original full-color image and each shader-modified greyscale version. This allows optimal A/B comparison. More info about the Grey Shader app and each of the GLSL shaders it uses is below. [Read More…]

Bare-Bones Shader Example in Cocos2d-x v.3.2

This is a bare-bones example of a shader in Cocos2d-x v.3.2. It swaps the color channels of the texture image: The Blue channel is drawn in the Red channel, Green in Blue, and Red in Green. See the results here: BasicShaderScreenshot.jpg
[Read More…]

Revelens Video Player Platform for Product Placement Purchasing

I built the video player for the Revelens Product Placement and Purchasing video platform.

The Revelens player allows the viewer to access more content associated with different parts of videos. The video owner connects specific parts of the video with weblinks, allowing product placement in the video to be tied directly to product purchase pages for the products in the video. Video owners may also make links to any kind of additional content their users may want to see that are related to the user’s favorite parts of the video timeline.

Revelens Platform Promo Video

[Read More…]

[Solved] SecurityError #2122 Redirected CDN Video File

We recently encountered SecurityError #2122 when trying to capture BitmapData from a video file. Crossdomain.xml files were being requested as required for using BitmapData.draw on content loaded into a SWF. Everything had been working well until we tried using a video hosted by Vimeo using their Pro service that allows you to use them as a CDN — they deliver video files and you play them in your own player.

[For an excellent background description about this redirect problem, read the posts linked below]

We determined that the media file returned to FlashPlayer was coming from a different domain than the domain we were requesting the video from. We considered detecting the domain of the redirected media file and following up our media file request with a Security.loadPolicyFile call using the new domain. [Read More…]

Debugging Server-hosted SWF with Flash Builder Debug Tools

Over-The-Shoulder Quick Tip

You have a Debug SWF uploaded to your server and want to use Flash Builder’s debugger features on it. You need to debug it from within its server environment for whatever reason. How do you initiate a debugger session in Flash Builder that connects with the debug-enabled SWF running from your server in the browser?

Answer: in Flash Builder’s Debug Configurations panel, set the *URL or path to launch* to “about:Blank”. Launch that debug configuration. Flash Builder begins listening for a debug SWF to be launched. Now launch the html page on the web that is hosting the debug-enabled SWF (in a browser with the debug version of the Flash Player installed). Flash Builder detects the SWF and begins debugging.


Referencing the Video Instance in OSMF (for BitmapData.draw)

Over-The-Shoulder Quick Tip

Accessing VideoSurface in OSMF is useful if you want to capture a snapshot of the playing video, but it can be difficult to locate the video display object. I found a tip in the comments section of a post by Nils Thingvall that helped:

var tVideoSurface : VideoSurface = ( MediaTraitType.DISPLAY_OBJECT ) as DisplayObjectTrait ).displayObject as VideoSurface;
var tBitmapData : BitmapData = new BitmapData( tVideoSurface.width, tVideoSurface.height, true, 0 );
tBitmapData.draw( tVideoSurface );


[UPDATE 03/09/2015] Several readers have reported difficulty capturing BitmapData using this technique despite being able to see the video. If you can play a video but not capture BitmapData from it, chances are you have a problem with security permissions. Check out another post regarding security limitations for help solving that issue:

[Solved] ADT Error: Unexpected Argument –migrate

Over-The-Shoulder Quick Tip

The solution to this error was simple but didn’t reveal itself easily.

The Error:
unexpected argument –migrate

The hyphen/dash is the wrong character! I must have copied/pasted it from somewhere.

The solution was found here:

Sending Images from Flash Player using HTTP POST

Flash Player can send images to web services like Amazon AWS. The built-in behavior requires the user to browse to an image on the user’s system using a system dialog to select the image for sending. It is possible to send an image from Flash Player without requiring the use of a system dialog to locate the image file, and even without the requirement of saving the image to the system before sending it! In fact, images can be sent without any user interaction whatsoever.

In a recent application we developed, we deployed a solution for capturing BitmapData of a playing video and sent the image to Amazon AWS. The thumbnail could be retrieved later for populating a display of the user’s video bookmarks.

  1. Capture a BitmapData object of something being displayed in a SWF – any display object
  2. Convert it to JPG. Several methods are available, we used:
  3. Using HTTP POST, send the image to Amazon (or anywhere) for storage. This is the difficult part. We derived our solution from Open Booth:

[Read More…]

OSMF Media Player with REOPS Extension

Tip 1: playing an FLV from your local machine.
To play a local video you must modify your config XML file to include a baseURL. Otherwise, the video fails to load.
[Read More…]

Accessing Application Descriptor XML on a Mobile Device

When publishing a mobile application with Adobe AIR, it’s possible to access the information in your application’s application descriptor xml file at runtime on a mobile device. Below is an example of accessing the versionNumber and renderMode from the application descriptor.
[Read More…]