Monday, December 22, 2008

INTERACTIVE VIDEO IN FLASH USING F4V H264 VIDEOS WITH FLASH PLAYER 10

INTERACTIVE F4V H264 VIDEO WITH FLASH PLAYER 10

Introduction

This blog article demonstrates how any users using Adobe Creative Suite CS4 or Adobe Flash CS4 Professional can create Interactive H264 Video for Flash player 10 to be viewed by any web browser supporting Flash Player 10 or higher. The following Software (part of Adobe Creative Suite CS4 or bundled with Adobe Flash CS4) as well as a third party Software called Activideo http://shop.actimus.com/ will be used in sequential order.
http://www.adobe.com/technology/graphics/video_visualization_and_interaction.html

1) Adobe Media Encoder CS4 or Adobe Media Encoder CS5

2) Adobe Bridge CS4 or Adobe Media Encoder CS5

3) Third party products such as Activideo (used in this article) or Adobe After Effect CS4 (http://vimeo.com/2345579) and finally

4) Adobe Flash CS4 or even Better Adobe Flash CS5 which support live preview of video on the designer stage

Users don't have to be familiar with Adobe Media Encoder to generate the XMP data but must be familiar with Action Script 3.0 to create the interactive experience inside Flash CS4 or Flash CS5. They can incorporate XMPData Event exposed by the NetStream player class. You must be familiar with mouse click event in Action Script 3 and really fast mouse hit test detection and finally you must be able to execute additionnal Action Script 3 functions.

Interactive user mouse click over specific areas in the video can provide useful web analytic data for the content provider streaming the videos, or lead the user to third party web site, or be able to jump to another position in the same video or a relative FLV or F4V video...

On android OS 2.2 with Flash Player 10.1 user could pause the video and display a popup to jump to various web site.

The time to produce an interactive video can vary from 5 minutes to few hours depending on variable parameters which have more or less impact on the time to complete the interactive presentation.
This time didn't include the encoding time of the H264 Video.
Software with motion tracking engine such as Adobe After Effects will also
facilitate the production of your interactive hot spots.


We are going to focus on one use cases. The first use case will show you step by step how to turn a logo within a Music Video Clip into a functional HyperLink to lead the user to the Television Company Web Site or a landing web page focused on the artist within the Television Company Web Site.


Why Interactive Video


1.Produce interactive banner ads using Flash and H264 F4V Video with persisted link in the Video so that syndicators can target ads for higher returns.

2. Same content used on TV and on the web and now on devices running Android 2.2 OS

3. Produce music or video clip which can lead the user to the content owner or artist web site so that they can earn more revenue.

4. Be able to increase search accuracy of H264 video content for search engine based on URL attached to specific object in time.

5. Provide “hidden” web analytic feedback to company to help them know which object were clicked in the Video by a user when and how many times.

6. Lead the user to other video or segment of the same video when the same object appears.


Music Video Clip Use Case

Step 1 Launch Adobe Media Encoder CS4 - Select Video Source and add to Batch




Step 2 Adobe Media Encoder CS4 - Insert Event Cuepoint for Interactive Sequence SMPTE Time In,

This step is no longer require with the updated version of Activideo. Activideo will generate an XMP file which can be embedded immediately in the Video (no need to merge)



The first step consist of using Adobe Media Encoder CS4 to encode your Video Source into H264 video and provide a list of marker matching each video segment related to each interactive sequences you are willing to produce. In our sample we will only create one sequence so for this manner you just have to provide two event markers.
We pick an mpeg one video clip of an 80's band Europe for there hit The Final Countdown. The reason we are doing this step is to produce a video with embedded XMP track. You can avoid this step if you are using latest version of Activideo (July 2010) but this is better to merge the XMP metadata exported by Activideo with additional Cue Points parameters with the XMP Metadata produced by Adobe Media Encoder.


When you add the source video file to Adobe Media Encoder CS4 batch list you can double click on the preset to be able to open the export settings window panel. From there you can provide in and out cuepoint. You can use the slider to be able to visually detect the beginning of your sequence. In this particular case when the VH1 classic logo appears.

For convenience give each in and out CuePoint a name which will help you associate each interactive sequence during the merging operation. The reason for doing this is that when Adobe Media Encoder will encode the video some XMP Metadata will be inserted in the Video Clip.

Adobe broaden XMP as the standard for embedded metadata to be used for internal and external workflow. In our use case XMP metadata will be used for external usage.

What is XMP ?

1. XMP is based on XML hence grammar can be extended at anytime

2. XMP is used across all Adobe Product for a better workflow

3. XMP can help users to work and collaborate on the same project thanks to the merging capability of XMP Data.

4. Using XMP provide indexation features for triple store engine once XMP data is converted to RDF hence web crawler can perform indexation of any files tagged using Adobe tools or thanks to the public version of XMPCore SDK

5. XMP is embedded in the Video File and remains in the video even if the content is moved or copy from one server to an other.

6. Video and its private data can be delivered in a single connection from Flas Media Server using RTMP protocol as well as from any HTTP server used to provide progressive download and playback mechanism to Flash Player.

7. XMP can be parsed using for x loop in Action Script 3


Step 3 Adobe Media Encoder CS4 - Insert Event Cuepoint for Interactive Sequence SMPTE Time Out




Using the video slider, look for the specific time where the logo will disappear and create an other Event Cuepoint. Once you have set both in and out Cuepoint to define the interval for your interactive sequence, you can Encode the video. To proceed to the next step you will have to wait for the F4V (H264 Video) to be fully encoded. The encoding time will vary based on your CPU speed. It is highly recommended to do
H264 encoding on Multi Core Computer or really fast single core CPU. It is also highly recommended to encode using Adobe Media Encoder for a valid interactive video use case. Doing that will ensure that correct XMP data will be embedded in the Video and this will also reserve some space in the beginning of the video to be able later on to merge Interactive XMP data with XMP Data previously embedded in the Video.

Step 4 Adobe Media Encoder CS4 - Encode F4V H264 Video for Flash Player 10




Encoding Process. All encoding and scrubbing for In and Out time code tasks to reserve Cuepoint entries for Video footage can be done by one person while an other person will generate the Interactive Data aimed to be merge at the end of encoding workflow.

Produce Interactive Sequence for a static area using Activideo




When it comes to generate fast interactive sequences for static area I really like to use Activideo. But don't get me wrong here, Interactive Sequence don't have to be static. Activideo is a software created by a small company Actimus which can help you generate all what you need to produce the raw data needed for an interactive video experience. For more information about Activideo visit http://shop.actimus.com/ and to see how it work visit http://shop.actimus.com/demo/howitworks/. Some video tutorials are also available to explain you how to use Activideo
http://shop.actimus.com/demo/tutorials/


Activideo is a fast and easy way to turn your videos into interactive presentations thanks to the export of well known Adobe XMP Metadata container. Activideo adds interactive hot spots (also called overlay sequences) to your videos. It is a simple but powerful concept: user-created hyperlinks within the video at various intervals and for specific areas in the video the same way hypertext is used on the Internet. These hyperlinks and interactive hotspots are exported into Adobe XMP RDF XML file format. Activideo could also produce Adobe Flash CS4 Action script 3 file along with a FLA and HTML template to be able to build your custom SWF with Adobe Flash CS4 thanks to a Plugin SDK.

Input Formats:

Activideo supports many input video file formats mostly any file format supported by the Direct Show software stack. Today, it currently supports MPEG1, MPEG2*, MPEG2-TS* transport streams including HD (720, 1080), DivX*, Microsoft AVI, Microsoft WMV* and WMV-HD * and Blueray * m2ts file. Activideo never modifies the original source video neither encode a Video. This tasks is left to Adobe Media Encoder and Adobe Bridge CS4 bundled with Adobe Flash CS4 Pro

Overlays:

The outlining of the overlay sequences is very precise because Activideo supports polygons with up to 100 vertices within a sequence. It performs linear interpolation of each vertex to transition smoothly from one shape to another. While the video is playing into Activideo, the user can move the current polygon location with the mouse visually to match any portion of the video associated and covered by polygon (and polygon are not visible on top of the final encoded Video. This is a human intervention process but it can be automated if the user doesn't plan to move the object on screen thanks to a very functional Wizard well suited to create a unique sequence and for example turn a logo encoded in the video into an hyperlink. To ease the overlay authoring process, a static logo sequence can be generate using the Creation Wizard.

Applications:

With Activideo, users can add interactive hotspot to their videos. Since the XMP data can be embedded into the Video using Adobe Media Encoder CS4/CS5 or Adobe Bridge CS4/CS4 the hyperlink will always moved whenever the Video is duplicated acting as a watermark for your video. It also provides a way to publish interactive Ads Banner using FLV or H264 video. Activideo will not encode video but just export XMP file using Adobe Flash CS4 FLV Cuepoint RDF grammar. The generated XMP metadata can be merged and embedded into FLV or F4V Video using Adobe Media Encoder or Adobe Bridge CS4. FLV or H264 Video can be encoded using Adobe Media Encoder or Elecard converter studio.

Demo version:
Yes : Export of XMP
No : Project saving.
Yes : Wizard to create an interactive sequence available.
21 days of evaluation.

It will take you 2 minutes to generate a simple interactive sequence for a static logo but you can create complex sequence to match moving objects in the video.

Full version:
Yes : Export XMP
Yes : Access to self registered COM Export Plug-ins available through Export As Menu
No activation required.

Although this use cases is focused on demonstrating how XMP can be used in H264 video for hyperlinks, Activideo can also provide Manual selection and on screen positioning of shapes on top of the video while the video is playing usefull when object are moving. Activideo support linear interpolation between shapes with the same amount of vertices set by default for all the sequences.

When you launch Activideo you will browse for the same Video Source you used to produce an H264 Video with Adobe Media Encoder CS4. Note that this use case will work only if the Video Size of your Encoded Video is the exact same size than
your Video Source. This is mandatory because we want all the Interactive Sequence coordinate in pixel to match the source and encoded video as well in term of duration and dimension.

Step 5 Activideo - Using the New project Wizard Option from the File Menu




Step 6 Activideo - Browse Video Source




Step 7 Activideo - Provide Basic Metadata




Step 8 Activideo - Interactive Sequence Generator



Provide a unique Name for your sequence to easily identify each interactive Sequence in your exported XMP file.

Provide an hyperlink. This can be relative path, absolute link to a fully qualify domain name URL or can be some sort of data which could be executed or interpreted using Action Script 3 code.

Provide a default location for your interactive hotspot. This is where you provide the default initial location of your hotspot. This position don't have to be accurate but this will accelerate the sequence tuning process.

Provide the initial size of your interactive hotspot.

Provide the number of key frame that you want for your interactive sequence. Since your hotspot is not going to move two keyframes are enough but you can insert more key frame if needed. Adding keyframe at this time is not really helpful since you want a keyframe to be set/added whenever the object within the sequence is likely to move in a different direction than the direction between two consecutive keyframes surrounding a specific frame within the sequence.


Step 9 Activideo - Click on Finish to Generate the Sequence



Step 10 Activideo - Adjust the sequence SMPTE In Time Code to Match Adobe Media Encoder SMPTE In Time Code



Use the video slider to locate the position where you set the In Event Cuepoint in Adobe Media Encoder. This time didn't have to be exactly perfect but close enough to be able to merge correct 2D spatial information in the XMP Data embedded in the H264 version of the video.Once you found the location you can select the overlay polygon move it right on top of the logo and adjust the size of the polygon using the right click button of your mouse to scale down or up the polygon. Finaly click in the toolbar on the trim before button. This will insert a keyframe and remove all keyframe prior to the current position.




Step 11 Activideo - Adjust the sequence SMPTE Out Time Code to Match Adobe Media Encoder SMPTE Out Time Code




In this frame you noticed an other block of data showing the Name of the Band, the track title and information related to the right owner of the content. A valid use case would be to create hyperlinks sequence for all of the content listed earlier to lead the user to multiple unique URL's.

For this ending sequence position select the trim after button in the toolbar. This will insert a keyframe and delete all following keyframes.

Step 12 Activideo - Export Adobe XMP



This option let you export the interactive video sequence into an Adobe XMP file




Adobe Bridge CS4 - Exporting and Merging XMP

Step 13 Adobe Bridge CS4 - Exporting XMP From F4V




There are several places where you can merge XMP Metadata using software installed with Adobe CS4 professional. The easiest way is to use Adobe Bridge CS4. Once you launch Adobe Bridge CS4 select the folder where you encode the H264 Video and right click on the F4V logo and choose File info...




Select the property sheet page named Raw Data. This is where the XMP Block is display in its RAW form. The highlighted text correspond to the AME Track for the unique interactive sequence matching the logo. Export the complete XMP data as a file to disk.








Step 14 Adobe Bridge CS4 - Merging XMP Data between Activideo XMP and the XMP data encoded earlier in the F4V Video.

The best free tool to merge XMP Data that I like to use is called WinMerge. It provides the ability to merge left or right using a double paned window view but notepad can be good enough :) in our example. A commercial version called araxis merge is also really good.



You want to merge the selected bloc in the left notepad window to the right bloc under the selected text in the right notepad loading the previously exported XMP. Don't forget to include the marker as well. Do this for every cuepoints. Once done saved you new XMP file. If you want to compel with XMP you can insert new saving history entry to show in the XMP File that a new software has been used to generate interactive hotspot. This is not a bad idea at all for workflow and tracking purposes.

Step 15 Adobe Bridge CS4 - Re-import XMP Data into F4V video file encoded by Adobe Media Encoder CS4







Because we merged manually we can choose the clear existing properties and replace with template properties.






Step 16 Adobe Flash CS4 - Create Interactive FLA Project file and generate SWF

While I understood that Activideo software has a plugin model which should provide solutions to export XMP the way you want I decided to create a FLA project and Action Script 3 code to quickly manipulate the XMP data to do something with the interactive XMP track.

1 Create an Action Script 3 project and saved the project to activideo.fla

2 Create two customs mouse cursor in order to change the mouse cursor when the mouse will be over a hotspot and one cursor when the mouse will be outside

3 Write some code to load XMP data in memory and last but not least

4 Write very fast polygon hit test detection code in Action Script 3 to detect when the mouse is in a Polygon.




The idea behind the scene would be to write an activideo plugin to generate a FLA which should be attached with a separate Action Script file and a separate XML file. The separate XML file could be used by the action script code to load the video source (local or relative path next to the SWF, http URL or rtmp URL). You can also export various interactive video related parameters specific to the Interactive Video Flash experience you want to deliver to your audience. An interactive video playback control must be self contained and the SWF must be as small as possible.
For ads you should not need any FLVPlayback Component Skins at all.

Actimus LLC is currently working on expanding JW Player and add support to parse XMP data describing Interactive Hotspot. This is a great move since many users want to experience the end result. Since JW player has been embedded in millions of Web Pages this is a great move for Activideo.



Step 17 Adobe Flash CS4 - Publish Setting

Make sure your publish setting is targeting Flash Player 10 since XMP Data is only available in Flash Player 10. If you target Flash Player 9 flash player 9 won't be able to pre-load the embedded XMP Data but your SWF will still work. This is what i like with Flash. A SWF generated for Player 9 will still be rendered with Flash PLayer 6. You are just going to miss few elements on screen.



Step 18 Adobe Flash CS4 - Publish SWF



The onXMPData is the Action Script Event Handler which will receive the XMP Raw Data when the Video will be playback. At this point you can build your SWF and test your movie. Make sure that the video is copied next to the FLA and by extension next to the SWF after publishing time unless you provide a custom path in an XML file or in your Action Script Code at runtime. Finally Test your Movie. The custom cursor are build in the FLA project. You can import your own cursor using the Photoshop Importer feature in Flash CS4. You can import transparent PSD and convert each graphic object into a movie clip. When you test the movie, the cursor will show an interactive cursor (hand cursor) when the mouse will be over the interactive hotspot and a standard cursor when the mouse will leave the hotspot. From now on do what you want when clicking in the hotspot !

Good Practice. You can edit the Action Script Code and add some code to auto loop your video (good for ads), you can add some code to turn Audio Off in order not to playback any audio from the Video and decide that you just want to render the video useful for interactive banner.

Actimus is working on a custom FLV and F4V Playback component which will support embedded interactive XMP sequences.
If you are interested in helping writing custom Playback Component send me an email through the following web site http://www.thomasyounsi.com/

Step 19 Adobe Flash CS4 - Test Movie

Outside Interactive Hotspot





Inside Interactive Hotspot



Step 20 Adobe Flash CS4 - Publish to the web

You will have to upload the F4V next to your SWF or change the local remote path with an http URL.

Publish and stream with FMS 3.0

You will have to change the local file path with an RTMP URL

Finally last but not least the beauty of XMP is that data can be injected on demand
straight into Flash Media Server, rather than having XMP permanently encoded into
the video this is why having the XMP as a separate file is also a valid use case.
On the other hand you can use a naming convention for each Key/Value Pair you want to add at the end of an XMP block in order to support multiple language or multiple condition. The only important thing is to make sure to append custom key/value pair string after the list of coordinates for each polygon belonging to an interactive sequence at a specific key frame. You can also keep the XMP files separate from the video if you want too by just exporting the XMP from the video after it has been added. You could use Flash remoting solution to deliver XMP as AMF objects from a web server using ColdFusion and PHP for instance :)

A new article to explain how to convert XMP Cuepoint time into Millisecond

http://younsi.blogspot.com/2009/02/how-to-convert-xmp-cuepoint-time-to.html

Adding Google Analytics

Google Analytics Hook into your SWF very usefull to report analytics when user click on an interactive hotspot in the video

import com.google.analytics.AnalyticsTracker;
import com.google.analytics.GATracker;
var tracker:AnalyticsTracker = new GATracker( this, "UA-111-222", "AS3", true );
playGame.addEventListener( MouseEvent.CLICK, onButtonClick );
function onButtonClick ( event:Event ):void
{
tracker.trackPageview("/myGame1");
}

In the following example, a movie clip called playGame exists on the stage. A new tracking object called tracker is created along with an event handler that listens for a mouse click. When the button is clicked, the onButtonClick function is called. For each click, the trackPageview() method increments the pageview count for the virtual page /myGame1.

http://www.google.com/analytics/
http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55520
http://www.adobe.com/devnet/flash/articles/google_analytics_flash.html
http://code.google.com/p/gaforflash/
http://code.google.com/apis/analytics/docs/flashTrackingIntro.html
http://code.google.com/apis/analytics/docs/flashTrackingSetupFlash.html#useAnalyticsLibrary

Enjoy !

More reference about interactive video at Adobe and third party tools

XMPCore http://partners.adobe.com/public/developer/xmp/topic.html

XMP http://www.adobe.com/devnet/xmp/

Flash CS4 Video Playback http://www.adobe.com/devnet/flash/articles/flvplayback_fplayer9u3_04.html

Interactive Hotspot using After Effect

http://blogs.adobe.com/keyframes/2007/10/creating_interactive_video_wit.html

Activideo http://www.actimus.com/
How to receive XMP data using FLVPlayback Component
http://younsi.blogspot.com/2010/01/how-to-retrieve-xmp-cuepoint-for.html

FLV and F4V http://en.wikipedia.org/wiki/Flash_Video

XMP http://en.wikipedia.org/wiki/Extensible_Metadata_Platform


Xcitex Pro Analyst Motion Tracker http://www.xcitex.com/html/proanalyst_description.php

Free Action Script 3 Interactive "FLVPlayback" Component for Flash CS5

http://shop.actimus.com/product_info.php?products_id=122

Thursday, December 18, 2008

How to detect if Visual Studio 2008 SP1 is installed on a machine

You can also determine the service pack level of a more general, larger scope by reading a REG_DWORD registry value named SP from under :

HKEY_LOCAL_MACHINE\Software\Microsoft\DevDiv\[ProductFamily]\Servicing\9.0\

VSTD for Visual Studio 2008 Team Edition
Look for SP or SPIndex DWORD key 1 means installed 0 means not installed

Turn off intellisense in Visual Studio 2008

While writting a complex macro is one thing, the quickest way to turn intellisense off forever is to rename C:\Program Files\Microsoft Visual Studio 9.0\VC\vcpackages\feacp.dll to feacp.dll.old. Seams to work fine with the VC++ IDE

If you want autocompletion purchase Visual Assist which is doing an awesome job for C++

http://www.wholetomato.com/

Tuesday, December 16, 2008

Setting Flex builder 3 to debug your swf with Flash CS4 and Flash CS3 installed

When you want to debug your application using Flex Builder 3
and if you have Flash CS4 installed as well as an older version of FLash CS3
you will see a dialog saying that C:\Program Files\Adobe\Adobe Flash CS4\Players\FlashPlayer.exe is not the version suitable to debug your SWF.
To fix this issue exit Flex Builder, backup your C:\Program Files\Adobe\Adobe Flash CS4\Players\FlashPlayer.exe and C:\Program Files\Adobe\Adobe Flash CS4\Players\Flash Player.app folder then copy C:\Program Files\Adobe\Adobe Flash CS4\Players\Debug to C:\Program Files\Adobe\Adobe Flash CS4\Players\.

Flex Builder 3 didn't map the right path to Debug\FlashPlayer.exe

Monday, December 08, 2008

Christmas bash party 2008 playlist

- Music Sounds Better With You - Stardust
- Hey Ya - OutKast - Speakerboxx the love below
- One Bourbon, One Scotch, One Beer John Lee Hooker 20th Century Masters The
Millenium Collection
- Get This Party Started - Pink
- I Want to Hug You - John Lee Hooker - Mr Lucky
- Sing It Back - Moloko
- Sister Sledge - We Are Family
- 4 minutes - Madonna feat justin timberlake and_timbaland
- Business Time - Flight of the Conchords - The Distant Future
- Here Comes Santa Claus - Elvis Presley - Elvis Christmas Holiday
- Talk Is Cheap - Toasters - The Skaboom!
- Drop You Off - Dimmer - I Believe You Are a Star
- Frosty the Snowman - Jimmy Durante-20th Century Masters The Millennium Collection Season's Greetings (Box Set)
- Don't stop Believin - Journey
- Tell Me 'Bout It-Joss Stone - Tell Me 'Bout It - Single
- Better - Guns n' Roses
- All summer long - Kid rock
- Don't Stop The Music - Rihanna
- All Night - Damian Marley & Stephen Marley - Welcome to Jamrock
- Short Skirt Long Jacket - Cake - Comfort Eagle
- Silver Bells - Dean Martin - Christmas With Dino
- Angel - Shaggy & Rayvon - Hot Shot
- Keep Hope Alive - The Crystal Method - Vegas
- Rudolph the Red - Nosed Reindeer - Burl Ives - Have a Holly Jolly Christmas
- Mysterious Girl - Peter Andre
- Can't Get Used to Losing You - The English Beat - Beat This The Best of the English Beat
- Do That There (The Young Einstein Hoo-Hoo Mix) - Lyrics Born - Same !@#$ Different Day
- Lose Yourself - Eminem - 8 Mile (Soundtrack from the Motion Picture)
- White Christmas (1947 Single) - Bing Crosby - White Christmas
- Doors of Your Heart - The English Beat - Beat This The Best of the English Beat
- Roll It Up - The Crystal Method - Tweekend
- Santa Claus Is Comin' to Town - Alvin & The Chipmunks-Merry Christmas from the Chipmunks
- Blue Christmas - Elvis Presley - Elvis Christmas Holiday
- Drop You Off - Dimmer - I Believe You Are a Star
- Walk This Land (Lock Stock Full Length Mix)- EZ Rollers - Storm from the East
- Mambo No.5 (a Little Bit Of...) - Lou Bega
- It Wasn't Me - Shaggy - Hot Shot
- Let It Snow, Let It Snow, Let It Snow - Michael Bubl‚ - Let It Snow!
- Shake It Off (Bad Dream Part II) - Same !@#$ Different Day
- Where Do I Begin - The Chemical Brothers - Dig Your Own Hole
- Santa Claus Is Comin To Town-Frank Sinatra - The Polar Express
- Part Of The Process - Morcheeba
- Shake It Baby - John Lee Hooker - 20th Century Masters The Millenium Collection
- A Holly Jolly Christmas - Burl Ives - Have a Holly Jolly Christmas
- Children - Dave Dorell
- Luv Me, Luv Me - Shaggy & Samantha Cole - Hot Shot
- Wonderful Night - Fatboy Slim - Palookaville
- America, F__k Yeah - Team America - Team America - World Police (Soundtrack from the Motion Picture)
- Mercy - Deffy
- Rudolph the Red Nosed Reindeer - Jack Johnson - This Warm December Brushfire Holiday'sVol1
- Save It For Later - The English Beat - Beat This! The Best of the English Beat
- Long Train Runnin' - The Doobie Brothers
- Disturbia - Rihanna
- Ring of fire - Johnny Cash
- Temperature - Sean Paul
- Kelis - Milkshake
- Gimme The Light - Sean Paul
- Jingle Bell Rock - Straight No Chaser - Holiday Spirits (Bonus Track Version)
- Short Change - EZ Rollers - Weekend World Dance
- If this aint love - Spiller groovejet
- Tequila - Alt and the lost civilisation
- Night Train - Alvino Rey Bachelor Pad Royale Ultra LoungeVol4
- Short Change - EZ Rollers - Weekend World
- Supermassive Black Hole - Muse-Black Holes and Revelations
- The Bay (Feat. C. Holiday and the Poets of Rhythm)
- Callin' Out Remix (Feat. E-40 and Casual)
- Feel Alright - Albino! - Rhino World
- The Beast - Milt Buckner - Bachelor Pad Royale Ultra LoungeVol4
- World Hold On (Extended Radio Edit) - Bob Sinclar - Bob Sinclar
- Superstar - Jamelia
- Steady As She Goes - The Raconteurs - Anywhere Anytime Outdoor Conditioning Alternative
- What Makes The Monkey Dance - Chuck Prophet - No Other Love Rock
- Demon_days - Gorillaz
- Son Of A Preacher Man - Dusty Springfield - Pulp Fiction Soundtrack
- Where Do I Begin - The Chemical Brothers - Dig Your Own Hole Electronic
- Peace On Earth Little Drummer Boy - Bing Crosby & David Bowie-Bing Crosby - Christmas Classics
- Should I - Rihanna
- If You're Into It - Flight of the Conchords - The Distant Future
- The Champs - Tequila
- Ms Jackson - Outkast
- It Must Be Love - Madness - Madness Ultimate Collection
- Jingle Bell Rock - Bobby Helms & The Anita Kerr Singers - 20th Century Masters -The Millennium Collection Season's Greeting (Box Set)
- Return of the mack - 4 strings feat mack
- Sleigh Ride - Ella Fitzgerald - Ella Wishes You a Swinging Christmas
- Stand By Me - Ben E. King
- Just A Gigolo - David Lee Roth
- Chumbawamba - Tubthumping
- Winter Wonderland - Tony Bennett - A Swingin' Christmas (feat. The Count Basie Big Band)
- La bamba - Los Lobos
- Play that funky music - Wild Cherry
- I m So Excited - The Pointer Sisters
- Merry Christmas Baby - Sheryl Crow with Eric Clapton
- Sex bomb - Tom Jones
- Lose Yourself - Eminem - The Single Box Set
- Without Me (Album Version) - Eminem - The Singles BoxSet
- Girls got rhythm - ACDC
- Crazy Seal Cover - Alanis Morissette
- White Wedding (Part 1) - Billy Idol - Greatest Hits
- Block Rockin' Beats - Chemical Brothers
- Music Sounds Better With You - Daft Punk and Stardust
- Every You Every Me - Cruel Intentions - Placebo
- One More Time - Daft Punk
- Fergie - Glamorous
- La La - Ashlee Simpson
- Santa Baby - Cynthia Basinet
- Madonna - Hung Up (Radio Version)
- Monkey Business - Black Eyed Peas - Pump It
- Et c'est parti - Nadya
- Promiscious - Nelly Furtado Ft Timberland
- So What - Pink
- Shut Up and Drive - Rihanna
- Maria Maria (Wyclef Remix) - Santana - Maria Maria
- All Summer Long - The Rock Heroes

- Preservation Hall Jazz Band From New Orleans

Flash CS4 to Flash Media Server 3 publication for RTMP

If you have not worked with Flash before you will probably find that using the Flash Media Server (FMS) is not as easy. Because FMS provides a full-blown application development environment based on Flash there are a lot more options you can choose.
The following tutorial will illustrate a very simple, stripped-down method to publish a video via FMS and should not be taken as the definitive way you should publish your content. For the purposes of this tutorial you should have:
• Licensed copy of Macromedia (Now part of Adobe) Dreamweaver 8 (or higher)
I now recommend Flash CS3 or Flash CS4
• Licensed copy of Macromedia Flash and Flash Video Encoder (version 8 or higher) bundle with Flash CS3 or Adobe Media Encoder bundle with Flash CS4
The basic process for encoding and publishing your video files is:
1. Request an application directory on the servers for your project.
2. Encode your video or audio into the Flash Video format using the Flash Video Encoder. Other tools may work but are beyond the scope of this tutorial.
3. Copy the encoded file(s) to the content directory
4. Publish the URL(s) to your content so clients can find it.

There are two use cases. The most common use case is to request an application directory on the media server(s) the video is supposed to come from. In most of the case team managing Flash Media Server are remote from the development site. In this case most of the time application directory are provided through email or web services which provide HTTP and/or FTP access to upload and later on deliver your files through HTTP or RTMP protocol. Generally, the path will look something like:
\\my.fullyqualidieddomainname.zzz\wmsroot$\\
This is the UNC path to your area and in some cases for company using inter office extranet can be accessed via Windows Explorer or SMB. You can even map a network drive letter to it if you'd like. The portion of the above path is a unique name given to your project and will be used to refer to your content later.
The second use case would be to upload to a local FMS in case you are running Flash CS4 and FMS on the same production machine


Generally speaking.
The first step is to encode your video files. This is done using Adobe Media Encoder in Flash CS4 and this operation is done during the the import video wizard process or running Adobe Media Encoder in stand alone mode.
Open the application and add a new video file to the queue by dragging the source video to the queue window. Then click Settings for each batch entry in case you want to change the video encoding profile.
Finally, you should click the Start Queue button to begin encoding your video(s). Depending on the size and quality of the video and the speed of your computer the encoding process can take a very long time. Once the encoding process is finished you can close Adobe Media Encoder.
Now that your video is encoded most of the time you create a new project, insert an FLVPlayback Component on the stage and then associate a video URL to the video component. This path can be a local path, an http URL or an RTMP url.

Every file should be copied to the application directory on the streaming media server (local test server) as well as remote server.
For this tutorial you should copy the file using a path structure similar to this:
\\myfullyqualidieddomainname.zzz\wmsroot$\myappdir\streams\100k\testvid.flv
You will need to create the streams and 100k directories before you can copy the video file (testvid.flv in this example).
Once you have created the directory structure and copied your video file to the FMS server, you need to create a special file called main.asc at the root of the application directory to tell the FMS server how to serve your content.

The easiest way to do this right now is to use Macromedia Dreamweaver to embed a Flash player into a web page and let it create the main.asc file for you. To do this, open Macromedia Dreamweaver 8 and create a new HTML page:
The most important fields on the Insert Flash Video window that you need to change are:
Video Type: Change this to Streaming Video. If you fail to change this to Streaming Video the .flv video file will be streamed from a web server and not the FMS server. This is called progressive streaming and is not the same as using FMS.
Server URI: rtmp://wms.myfullyqualidieddomainname.zzz /myappdir/100k . This is the base URI that the Flash video player will use to construct the path to the video. Do not add the streams portion of the path to the URI. For example, the physical path might be
\\wms.myfullyqualidieddomainname.zzz /myappdir/streams/100k/myvideo.flv
but the correct rtmp path would be
rtmp://www.myfullyqualidieddomainname.zzz/myappdir/100k/myvideo.flv
Adding the streams portion of the path to the URI like this
rtmp://www.myfullyqualidieddomainname.zzz /myappdir/streams/100k/myvideo.flv
would be incorrect.
It is very important that you use the correct URI or else the stream will not work.
Stream name: This is the name of the video file (vidtest.flv in this case).
The other fields can be left blank or modified as you see fit.

Save the file.
By using Dreamweaver to insert the video player all the hard work of creating the embedded video player and the main.asc file has been done for you. Now all that remains is to copy the main.asc file to the root of your FMS application directory:
\\myfullyqualidieddomainname.zzz \wmsroot$\myappdir\main.asc
and publishing the Dreamweaver site to a web server of your choice (www.myfullyqualidieddomainname.zzz).

The main.asc file is a simple template Flash Action Script document that helps FMS to feed the video file to the client when a request comes in. It must exist at the root of your FMS application directory in order for streaming to work correctly.
You can do a lot within the main.asc file such as security checking and automatic bandwidth detection. Using these advanced features require programming and are beyond the scope of this tutorial. A good place to start looking for further information would be the Adobe Flash Media Server Developer Center. Now all that remains is for you to open the HTML page from your webserver and check that the Flash video plays correctly. If you entered everything correctly and placed the files in the right places then you should see an embedded flash video player in your browser window with your video playing within it. If all you see is a blank HTML page then it's likely that you mistyped the rtmp path or file name incorrectly.

Finally if your Flash Media Server is running under Windows Server 2003 make sure to open port 1935 and port 443.

When the Flash Player encounters the connect() method, it attempts to connect to your FMS following a very specific pattern. It first attempts to connect over port 1935, then port 433, then port 80 and then it automatically attempts to tunnel through by sending rtmp data over http also called RTMPT it turns out the automatic sequence of attempts is fine for many situations however you may find that some users can't make a connection (well , the NetConnection can't) because their firewall (hardware) blocks data from traveling through port 1935. If those users can connect to any website surely they can use port 80 and even if their setup blocks rtmp surely they can use RTMPT over port 80 because its really just plain http ...

To force the flash player to try to connect through a specific port other than the defaults as specified above.....write rtmp as ....my_nc.connect("rtmp:://mydomain.com:8500/video);

Note for Flash Media Server:

It is possible that the default Adaptor.xml file has port 19350.
You can change this port but be carefull not to take
1935 which may result in conflict with the external port which clients (FlashPlayer) uses to connect to FMS, which is also 1935 by default

To change this port goto C:\Program Files\..\"Flash Media Server 3"\conf\_defaultRoot_\adaptor.xml and change 19350 to an other prot

Finally make sure you open this port locally in you FireWall and 1935 from outbound to inboud traffic

The change in adaptor.xml can be done around the following block :

${ADAPTOR.HOSTPORT}


${ADAPTOR.HOSTPORT}


Stop Flash Media Server and Restart the server.

Remember that a user might not connect remotely if the server hosting Flash Media Server is blocking port 1935

If you want to play an MP4/H264 MOV or F4V make sure you add mp4: before the video file name EG:
rtmp://localhost/vod/mp4:480p.f4v

You may be interested to read more about interactive video in Flash CS4 as well

http://younsi.blogspot.com/2008/12/interactive-video-in-flash-using-f4v.html

Tuesday, December 02, 2008

MFC and Standard CRT Runtime Conflict

When linking an exe with many dependencies one useful thing to do to make sure the links paths are correct is to
add /verbose:lib under the Project Property Page under Linker in the Command Line Additionnal Options text field (Visual Studio 2008). Doing this will output the full path of each library loaded by the linker when the linker will build your final binary (EXE, DLL for instance).

It is also important to make sure not to mix MFC and non MFC runtime. Many time even if you are not using MFC you can generate a static library using the MFC runtime in order to avoid those anoying nodefault library line.

A LNK2005 error occurs when the CRT library and MFC libraries are linked in the wrong order in Visual C++
View products that this article applies to.
This article was previously published under Q148652
On This Page

* SYMPTOMS
* CAUSE
* RESOLUTION
o Solution One: Force Linker to Link Libraries in Correct Order
o Solution Two: Locate and Correct the Problem Module
* STATUS
* MORE INFORMATION
o Steps to Reproduce the Problem in Visual C++ .NET

Expand all | Collapse all
SYMPTOMS
When the C Run-Time (CRT) library and Microsoft Foundation Class (MFC) librarie...
When the C Run-Time (CRT) library and Microsoft Foundation Class (MFC) libraries are linked in the wrong order, you may receive one of the following LNK2005 errors:
nafxcwd.lib(afxmem.obj) : error LNK2005:
"void * __cdecl operator new(unsigned int)"(??2@YAPAXI@Z) already
defined in LIBCMTD.lib(new.obj)
nafxcwd.lib(afxmem.obj) : error LNK2005:
"void __cdecl operator delete(void *)"(??3@YAXPAX@Z) already defined
in LIBCMTD.lib(dbgnew.obj)
nafxcwd.lib(afxmem.obj) : error LNK2005:
"void * __cdecl operator new(unsigned int,int,char const *,int)"
(??2@YAPAXIHPBDH@Z) already defined in LIBCMTD.lib(dbgnew.obj)
mfcs40d.lib(dllmodul.obj): error LNK2005: _DllMain@12 already defined in
MSVCRTD.LIB (dllmain.obj)
mfcs42d.lib(dllmodul.obj): error LNK2005: _DllMain@12 already defined in
msvcrtd.lib(dllmain.obj)
Back to the top
CAUSE
The CRT libraries use weak external linkage for the new, delete, and DllMain fu...
The CRT libraries use weak external linkage for the new, delete, and DllMain functions. The MFC libraries also contain new, delete, and DllMain functions. These functions require the MFC libraries to be linked before the CRT library is linked.

Back to the top
RESOLUTION
There are two ways to resolve this problem. The first solution involves forcing...
There are two ways to resolve this problem. The first solution involves forcing the linker to link the libraries in the correct order. The second solution allows you to find the module that is causing the problem and to correct it.

Note The following steps are based on Visual C++ 6.0.
Back to the top
Solution One: Force Linker to Link Libraries in Correct Order

1. On the Project menu, click Settings.
2. In the Settings For view of the Project Settings dialog box, click to select the project configuration that is getting the link errors.
3. On the Link tab, click to select Input in the Category combo box.
4. In the Ignore libraries box, insert the library names (for example, Nafxcwd.lib;Libcmtd.lib).

Note The linker command-line equivalent in /NOD:.
5. In the Object/library modules box, insert the library names. You must make sure that these are listed in order and as the first two libraries in the line (for example, Nafxcwd.lib Libcmtd.lib).

To set this option in Visual C++ .NET, read the "Setting Visual C++ Project Properties" online help topic.
Back to the top
Solution Two: Locate and Correct the Problem Module
To view the current library link order, follow these steps:

1. On the Project menu, click Settings.
2. In the Settings For view of the Project Settings dialog box, click to select the project configuration that is getting the link errors.
3. On the Link tab, type /verbose:lib in the Project Options box.
4. Rebuild your project. The libraries will be listed in the output window during the linking process.

Back to the top
STATUS
This behavior is by design.
This behavior is by design.
Back to the top
MORE INFORMATION
When you use the MFC libraries, you must make sure that they are linked before...
When you use the MFC libraries, you must make sure that they are linked before the CRT library is linked. You can do this by making sure that every file in your project includes Msdev\Mfc\Include\Afx.h first, either directly (#include ) or indirectly (#include ). The Afx.h include file forces the correct order of the libraries, by using the #pragma comment (lib,"") directive.

If the source file has a .c extension, or the file has a .cpp extension but does not use MFC, you can create and include a small header file (Forcelib.h) at the top of the module. This new header makes sure that thelibrary search order is correct.

Visual C++ does not contain this header file. To create this file, follow these steps:

1. Open Msdev\Mfc\Include\Afx.h.
2. Select the lines between #ifndef _AFX_NOFORCE_LIBS and #endif //!_AFX_NOFORCE_LIBS.
3. Copy the selection to the Windows Clipboard.
4. Create a new text file.
5. Paste the contents of the Clipboard into this new file.
6. Save the file as Msdev\Mfc\Include\Forcelib.h.


APPLIES TO

* Microsoft Visual C++ 2008 Express Edition
* Microsoft Visual C++ 4.0 Standard Edition
* Microsoft Visual C++ 4.1 Subscription
* Microsoft Visual C++ 5.0 Enterprise Edition
* Microsoft Visual C++ 6.0 Enterprise Edition
* Microsoft Visual C++ 5.0 Professional Edition
* Microsoft Visual C++ 6.0 Professional Edition
* Microsoft Visual C++, 32-bit Learning Edition 6.0
* Microsoft Visual C++ .NET 2002 Standard Edition
* Microsoft Visual C++ .NET 2003 Standard Edition

http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q148652

Wednesday, November 26, 2008

w3c mimetype tired of looking for them when i need them

# This is a comment. I love comments.

# This file controls what Internet media types are sent to the client for
# given file extension(s). Sending the correct media type to the client
# is important so they know how to handle the content of the file.
# Extra types can either be added here or by using an AddType directive
# in your config files. For more information about Internet media types,
# please read RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type
# registry is at .

# MIME type Extensions
application/activemessage
application/andrew-inset ez
application/applefile
application/atom+xml atom
application/atomcat+xml atomcat
application/atomicmail
application/atomsvc+xml atomsvc
application/auth-policy+xml
application/batch-smtp
application/beep+xml
application/cals-1840
application/ccxml+xml ccxml
application/cellml+xml
application/cnrp+xml
application/commonground
application/conference-info+xml
application/cpl+xml
application/csta+xml
application/cstadata+xml
application/cybercash
application/davmount+xml davmount
application/dca-rft
application/dec-dx
application/dialog-info+xml
application/dicom
application/dns
application/dvcs
application/ecmascript ecma
application/edi-consent
application/edi-x12
application/edifact
application/epp+xml
application/eshop
application/fastinfoset
application/fastsoap
application/fits
application/font-tdpfr pfr
application/h224
application/http
application/hyperstudio stk
application/iges
application/im-iscomposing+xml
application/index
application/index.cmd
application/index.obj
application/index.response
application/index.vnd
application/iotp
application/ipp
application/isup
application/javascript js
application/json json
application/kpml-request+xml
application/kpml-response+xml
application/mac-binhex40 hqx
application/mac-compactpro cpt
application/macwriteii
application/marc mrc
application/mathematica ma nb mb
application/mathml+xml mathml
application/mbms-associated-procedure-description+xml
application/mbms-deregister+xml
application/mbms-envelope+xml
application/mbms-msk+xml
application/mbms-msk-response+xml
application/mbms-protection-description+xml
application/mbms-reception-report+xml
application/mbms-register+xml
application/mbms-register-response+xml
application/mbms-user-service-description+xml
application/mbox mbox
application/mediaservercontrol+xml mscml
application/mikey
application/moss-keys
application/moss-signature
application/mosskey-data
application/mosskey-request
application/mp4 mp4s
application/mpeg4-generic
application/mpeg4-iod
application/mpeg4-iod-xmt
application/msword doc dot
application/mxf mxf
application/nasdata
application/news-message-id
application/news-transmission
application/nss
application/ocsp-request
application/ocsp-response
application/octet-stream bin dms lha lzh class so iso dmg dist distz pkg bpk dump elc
application/oda oda
application/oebps-package+xml
application/ogg ogg
application/parityfec
application/pdf pdf
application/pgp-encrypted pgp
application/pgp-keys
application/pgp-signature asc sig
application/pics-rules prf
application/pidf+xml
application/pkcs10 p10
application/pkcs7-mime p7m p7c
application/pkcs7-signature p7s
application/pkix-cert cer
application/pkix-crl crl
application/pkix-pkipath pkipath
application/pkixcmp pki
application/pls+xml pls
application/poc-settings+xml
application/postscript ai eps ps
application/prs.alvestrand.titrax-sheet
application/prs.cww cww
application/prs.nprend
application/prs.plucker
application/qsig
application/rdf+xml rdf
application/reginfo+xml rif
application/relax-ng-compact-syntax rnc
application/remote-printing
application/resource-lists+xml rl
application/riscos
application/rlmi+xml
application/rls-services+xml rs
application/rsd+xml rsd
application/rss+xml rss
application/rtf rtf
application/rtx
application/samlassertion+xml
application/samlmetadata+xml
application/sbml+xml sbml
application/scvp-cv-request scq
application/scvp-cv-response scs
application/scvp-vp-request spq
application/scvp-vp-response spp
application/sdp sdp
application/set-payment
application/set-payment-initiation setpay
application/set-registration
application/set-registration-initiation setreg
application/sgml
application/sgml-open-catalog
application/shf+xml shf
application/sieve
application/simple-filter+xml
application/simple-message-summary
application/simplesymbolcontainer
application/slate
application/smil
application/smil+xml smi smil
application/soap+fastinfoset
application/soap+xml
application/sparql-query rq
application/sparql-results+xml srx
application/spirits-event+xml
application/srgs gram
application/srgs+xml grxml
application/ssml+xml ssml
application/timestamp-query
application/timestamp-reply
application/tve-trigger
application/ulpfec
application/vemmi
application/vividence.scriptfile
application/vnd.3gpp.bsf+xml
application/vnd.3gpp.pic-bw-large plb
application/vnd.3gpp.pic-bw-small psb
application/vnd.3gpp.pic-bw-var pvb
application/vnd.3gpp.sms
application/vnd.3gpp2.bcmcsinfo+xml
application/vnd.3gpp2.sms
application/vnd.3gpp2.tcap tcap
application/vnd.3m.post-it-notes pwn
application/vnd.accpac.simply.aso aso
application/vnd.accpac.simply.imp imp
application/vnd.acucobol acu
application/vnd.acucorp atc acutc
application/vnd.adobe.xdp+xml xdp
application/vnd.adobe.xfdf xfdf
application/vnd.aether.imp
application/vnd.amiga.ami ami
application/vnd.anser-web-certificate-issue-initiation cii
application/vnd.anser-web-funds-transfer-initiation fti
application/vnd.antix.game-component atx
application/vnd.apple.installer+xml mpkg
application/vnd.audiograph aep
application/vnd.autopackage
application/vnd.avistar+xml
application/vnd.blueice.multipass mpm
application/vnd.bmi bmi
application/vnd.businessobjects rep
application/vnd.cab-jscript
application/vnd.canon-cpdl
application/vnd.canon-lips
application/vnd.cendio.thinlinc.clientconf
application/vnd.chemdraw+xml cdxml
application/vnd.chipnuts.karaoke-mmd mmd
application/vnd.cinderella cdy
application/vnd.cirpack.isdn-ext
application/vnd.claymore cla
application/vnd.clonk.c4group c4g c4d c4f c4p c4u
application/vnd.commerce-battelle
application/vnd.commonspace csp cst
application/vnd.contact.cmsg cdbcmsg
application/vnd.cosmocaller cmc
application/vnd.crick.clicker clkx
application/vnd.crick.clicker.keyboard clkk
application/vnd.crick.clicker.palette clkp
application/vnd.crick.clicker.template clkt
application/vnd.crick.clicker.wordbank clkw
application/vnd.criticaltools.wbs+xml wbs
application/vnd.ctc-posml pml
application/vnd.cups-pdf
application/vnd.cups-postscript
application/vnd.cups-ppd ppd
application/vnd.cups-raster
application/vnd.cups-raw
application/vnd.curl curl
application/vnd.cybank
application/vnd.data-vision.rdz rdz
application/vnd.denovo.fcselayout-link fe_launch
application/vnd.dna dna
application/vnd.dolby.mlp mlp
application/vnd.dpgraph dpg
application/vnd.dreamfactory dfac
application/vnd.dvb.esgcontainer
application/vnd.dvb.ipdcesgaccess
application/vnd.dxr
application/vnd.ecdis-update
application/vnd.ecowin.chart mag
application/vnd.ecowin.filerequest
application/vnd.ecowin.fileupdate
application/vnd.ecowin.series
application/vnd.ecowin.seriesrequest
application/vnd.ecowin.seriesupdate
application/vnd.enliven nml
application/vnd.epson.esf esf
application/vnd.epson.msf msf
application/vnd.epson.quickanime qam
application/vnd.epson.salt slt
application/vnd.epson.ssf ssf
application/vnd.ericsson.quickcall
application/vnd.eszigno3+xml es3 et3
application/vnd.eudora.data
application/vnd.ezpix-album ez2
application/vnd.ezpix-package ez3
application/vnd.fdf fdf
application/vnd.ffsns
application/vnd.fints
application/vnd.flographit gph
application/vnd.fluxtime.clip ftc
application/vnd.framemaker fm frame maker
application/vnd.frogans.fnc fnc
application/vnd.frogans.ltf ltf
application/vnd.fsc.weblaunch fsc
application/vnd.fujitsu.oasys oas
application/vnd.fujitsu.oasys2 oa2
application/vnd.fujitsu.oasys3 oa3
application/vnd.fujitsu.oasysgp fg5
application/vnd.fujitsu.oasysprs bh2
application/vnd.fujixerox.art-ex
application/vnd.fujixerox.art4
application/vnd.fujixerox.hbpl
application/vnd.fujixerox.ddd ddd
application/vnd.fujixerox.docuworks xdw
application/vnd.fujixerox.docuworks.binder xbd
application/vnd.fut-misnet
application/vnd.fuzzysheet fzs
application/vnd.genomatix.tuxedo txd
application/vnd.google-earth.kml+xml kml
application/vnd.google-earth.kmz kmz
application/vnd.grafeq gqf gqs
application/vnd.gridmp
application/vnd.groove-account gac
application/vnd.groove-help ghf
application/vnd.groove-identity-message gim
application/vnd.groove-injector grv
application/vnd.groove-tool-message gtm
application/vnd.groove-tool-template tpl
application/vnd.groove-vcard vcg
application/vnd.handheld-entertainment+xml zmm
application/vnd.hbci hbci
application/vnd.hcl-bireports
application/vnd.hhe.lesson-player les
application/vnd.hp-hpgl hpgl
application/vnd.hp-hpid hpid
application/vnd.hp-hps hps
application/vnd.hp-jlyt jlt
application/vnd.hp-pcl pcl
application/vnd.hp-pclxl pclxl
application/vnd.httphone
application/vnd.hzn-3d-crossword x3d
application/vnd.ibm.afplinedata
application/vnd.ibm.electronic-media
application/vnd.ibm.minipay mpy
application/vnd.ibm.modcap afp listafp list3820
application/vnd.ibm.rights-management irm
application/vnd.ibm.secure-container sc
application/vnd.igloader igl
application/vnd.immervision-ivp ivp
application/vnd.immervision-ivu ivu
application/vnd.informedcontrol.rms+xml
application/vnd.intercon.formnet xpw xpx
application/vnd.intertrust.digibox
application/vnd.intertrust.nncp
application/vnd.intu.qbo qbo
application/vnd.intu.qfx qfx
application/vnd.ipunplugged.rcprofile rcprofile
application/vnd.irepository.package+xml irp
application/vnd.is-xpr xpr
application/vnd.jam jam
application/vnd.japannet-directory-service
application/vnd.japannet-jpnstore-wakeup
application/vnd.japannet-payment-wakeup
application/vnd.japannet-registration
application/vnd.japannet-registration-wakeup
application/vnd.japannet-setstore-wakeup
application/vnd.japannet-verification
application/vnd.japannet-verification-wakeup
application/vnd.jcp.javame.midlet-rms rms
application/vnd.jisp jisp
application/vnd.joost.joda-archive joda
application/vnd.kahootz ktz ktr
application/vnd.kde.karbon karbon
application/vnd.kde.kchart chrt
application/vnd.kde.kformula kfo
application/vnd.kde.kivio flw
application/vnd.kde.kontour kon
application/vnd.kde.kpresenter kpr kpt
application/vnd.kde.kspread ksp
application/vnd.kde.kword kwd kwt
application/vnd.kenameaapp htke
application/vnd.kidspiration kia
application/vnd.kinar kne knp
application/vnd.koan skp skd skt skm
application/vnd.liberty-request+xml
application/vnd.llamagraphics.life-balance.desktop lbd
application/vnd.llamagraphics.life-balance.exchange+xml lbe
application/vnd.lotus-1-2-3 123
application/vnd.lotus-approach apr
application/vnd.lotus-freelance pre
application/vnd.lotus-notes nsf
application/vnd.lotus-organizer org
application/vnd.lotus-screencam scm
application/vnd.lotus-wordpro lwp
application/vnd.macports.portpkg portpkg
application/vnd.marlin.drm.actiontoken+xml
application/vnd.marlin.drm.conftoken+xml
application/vnd.marlin.drm.mdcf
application/vnd.mcd mcd
application/vnd.medcalcdata mc1
application/vnd.mediastation.cdkey cdkey
application/vnd.meridian-slingshot
application/vnd.mfer mwf
application/vnd.mfmp mfm
application/vnd.micrografx.flo flo
application/vnd.micrografx.igx igx
application/vnd.mif mif
application/vnd.minisoft-hp3000-save
application/vnd.mitsubishi.misty-guard.trustweb
application/vnd.mobius.daf daf
application/vnd.mobius.dis dis
application/vnd.mobius.mbk mbk
application/vnd.mobius.mqy mqy
application/vnd.mobius.msl msl
application/vnd.mobius.plc plc
application/vnd.mobius.txf txf
application/vnd.mophun.application mpn
application/vnd.mophun.certificate mpc
application/vnd.motorola.flexsuite
application/vnd.motorola.flexsuite.adsi
application/vnd.motorola.flexsuite.fis
application/vnd.motorola.flexsuite.gotap
application/vnd.motorola.flexsuite.kmr
application/vnd.motorola.flexsuite.ttc
application/vnd.motorola.flexsuite.wem
application/vnd.mozilla.xul+xml xul
application/vnd.ms-artgalry cil
application/vnd.ms-asf asf
application/vnd.ms-cab-compressed cab
application/vnd.ms-excel xls xlm xla xlc xlt xlw
application/vnd.ms-fontobject eot
application/vnd.ms-htmlhelp chm
application/vnd.ms-ims ims
application/vnd.ms-lrm lrm
application/vnd.ms-playready.initiator+xml
application/vnd.ms-powerpoint ppt pps pot
application/vnd.ms-project mpp mpt
application/vnd.ms-tnef
application/vnd.ms-wmdrm.lic-chlg-req
application/vnd.ms-wmdrm.lic-resp
application/vnd.ms-wmdrm.meter-chlg-req
application/vnd.ms-wmdrm.meter-resp
application/vnd.ms-works wps wks wcm wdb
application/vnd.ms-wpl wpl
application/vnd.ms-xpsdocument xps
application/vnd.mseq mseq
application/vnd.msign
application/vnd.multiad.creator
application/vnd.multiad.creator.cif
application/vnd.music-niff
application/vnd.musician mus
application/vnd.muvee.style msty
application/vnd.ncd.control
application/vnd.ncd.reference
application/vnd.nervana
application/vnd.netfpx
application/vnd.neurolanguage.nlu nlu
application/vnd.noblenet-directory nnd
application/vnd.noblenet-sealer nns
application/vnd.noblenet-web nnw
application/vnd.nokia.catalogs
application/vnd.nokia.conml+wbxml
application/vnd.nokia.conml+xml
application/vnd.nokia.isds-radio-presets
application/vnd.nokia.iptv.config+xml
application/vnd.nokia.landmark+wbxml
application/vnd.nokia.landmark+xml
application/vnd.nokia.landmarkcollection+xml
application/vnd.nokia.n-gage.ac+xml
application/vnd.nokia.n-gage.data ngdat
application/vnd.nokia.n-gage.symbian.install n-gage
application/vnd.nokia.ncd
application/vnd.nokia.pcd+wbxml
application/vnd.nokia.pcd+xml
application/vnd.nokia.radio-preset rpst
application/vnd.nokia.radio-presets rpss
application/vnd.novadigm.edm edm
application/vnd.novadigm.edx edx
application/vnd.novadigm.ext ext
application/vnd.oasis.opendocument.chart odc
application/vnd.oasis.opendocument.chart-template otc
application/vnd.oasis.opendocument.formula odf
application/vnd.oasis.opendocument.formula-template otf
application/vnd.oasis.opendocument.graphics odg
application/vnd.oasis.opendocument.graphics-template otg
application/vnd.oasis.opendocument.image odi
application/vnd.oasis.opendocument.image-template oti
application/vnd.oasis.opendocument.presentation odp
application/vnd.oasis.opendocument.presentation-template otp
application/vnd.oasis.opendocument.spreadsheet ods
application/vnd.oasis.opendocument.spreadsheet-template ots
application/vnd.oasis.opendocument.text odt
application/vnd.oasis.opendocument.text-master otm
application/vnd.oasis.opendocument.text-template ott
application/vnd.oasis.opendocument.text-web oth
application/vnd.obn
application/vnd.olpc-sugar xo
application/vnd.oma-scws-config
application/vnd.oma-scws-http-request
application/vnd.oma-scws-http-response
application/vnd.oma.bcast.associated-procedure-parameter+xml
application/vnd.oma.bcast.drm-trigger+xml
application/vnd.oma.bcast.imd+xml
application/vnd.oma.bcast.notification+xml
application/vnd.oma.bcast.sgboot
application/vnd.oma.bcast.sgdd+xml
application/vnd.oma.bcast.sgdu
application/vnd.oma.bcast.simple-symbol-container
application/vnd.oma.bcast.smartcard-trigger+xml
application/vnd.oma.bcast.sprov+xml
application/vnd.oma.dd2+xml dd2
application/vnd.oma.drm.risd+xml
application/vnd.oma.group-usage-list+xml
application/vnd.oma.poc.detailed-progress-report+xml
application/vnd.oma.poc.final-report+xml
application/vnd.oma.poc.groups+xml
application/vnd.oma.poc.optimized-progress-report+xml
application/vnd.oma.xcap-directory+xml
application/vnd.omads-email+xml
application/vnd.omads-file+xml
application/vnd.omads-folder+xml
application/vnd.omaloc-supl-init
application/vnd.openofficeorg.extension oxt
application/vnd.osa.netdeploy
application/vnd.osgi.dp dp
application/vnd.otps.ct-kip+xml
application/vnd.palm prc pdb pqa oprc
application/vnd.paos.xml
application/vnd.pg.format str
application/vnd.pg.osasli ei6
application/vnd.piaccess.application-licence
application/vnd.picsel efif
application/vnd.poc.group-advertisement+xml
application/vnd.pocketlearn plf
application/vnd.powerbuilder6 pbd
application/vnd.powerbuilder6-s
application/vnd.powerbuilder7
application/vnd.powerbuilder7-s
application/vnd.powerbuilder75
application/vnd.powerbuilder75-s
application/vnd.preminet
application/vnd.previewsystems.box box
application/vnd.proteus.magazine mgz
application/vnd.publishare-delta-tree qps
application/vnd.pvi.ptid1 ptid
application/vnd.pwg-multiplexed
application/vnd.pwg-xhtml-print+xml
application/vnd.qualcomm.brew-app-res
application/vnd.quark.quarkxpress qxd qxt qwd qwt qxl qxb
application/vnd.rapid
application/vnd.recordare.musicxml mxl
application/vnd.recordare.musicxml+xml
application/vnd.renlearn.rlprint
application/vnd.rn-realmedia rm
application/vnd.ruckus.download
application/vnd.s3sms
application/vnd.sbm.mid2
application/vnd.scribus
application/vnd.sealed.3df
application/vnd.sealed.csf
application/vnd.sealed.doc
application/vnd.sealed.eml
application/vnd.sealed.mht
application/vnd.sealed.net
application/vnd.sealed.ppt
application/vnd.sealed.tiff
application/vnd.sealed.xls
application/vnd.sealedmedia.softseal.html
application/vnd.sealedmedia.softseal.pdf
application/vnd.seemail see
application/vnd.sema sema
application/vnd.semd semd
application/vnd.semf semf
application/vnd.shana.informed.formdata ifm
application/vnd.shana.informed.formtemplate itp
application/vnd.shana.informed.interchange iif
application/vnd.shana.informed.package ipk
application/vnd.simtech-mindmapper twd twds
application/vnd.smaf mmf
application/vnd.solent.sdkm+xml sdkm sdkd
application/vnd.spotfire.dxp dxp
application/vnd.spotfire.sfs sfs
application/vnd.sss-cod
application/vnd.sss-dtf
application/vnd.sss-ntf
application/vnd.street-stream
application/vnd.sun.wadl+xml
application/vnd.sus-calendar sus susp
application/vnd.svd svd
application/vnd.swiftview-ics
application/vnd.syncml+xml xsm
application/vnd.syncml.dm+wbxml bdm
application/vnd.syncml.dm+xml xdm
application/vnd.syncml.ds.notification
application/vnd.tao.intent-module-archive tao
application/vnd.tmobile-livetv tmo
application/vnd.trid.tpt tpt
application/vnd.triscape.mxs mxs
application/vnd.trueapp tra
application/vnd.truedoc
application/vnd.ufdl ufd ufdl
application/vnd.uiq.theme utz
application/vnd.umajin umj
application/vnd.unity unityweb
application/vnd.uoml+xml uoml
application/vnd.uplanet.alert
application/vnd.uplanet.alert-wbxml
application/vnd.uplanet.bearer-choice
application/vnd.uplanet.bearer-choice-wbxml
application/vnd.uplanet.cacheop
application/vnd.uplanet.cacheop-wbxml
application/vnd.uplanet.channel
application/vnd.uplanet.channel-wbxml
application/vnd.uplanet.list
application/vnd.uplanet.list-wbxml
application/vnd.uplanet.listcmd
application/vnd.uplanet.listcmd-wbxml
application/vnd.uplanet.signal
application/vnd.vcx vcx
application/vnd.vd-study
application/vnd.vectorworks
application/vnd.vidsoft.vidconference
application/vnd.visio vsd vst vss vsw
application/vnd.visionary vis
application/vnd.vividence.scriptfile
application/vnd.vsf vsf
application/vnd.wap.sic
application/vnd.wap.slc
application/vnd.wap.wbxml wbxml
application/vnd.wap.wmlc wmlc
application/vnd.wap.wmlscriptc wmlsc
application/vnd.webturbo wtb
application/vnd.wfa.wsc
application/vnd.wmc
application/vnd.wordperfect wpd
application/vnd.wqd wqd
application/vnd.wrq-hp3000-labelled
application/vnd.wt.stf stf
application/vnd.wv.csp+wbxml
application/vnd.wv.csp+xml
application/vnd.wv.ssp+xml
application/vnd.xara xar
application/vnd.xfdl xfdl
application/vnd.xmpie.cpkg
application/vnd.xmpie.dpkg
application/vnd.xmpie.plan
application/vnd.xmpie.ppkg
application/vnd.xmpie.xlim
application/vnd.yamaha.hv-dic hvd
application/vnd.yamaha.hv-script hvs
application/vnd.yamaha.hv-voice hvp
application/vnd.yamaha.smaf-audio saf
application/vnd.yamaha.smaf-phrase spf
application/vnd.yellowriver-custom-menu cmp
application/vnd.zzazz.deck+xml zaz
application/voicexml+xml vxml
application/watcherinfo+xml
application/whoispp-query
application/whoispp-response
application/winhlp hlp
application/wita
application/wordperfect5.1
application/wsdl+xml wsdl
application/wspolicy+xml wspolicy
application/x-ace-compressed ace
application/x-bcpio bcpio
application/x-bittorrent torrent
application/x-bzip bz
application/x-bzip2 bz2 boz
application/x-cdlink vcd
application/x-chat chat
application/x-chess-pgn pgn
application/x-compress
application/x-cpio cpio
application/x-csh csh
application/x-director dcr dir dxr fgd
application/x-dvi dvi
application/x-futuresplash spl
application/x-gtar gtar
application/x-gzip
application/x-hdf hdf
application/x-latex latex
application/x-ms-wmd wmd
application/x-ms-wmz wmz
application/x-msaccess mdb
application/x-msbinder obd
application/x-mscardfile crd
application/x-msclip clp
application/x-msdownload exe dll com bat msi
application/x-msmediaview mvb m13 m14
application/x-msmetafile wmf
application/x-msmoney mny
application/x-mspublisher pub
application/x-msschedule scd
application/x-msterminal trm
application/x-mswrite wri
application/x-netcdf nc cdf
application/x-pkcs12 p12 pfx
application/x-pkcs7-certificates p7b spc
application/x-pkcs7-certreqresp p7r
application/x-rar-compressed rar
application/x-sh sh
application/x-shar shar
application/x-shockwave-flash swf
application/x-stuffit sit
application/x-stuffitx sitx
application/x-sv4cpio sv4cpio
application/x-sv4crc sv4crc
application/x-tar tar
application/x-tcl tcl
application/x-tex tex
application/x-texinfo texinfo texi
application/x-ustar ustar
application/x-wais-source src
application/x-x509-ca-cert der crt
application/x400-bp
application/xcap-att+xml
application/xcap-caps+xml
application/xcap-el+xml
application/xcap-error+xml
application/xcap-ns+xml
application/xenc+xml xenc
application/xhtml+xml xhtml xht
application/xml xml xsl
application/xml-dtd dtd
application/xml-external-parsed-entity
application/xmpp+xml
application/xop+xml xop
application/xslt+xml xslt
application/xspf+xml xspf
application/xv+xml mxml xhvml xvml xvm
application/zip zip
audio/32kadpcm
audio/3gpp
audio/3gpp2
audio/ac3
audio/amr
audio/amr-wb
audio/amr-wb+
audio/asc
audio/basic au snd
audio/bv16
audio/bv32
audio/clearmode
audio/cn
audio/dat12
audio/dls
audio/dsr-es201108
audio/dsr-es202050
audio/dsr-es202211
audio/dsr-es202212
audio/dvi4
audio/eac3
audio/evrc
audio/evrc-qcp
audio/evrc0
audio/evrc1
audio/evrcb
audio/evrcb0
audio/evrcb1
audio/g722
audio/g7221
audio/g723
audio/g726-16
audio/g726-24
audio/g726-32
audio/g726-40
audio/g728
audio/g729
audio/g7291
audio/g729d
audio/g729e
audio/gsm
audio/gsm-efr
audio/ilbc
audio/l16
audio/l20
audio/l24
audio/l8
audio/lpc
audio/midi mid midi kar rmi
audio/mobile-xmf
audio/mp4 mp4a
audio/mp4a-latm
audio/mpa
audio/mpa-robust
audio/mpeg mpga mp2 mp2a mp3 m2a m3a
audio/mpeg4-generic
audio/parityfec
audio/pcma
audio/pcmu
audio/prs.sid
audio/qcelp
audio/red
audio/rtp-enc-aescm128
audio/rtp-midi
audio/rtx
audio/smv
audio/smv0
audio/smv-qcp
audio/sp-midi
audio/t140c
audio/t38
audio/telephone-event
audio/tone
audio/ulpfec
audio/vdvi
audio/vmr-wb
audio/vnd.3gpp.iufp
audio/vnd.4sb
audio/vnd.audiokoz
audio/vnd.celp
audio/vnd.cisco.nse
audio/vnd.cmles.radio-events
audio/vnd.cns.anp1
audio/vnd.cns.inf1
audio/vnd.digital-winds eol
audio/vnd.dlna.adts
audio/vnd.dolby.mlp
audio/vnd.everad.plj
audio/vnd.hns.audio
audio/vnd.lucent.voice lvp
audio/vnd.nokia.mobile-xmf
audio/vnd.nortel.vbk
audio/vnd.nuera.ecelp4800 ecelp4800
audio/vnd.nuera.ecelp7470 ecelp7470
audio/vnd.nuera.ecelp9600 ecelp9600
audio/vnd.octel.sbc
audio/vnd.qcelp
audio/vnd.rhetorex.32kadpcm
audio/vnd.sealedmedia.softseal.mpeg
audio/vnd.vmx.cvsd
audio/wav wav
audio/x-aiff aif aiff aifc
audio/x-mpegurl m3u
audio/x-ms-wax wax
audio/x-ms-wma wma
audio/x-pn-realaudio ram ra
audio/x-pn-realaudio-plugin rmp
audio/x-wav wav
chemical/x-cdx cdx
chemical/x-cif cif
chemical/x-cmdf cmdf
chemical/x-cml cml
chemical/x-csml csml
chemical/x-pdb pdb
chemical/x-xyz xyz
image/bmp bmp
image/cgm cgm
image/fits
image/g3fax g3
image/gif gif
image/ief ief
image/jp2
image/jpeg jpeg jpg jpe
image/jpm
image/jpx
image/naplps
image/png png
image/prs.btif btif
image/prs.pti
image/svg+xml svg svgz
image/t38
image/tiff tiff tif
image/tiff-fx
image/vnd.adobe.photoshop psd
image/vnd.cns.inf2
image/vnd.djvu djvu djv
image/vnd.dwg dwg
image/vnd.dxf dxf
image/vnd.fastbidsheet fbs
image/vnd.fpx fpx
image/vnd.fst fst
image/vnd.fujixerox.edmics-mmr mmr
image/vnd.fujixerox.edmics-rlc rlc
image/vnd.globalgraphics.pgb
image/vnd.microsoft.icon
image/vnd.mix
image/vnd.ms-modi mdi
image/vnd.net-fpx npx
image/vnd.sealed.png
image/vnd.sealedmedia.softseal.gif
image/vnd.sealedmedia.softseal.jpg
image/vnd.svf
image/vnd.wap.wbmp wbmp
image/vnd.xiff xif
image/x-cmu-raster ras
image/x-cmx cmx
image/x-icon ico
image/x-pcx pcx
image/x-pict pic pct
image/x-portable-anymap pnm
image/x-portable-bitmap pbm
image/x-portable-graymap pgm
image/x-portable-pixmap ppm
image/x-rgb rgb
image/x-xbitmap xbm
image/x-xpixmap xpm
image/x-xwindowdump xwd
message/cpim
message/delivery-status
message/disposition-notification
message/external-body
message/http
message/news
message/partial
message/rfc822 eml mime
message/s-http
message/sip
message/sipfrag
message/tracking-status
message/vnd.si.simp
model/iges igs iges
model/mesh msh mesh silo
model/vnd.dwf dwf
model/vnd.flatland.3dml
model/vnd.gdl gdl
model/vnd.gs.gdl
model/vnd.gtw gtw
model/vnd.moml+xml
model/vnd.mts mts
model/vnd.parasolid.transmit.binary
model/vnd.parasolid.transmit.text
model/vnd.vtu vtu
model/vrml wrl vrml
multipart/alternative
multipart/appledouble
multipart/byteranges
multipart/digest
multipart/encrypted
multipart/form-data
multipart/header-set
multipart/mixed
multipart/parallel
multipart/related
multipart/report
multipart/signed
multipart/voice-message
text/calendar ics ifb
text/css css
text/csv csv
text/directory
text/dns
text/enriched
text/html html htm
text/parityfec
text/plain txt text conf def list log in
text/prs.fallenstein.rst
text/prs.lines.tag dsc
text/red
text/rfc822-headers
text/richtext rtx
text/rtf
text/rtp-enc-aescm128
text/rtx
text/sgml sgml sgm
text/t140
text/tab-separated-values tsv
text/troff t tr roff man me ms
text/ulpfec
text/uri-list uri uris urls
text/vnd.abc
text/vnd.curl
text/vnd.dmclientscript
text/vnd.esmertec.theme-descriptor
text/vnd.fly fly
text/vnd.fmi.flexstor flx
text/vnd.in3d.3dml 3dml
text/vnd.in3d.spot spot
text/vnd.iptc.newsml
text/vnd.iptc.nitf
text/vnd.latex-z
text/vnd.motorola.reflex
text/vnd.ms-mediapackage
text/vnd.net2phone.commcenter.command
text/vnd.si.uricatalogue
text/vnd.sun.j2me.app-descriptor jad
text/vnd.trolltech.linguist
text/vnd.wap.si
text/vnd.wap.sl
text/vnd.wap.wml wml
text/vnd.wap.wmlscript wmls
text/x-asm s asm
text/x-c c cc cxx cpp h hh dic
text/x-fortran f for f77 f90
text/x-pascal p pas
text/x-java-source java
text/x-setext etx
text/x-uuencode uu
text/x-vcalendar vcs
text/x-vcard vcf
text/xml
text/xml-external-parsed-entity
video/3gpp 3gp
video/3gpp-tt
video/3gpp2 3g2
video/bmpeg
video/bt656
video/celb
video/dv
video/h261 h261
video/h263 h263
video/h263-1998
video/h263-2000
video/h264 h264
video/jpeg jpgv
video/jpm jpm jpgm
video/mj2 mj2 mjp2
video/mp1s
video/mp2p
video/mp2t
video/mp4 mp4 mp4v mpg4
video/mp4v-es
video/mpeg mpeg mpg mpe m1v m2v
video/mpeg4-generic
video/mpv
video/nv
video/parityfec
video/pointer
video/quicktime qt mov
video/raw
video/rtp-enc-aescm128
video/rtx
video/smpte292m
video/ulpfec
video/vc1
video/vnd.dlna.mpeg-tts
video/vnd.fvt fvt
video/vnd.hns.video
video/vnd.motorola.video
video/vnd.motorola.videop
video/vnd.mpegurl mxu m4u
video/vnd.nokia.interleaved-multimedia
video/vnd.nokia.videovoip
video/vnd.objectvideo
video/vnd.sealed.mpeg1
video/vnd.sealed.mpeg4
video/vnd.sealed.swf
video/vnd.sealedmedia.softseal.mov
video/vnd.vivo viv
video/x-fli fli
video/x-ms-asf asf asx
video/x-ms-wm wm
video/x-ms-wmv wmv
video/x-ms-wmx wmx
video/x-ms-wvx wvx
video/x-msvideo avi
video/x-sgi-movie movie
x-conference/x-cooltalk ice
application/x-httpd-php php
application/x-httpd-php-source phps

Sunday, November 16, 2008

Crypto++ to PHP

This article if following one article that I wrote about using libcurl or wget to post data to a coldfusion and php server. In my sample data were sent in a clear form to the server which is NOT the best things to do.
When submitting sensitive data to a server over HTTP using HTTP Post Request it is highly recommended to use encryption or any sort of obfuscation of your own using xor and rotation etc... to encapsulate data inside your http key/value form data.
A c++ client can achieve this thanks to the great C++ library Crypto++. There are various encryption type out there some more stronger than other... Which means some can be broken super fast some will require more CPU time. I like asymetric encryption in a sense that the client doesn't store a unique key which has to be hidden inside the client code but use a key pair instead and just the public key is stored inside the client whereas the server will store the private key... Although,
I have not found any PHP implementation of RSA so far and I think mcrypt didn't support RSA for copyright issues I guess... I would love to see a complete support of crypto++ written in PHP or available as a PHP module. If you find anything out there let me know. As a great alternative, since mcrypt support ECB a DES_EDE3 encryption solution which is also supported by crypto++ here is a good way to encrypt data in C++ and decrypt data in PHP.

Here we go !

Client Side using ECB - DES_EDE3
==================================

#include "cryptlib.h"
#include "modes.h"
#include "des.h"
#include "base64.h" <-- any base64 encoder/decoder i found the usage of crypto++ base64 class a bit hard to use since you have to know how many byte are taken to encode a byte in base 64...
#include "hex.h"

// Encode the data using the handy Crypto++ base64 encoder. Base64 uses
// 3 characters to store 2 characters.
const int BUFFER_LENGTH = 255;
byte plaintext[BUFFER_LENGTH];
byte ciphertext[BUFFER_LENGTH];
byte newciphertext[BUFFER_LENGTH];
byte decrypted[BUFFER_LENGTH];

CryptoPP::Base64Encoder base64Encoder;
CBase64Coding base64Coder;
CString MySensitiveDataUncrypted;
CString MySensitiveData;

// Set up the same key and IV
const int KEY_LENGTH = 24;
const int BLOCK_SIZE = CryptoPP::DES::BLOCKSIZE;
byte key[KEY_LENGTH], iv[CryptoPP::DES::BLOCKSIZE];
memset( key, 0, KEY_LENGTH);
memcpy( key, "012345678901234567890123", KEY_LENGTH );
memset( iv, 0, CryptoPP::DES::BLOCKSIZE);
memcpy( iv, "01234567", CryptoPP::DES::BLOCKSIZE );
memset( plaintext, 0, BUFFER_LENGTH);
memset( ciphertext, 0, BUFFER_LENGTH);
memset( newciphertext, 0, BUFFER_LENGTH);
strcpy((char*)plaintext,MySensitiveDataUncrypted.GetBuffer(0));
// now encrypt
CryptoPP::ECB_Mode::Encryption ecbEncryption(key, sizeof(key));
ecbEncryption.ProcessString(newciphertext, plaintext, BUFFER_LENGTH);
// your own base64 encoder/decoder
base64Coder.Encode((char *)newciphertext,BUFFER_LENGTH,(char *)ciphertext);
MySensitiveData.Format(_T("%s"),ciphertext);

// MySensitiveData can now be send over http


Server Side in PHP using ECB - DES_EDE3
=========================================

// $MyBase64EncodedSecretString will receive/store the encrypted string which will also be base64Encoded for HTTP protocol convenience

$key = "012345678901234567890123";
$iv = "01234567";

// Set up an "encryption" descriptor. This is basically just an object that
// encapsulates the encryption algorithm. 'tripledes' is the name of the
// algorithm, which is simply the DES algorithm done three times back to
// back. 'ecb' describes how to encrypt different blocks. See, DES
// actually only encrypts 8-byte blocks at a time. To encrypt more than 8
// bytes of data, you break the data up into 8-byte chunks (padding the
// last chunk with NULL, if need be), and then encrypt each block
// individually. Now, ECB (which stands for "Electronic Code Book", for
// whatever that's worth) means that each 8-byte block is encrypted
// independently. This has pros and cons that I don't care to discuss.
// The other option is CBC ("Cipher Block Chaining") which links the blocks,
// such as by XORing each block with the encrypted result of the previous
// block. Security geeks probably really get excited about this, but for my
// needs, I don't really care.
$td = mcrypt_module_open( 'tripledes', '', 'ecb', '' );
mcrypt_generic_init( $td, $key, $iv );

// Grab some interesting data from the descriptor.
// $maxKeySize = 24, meaning 24 bytes
// $maxIVSize = 8, meaning 8 bytes
$maxKeySize = mcrypt_enc_get_key_size( $td );
$maxIVSize = mcrypt_enc_get_iv_size( $td );
//echo "maxKeySize=$maxKeySize, maxIVSize=$maxIVSize\n";

// let's decrypt it and verify the result. Because DES pads
// the end of the original block with NULL bytes, let's trim those off to
// create the final result.
$MyEncodedSecretString = base64_decode( $MyBase64EncodedSecretString );
$MyDecodedString = rtrim( mdecrypt_generic( $td, $MyEncodedSecretString ), "\0" );

// And finally, clean up the encryption object
mcrypt_generic_deinit($td);
mcrypt_module_close($td);


Client Side Stronger Encryption using RSA
=========================================

First you will need to generate a public/private key pair using crypto++ keygen console application then your client code should be something like

// Client Side Using RSA
#include "cryptlib.h"
#include "rsa.h"
#include "hex.h"
#include "randpool.h"
#include "filesource.h"

CString MyNotverySecretStringInMemory;
CString MySensitiveData;
char pubFilename[128];
char seed[1024], message[1024];

// MAX = 19999991
strcpy(seed,"12345");

CString tmpPath;
TCHAR appPath[MAX_PATH];
::GetModuleFileName(NULL,appPath,MAX_PATH);

tmpPath = appPath;
tmpPath = tmpPath.Left(tmpPath.ReverseFind('\\')+1);
tmpPath += "public.key"; // 1024 key length for higher security.

strcpy(pubFilename,tmpPath.GetBuffer(0));
strcpy(message,MyNotverySecretStringInMemory.GetBuffer(0));
CryptoPP::FileSource pubFile(pubFilename, true, new CryptoPP::HexDecoder);
CryptoPP::RSAES_OAEP_SHA_Encryptor pub(pubFile);
CryptoPP::RandomPool randPool;
randPool.IncorporateEntropy((byte *)seed, strlen(seed));
std::string result;
CryptoPP::StringSource(message, true, new CryptoPP::PK_EncryptorFilter(randPool, pub, new CryptoPP::HexEncoder(new CryptoPP::StringSink(result))));
MySensitiveData.Format(_T("%s"),result.c_str());

// Server code will need to use private.key to decode the hexencode rsa string


Didn't find any PHP implementation yet if anyone heard about one shoot me an email.

Use it at your own certitude :)) to think your solution is going to be more secure. I would say one sentence about security. All is a matter of time given to put yourself or your solution in a "SAFE" zone until the code is broken.
The longer time it takes to break the solution the more bullet proof your solution is.

Thursday, October 30, 2008

FLV Cuepoints in Flash CS3 with Flash Video Encoder versus FLV and F4V Cuepoints in Flash CS4 with Adobe Media Encoder Best Practice

This article is aimed to clarify:

How Cuepoints and which cuepoints type are presented to the user in Flash CS3 for FLV

and
How Cuepoints and which cuepoints type are presented in Flash CS4 for FLV and F4V.

View Cuepoint In Flash CS3
==========================

FLV:

Cuepoints when available are inported at the end of the Import Video Wizard workflow.
User are able to see their cuepoints by selecting the FLVPlayback Control on stage and after showing the Component Inspector panel (dockable panel). The cuepoints are visible in the cuepoint property of the Component Inspector. Cuepoints are sorted based on the SMPTE time at which they have been created. User can insert Event or Navigation Cuepoints using Flash Video Encoder. Cuepoints are embedded in the FLV.

Codewise, Flash Developers have the option to use Action Script 2 or Action Script 3 in order to interpret Cuepoints (Event and Navigation) at runtime (when the SWF is playback by Flash Player 9 or Flash Player 10). I am not going to cover the onCuepoint Callback (timed based event cuepoint callback) which applies to FLV only but rather focus on the use case where all cuepoints are preloaded/received at once. The following code is Action Script 3 code using NetStreem to attach a _metadata class in order to receive Metadata through onMetaData event callback. In onMetaData Cuepoints are returned in an Array.


connection.connect(connectURL);
stream = new NetStream(connection);
//assign metadata client
stream.client = _metadata;
var video:Video = new Video();
video.attachNetStream(stream);
stream.seek(0);

........

_metadata.onMetaData = function(eventObj:Object):void {
var cuePoints:Array = eventObj.cuePoints;

//cuepoints are returned as an Array
}

Callback Sequence
=================

For FLV the callback sequence will be

Callbacks: onMetaData


View Cuepoints In Flash CS4
===========================

FLV:

FLVs now contains two types of Cuepoints. Two types of Cuepoints are encoded in the FLV. "Flash CS3" Cuepoints and Cuepoints encoded as a subset of an XML Track


first < has been replace by { and > by } because google blog text editor is retarded..

{xmpDM:trackName}AME Markers{/xmpDM:trackName}
{xmpDM:frameRate}f254016000000{/xmpDM:frameRate}
{xmpDM:markers}
{rdf:Seq}
{rdf:li rdf:parseType="Resource"}
{xmpDM:startTime}7695905817600{/xmpDM:startTime}
{xmpDM:name}Title1{/xmpDM:name}
{xmpDM:type}FLVCuePoint{/xmpDM:type}
{xmpDM:cuePointType}Navigation{/xmpDM:cuePointType}
{xmpDM:cuePointParams}
{rdf:Seq}
{rdf:li rdf:parseType="Resource"}
{xmpDM:key}Title{/xmpDM:key}
{xmpDM:value}Star Trek{/xmpDM:value}
{/rdf:li}
{rdf:li rdf:parseType="Resource"}
{xmpDM:key}Color{/xmpDM:key}
{xmpDM:value}Blue{/xmpDM:value}
{/rdf:li}
{/rdf:Seq}
{/xmpDM:cuePointParams}
{/rdf:li}
{/rdf:Seq}
{/xmpDM:markers}
{/rdf:li}
{/rdf:Bag}
{/xmpDM:Tracks}

The cuepoint type are the same than the one defined in the FLV spec part of Flash CS3. The FLV Cuepoint Track (AME Markers in the above sample XMP block) follows
a "well defined" XML syntax, namely the XMP subset of RDF. The RDF spec uses a BNF-like grammar, not an XML DTD. The XML syntax described above is compliant with Flash CS4 integration of Cue Points through the Cue Points dialog and the Component Parameters Cue Points Property. This is assuming you are calling Adobe Media Encoder from Flash CS4 at encoding time.
For FLVs to ensure backward compatibility with Flash CS3, Flash CS4 presents the FLV Cuepoints encoded in the "non XMP form", like wise they were encoded in Flash CS3 and earlier, and WON'T present FLV XMP Cuepoints in the Component Inspector at all if the FLVs have been encoded by Adobe Media Encoder. If Flash Designers and Developers change XMP Cuepoints in their FLVs they have to bare in mind to maintain the non XMP cuepoints as well encoded in the file if they want to see them in Flash CS4 using Adobe SDK and Adobe Software. If Flash Developers prefer to preload XMP Cuepoints only in their SWFs for FLVs, they can rely on Adobe Bridge CS4 or the Import and Export XMP feature available in Adobe Media Encoder CS4 to edit/replace their Cuepoints. They need to preload their Cuepoints at runtime all the time through the onXMPData callback. As far as synchronisation of Cuepoints is concerned they can use a timer and video polling techniques when loading Cuepoints through onXMPData in order to provide accurate synchronization of Event and Navigation Cuepoints with Action Scripts. If they don't want to preload XMP Cuepoints but still want to use Cuepoints in their SWF they need to preload Cuepoints at runtime through onMetadata and proceed with timer and video polling techniques to perform the synchronization of their Action Scripts Code or rely on OnCuepoint which is an SMPTE timed based event callback notification available in Flash CS3 as well and Flash Player 9 but only for FLV.

F4V:

F4Vs also contains XMP Metadata in order to represent "FLV Cuepoints" as well when the F4Vs are encoded by Adobe Media Encoder

For F4Vs Flash CS4 present XMP Cuepoints in the Component Inspector in the order they appears in the RAW XMP Metadata block embedded in the F4V and in the Cuepoints dialog, Cuepoints params are listed in the order they appears in the RAW XMP Metadata block. User can alter XMP Cuepoints using Software and Human Interface such as Adobe Media Encoder or Adobe Bridge CS4 by exporting/modifying/importing XMP files.

Codewise, Flash Developers have the option to use Action Script 2 or Action Script 3 in order to interpret FLVs and F4Vs "FLV Cuepoints" at runtime (when the SWF is rendered by Flash Player 10). As far as synchronisation of Cuepoints is concerned they HAVE to use a timer and video position polling techniques when loading Cuepoints through onXMPData and they have to do their own Action Script synchronization for event and navigation cuepoints.


The following code is Action Script 3 code using NetStream to attach a _metadata class in order to receive Metadata through onMetaData event callback as well as the new callback onXMPData.

Callback Sequence
=================

For F4V the callback sequence is

Callbacks: onMetaData -> onXMPData -> onMetadata

For FLV the callback sequence is

Callbacks: onMetaData -> onXMPData


connection.connect(connectURL);
stream = new NetStream(connection);
//assign metadata client
stream.client = _metadata;
var video:Video = new Video();
video.attachNetStream(stream);
stream.seek(0);

........

_metadata.onMetaData = function(eventObj:Object):void {
var cuePoints:Array = eventObj.cuePoints;

// For F4V First and Third callback call in the callback sequence listed above
// For FLV First call in the callback sequence listed above
}

_metadata.onXMPData = function(info:Object):void {
trace("raw XMP =\n");
trace(info.data);
// For F4V Second call in the callback sequence listed above info.data contains raw XMP block
// For FLV Second call in the callback sequence listed above info.liveXML contains raw XMP block
}

Note: Flash CS4 will import Cue Points stored in the info.data object only not info.liveXML but your AS3 code in your custom player will receive the data as listed above with Flash Player 10

Overall : It is possible with both FLV and F4V cuepoints to have frame accuracy with Event and Navigation Cuepoint

XMP Resources and spec

XMPCore http://partners.adobe.com/public/developer/xmp/topic.html
XMP http://www.adobe.com/devnet/xmp/

Flash CS4 Video Playback http://www.adobe.com/devnet/flash/articles/flvplayback_fplayer9u3_04.html

FLV and F4V http://en.wikipedia.org/wiki/Flash_Video

XMP http://en.wikipedia.org/wiki/Extensible_Metadata_Platform

http://www.adobe.com/products/xmp/

Some useful resource regarding RDF and triple store

http://www.w3.org/TR/rdf-schema/
http://simile.mit.edu/reports/stores/

and finally a great use case of what can be done using XMP cuepoint : Interactive FLV and F4V Video

http://younsi.blogspot.com/2008/12/interactive-video-in-flash-using-f4v.html

Tuesday, October 21, 2008

HTTP Post behavior between a C++ CURL client and IIS running Coldfusion 7 not as good as PHP but still providing the functionality

I found that PHP is way more advance when it comes to parse HTTP post request send towards a web server from a C++ client using CURL. HTTP form data are very handy when you want to send data such as cookie, login, password, files, custom command to fit your own underlying protocol between your client and your server. The test that i performed consisted in posting data using form-data towards a IIS/ColdFusion 7 server script from a C++ Client using CURL and i did the same with IIS/Apache/PHP.

To validate my test i also used wget command line tool to post form data using the follwoing command.

wget-1.11.4b>wget --header="Content-tye:multipart/form-data, boundary=--========00000003640" --post-file=postdata.txt http://www.fullyqualifydomainname.com/post.cfm

where the file postdata.txt is :

--========00000003640
Content-Disposition: form-data; name="SessionID"
Content-Type: text/plain
--========00000003640
Content-Disposition: form-data; name="UserName"
Content-Type: text/plain
test
--========00000003640
Content-Disposition: form-data; name="UserPassword"
Content-Type: text/plain
test
--========00000003640
Content-Disposition: form-data; name="EOF"
Content-Type: text/plain
EOF
--========00000003640—

The conclusion of my test was that it is not easy to retrieve all post data into an array in one single call in ColdFusion something which is working great and easy to achieve in PHP. Something the coldfusion team should concider for future APIs... !

ColdFusion Script post.cfm
==========================

first < has been replace by / and > by \ because google blog text editor is retarded..

/cfset x = GetHttpRequestData()\

/cfsavecontent variable="y"\
/cfoutput\
/table cellpadding = "2" cellspacing = "2"\
/tr\
/td\/b\HTTP Request item//b\//td\
/td>/b>Value//b//td\ //tr\
/cfloop collection = #x.headers# item = "http_item"\
/tr\
/td>#http_item#//td\
/td>#StructFind(x.headers, http_item)#//td\ //cfloop\
/tr\
/td\request_method//td\
/td\#x.method#//td\//tr\
/tr\
/td>server_protocol//td\
/td>#x.protocol#//td\//tr\
//table\
/b>http_content --- #x.content#//b\
//cfoutput\
//cfsavecontent\

working post.php script
=======================

#begin script

error_log("post.php Enter");

$debug = 1;
$ua = $_SERVER["HTTP_USER_AGENT"];
$server_request_uri = $_SERVER['REQUEST_URI'];
$server_name = $_SERVER['HTTP_HOST'];
$remote_addr = $_SERVER['REMOTE_ADDR'];
$server_addr = $_SERVER['SERVER_ADDR'];
$server_port = $_SERVER['SERVER_PORT'];
$server_request = $_SERVER['REQUEST_METHOD'];
$server_request_time = $_SERVER['REQUEST_TIME'];
$server_protocol = $_SERVER["SERVER_PROTOCOL"];

error_log("=============================");
error_log("");
error_log("POST $server_request_uri HTTP/1.0");
foreach ($headers as $header_entry=>$header_value)
{
error_log("$header_entry: $header_value");
}
error_log(print_r($_POST,true));

#end script


WORKING PHP LOG
===============

21-Oct-2008 09:15:39]
[21-Oct-2008 09:16:29] post.php Enter
[21-Oct-2008 09:16:29] =============================
[21-Oct-2008 09:16:29]
[21-Oct-2008 09:16:29] POST /post.php HTTP/1.0
[21-Oct-2008 09:16:29] Host: www.fullyqualifydomainname.com
[21-Oct-2008 09:16:29] Content-Length: 655
[21-Oct-2008 09:16:29] Content-Encoding: ISO-8859-1
[21-Oct-2008 09:16:29] Content-Type: multipart/form-data; boundary=========00000024328
[21-Oct-2008 09:16:29] Accept: text/html, *.*
[21-Oct-2008 09:16:29] Expect: 100-continue
[21-Oct-2008 09:16:29] Array
(
[SessionID] =>
[version] => 1.0
[UserName] => test
[UserPassword] => test
[EOF] => EOF

)

on the other hand

wget http://www.fullyqualifydomainname.com/download/update.cfm --post-data="UserName=test&UserPassword=test" works fine with ColdFusion 7 and the previous script assuming that you will have to parse UserName=test&UserPassword=test as a ByteArray