Flash H.264 File Format

  

Active4 years, 8 months ago

I am trying to convert different files to a flash compatible .mp4 file with ffmpeg, but I can't seem to get it to work. Of course the objective is to get the greatest quality with the smallest file size.

Nowadays, more people are using MP4/MKV/H.264 formats. Many Blu-ray players will play h.264 in MP4 or MKV from a flash drive, USB hard drive, even network shares. I have an LG BD-670 that does so. You can also look into standalone media players like the Western Digital WDTV series. A format is like MPEG, MPEG-2, MPEG-4 (Part 2), MPEG-4 AVC (Part 10) or H.264 or x264. Anyway, the point is your TV may not identify the format by the container (file name extension) so just RENAME your.MP4 to.AVI and see if it works. If it does, I will give you more gyan on why it did.:) All best!

Flash Player 9 Update 3, released on 3 December 2007, also includes support for the new Flash Video file format F4V and H.264 video standard (also known as MPEG-4 part 10, or AVC) which is even more computationally demanding, but offers significantly better quality/bitrate ratio. H.264 player free download - Total Video Player, H.264 Video ES Viewer, DiscretePhoton H.264 Encoder, and many more programs. And any other format video and audio files. Free to try Editors. Open and play a H264 file fast (and other formats). Free Audio and Video Player Software – Media Player Lite. MPL also supports H.264 DivX, XviD and Flash Video. Re: Can't Play Encoded h.264 Files thunderclap82 Dec 20, 2012 4:30 AM ( in response to Jim_Simon ) Quicktime, VLC and Windows Media Player are the three I tried. Now Adobe Flash player has supported MP4 video playback encoding with H.264 and pure FLV encoding with H.264. Regardless of MP4 or pure FLV encoding with H.264, Moyea FLV Player can playback both well. Using this FLV player, just freely enjoy your favorite videos with H.264 codec.

So far I have this, which works, but it doesn't play in a flash player for some reason. The result isn't that great, how can I improve this conversion?

This is the command I'm using:

hichris123
7,60012 gold badges45 silver badges63 bronze badges
espenhogbakkespenhogbakk
4,6318 gold badges33 silver badges35 bronze badges

8 Answers

To create the interleaving metadata (which will allow for mid stream resumes, and rewinds/fforwards), use the gpac utilities (included in medibuntu for example) to re-interleave the file. Convert to mp4 as follows, with FFmpeg version 0.5 or better:

then

Tada! Done! This will stream properly in JW Flv or other flash players.

Stu Thompson
31k18 gold badges101 silver badges150 bronze badges
Derek Anderson

FLV and MP4 are media containers.

MPEG-4 part 2 and H.264 are video codecs. (and H.264 gives much better quality)

libx264 is an encoder for H.264 codec.

mpeg4 is an encoder for MPEG-4 part 2 codec.

Flash can only play video codec H.264 in FLV container.

So the params should be like that:

tsttst
3,2611 gold badge12 silver badges7 bronze badges

In my snippet collection I have the following for this task.

ffmpeg first pass:

ffmpeg second pass:

The quality setting are 2000k = video bitrate, 128k = audio bitrat and 300 = GOP. Don't ask me what the other parameters are. :)

Interleaving with MP4Box:

Create a thumbnail / poster image (play around with 5 to obtain your desired image)

Hope this helps.

janosrusiczkijanosrusiczki
1,3602 gold badges15 silver badges37 bronze badges

I use a sequence of commands to do this, starting with mencoder. (see script below). The trick is that ffmpeg's (and mencoder's) mp4 file output is not generally flash compatible due to the way it's interleaved and they don't offer good control over this behavior. So, I produce an AVI file and then use mp4box to remux it the way I want. Here's my complete script, that expects to be given an .avi file, and produces a flash-playable .mp4 file.

slacyslacy
7,6155 gold badges47 silver badges57 bronze badges

If you're using ffmpeg to make .mp4s, look in the ffpresets/ directory and use -vpre. The default options (for all codecs, but especially libx264) are very bad and practically all of them should be set to something custom. -vpre takes care of most of it for x264.

File format download
alex strangealex strange

Actually you shouldn't be using maxrate, especially not a maxrate of 10000k when you have your bitrate explicitly set to 200k. In fact looking at this even closer I really don't think you understand what most of that stuff is for :)

For starters you're calling the input file output.mp4, plus the output file (which should actually be /dev/null for pass 1) is called yourinfile.avi and you haven't actually set a container format so what you would end up with is an h264 encoded avi file.

Try this for high quality 1080p HD flash compatible h264 encoded MPEG-4 videos, first create a file with the following contents in the same directory as the video you're encoding and name it something like flash-mp4.ffpreset

then from the command line:

That should play perfectly with flash 10+

Justin BuserJustin Buser

Just some ideas of why this might happen

  • mp4 is only supported in flash 9.0.115.0 or higher, what version are you using?
  • does the webserver hosting the file have the mp4 mime type setup?

does it play when converting to FLV and is that an option? You would then use something like the following options

olleolle

I found this (very verbose, i'm not sure what half of it even does) snippet somewhere on the web. It's made for doing two passes, so it won't output any video on the first pass, you'll need to set it to do -pass 2 to run the second pass and output the actual video.

To get progressive playback during download you will also need to move the metadata to the start of the file. ffmpeg puts this at the end and flash needs this before it can start playing. A useful tool for this is QTIndexSwapper

grapefruktgrapefrukt
19.8k4 gold badges42 silver badges67 bronze badges

Not the answer you're looking for? Browse other questions tagged flashffmpegflash-video or ask your own question.

If you have trouble in playing back the H.264 files on your existing media player, there is a great and free H.264 player that you can try out. That's the VLC player. It works across platforms such as on Mac, Windows, Linux and etc. However, If you're used to your original media player and don't want to download another player on your computer, that's understandable. You can probably try to convert the H.264 files to other formats that's compatible with your own player. By the way, converting the H.264 files enables you to get the most out of it - recognized for playbacks in any application or device, supports further editing in any other software (i.e. iMovie or Final Cut) and so on.

What is H.264?

H.264 is an implementation of MPEG-4 Part 10, a standard for video compression. Compared to other video, it produces very high quality at a lower bitrate, which makes it more suitable to compress full high-definition video content into a smaller file size. However, it also consumes more resources than other popular video formats when it provides higher quality video. Actually, it's a video codec, which must be stored in other multimedia containers like the MP4, MOV, AVI, MKV and etc.

Play H.264 Files by Video Conversion

Considering various video formats that your H.264 files are probably saved in, you'd better convert the H.264 files for smoother playbacks on a variety of applications and devices or etc. To convert to or from H.264 files, you'll need some help from the Video Converter (Video Converter for Mac).

1. Download, install and run this program.

Flash H 264 File Format Player Download

2. Drag-and-drop the H.264 files from your computer's hard drive onto this program, open the format list by clicking the OutputFormat image icon on the right-hand side of the interface and then select any output format you want. There's also other presets available for your convenience.

File Format Factory

3. Hit the Convert button to convert your H.264 files.