create a composite from bitmap and video file with FFmpeg or other binary via as3 frontend - actionscript-3

After receiving much help with reading all the great stackoverflow topics in the past, I finally have to post a question myself.
For a client I need to create some sort of video-editor for dummies,
which has to generate a video file as output.
The editor has to load a movie-file scale and rotate it to a certain degree, and generate a composite video of a background bitmap and the rotated and placed video.
The frontend will be done in Flash/AS3 and has to use some background tools for processing the video.
Can I use FFmpeg to generate such a composite? Or is there any other good background task available?
edit:
update 19.12. ... still did not find a solution... any ideas from others?
thanks!

I don't think ffmpeg is the best tool for compositing. Instead, you could simply have Flash do the compositing, create the frames (as BitmapData objects) and upload them to some server-side script.
Then once all the frames have been uploaded, use Flash to call a second script that will build the video using ffmpeg.

Related

Saving and loading files in HTML5 with LibGDX

I was looking at the "wiki" for LibGDX and I don't see a method to save or load when using HTML5.
Could anyone point me in the right direction on how I can go about saving and loading files in HTML5 via LibGDX?
I know it is possible with HTML5 just not sure how to do it through LibGDX.
The File handling wiki says, that on HTML5 only Gdx.Files.internal is available.
Gdx.Files.internal is read only, so you can only load data from there.
there is one other possibility: The Preferences.
The wiki says:
Preferences are also the only way to date to write persistent data when your application is run in the browser.
This means, that only this way you can sava and load data.

How to create a Flash Movieclip via a web interface?

Forgive me if this is not the correct place to ask such a question.
Basically, I am looking for a way to allow someone to easily (at least, easier then diving into Flash) create a basic Flash animation (movieclip) with some placed image assets and text, all via a web interface.
I was thinking along the lines of using jQuery to allow drag and drop assets, of which you'd "record" the co-ordinates and relay that to Flash somehow to create the SWF file.
Or would it be better to create a tool in Flash (surely making operations easier) and then have some kind of "save" button to render out the SWF?
I'm totally open to suggestions.
Thank you
If you really need to produce a stand-alone SWF file (and not just a config file for you own "player"), I would probably do it like this;
1) Create your editor in whatever system you feel like (flash, jquery etc).
2) Build a config file in the client. This is used, together with all the resources the user added, to play back the animation.
3) Upload said assets and config file to your web server.
4) Use the flex compiler (on the server) to produce the resulting SWF, combining your player with generated AS3 which embeds the uploaded resources as needed, to make it available to the player.
5) Give the user a download link for the newly generated SWF file.
I don't think there is any swf compiler available for Flash (actionescript). You may create a swf that allows users to create an animation, save it as a home-made vector format, and then replay it. But I don't believe you can create and independant swf file with only the created animation in it.
Just think about a player in Flash, and a format that the player will read (xml, json, name it...). You can either generate the input with jQuery or Flash, and then feed it into your player to display it. You will eventually need two files.
Apparently this library allows you to compile SWFs at runtime. I haven't used it myself (yet) and don't know how stable or flexible it is, but it appears to be what you're looking for. I'd recommend giving it a spin and seeing if it's sufficient.
I'm not exactly sure how it saves the file, so you might run into security problems since it's a web application. Hopefully it should be OK though.

Encode video from any format to .flv format in AS3

Is there any library in Action Script that be able to convert any video format to .FLV?
I've been looking for it with no success. I thought that as3 had functions for that purposes but not found.
I want to give the possibility that in my site, users can upload any video, so I need to convert it to a standard and compress it to a fixed resolution.
Thanks in advance.
There's a FLV encoder AS3 library. As far as I remember it requires image bytes and audio bytes for a frame. But you will have to get image data and sound data somewhere. You could either
play the video in flash and grab 'screenshots'
decode it and get actual data
In the first case you'll end with a mp4/flv -> flv converter which I guess is not what you need. In the second case you will have to decode videos somehow. So you either will have to implement decoding algorythms in AS3 or use Alchemy and existing C/C++ solutions.
Adobe is messing up with Alchemy at the moment, so I guess it is not an option anyway.
But everyone in their mind uses a server-side script to convert videos. There are tons of articles in the web. This will be the simplest, fastest and least painful solution.

edit actionscript from swf - compiled file

I have one swf file, it is JW Player plugin. It have one actionscript file in which is whole plugin code, and rest of files are jwplayer api files. So i need to open that file (where whole plugin code is) and edit few lines. But there is a problem, because when i try to decompile file with sothink swf decompiler (and few others) - to convert it to .FLA, decompiles simply crashes. It is because of some file from jwplayer api library. So, next thing i tried is to edit via HEX (because there is not much to be edited), but i couldn't find what i needed. So what i need is - is there any way or not? If yes, which program can be used for this?
I've had to do something similar in the past. In my scenario, the client had the SWF but no FLA. I needed to change a hardcoded url and sothink wasn't decompiling but I could view the AS in the sothink previewer. Luckily for me the flash wasn't very complex so I was able to copy the AS and graphics out and start a new project. I would imagine that JW Player is much more complex so this may not be an option for you, but thought I'd mention it anyway.
Depending on your needs, you may be able to get what you want by using the plugin API to extend the functionality or maybe even by customizing a skin.

Adobe AIR application audio

I have a quick question relating to Actionscript 3 / AIR. I have looked through the site, but may be searching for the wrong thing or terms.
Is it possible to get an application wide audio stream from an AIR application?
I am trying to create a local audio file containing everything (all channels) played in an AIR app.
Does anybody have any ideas or suggestions?
Kind regards,
Phil
Update:
I have tried using the SoundMixer.computeSpectrum() function, but it returns a bytearray (size 2480) full of zeros...
It looks like it isn't reading the audio data correctly... I am playing a swf loaded using a SwfLoader and it is playing the sound out...
Odd... Anybody got an idea..?
There is SoundMixer.computeSpectrum, which will give you the global waveform or frequency data for the app. Unfortunately, it is fairly unreliable, and if you are trying to piece together the entire accurate audio stream, it is probably insufficient. But it might be enough to suit your needs if you are making, say, a visualizer or something else that only wants to know the current state of the audio stream.
Have you looked at SoundMixer Class? It has a computeSpectrum method that can get all playing sounds into a ByteArray, if I'm not totally misinterpreting the docs there.