Thanks a lot Jon, Jon Bradley wrote: > > 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.
The reason I use FLVPlayback because I tried before writing my own video player, and didn't find any performance improvements (at that time I didn't use full screen mode though, video was resized to full screen size instead, to be controlled by a slide show engine I wrote, now I separated video from other contents). I will test whether it can improve in full screen mode if I have time on this project. > > 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. Yes I tried half rate a few days before, the results was similar. > >> 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. I tested both 480p and 720p, the video performance from Adobe HD gallery even worse. I think it because most of our pc/Macs using Intel shared graphics chips? But the owner of project wish to get high quality video playback in full screen even with Intel chips. Seems it has to have dedicated graphics card to play, as I test with iMac, the video running more smoothly. > > 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. The application change dynamically videos playback and other contents anytime. I tested on Vista, regular video play use 100M more memory than clean them when possible ( use both vp.clean() and vp.close() and then System.gc()). The error say 'failed to reconnect.' or so, happened in a special situation, as the application working in dual screen mode, it can sometime go back to single screen mode, so the same video (another video instance but same video source) will be played inside main window (for example, the second screen was disconnected by accident). This error happen when I switch from dual-screen to one-screen and return back again to dual-screen (will reconnect to the same source). > >> - 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 > >

