Splitting H.264 with ActionScript - actionscript-3

I'm wondering if someone can help me with references or code snippet of H.264 files splitting.

It is not possible to split an h.264 file directly in AS3.
With out more information it is difficult to suggestion anything. But I'll try. What you can do is, somehow, communicate to an external process to split the file for you. E.g.: Java, C#, Python, something running outside of the browser (or Adobe AIR.)
Splitting an h.264 video is non-trivial. More than likely you will need to use third party software. Two suggestions jump to mind:
ffmpeg (with x264)
MP4Box
Again, this is non-trivial and there are more than one approaches to the problem. Without more details, we cannot help.

It is certainly possible to split h.264, it just might be difficult. Thibault Imbert made a
FLVSlicer

Related

decompile/extract microsoft agent?

I'm looking for a way to decompress or decompile a microsoft agent.
for example the merlin agent
I'd like to extract the animations/images. best way i've found so far is. recording my screen with a pink background. and splitting the video... but this isn't really good practice...
any tips?
Years ago, I authored an MSAgent Character Data Specification, which documents the complete ACS, ACF, and ACA file formats.
I have used that knowledge to write my own MSAgent decompiler that can fully decompile an ACS file into its constituent image and audio files, and create a complete ACD file that can be opened in the MSAgent Editor.
You can download the decompiler from my website, under
"Products | Applications | MSAgent Decompiler".
As for extracting the animations from the ACS file, which is the file for the MS Agent Character, it cannot be done with any known software. Over the years, I have searched for methods to extract the files from the ACS file, have found nothing even as of today (May 6, 2017).
You might be able to get somewhere using resourcehacker. At the least, separate out the useless parts from the useful.
I'm not sure what format they would have used for that, which makes this more difficult. Either way you need to first break open the container first.

What are the pro and cons of using Haxe over Actionscript-3?

I'm thinking about using Haxe in place of AS3.
What are the disadventages of that? I can think about:
Difficulties with using native AS3 libraries.
Difficulity of debugging after language translation.
Haxe is quite young, it may have some rough edges. Does it?
Does any one of you have expirience with Haxe dark sides?
What are the adventages? I've heard:
Performance.
Multiple targets (But I don't see how that is useful)
Better typing that AS3
Maybe better syntax.
Haxe is big enough that there should be more. What are the pros of Haxe?
Edit:
If there are no real disadvantages then why Haxe is not replacing AS3?
Your first point is surely true. Some "native" libraries (such as Flex) may require a little of gym to be included in your project. In the vast majority of cases it is a quite smooth process. Haxe supports multiple -swf-lib which permit to have the code of the imported assets immediately available in your application. Note that the imported libs are not just embedded but are recognized as code asset, so if your IDE is integrated with Haxe you will have type completion for that too.
About the debugging there are no issues at all for the translation, that because the language is not translated to AS3 but directly compiled to AVM2 bytecode. When the -debug switch is on, the full stack trace with source code references (filename, line and position) is fully preserved. An uncaught exception will point you exactly at the line of code that generated it.
Haxe is not really that young and for sure the AVM2 output is the one with the best support of all. There are no rough edges in my opinion.
Of the pros you have outlined I want to underline that multiple targets can be huge. Of course to take really advantage of it you can't really rely on external libs specific for AS3. Even so there are always big chunks of code that you want/can reuse across projects.
To mention a few other advantages:
macros are a recent addition which add a huge pool of possibilities.
Molehill API is already available for Haxe (SVN version) and Nicolas is working on a Shader system that makes it even bigger.
Haxe is evolving constantly bringing new (important) features at each release.

AS3 PNG Encoder?

Is there a way to encode bitmap data into PNG for use with a FileReference.Save() method in AS3? I assume I need an encoder library.
Where can I get a library that encode BitpmapData into PNG?
Shameless plug!
I just wrote a new PNG encoder called PNGEncoder2. It's extremely fast, offers three compression levels, supports huge images, and offers true asynchronous encoding (no pause at the end during the compression step).
More details, including usage examples and the full feature list, can be found in the README on GitHub. I also wrote a blog post about it, which includes a benchmark comparing it to other encoders (including Adobe's and blooddy's).
You're looking for: https://github.com/mikechambers/as3corelib
There are probably other solutions, but this is widely used and well tested. I've used it myself on several occasions without issue.
I've been using blooddy_crypto.swc which you can read about and download here: http://va.lent.in/blog/2010/06/23/100x-times-faster-md5-and-more/ - I found it approx. 3 times faster than the adobe PNGEncoder.

What's the project of choice for compiling GPB to AS3?

Inside a Java project I use Google Protocol Buffers (GPB) for serializing my objects. I can use the same .proto files in auxiliary Python code, which is great. Now I'm adding a Flex client to the whole thing and I'd like to use the same .proto files once more.
It seems there's a couple of projects out there which compile .proto files to Actionscript. From a few glances at the projects' homepages, it seems to me that protobuf-actionscript3 is actually the most advanced and most "alive" of these projects.
Has anybody had practical experience with GPB to AS3 compilers and which one(s) can you recommend (or recommend against)?
If you're sure you want to use GPB, then protobuf-actionscript3 is your best option. It builds on the semi-successful protocol-buffers-actionscript project: http://code.google.com/p/protocol-buffers-actionscript/
If you're open to looking at other formats, there's always Adobe's own AMF3. It seems to have a good amount of community support behind it.
The only choice now is https://code.google.com/p/protoc-gen-as3/. All the other Protobuf/AS3 projects are out-of-date, and lack of features.

Adding a language to the AVM2

I'm interested in making a language to run on the AVM2 and I'm looking for advice on where to start. I do realize that this is by no means a trivial task, but I would like to give it a try and at the very least learn more about implementing a language along the way.
I have messed around with ANTLR and have been reading up on syntax issues for language development. What I'm looking for is advice on a path to take or useful references/books.
For instance I would like to generate (script/manually) some very simple AVM2 bytecode and get that to run on the VM as a start.
Thanks
If you are not interested in Haxe, you will basically need to write your own compiler that compiles objects down to ABC (Actionscript Byte Code). The AVM2 Overview document available from Adobe on ABC and the AVM2 which should help you get started. It's a fairly thorough document but stay alert for a few typo's in the bytecode instructions.
You will also need to wrap the bytecode in a doABC tag as part of a SWF container. You can get more information from the SWF File Format documentation.
If you'd like a headstart on writing the data structures (optimised int formats, etc), feel free to checkout the code at asmock, a dynamic mocking project I've been working on. The SWF/ByteCode generation stuff is a bit messy but there are IDataOutput wrappers (SWF, ByteCode) that might come in handy.
Project Alchemy by Adobe can be a good reference
http://labs.adobe.com/technologies/alchemy/
How did it go?
I'm also interested in doing a Java to AVM2 compiler...
Do you have any published code?
Take a look at Haxe: it is an open source language that can target different platforms, including the AVM. You can dig into the SWF compiler source code to get some inspiration.