-->

Encode video from any format to .flv format in AS3

2019-03-05 12:56发布

问题:

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.

回答1:

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

  1. play the video in flash and grab 'screenshots'
  2. 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.