What's the fastest way to access video pixels in as3?
I would like to copy pixels from a 1080p video from one location to another efficiently / with minimal CPU impact.
So far, my implementation is pretty simple:
- using Drawmap BitmapData method to capture pixels from video
- using BitmapData copyPixels () to shuffle the pixels around
Ideally this would have as little CPU impact as possible, but I'm running out of options and can indeed use some advice from experienced actionscript 3 developers.
I profiled my code with Scout and noticed that the CPU usage is mostly around 70% but over 100%. I've looked at StageVideo , but one of the main limitations is this:
Video data cannot be copied to a BitmapData object (BitmapData.draw).
Is there a more direct way to access video pixels rather than rasterizing the DisplayObject?
Can I directly access each video frame as a ByteArray and connect it to the strong> BitmapData object? (I found appendBytes , but it seems to do whatever it needs to in my setup).
What's the most CPU friendly way to manipulate pixels from h264 1080p video in actionscript 3?
Also, is there a faster way to move pixels around others than copyPixels () using Flash Player?Also, I can see that Scout indicates that the video is not hardware accelerated (
). Shouldn't h264 hardware acceleration (even without scene video) as per this article (or is it just for fullscreen)?
source to share