Giter VIP home page Giter VIP logo

Comments (20)

begeekmyfriend avatar begeekmyfriend commented on May 18, 2024

I have tested publishing overnight.

  • Does it happen each time?
  • What is the exception thrown?
  • Is your networking all right?

from yasea.

flyminiboy avatar flyminiboy commented on May 18, 2024

It happen each time
The network is normal
Sorry, I forget to see the exception

from yasea.

begeekmyfriend avatar begeekmyfriend commented on May 18, 2024

Enough, if it happens each time, the exception might well be EPIPE. I have got it.

from yasea.

flyminiboy avatar flyminiboy commented on May 18, 2024

What I can do to avoid the this exception.
In other places I have seen this exception,and the most people say it's it's caused by and extend the timestamp。

from yasea.

begeekmyfriend avatar begeekmyfriend commented on May 18, 2024

Nothing but re-connection since it is the Nginx-RTMP that closes the socket. Today I will verify it on Nginx-RTMP.

from yasea.

begeekmyfriend avatar begeekmyfriend commented on May 18, 2024

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 ngx_rtmp_recv function, once Nginx-RTMP receives extended time stamp in chunk type less than 3, then it will always parses extended time stamp in the subsequent packets whatever the chunk type is.

from yasea.

begeekmyfriend avatar begeekmyfriend commented on May 18, 2024

Try 9e35f22 please.

from yasea.

flyminiboy avatar flyminiboy commented on May 18, 2024

I get the latest code, find a new exception : java.net.UnknownHostException: Host is unresolved
It happened before.

from yasea.

begeekmyfriend avatar begeekmyfriend commented on May 18, 2024

That is your URL or networking issue.

from yasea.

flyminiboy avatar flyminiboy commented on May 18, 2024

But I use the old code can push stream.

from yasea.

begeekmyfriend avatar begeekmyfriend commented on May 18, 2024

Are you sure? I downloaded and tried just now you were saying.

from yasea.

flyminiboy avatar flyminiboy commented on May 18, 2024

Sorry, Should be a network problem. Just in time is a coincidence

from yasea.

flyminiboy avatar flyminiboy commented on May 18, 2024

It seem still have the same problem
And I will test again.

from yasea.

flyminiboy avatar flyminiboy commented on May 18, 2024

Maybe you can refer to this blog librtmp 时间戳

from yasea.

begeekmyfriend avatar begeekmyfriend commented on May 18, 2024

A rapid reappearance approach is adding code in rtmp/io/WriteThread.java. It can help find the bug though no solution occurs to me currently.

                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();

from yasea.

begeekmyfriend avatar begeekmyfriend commented on May 18, 2024

Final patch on this issue: 5ee43c6

from yasea.

flyminiboy avatar flyminiboy commented on May 18, 2024

I did the test Yesterday night,and It seem still exist

from yasea.

flyminiboy avatar flyminiboy commented on May 18, 2024

Stream disconnect after 10 hours.

from yasea.

flyminiboy avatar flyminiboy commented on May 18, 2024

Can I catch the exception and reconnect.

from yasea.

begeekmyfriend avatar begeekmyfriend commented on May 18, 2024

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.

from yasea.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.