Full HD video converted to FLV, slow playback in browser

1.4k Views Asked by At

I rendered a full HD video using Adobe AfterEffects CS5 in mp4 format. It plays just fine. I've got this video app to which I fed the mp4 file. The video app converts the mp4 to flv format and makes the video available via a web page. I've downloaded the resulting flv file to my local PC - it plays just fine in my VLC player. But, the problem is I'm getting awful playback inside my browser.

I've made sure the issue is not bandwidth related. Both original mp4 file, and ffmpeg-converted FLV file, play perfectly using VLC player. I've tested the FLV file with two players - Agryia FLV Player Elite and JW Player. Both players play the video awfully - really slow and very choppy.

Here's my ffmpeg -i myflvfile.flv: `

Seems stream 0 codec frame rate differs from container frame rate: 119.88 (120000/1001) -> 59.92 (719/12)
Input #0, flv, from '94044631305552037.flv':
Metadata:
duration        : 146
width           : 1920
height          : 1080
videodatarate   : 684
framerate       : 60
videocodecid    : 7
audiodatarate   : 62
audiosamplerate : 22050
audiosamplesize : 16
stereo          : true
audiocodecid    : 2
major_brand     : mp42
minor_version   : 0
compatible_brands: mp42mp41
creation_time   : 2012-02-10 00:55:19
encoder         : Lavf52.111.0
filesize        : 61969316
Duration: 00:02:25.77, start: 0.034000, bitrate: 764 kb/s
Stream #0.0: Video: h264 (High), yuv420p, 1920x1080 [PAR 3:4 DAR 4:3], 700 kb/s, 59.92 tbr, 1k tbn, 119.88 tbc
Stream #0.1: Audio: mp3, 22050 Hz, stereo, s16, 64 kb/s`

Can any one point me in the right direction here? Why is playback perfect with VLC player of both the mp4 and the flv file on my local PC, yet in my browser, using two different players, the playback is so bad?

PS Here's my convert command:

ffmpeg -y -i /var/www/sandverlag.com/htdocs/rmtk/videos/originals/94044631305552038.mp4 -vcodec libx264 -ar 22050 -ac 2 -vb 700000 -s 1920x1080 -crf 22 -threads 0 -f flv /var/www/sandverlag.com/htdocs/rmtk/videos/converted/94044631305552038.flv > /dev/null &    
1

There are 1 best solutions below

3
On

A couple of thoughts:

  • What version of Flash are you using? Only the most recent versions of Flash in mainstream platforms support h264 hardware decoding. Without the hardware decoding, many CPUs can easily overtaxed with the h264 decoding.
  • Why are you placing h264 video into an FLV container? Flash supports MP4 containeres, like F4V. In fact, I believe Adobe specifically recommends not using FLV containers for h264 video. FLV is dated, move on.
  • What hardware are you running? VLC is highly optimized and seems to play almost anything without effort on even modest hardware. Flash plugins don't exactly meet that level of playback performance.