Log in

View Full Version : Encoding for Flash


Lele-brz
15th September 2008, 14:42
Hi,
What do you think are the parameters to consider when encoding h264 for Flash.
It seems to me that playing an mp4 (h264+aac) seems quite CPU demanding from Flash.
Do I have to use just Baseline profile or the problem is the performance of the Flash h264 decoder?

Thanks for any tips on that
Bye

Comatose
15th September 2008, 15:09
I think Flash takes anything. I haven't tried, but you can definitely go at least up to 4.1, with no bframe or ref limitations.

The problem is performance, so I'd just try encoding and see how much CPU% it uses.

Lele-brz
15th September 2008, 16:27
thanks,
well, I have to say that now I'm using Flash 10 beta and I have to say that the performance are much better, especially at full-screen.

Dark Shikari
15th September 2008, 16:34
Flash is pretty demanding no matter what it plays; last I tried 8 megabit 720p FLV1 (Sorenson H.263) lags on my Core 2 Duo.

But for standard-def H.264 I've never had a problem on most PCs, even for 60fps stuff (http://mirror05.x264.nl/Dark/Flash/mof.html). Though Flash as a whole does stutter a bit in all browsers I've tried except Google Chrome.

Lele-brz
15th September 2008, 16:45
I noticed that with Flash Player 10 Beta I can play full screen those videos:
http://www.flashcomguru.com/apps/hd_full/hd.html

I downloaded one to check encoding parameters but it's not encoded using x264.

smok3
7th November 2008, 12:22
is there a strategy to make videos less demanding (some buffering caps, ect?)? - i mean with x264. The goal is 0 stuttering, 100% fluid playback.

audyovydeo
7th November 2008, 13:45
is there a strategy to make videos less demanding (some buffering caps, ect?)? - i mean with x264. The goal is 0 stuttering, 100% fluid playback.

... encoding to Main or Baseline profiles ? ...

cheers
audyovydeo

smok3
7th November 2008, 15:16
without making them ipod-ish i should add :)

Dark Shikari
7th November 2008, 19:59
... encoding to Main or Baseline profiles ? ...

cheers
audyovydeoHigh requires not one ounce more CPU than Main--if anything, at the same quality level, it requires less...

Sagekilla
7th November 2008, 20:28
CAVLC vs CABAC, resolution, and deblocking (on or off) are the three things that'll determine how fast it'll play back. Otherwise, nothing else really matters.

More refs just take up more memory but they won't cause the decoder to slow down.

smok3
8th November 2008, 12:02
ok so --no-cabac maybe worth investigating? (say my goal is 576x320 video with stereo LC AAC audio)

Dark Shikari
8th November 2008, 12:13
ok so --no-cabac maybe worth investigating? (say my goal is 576x320 video with stereo LC AAC audio)If a computer can't play sub-SD resolution with CABAC... well I doubt there are a significant number of people still using Pentium 2s.

smok3
8th November 2008, 12:22
We are talking about flash playback only right?

Dark Shikari
8th November 2008, 12:32
We are talking about flash playback only right?Sure, but Flash uses the Mainconcept decoder, which isn't exactly slow.

Sagekilla
8th November 2008, 19:07
In other words, if you're doing something like 640x480 (4:3) or 640x360 (16:9) playback, which in most cases is no where near that high, you have nothing to worry about. If you're doing 720p decoding though, depending how old the person's computer they might run into stuttering with video. Anything at SD or lower should be fine though.

smok3
8th November 2008, 19:10
ok, next time ppl get jumpering issues i will just point them at this thread, solved :devil:

foxyshadis
14th November 2008, 07:22
With flash, it's not the decoding, the display can actually eat up more cpu than the entire decoding process. Adobe still has a lot of work to do on their hardware accelerated display code. Larger or full-screen video gets laggy easy, even at tiny bitrates!

smok3
14th November 2008, 09:00
--no-cabac didn't solve anything, must be some other issue (no, its not full screen either, jumpering happens in 1:1 displays as well).

fields_g
18th November 2008, 02:00
With flash, it's not the decoding, the display can actually eat up more cpu than the entire decoding process. Adobe still has a lot of work to do on their hardware accelerated display code. Larger or full-screen video gets laggy easy, even at tiny bitrates!

I've had Flash 10 freeze after about 10-30 seconds when playing back at fullscreen. Disabling hardware acceleration fixes that. Indeed, Adobe has some work to do!

joenobody33
19th November 2008, 16:31
You can check one of my x264 encoded Flash videos and see how it plays:

http://www.quakeunity.com/file=2753

Just click "Watch in High-Definition" under the video.

Adub
19th November 2008, 17:17
Weirdly enough, when I click on "Watch in High-Definition", nothing happens.

joenobody33
19th November 2008, 17:55
weird..just uses javascript to tell the player to use a different file and update the div. What browser/OS are you using? It is using port81, so that might blocked on your end.. Try this link:

http://www.quakeunity.com/streaming/stream.php

Here is the basic encoding parameters I used:

--crf 36 --ref 5 --mixed-refs --subme 6 --trellis 1 --partitions p8x8,b8x8,i4x4,i8x8 --8x8dct --me umh --threads auto --thread-input --sar 1:1 --progress --no-psnr --no-ssim

I had tested playing the videos on my slowest computer, an old Toshiba tablet PC, and although it was using around 80% CPU, it played without any lag. I used the VFW x264 build from inside Vegas video.

Adub
20th November 2008, 04:36
That one works just fine.