pili-engineering / PLDroidMediaStreaming

PLDroidMediaStreaming 是七牛推出的一款适用于 Android 平台的推流 SDK,支持 RTMP 推流,h.264 和 AAC 编码,硬编、软编支持。具有丰富的数据和状态回调,方便用户根据自己的业务定制化开发。具有直播场景下的重要功能,如:美颜、背景音乐、水印等功能。PLDroidMediaStreaming 是现在目前重点维护的版本,自带采集模块也支持用户自己做采集端。
https://github.com/pili-engineering/PLDroidMediaStreaming/wiki
Apache License 2.0
1.45k stars 460 forks source link

Adaptive streaming #153

Open sdebasek opened 8 years ago

sdebasek commented 8 years ago

I was looking at this code: mProfile.setVideoQuality(StreamingProfile.VIDEO_QUALITY_HIGH3) .setAudioQuality(StreamingProfile.AUDIO_QUALITY_MEDIUM2) // .setPreferredVideoEncodingSize(960, 544) .setEncodingSizeLevel(Config.ENCODING_LEVEL) .setEncoderRCMode(StreamingProfile.EncoderRCModes.QUALITY_PRIORITY) .setAVProfile(avProfile) .setDnsManager(getMyDnsManager()) .setStreamStatusConfig(new StreamingProfile.StreamStatusConfig(3)) // .setEncodingOrientation(StreamingProfile.ENCODING_ORIENTATION.PORT) .setSendingBufferProfile(new StreamingProfile.SendingBufferProfile(0.2f, 0.8f, 3.0f, 20 * 1000));

And my questions is - is it possible to set some of those parameters during streaming? I would like to achieve adaptive streaming solution, so the streaming settings will adapt to current network conditions.

gouravd commented 8 years ago

StreamingProfile.SendingBufferProfile(0.2f, 0.8f, 3.0f, 20 * 1000));

This line achieves exactly that, it notches up/down the bitrate depending on the buffer during streaming. Basically if the buffer is too full, then the bitrate goes down and vice versa.

The explanation for the values are given in the wiki

sdebasek commented 8 years ago

@gouravd Thank you - this is now clear to me, but I cannot find how to modify framerate while streaming.