How can I encode or mux h.264 streams in a SWF container?

1

Is there any way to encode a video file into a H.264 stream inside a SWF, or a program that allows muxing an existing (x264) stream into a SWF?

If not, any other possible codec better than Flash Video for a SWF? (I suppose it's possible since Youtube uses H.264 and AAC already).

Camilo Martin

Posted 2010-01-06T04:13:16.517

Reputation: 2 308

Question was closed 2014-10-09T22:07:13.233

First time I vote to close my own question (as off-topic, 'cause I think this kind of question is not welcome anymore in this site and gosh, it's been 4 years, it's not even relevant anymore with HTML5's native support for MKV (.webm) files). – Camilo Martin – 2014-10-07T21:30:21.627

Answers

1

You won't be able to encode H.264 to swf because as mentioned, swf supports Vector Graphics. You can't encode H.264 using flv container either (using ffmpeg, etc) because the authors intentionally prevents this for copyright reasons. You would have to purchase H.264 licenses to encode to flv. (YouTube has H.264 flv because they purchased the license to do so.)

The best thing you can do is encode your file to h.264 mp4 container and create or use an swf player and include XML meta data and tags to stream the mp4 file. Its just like using H.264 flv and the JWPlayer is great for doing this with Flash Player 10.

This worked great for me!!!

Peter

Posted 2010-01-06T04:13:16.517

Reputation:

Thanks for the answer. But are you sure Youtube has H.264 FLVs? Their H.264 streams seem to be encoded in mp4 containers. – Camilo Martin – 2010-02-14T19:46:35.870

This is wrong... You can compile FFmpeg yourself with h.264 support. I have x264 in my FFmpeg build. – Wyatt8740 – 2014-05-07T02:36:38.920

0

Free video to flash converter can make SWF files using H.264 as well as AAC and as the name implies, it is free. I use it all the time.

Mark

Posted 2010-01-06T04:13:16.517

Reputation: 1

Answer is not very usefull without link to the software. – DavidPostill – 2014-10-07T10:12:20.060

@DavidPostill I'm guessing the name is "Free Video to Flash Converter" - from that name, I'd run the thing through VirusTotal, Anubis and still run it in a VM anyway lol.

– Camilo Martin – 2014-10-07T21:28:35.880

0

The simplest solution would be to import the video into Flash then play about with it there.

Another way, depending on where you're using the SWF would be to make a video player in Flash then use XML (or any other method, I don't know Flash or AS) then stream the video through the player.

But I don't know of any software which fits your precice needs.

Ben Shelock

Posted 2010-01-06T04:13:16.517

Reputation: 350

The problem is I don't know Flash either. I just wanted to have a nice quality video in SWF since Flash video and MP3 are not the best for low bitrates. – Camilo Martin – 2010-01-06T17:41:29.217

@Camilo, if you are using an external encoder, you can tweak things a bit. I was able to get decent size/quality out of mp3 with lame using 8-bit mono 22khz sample rate, YMMV. For the video, it sucks but you can use 3rd party encoders that get better results than what comes with Flash. – Tracker1 – 2010-01-16T03:18:37.353

0

Wish I had a better answer for you. For compatibility you're pretty much stuck with FLV. FLV is geared towards a longer encoding time, and a less-cpu intensive decoding. If you don't go too nuts with the size targeting you can get sizes and quality similar to mp4 (non-avc, no h.264) with flv. It's worth noting that there are some 3rd party FLV encoders that do a better job than the ones that come with Flash, most are commercial though.

IIRC, FLV uses an encoding from a company that was bought out by Google last year and an earlier version of that codec was the base for Theora.

Tracker1

Posted 2010-01-06T04:13:16.517

Reputation: 563

flv is container not encoder! – Maciek Sawicki – 2010-01-16T03:27:22.903

0

Why not use flv ( http://en.wikipedia.org/wiki/Flash_Video )? it's Adobe container that supports h264. You can do this with ffmpeg or vlc.

SWF is for Vector graphics ( http://en.wikipedia.org/wiki/SWF), and I'm not sure if it supports h264 directly. I think programs like "Alice H264 to SWF" just embedding flv into swf.

If You need easy option to play flv You can use flash based player (JWplayer for example).

Maciek Sawicki

Posted 2010-01-06T04:13:16.517

Reputation: 1 072