2

After a lot of head banging i'm still stuck!

I'm trying to deliver h.264 video over RTMP to a Flex app running on a Motorola Xoom. The BBC Iplayer, Youtube and lots of other video sites have beautiful HD video streaming without issues.

My solution currently encodes video using ffmpeg and plays fine on a desktop. But really appaulingly on the Xoom.

I've tried forcing it to use h.264 baseline, and force it to use various levels. Still with no luck.

Has anyone had any luck encoding video for Flash on Android using ffmpeg and got a nice result?

Thanks in advance. Ben

Ben Ford
  • 1,354
  • 2
  • 14
  • 35
  • 2
    Mind showing some code? What have you used? – J_A_X May 17 '11 at 16:12
  • What is the problem with the video? Buffers a lot? A lot of pixelation? Maybe you can post the ffmpeg command line you use? What is the network between the server that runs ffmpeg and your Xoom ? – Wim Deblauwe May 17 '11 at 18:54
  • The video looks great while it's playing so it's not a pixelation issue. It will play for a while then hang stopping both video and audio. Looking like its an empty buffer. But the buffer has plenty of video in it. Also, If I seek far into a file. Say an hour or so in. It will hang the video and play the audio for that seek point. – Ben Ford May 20 '11 at 10:49
  • As far as ffmpeg command lines go. I've used far too many to post them all. -i "{0}" -threads 0 -y -ar 22050 -acodec libfaac -vcodec libx264 -ac 2 -b {2} -g 30 -r 20 -s {3}x{4} -y "{1}" That was our existing command line for web video. -i "{0}" -threads 0 -s {3}x{4} -vcodec libx264 -b {2} -r 24 -coder 0 -level 21 -acodec libfaac -ac 2 -ar 22050 -y "{1}" This was one forcing it to use h.264 baseline at level 2.1 I have a number of others specifying -flags and various bits. All giving the same result – Ben Ford May 20 '11 at 10:52

2 Answers2

0

I have only built a flex streaming player once so there may be a better way to do it.
The way I did it was to encode a few versions of the video from low rez to high rez.
Then I had the player test bandwidth to the cdn server.
Once I knew the bandwidth I would deliver the proper file never going over the limits.


This was for a poker training website and there was only around 50 tutorial videos. So making 3 versions with different resolutions wasn't all that bad.

The_asMan
  • 6,364
  • 4
  • 23
  • 34
  • The process you're talking about is Dynamic Streaming. Or Adaptive streaming. That is in place in the player. However the videos themselves are the issue. Even if I force the player to play the lowest quality version it plays very poorly. – Ben Ford May 23 '11 at 19:08
  • Have you tried to play videos that where not encoded by your team? Capture a youtube video and try that one. Maybe it is your encoding process. Or perhaps the server is choking. – The_asMan May 23 '11 at 19:12
  • I ripped a YouTube video and uploaded it to our FMS box. It plays just as well as on YouTube. So the problem is definitely in our encoding. – Ben Ford May 23 '11 at 19:32
  • So now you get to pick on your video guys for making you waste days on end. – The_asMan May 23 '11 at 19:47
0

What bit-rate/resolution/image size are you using?

I have created some H.264/RTMP test streams for my company that you can test here. The streams are encoded with ffmpeg (baseline profile) and are available in a few different bit rates roughly corresponding to the YouTube video quality formats.

The player is the JWPlayer and the videos are streamed from Amazon CloudFront. Note that the bitrate reported in the flash player is not accurate!

rupello
  • 8,361
  • 2
  • 37
  • 34
  • I have tried to open the Flash player versions of those videos and the JWPlayer doesn't appear to load. Do you know the RTMP addresses of those videos? I could try them directly? If they do work do you know what ffmpeg options you used to encode them? – Ben Ford May 23 '11 at 19:13
  • I am currently encoding a 1M 800K 600K and 350K versions of the videos. The resolution is 640x480. The issue isn't the video requiring buffering. Its the playback on flash on android being appauling. – Ben Ford May 23 '11 at 19:15
  • strange - it is work fine on my phone (Moto Droid with Gingerbread ROM). Make sure you try one of the lower bit-rate versions such as (BBB-005-FL-RTMP) If you 'view source' on the player web page and look for – rupello May 23 '11 at 19:52