Comments (11)
I see,
A quick solution, have you you realized that there is a buffer parameter that you can give at the url.
https://rtmpdump.mplayerhq.hu/librtmp.3.html
buffer=num
Set buffer time to num milliseconds. The default is 30000.
from librtmp-client-for-android.
I know.
But it's option of librtmp itself.
https://github.com/ant-media/LibRtmp-Client-for-Android/blob/master/rtmp-client/src/main/cpp/librtmp/rtmp.c
has I/F RTMP_SetBufferMS
, but it's not jni exported
https://github.com/ant-media/LibRtmp-Client-for-Android/blob/master/rtmp-client/src/main/cpp/librtmp-jni.c
from librtmp-client-for-android.
yes you're right.
Do you need this kind of implementation urgently? In other hands, when do you need?
On the other hand, if you have chance to make a PR, I will be glad to merge it.
from librtmp-client-for-android.
If possibble, I want to use RTMP playback feature through ExoPlayer, but for live streaming service, latency is very important thing.
Now, the latency of RTMP on ExoPlayer is larger than that of HLS.
from librtmp-client-for-android.
Sorry for the late reply.
There should be a problem in somewhere, because latency does not exceed 3 seconds in our tests.
Which server do you use?
Regards,
from librtmp-client-for-android.
latency does not exceed 3 seconds in our tests
It may depend on the definition of "latency".
I mean the time between "Broadcaster do something in front of camera" and "it's displayed on screen of viewer", and our target of this "latency" is about 2-4 secs.
3 secs buffer size on librtmp is too large for us.
When I use ExoPlayer(with default setting) with RTMP extension (which use this library), it's about 3-8 seconds slower than our RTMP player for iOS.
The video is come from same broadcaster/server.
I think buffer size of librtmp (3 seconds) is one of the reason.
Additionally, ExoPlayer may have their own buffer.
from librtmp-client-for-android.
Yeah we both mean the samething for latency.
Let us check the latency one more time and post here.
from librtmp-client-for-android.
Do we have plant to add this feature?
from librtmp-client-for-android.
Any news on this? I am having the same issue with Exoplayer. @mekya
Did you find a solution? @matsujun
from librtmp-client-for-android.
this buffer time actually does not affect latency in RTMP. We have made some tests for @nagendraK6 :) and find out somethings. I have copied-pasted the things directly from email :)
Hey Guys,
Let me tell what I have found.
Firstly, I digged into the native librtmp to find out somethings to reduce buffering times. Yeah I have found somethings, max buffer time for librtmp is 30sec.
I have changed it several times, compiled native code and test it unfourtunately there is nothing changed. After all i go deeper and found out that librtmp does not care about this buffering time. It just reads data from server.
After that I've started to look at the buffering times for ExoPlayer. After a while I found, min buffer, max buffer, play back buffer, playback rebuffer durations.
I have changed these default values by creating ExoPlayer like below
player = ExoPlayerFactory.newSimpleInstance(renderersFactory, trackSelector, new DefaultLoadControl(
new DefaultAllocator(true, C.DEFAULT_BUFFER_SEGMENT_SIZE),
500, // min buffer 0.5s
3000, //max buffer 3s
1000, // playback 1s
1000 //playback after rebuffer 1s
));
Then latency is really good on our test environment about 1.5 - 2 and no rebufferings. Source stream has 2 sec key frame interval.
However we need to be sure it also works for your real environment.
The parameters above I've used needs to be tuned for your case. Values can be bigger or lower, just let's test on your environment and see the results.
Btw, health of the source stream is very important. If server does not has an healthy incoming stream, it is for sure that server does not send any stream to viewers and
rebufferings happen on viewer side.
Regards,
A. Oguz
from librtmp-client-for-android.
hello
i have the same problem, my rtmp stream has low latency when played with ffplay
but with exo player there is an important delay (3/4 seconds)
i tested your code :
DefaultAllocator allocator = new DefaultAllocator(true, C.DEFAULT_BUFFER_SEGMENT_SIZE);
DefaultLoadControl loadControl = new DefaultLoadControl(allocator, 1000, 1000, 1000, 1000, -1, true);
player = ExoPlayerFactory.newSimpleInstance(this, trackSelector,loadControl);
but not change ...
i tested to add the buffer option in my url but no improvement
videoSource = new ExtractorMediaSource.Factory(mediaDataSourceFactory) .createMediaSource( Uri.parse(url + " live=1 buffer=0"), null, null );
this is my command with ffplay
ffplay -fflags nobuffer rtmp://xxx:1935/live/xxx -loglevel verbose
from librtmp-client-for-android.
Related Issues (20)
- Sample Example for RTMP URL HOT 1
- always crash with SIGSEGV after 6~8 hours rtmp steam play in android HOT 2
- Upload RTMP to YT - closing after a couple of buffers (NAL units) HOT 7
- RtmpMuxer推流使用exoplay无法播放,但是电脑直接用ffmepg推流exoplay可以正常播放? HOT 2
- Unable to stream video after updating to the new release 3.2.0 HOT 1
- 请问RTMPMuxer.writeVideo返回-20是什么错误? HOT 1
- write stream to local file
- Issues enabling debug mode
- Can not stream with RtmpStreamer? HOT 2
- SEI message support (Display Orientation)
- how to work with this lib in Azure media service android? HOT 1
- 断网close后,第二次不能推流到服务端
- 推流无法使用VLC播放 HOT 2
- The method of writevideo is not hard to push. When writeaudio is added to push, the video cannot be played HOT 1
- Does this library support audio only publishing? HOT 2
- how to switch rtmp stream HOT 2
- JCenter shutdown - do you plan to move the latest version to another repository? HOT 20
- Send Metadata HOT 1
- RTMP publish/write confusion HOT 1
- Failed to analyze sps from h264 data
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from librtmp-client-for-android.