Add to Technorati Favorites

May 07, 2008

How To Convert Movies to Flash or Silverlight with c#

SilverlightLooking for a fun software development project? Want to build your own YouTube? Ya me either, but how the heck do you convert videos to flash or Silverlight? It's not that hard actually as long as you use FFmpeg and some c# code. FFmpeg is a free video and audio converter.  What I like about Silverlight is it will just take the WMV format, and stream it for you.  So if your video is already in WMV, your are done.  If not, you can convert i to WMV, including the HD formats.  In flash, you will have to write some extra code to get it converted.  Check out the HD Halo Trailer in Silverlight by the way.

The first thing you will want to do is download FFmpeg.  There will be a few different files in there.  Make sure you put FFMPEG.exe and FLVTOOL.exe in your application directory.  Next you will want set the correct permissions on your web server.

The code below is fairly basic, but using other FFmpeg commands you can easily create thumbnails from the video, and save them to a location on your web server.  This code for example would create some image thumbnails for you quit easily.

startInfo.Arguments = string.Format(“-i \”{0}\”
-f image2 -ss 1 -vframes 1
-s 80x60 -an \ \”{1}\”", srcURL, destURL);

If you are using Silverlight, you can just keep the file in wmv, or convert it to wmv, and just run the command above against the video file to capture the image screenshot.

Anyway here is the sample code for you to try out to convert the video file to flash.  Silverlight is cool because you don't have to do that and it can just play the wmv in a streaming format automagically.

Sample Code

private void ConvertVideo(string srcURL, string destURL)
{
    string ffmpegURL = “~/project/tools/ffmpeg.exe”;
    DirectoryInfo directoryInfo = new DirectoryInfo(Path.GetDirectoryName
(Server.MapPath(ffmpegURL))); ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = Server.MapPath(ffmpegURL); startInfo.Arguments = string.Format(“-i \”{0}\”
-acodec mp3 -ab 64k -ac 2
-ar 44100 -f flv -deinterlace -nr 500 -croptop 4 -cropbottom 8 -cropleft 8
-cropright 8 -s 640x480 -aspect 4:3 -r 25 -b 650k -me_range 25 -i_qfactor 0.71
-g 500 \”{1}\”", srcURL, destURL); startInfo.WorkingDirectory = directoryInfo.FullName; startInfo.UseShellExecute = false; startInfo.RedirectStandardOutput = true; startInfo.RedirectStandardInput = true; startInfo.RedirectStandardError = true;

using (Process process = new Process())
{
process.StartInfo = startInfo;

try
{
process.Start();
StreamReader standardOutput = process.StandardOutput;
StreamWriter standardInput = process.StandardInput;
StreamReader standardError = process.StandardError;
process.WaitForExit();

lblError.Text = standardError.ReadToEnd();
lblOutput.Text = standardOutput.ReadToEnd();
}
catch (Exception ex)
{
Response.Write(ex.ToString());
}
}
}

April 30, 2008

CSI : New York Showing off Photosynth Tonight

Photosynth Photosynth is being showed off today on CSI: New York.  Why is Photosynth so cool?  It can take a bunch of pictures, analyze them for similarities, and display them in a three-dimensional space.  If you are not clear, this means it takes digital pictures you have taken, automagically analyzes them, and constructs a completely three-dimensional environment out of the pictures that you can fly around and navigate in.  It sounds like some crazy voodoo magic, but it works.  Kiss the crappy Quicktime VR goodbye that currently needs lots of special equipment and doesn't even do close to what Photosynth can do.

Photosynth was shown in 2006 at the Web 2.0 Summit, and a huge hit.

Check out Photosynth Live Labs where you can download a tech preview and see the application in action. 

March 23, 2008

Deep Zoom Composer

Deep Zoom ComposerIf you Silverlight 2 Beta 1 announcements at MIX, you should know that Silverlight 2 includes support for the Deep Zoom technology to allow you to quickly and smoothly zoom in on really large images. You have to check it out to see what I am talking about, it's pretty crazy cool.  If you want to see an amazing implementation of the Deep Zoom technology, check out the Hard Rock Memorabilia site: http://memorabilia.hardrock.com/

Deep Zoom Composer allows you to quickly import your own images, arrange and position them to your liking, and export the final output as either a Deep Zoom Image or Collection that can be fed into Silverlight's MutliScaleImage control. This means that you too can use your own images and display them using our Deep Zoom technology.

Deep Zoom is related to the SeaDragon technology that Microsoft has been demoing in their PhotoSynth application.

 

image

  Download Deep Zoom Composer

 

Technorati Tags: ,

February 17, 2008

The Complete List of XAML Tools

XAML ManXAML (Extensible Application Markup Language) is one of the most exciting innovations to come out of Microsoft in years.  It finally enables you to easily bridge the gap between designers and developers.  XAML promises to save companies a lot of time, money, and frustration.  XAML is used in WPF, Windows Presentation Foundation, and WPF/E, now named Silverlight.  WPF applications run native on Windows Vista, and Silverlight applications run anywhere, after installing an insanely small browser plugin.

Below is a complete listing of XAML Tools you can use today to build interactive user interfaces and applications that run on WPF and Silverlight.

Free XAML Tools

Visio Export to XAML
An Add-in to Visio 2007 to create XAML directly.

XAML Tune - Convert SVG# to XAML
A free tool that allows you to convert SVG files to XAML files.  It automates XAML transformations in order to improve design and code integration.

Adobe Illustrator Export to XAML
A freely available plug-in that enables Adobe Illustrator to export WPF and Silverlight compatible XAML

Adobe Illustrator to XAML Export C# Script
A script for exporting Adobe Illustrator artwork in the WPF/XAML format. The script is written in C#/.Net 2.0 using the Illustrator CS2 COM Type Library. Although it is treated as a script in Illustrator, it is also a stand-alone application.

Adobe Fireworks Export to XAML
The Infragistics Fireworks to XAML Exporter is a Fireworks Extension that allows you to easily convert artwork created in Adobe Fireworks to the new XAML format introduced with Windows Presentation Foundation (WPF). For those of you with libraries of artwork created in Fireworks (like the Infragistics Visual Design Group), this should be welcome news! You can now reuse prior artwork, fills, and layouts in your new WPF applications.

Adobe Photoshop Export to XAML
Simple, free, open-source tool for converting Photoshop .PSD files to XAML. Also supports limited SWF conversion to XAML.

Adobe Flash Export to XAML
A free tool that converts Adobe/Macromedia Flash files to XAML

SVG Export to XAML
Another free tool that allows you to convert SVG files to XAML files.

Clipboard and Metafile's Export to XAML
Paste2Xaml is a WPF application that can read Windows metafile's (wmf), Enhanced Metafile's (emf) or get matafile objects from clipboard and can convert it into XAML. It can also export embedded images that can be used in exported XAML.

Blender Export to XAML
The XAML export script for Blender allows the popular free 3D modeller to be used to create content for WPF applications. 3D scenes created in Blender are exported to .XAML files which can be dynamically loaded or compiled into your WPF applications.

Online 3D Studio Max Export to XAML
Online 3ds to xaml converter can only convert smaller and simpler 3ds files.

3D Studio Max Export to XAML
Reader3ds is a class library than can be used to read 3D models from a 3ds file and to use them in a WPF (.Net 3.0) application. This way you can define 3D models in 3D modeling application and simply use the models in you application.

XAML PAD
XamlPad (xamlpad.exe) is a basic visual editor for Extensible Application Markup Language (XAML). XAMLPad is installed with the SDK and can be found from the start menu at All Programs/Microsoft Windows SDK/Tools/XAMLPad

XAML Tools for Purchase

Expression Blend
A user interface design tool for creating rich graphical interfaces for web and desktop applications that blend the features of these two types of applications. Expression Blend is itself written using the .NET Framework 3.0 and Windows Presentation Foundation (WPF).

Expression Design
Microsoft's commercial professional illustration vector and raster graphic design tool based on Creature House Expression, which was acquired by Microsoft in 2003. It is part of the Microsoft Expression Studio suite and is written using Windows Presentation Foundation.

Visual Studio 2008
Visual Studio is the main Integrated Development Environment (IDE) from Microsoft. It can be used to develop console and GUI applications along with Windows Forms applications, web sites, web applications, and web services in both native code as well as managed code for all platforms supported by Microsoft Windows, Windows Mobile, .NET Framework, .NET Compact Framework and Microsoft Silverlight.

Electric Rain ZAM 3D Version
Zam 3D is a 3D XAML Tool for XAML Application Development.  It provides developers and designers with a quick and easy solution for creating 3D interface elements for Microsoft Windows Vista based applications. It also acts as a 3ds to XAML and DXF to XAML converter.

Electric Rain Swift 3D
The premier 3D tool for rich media designers. It's the only 3D software to directly integrate with Adobe Flash and Silverlight through the Swift 3D File Importer and SmartLayer Technology, and produces unrivalled vector rendering quality and output style options. Swift 3D's toolset and interface allow anyone to quickly create 3D content, while providing a full set of advanced tools to grow into. And with new Papervision3D export, Swift 3D introduces a whole new realm of true 3D possibilities in Flash and Silverlight.

Aurora XAML Designer
Aurora is a XAML design product for developing user interfaces and graphics for Windows desktop and web applications. In addition to being a XAML designer, Aurora also serves as a customizable and embeddable graphics design platform with an Object Model and Plug-in architecture.

Maya Export to XAML
This plug-in allows designers to create compelling 3D user interfaces in Maya and export to XAML, the next generation application GUI markup language for windows and the web. Objects created in Maya can be used as hit targets, windows forms controls, and more. Because the objects are kept as vector data in the interface, the user can scale the entire application and keep the same look and feel.

Lightwave Export to XAML
Export your LightWave objects and scenes to XAML for use in Microsoft Expression Blend.

40+ 3D Format Import and Export to XAML
Publish to more than 40 different 2D and 3D graphic formats. Automatically
publish into 3D interactive PDF documents, XAML, Silverlight, WPF,
Adobe or HTML.

Adobe Flash Export to XAML (Converts Animations)
This program converts Flash animations to the Xaml format. It accepts files up to Flash version 8. It handles animation, sound and fonts. You drag files in, it generates the results. You can use the command line for automation. There is also a new interface that allows viewing files and all their definitions as WPF or Silverlight.

 

Technorati Tags: ,,

Add Us

  • Add to Technorati Favorites
    Add Miguel Carrasco's Feedburner

    Add Miguel Carrasco to Google

    Subscribe to MyMSN

    Subscribe to MyYahoo!

    Subscribe to Bloglines

    Subscribe to Newsgator

    Subscribe to Feedster

    Subscribe to NewsIsFree

Great Sites