Converting Mpeg file to flv and simultaneously playing the converted file in flash cs3 using as3 - actionscript-3

I have an mpg file which I want to convert to flv format, but I have a requirement that while converting the mpg file, I also have to simultaneously play the converted flv file in the flash cs3. How to do it? I am using cs3 and as3.

If you want to convert your files programmaticly then use ffmpeg. This is a commandline tool which can convert video files to nearly everything. You have to execute ffmpeg with the correct params and wait until the video is ready. This works only on serverside. Means the flash client loads up the video file to the server. There it gets converted. You can execute ffmpeg with any serverside language like php.
Sadly I have no idea if it is possible to watch the video while converting. I think not but maybe someone else knows more.

Related

AAC & AVC byte stream data into ts file

Background:
I am trying to build my own RTMP server for live streaming. (Python3+)
I have succeeded to establish an RTMP connection between the server and the client (using OBS). The client sends me the video and audio data. (audio codec: AAC, video codec: AVC).
I also built a website (HTTP), with HLS (hls.js) player (.TS & .M3U8) that works properly.
Goal:
What I need to do is to take the video and audio data (bytes) from the RTMP connection and join them into a .ts file container so it could be playable on my website.
Plan:
I planned to join them into an FLV file and then convert it to TS using FFmpeg. which actually worked with the audio data because FLV support AAC, so I generated FLV files that contained audio-only.
Problem:
The problem started when I tried to add the video data into the FLV file, but it is not possible because FLV does not support AVC.
What I tried to do:
I can choose another file container to work with, that supports AVC/AAC but they all seem really complicated and I don't have much time for this.
I tried to find a way to convert the AVC to H.263 and then put it inside the FLV (Because it does support H263) but I couldn't find a way.
I really need help. Thanks in advance!

Export dynamic audio from Flash

I'm generating a 44100hz dynamic audio stream in Flash using a flash.media.Sound object and the SAMPLE_DATA event. I'd like to be able to analyze the output instead of just listening to it.
What would be the most straightforward way of converting my Flash stream of float samples to an audio file, in a standard format that can be opened by an audio editor? Is there any audio format that would be particularly suitable for this?
If you don't want to listen to it, there's no need to use Sound or the Event.SAMPLE_DATA at all. Just create the numbers and store them in a ByteArray or other data structure.
Is there any audio format that would be particularly suitable for this?
A format that can be opened by your audio editor would be preferable.
Otherwise, this totally depends on what you want to do with the sound data.
What would be the most straightforward way of converting my Flash stream of float samples to an audio file, in a standard format that can be opened by an audio editor?
To use an existing library that encodes the data into the specified format.
tonfall supports "various audio formats Wav AIFF RAW PCM (no header) "Encoder/Decoder
WaveEncoder from Nicolas Bretin apparently encodes to WAV
Of course, if you know the specification, you can write your own encoder.

Embed a wav as3

How can I embed a wav into as3/flash builder?
I have:
[Embed(source="assets/sounds/claps.wav")]
public var testSound:Class;
private var blahsound:Sound = Sound(new testSound());
But no luck...
You can't. Well, not directly.
Although there are various sound file formats used to encode digital
audio, ActionScript 3.0, Flash Player and AIR support sound files that
are stored in the mp3 format. They cannot directly load or play sound
files in other formats like WAV or AIFF.
You either need to convert it to an mp3 before embedding it. Or embed it as a ByteArray, and then try to use SampleDataEvent.SAMPLE_DATA to fill the sound buffer manually with the bytes from the wav file, but you are going to have to do some finagling.
It's possible, but hacky. As #32bitkid said, FP doesn't directly support loading sound files other than mp3. The solution is to load the wav as a ByteArray, construct a SWF in memory (as using the Flash IDE, you can add wav files), then access the Sound object from this SWF.
Check out http://richapps.de/?p=97
You can try the open source library, as3wavsound (AWS). It supports embedding .wav files and playing them natively.

Code-generated SWF to FLV

I need to convert a swf movie that is created entirely through code (with the help of TweenLite) to a .flv format. The issue here is that I need to 1) Do this as a batch process, and that 2) since the swf is entirely generated by code it only has 1 frame and as such normal conversions like from CS5.5 to to the .avi format give me just 1 frame in the resulting video format. Is there a free converter out there that can get past the fact that my video is technically only 1 frame long and can handle batch jobs? Thanks for all your help
Sounds like you could implement a JSFL extension if you have a copy of Adobe Flash or a trial from their site. It basically adds a command to publish multiple folders and sub folders.
http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&loc=en_us&extid=1021887

Can i save byteArray to mp3 file?

Well, i am recording the voice from heaphone and the sound data is stored in ByteArray at runtime, now can i stored as mp3 ??
i want to save as mp3 file on the client system.. For that, i think i have to use air application.. Am i right?
I found this link where someone used Alchemy to convert to MP3.