-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
About push the stream of time #16
Comments
I have tested publishing overnight.
|
It happen each time |
Enough, if it happens each time, the exception might well be |
What I can do to avoid the this exception. |
Nothing but re-connection since it is the Nginx-RTMP that closes the socket. Today I will verify it on Nginx-RTMP. |
Ah, I see. This article illustrates the reason. ngx_rtmp_recv(ngx_event_t *rev)
{
for( ;; ) {
/* parse headers */
if (b->pos == b->start) {
/* chunk basic header */
fmt = (*p >> 6) & 0x03;
csid = *p++ & 0x3f;
if (fmt <= 2 ) {
/* timestamp: big-endian 3b -> little-endian 4b */
pp = (u_char*)timestamp;
ext = (timestamp == 0x00ffffff);
if (fmt <= 1) {
/* size: big-endian 3b -> little-endian 4b type*/
pp = (u_char*)&h->mlen;
h->type = *(uint8_t*)p++;
if (fmt == 0) {
/* stream: little-endian 4b -> little-endian 4b */
pp = (u_char*)&h->msid;
}
}
}
/* extended header */
if (ext) {
pp = (u_char*)timestamp;
pp[3] = *p++;
pp[2] = *p++;
pp[1] = *p++;
pp[0] = *p++;
} In |
Try 9e35f22 please. |
I get the latest code, find a new exception : java.net.UnknownHostException: Host is unresolved |
That is your URL or networking issue. |
But I use the old code can push stream. |
Are you sure? I downloaded and tried just now you were saying. |
Sorry, Should be a network problem. Just in time is a coincidence |
It seem still have the same problem |
Maybe you can refer to this blog librtmp 时间戳 |
A rapid reappearance approach is adding code in while (!writeQueue.isEmpty()) {
RtmpPacket rtmpPacket = writeQueue.poll();
ChunkStreamInfo chunkStreamInfo = rtmpSessionInfo.getChunkStreamInfo(rtmpPacket.getHeader().getChunkStreamId());
chunkStreamInfo.setPrevHeaderTx(rtmpPacket.getHeader());
if (rtmpPacket instanceof Video || rtmpPacket instanceof Audio) {
rtmpPacket.getHeader().setAbsoluteTimestamp((int) chunkStreamInfo.markAbsoluteTimestampTx() + 0xffffff);
} else {
rtmpPacket.getHeader().setAbsoluteTimestamp((int) chunkStreamInfo.markAbsoluteTimestampTx());
}
rtmpPacket.writeTo(out, rtmpSessionInfo.getTxChunkSize(), chunkStreamInfo);
Log.d(TAG, "WriteThread: wrote packet: " + rtmpPacket + ", size: " + rtmpPacket.getHeader().getPacketLength());
if (rtmpPacket instanceof Command) {
rtmpSessionInfo.addInvokedCommand(((Command) rtmpPacket).getTransactionId(), ((Command) rtmpPacket).getCommandName());
}
if (rtmpPacket instanceof Video) {
publisher.getVideoFrameCacheNumber().getAndDecrement();
calcFps();
}
}
out.flush(); |
Final patch on this issue: 5ee43c6 |
I did the test Yesterday night,and It seem still exist |
Stream disconnect after 10 hours. |
Can I catch the exception and reconnect. |
10 hours? That might not be extended time stamp. Maybe the video cache number is full and your network is weak? You may do it yourself. |
- Optimized communication between LISA agent using H264 encoding instead of sending raw YUV frames.
- Improved camera switching by setting encoder to produce i-frame every frame, and some other minor fixes
Now, Continue to push flow more than 4 hours and 30 minutes,It will stop.
The text was updated successfully, but these errors were encountered: