Git Product home page Git Product logo

Comments (6)

ThibaultBee avatar ThibaultBee commented on July 20, 2024

Hi,

it seems that when the image is static, no data is sent to the server

I have noticed the same behaviour. This is a behaviour from the Android API that is used to capture the screen (MediaProjection/VirtualDisplay): it does not generate frame for nothing. I guess most of screen recording application should have this behaviour. I can't see easy way to fix it.

As a workaround, I can't see anythibg else than increasing the publish timeout to infinity.

Regards,
Thbault

from streampack.

VonLisboa avatar VonLisboa commented on July 20, 2024

Yes, I also thought about this idea of putting infinite timeout, but I still haven't found any open source server with this possibility. Maybe I can customize in the source code.

Another test I did was with the RTP protocol and libstreaming on android and it doesn't have this problem, I don't know if it's the way the protocol works, maybe an RTP extension would be interesting...

from streampack.

ThibaultBee avatar ThibaultBee commented on July 20, 2024

Hi,

Yes, I also thought about this idea of putting infinite timeout, but I still haven't found any open source server with this possibility. Maybe I can customize in the source code.
Sorry, I can't help you on this one. Maybe there is a timeout configuration is SRS.

Another test I did was with the RTP protocol and libstreaming on android and it doesn't have this problem, I don't know if it's the way the protocol works, maybe an RTP extension would be interesting...

Does libstreaming provide a screen recorder embed in RTP?

Anyway, It has nothing to do with the container or network protocol. It is just a behaviour of the screen recorder (MediaProjection) on Android: it does not generate a lot of frames. You can test with the camera, you won't have this issue.

from streampack.

VonLisboa avatar VonLisboa commented on July 20, 2024

Hello,

Does libstreaming provide a screen recorder embed in RTP?

No it doesn't provide ready to use as your project, need to use MediaCodecInputStream and do all the code which takes the frames for the encoding.

But what I meant is that the protocol did not close the connection by timeout due to lack of data coming in but this must be from the RTP server implementation probably (janus). I don't know.

from streampack.

ThibaultBee avatar ThibaultBee commented on July 20, 2024

Hi,

I have no plan to support RTP for now.
You should try to find the publishing timeout in SRS settings. Contact them if you can't find the settings.

Best regards,
Thibault

from streampack.

VonLisboa avatar VonLisboa commented on July 20, 2024

A possible solution to this problem is this:
MediaFormat.KEY_REPEAT_PREVIOUS_FRAME_AFTER

MediaFormat.createVideoFormat(MediaFormat.MIMETYPE_VIDEO_AVC, width, height).let {
    it.setInteger(MediaFormat.KEY_REPEAT_PREVIOUS_FRAME_AFTER, 1000000 / DEFAULT_FRAME_RATE)
    it.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 1)
}

from streampack.

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.