Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 17th June 2011, 17:01   #1  |  Link
MuTPu4
Registered User
 
Join Date: Aug 2009
Posts: 6
x264 settings for live streaming to Adobe Flash

Hello,

I am working on realtime encoding of dynamically synthesized SD (352 x 480p @ 25) video streams for Internet broadcast.
I know that there is a problem with H.264 buffering in Adobe Flash Player, there is either zero buffer (NetStream.bufferTime = 0) or >=64 frames buffer (NetStream.bufferTime > 0). Also I know that live encoder settings (like x264's tune=zerolatency) noticeably reduce quality (given the same bandwidth).
So I am trying to create two kinds of settings profiles, one with buffering (NetStream.bufferTime = 0.1), B-frames, lookahead and other H.264 features (hoping for 3-4 seconds latency and stable quality) and one with no buffering and zerolatency features (hoping for <1 seconds latency, lower quality and some minor artifacts) and evaluate these profiles for different real-world Internet connections.
I have followed official x264 pages on MeWiki and numerous posts on relevant forums (Doom9, Doom10, Wowza Media Systems, etc) and have done a lot of experimenting but I am not really satisfied with the result. I am not an expert in video encoding domain and I hope that more experienced readers may point out the obvious shortcomings of my profiles or give some other tips.

Medium latency
Code:
{threads=1,profile=main,preset=faster,intra-refresh,bframes=2,ref=2,level=3,scenecut=40, \
qpmax=28,qpmin=16,weightp=1,keyint=50,keyint_min=25,b-adapt=0,deblock=-1:-2,fullrange=on,bitrate=640}
This is the most acceptable setup. I am not sure about the necessity of some settings here (such as level, qp, scenecut, etc) but all of my recent experiments resulted in worse quality so I have decided to leave them as is. The problem is the quality is not as stable as I want it to be. In a highly-dynamic scene video sometimes stops for several seconds and then plays faster for several seconds. It happens frequently on Internet connection (>1 Mbit, 250ms latency) and not so frequently on LAN (100Mbit, <1ms latency) but it is not accaptable for interactive/live application which allready has 4 seconds latency. The other minor problem is the picture is not so crisp as the original contrasting synthesized animation. I have tried to use lower deblock parameters hoping to overcome this problem but with no great success. Maybe there are some other ways?

Low latency
Code:
{threads=1,profile=main,preset=faster,tune=zerolatency,intra-refresh,weightp=1,keyint=30, \
min-keyint=5,deblock=-1:-2,fullrange=on,bitrate=1000}
This setup is almost useless for now. It has all of the shortcomings of the first setup but with considerably higher magnitudes. Namely a poor image quality, unstable framerate (I had got around continuous stuttering but frequent slowdowns and speedups are taking place as it described above) and most importantly the latency is still very high, around 2 second or even more (on LAN) so there is no practical gain of this setup.

I am sure that my settings are far from perfect but I have doubt about the stability of the other components of the system also. I am synthesizing frames with relatively constant speed slightly higher than target 25 FPS (27-29 FPS actually), some fluctuations may be imposed due to timers inaccuracy and non-RT OS activity. These frames are piped to VLC which transcodes it using x264 and streams it over RTP (using LIVE555 I suppose) to Wowza Media Server which in turn publishes it over RTMP. According to my observations VLC (and maybe LIVE555) lacks industrial grade reliability (being a great software though), so I am not sure if is it their limitations. Wowza on the other hand seems to improve playback smoothness after restreaming (I am varying It's buffers sizes accordings to manual from 15 to 66 frames).

So the question is, is there anything I can do with this architecture to achive my goals or just to improve my results in terms of quality, stability or latency. For example it would be really useful and reasonable to reduce latency of the Low latency profile to <1 seconds or to make Medium latency streaming fully stable and crisp but all of my recent attempts failed so I am asking for help of any kind.

Thanks in advance!

Last edited by Guest; 17th June 2011 at 17:10. Reason: readability
MuTPu4 is offline   Reply With Quote
 

Tags
flash, latency, live, vlc, x264

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:36.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.