On Mar 11, 2009, at 10:56 AM, George wrote:

What I'm doing on video:

Use an standalone Window component to contain a FLVPlayback (CS4
version), run full screen display mode on its stage alone. (Didn't set
'fullScreenSourceRect', as I tried, it cause worse performance
significantly)

Write your own. I'd stay away from FLVPlayback. Roll your own video player using NetStream and/or video classes along with scripts to control it.

Instead of using fullScreenSourceRect you can just try simple full screen mode and set up your controls properly. Flash has a pretty efficient full screen model now and also takes into consideration vertical blank (VBL) for smoother playback. I'm not so sure hardware scaling does that.

Video encode settings:
960x540, Field Oder - none (no interlace), profile - high, level - 4.1,
frame rate - should be 30 or 29.97 fps, target bitrate - 1.5 mbps, max
bitrate - 2 mbps.

That sounds good.

Ensure no smoothing is on the video. Try to set the profile to "main." High is more processor intensive. Drop the data rate in half as a test - though I'm guessing the results you get will be similar. It just might be your processor.

My question is:
- Does each AIR nativeWindow run its own thread, or the whole AIR
application running a single thread?

Certain things within Flash are multithreaded and will take advantage of multiple cores (bitmap filters, some vector ops, H.264 decoding and hardware scaling).

Flash itself runs in one thread (i think?). The only other thing with AIR that's unique is WebKit ... don't know much about that.

- What's the best practices for full screen high quality video in AIR?
Anything I can improve?

On an intel core 2 duo chip you should be able to do full screen 720p (1280x720) video at the least - and barely 1080p. Should being the operative word. Best practices here is all in the encoding and bit rate.

Check out the Adobe HD Gallery and see if you can run those videos on your test case. If you can't, you need a faster machine.

You can try FFMPEG to encode the H.264 video (x264 or mencoder). It does a great job and you get some nice additional encoding features that might give you a one-up on performance. That said, I think the latest Flash Media Encoder is pretty well tuned.

- How to GC after video played? I used videoplayer.clear(), but cannot
run videoplayer.close(), as I test when try to load a new video quickly,
it throw an error.

Not sure there's enough information to help here. What error are you getting? GC is automatic and you don't have much control with FLVPlayback.

- What's the best HD video performance we can get in multiple windows
Flex/AIR application?

One stream of H.264 encoded 1080p video for best performance on a dual core processor. More windows with more streams is possible but from a performance standpoint, you might need 2x as many cores as you have streams to play. I'm not sure how smart the multithreading is on the video decoding in Flash.

Some other thoughts:

1. I'd recommend trying WinXP Pro as a test case

2. Do not use any transparent border skin for the AIR Window. The custom border skin will kill the performance of your application anywhere from 10-20%

cheers,

Jon



Reply via email to