My Session at Adobe Max Milan

This year I have a session at Max Milan called “Complex Data Manipulation With Actionscript 3.0”. The title is a bit missleading because rather then showing how complex it is I want to show you how simple it is ;-)
In this session I want to cover aspects of working with files and streams in AIR and the Flash Player and take a look into how to manipulate those files by using the ByteArray class.
My current plan goes like this:
Overview of how file manipulation/analyzation is used in the Parleys Publisher/Player.
From there I extract some samples that will be discussed in detail (code).

  1. Implementing Resumable downloads
  2. Donwload videos while playing the partial loaded data
  3. Analyzing an flv file to find out keyframe positions – using this information creatively
  4. Loading a mp3 file reading the wave curve – mixing sounds and and save the result as .wav

So my question: Is this stuff interesting for you? What are you missing? What of the above examples interests you most/less? If you`re coming to MAX Milan and if you`re interested in this topic this is your chance to make sure the session will be relevant for you ๐Ÿ˜‰

Sure it`s hard to cover all this in just 50 min but it`s meant to be an inspiring session which gives you an idea of the possibilities and to take away possible fear that this stuff is too difficult – it really isn`t!
If the topic is interesting to you I would love you to register for it!

I had to cancel my presentation due to time constraints which is really a shame :-(
Anyway I wish you all agreat MAX – and iยดll make sure I use my planned session material for some more blog posts.
Benz

RichFLV ready for AIR 1.0

Just updated RichFLV for Air 1.0 and introduced some minor feature updates.

1. Edit Metadata:
This was requested for a long time. You can now edit the onMetaData. For now you can simply add or delete custom key/value pairs.

editmetadata.jpg

2. Set In- and Outpoints on Keyframes:
You can now set the In and outpoints directly on keyframes. Select a keyframe in the keyframe tab and click on the Set Inpoint/Set Outpoint buttons.

inpoint.jpg

[kml_flashembed movie=”http://www.richapps.de/files/richflv/installbage/badge.swf” height=”180″ width=”217″ fvars=”appname=RichFLV&appurl=http://www.richapps.de/files/richflv/installbadge/richflv.air&airversion=1.0.M6&buttoncolor=FF0000&messagecolor=000000&imageurl=http://www.richapps.de/files/richflv/installbadge/richflv.jpg” /]

It`s a bit strange working on this “old” version while already working on
version 2 which is completely different but this may take a while. In the meantime you can check out this video to see what`s coming.
Enjoy!

RichFLV now with autoupdate and drag`n drop

I`ve build in some more AIR specific features into RichFLV and also worked on the SWF export that now includes sound export.
Until now you could export your flv as an SWF but without the sound. I now managed to implement the SoundStreamHead and SoundStreamBlock Tags
from the SWF Specification. With some flvs there are still problems but most of the time it works fine. Don`t wonder if the SWF export now takes a bit longer i will optimize that later.

I`ve also implemented an autoupdate feature. When RichFLV is started it checks automatically if updates are available. If it finds an update it will show you a dialog that tells you something about
the changes in the new version and allows to auto update the app with one click. You can also manually check for updates by clicking the “Check for updates” item in the “About” menu.

updateMenu.gif

updateWindow.gif

One other small feature i`ve included is that if you have a video playing you can drag the video at any point to your desktop and it will make a screenshot from that position on your desktop (as a PNG).

dragImage.jpg

Get the Update:
RichFLV.air

Read/Write ID3 Tags with AIR

I found some time to improve my MP3 library. Now it allows to read and write! ID3v2 Tags.
I`ve not implemented everything but you can read basic information and edit it. You can even select a jpeg or png file that will be embedded into the mp3.
You can still trim the mp3 with the timeline. ByteArray and AIR kicks ass!

Check it out here (You`ll need the Adobe AIR Runtime)

Sources will be released as soon as i find the time to clean up the code and implement some more functionality.
id3.jpg

RichFLV now with mp3 import!

Finally i`ve a version ready with mp3 import. You can now select your favorite mp3 and swap the sound of the flv file with this mp3.
This is not the only big update. Maybe the most important thing are the performance improvements. I completely rewrote my flv classes so that it takes up much less memory and time to process flvs. Now it`s possible to analyze and modify even bigger files. For example with the old version a flv file with 150mb would eat up about 1.5Gb!!! of memory now it takes about 150mb. The only downside is that the export time has been increased slightly but not much. There is still more to find concerning performance but i think this update is quite significant and finaly makes RichFlv a really useful app.
Because i had to rewrite all classes it could be that there are some issues that i haven`t found yet. I`m absolutely busy at the moment and have no time to really test things so please get back to me with your findings and comments.

Here is a run down of how to do an mp3 import:

Choose Import>Mp3 and select an mp3 file.

mp3import.jpg

A new Timeline for the sound file will open up. The blue bar represents the flv file. You can drag the bar to alter the timestamp of the mp3.
mp3_timeline.jpg

If you want to export your flv with the new mp3 sound click the “Use Mp3 as soundtrack” checkbox. Otherwise the flv will be exported with it`s original sound.
Than just export the flv like before (Export>>FLV). You can now also decide if you want to keep the original sound were your new mp3 is not playing.
mp3controls.gif

I hope this release is useful for some of you. I have so much more things to add in the future but have to make small steps because i only find time for this late at night ๐Ÿ˜‰
But all your comments, ideas and bug reports are very much welcome (benz (at) richapps.de).

Download the new version here: RichFLV.air

(You`ll need the AIR runtime. If the file downloads as a zip file just rename it`s extension to air)

Editing Mp3s with Apollo

This is just a quick sample app that allows you to cut an mp3 file and get some information about it.
It`s all implemented using the ByteArray class and allows to read the frames and their headers from an mp3 file.
With this information it`s possible to cut the mp3 and create a new one. It would even be possible to merge several mp3 files into one long file.
I`m experimenting with this because i want to enable RichFLV to change the sound and add new mp3 sound tracks to the flv.
richMp3.jpg
You can download my prove of concept Mp3 tool here. (You`ll need the alpha Apollo Runtime)

RichFLV – Apollo app updated

This is the biggest update to RichFLV since it`s release.

Download RichFLV (Rename extension to .air if it downloads as a zip file)
Download Apollo Runtime (Alpha Version)

Here is a brief description what has been changed.

Performance:
The biggest improvement is the performance boost. This version should analyse flvs up to 10 times faster than the old version.
I was able to analyse a 140Mb file also i would not recommend this but files up to 80 Mb should be ok.
The biggest problem currently is the memory consumption. With the 140Mb file my RAM could easily eat up 1GB. I will look into that for a next update.
One thing i will also invastigate is to change the analysis of the flv when it`s loaded. Maybe it would make more sense to do the major part of the analysis when the file is saved.
This will keep memory usage low while working on the file and the import would be much faster but than it will take longer to save changes.

Progress Information:
I finally found a way to add a progress bar while importing a flv file. I was motivated to do this by the book “The Laws Of Simplicity” by John Maeda.
I can really recommend this book! The progress information is given in two chunks. First it shows how much of the file has been read and than it shows you how much of the flv has been analysed.
While analysing the flv it will also output how many tags of the different kinds (Video, Sound, Metadata) it has found.
Progress

New Improved Timeline:

The timeline is now more compact and easier to handle (i hope!?). I`ve build custom components for the sliders because i was not happy with the Slider component.
The keyframe and cutter handling should be much more precise now.

Timeline

Export Still Image As Jpeg:
I`ve added the ability to export still images from the video player. They will be saved as jpeg files at the moment. Later i will add different formats (PNG,BMP).
In the options menu you have the ability to change the quality settings for the jpegs.

jpegExport.jpg

Improved Layout Handling:

You can now hide the info panel and the timeline panel and get different views of the editor.
layout.jpg

More Options

I`ve included an option to set the aspect ration handling of the video and one for creating new cuepoints at the current timestamp of the video.
options.jpg

Chrome changed
I have changed the chrome settings from a custom chrome with transparency to the standard chrome because of performance issues.
Espacially when you had the application in fullscreen mode the app became quite sluggish. Now with the standard chrome it behaves much better.
I haven`t noticed a big performance hit with transparency in other apps i`ve build with apollo but when it comes to video this definetely has a huge impact.
Will see if that improves i the upcoming beta of apollo.

Please give comments if you like the changes, have suggestions or bug reports.

Download RichFLV (Rename extension to .air if it downloads as a zip file)
Download Apollo Runtime (Alpha Version)

RichFLV Updated

I couldn`t resist to rush out a new version (alpha 2.0) of RichFLV that adds some nice features.
I will be of to OFFF in Barcelona tomorrow and so i will not be able to work on this for a couple of days.
All this stuff is not tested in depth but seems to work fine. New features are:

– Keyframe visualisation:
Timeline_RichFLV

The timeline is extended to show were keyframes are located. This is important to see were it makes sense to cut the flv.

– Keyframe precise cutting
If you drag the thumbs for cutting the flv they will automatically adjust to the timestamp of the nearest keyframe in the flv.
Before this it was possible to cut a flv even on intra frames which makes no sense (or does it?). Maybe i will make it an option to allow cutting again on videoframes that are no keyframes.

– Selecting Keyframes via Keyframe Datagrid:

KeyframeDataGrid

If you select a keyframe in the datagrid the playhead will be set to that position in the flv.

– Export/Import Cuepoint Data with the FLVCoreCuepoints Format

Export
You can now export/import cuepoint in the new Adobe FLVCoreCuepoints xml-format. This makes it easy to save settings and apply them to different flvs.

– Finally fixed the Google/Youtube onMetadata Bug

The problem with importing youtube flvs should be solved now. Everyone who had problems with that could you confirm that?

Again all this has not been tested in depths so this is kind of an experimental update.

Download it here: RichFLV_alpha2.0 !!! New Version Available See This Post !!!
BTW: If any Flex people are at OFFF and want to meet for a chat let my know.