RootEncoder icon indicating copy to clipboard operation
RootEncoder copied to clipboard

switching between displayService and rtspFromFile with continuous timestamp

Open lchy12345 opened this issue 2 years ago • 4 comments

Hi, pedro

I am doing a rtsp stream with audio streaming continuously, but the video stream will switch between displayService and rtspFromFile.

I found that the timestamp of the video frame is not align with the audio stream causing ffmpeg to drop most of the video frame (ffmpeg_log.txt). Because when the rtspFromFile stream start the timestamp seems to start from beginning, also when switch back to displayService, the timestamp seems to recount. May i know if there is a way to make the timestamp continuous no matter doing any switching?

Here is how I write the switching ( code.txt ). It would be grateful if you could give a hand. Many thanks in advance.

lchy12345 avatar Dec 01 '23 09:12 lchy12345

Hello,

This is the expected behavior. You can do a little trick for it. You can use a SurfaceFilterRender reproducing a video instead of use rtspFromFile. To avoid see that display screen, you can use BlackFilterRender and then SurfaceFilterRender (2 filters). This way you will hide display screen.

pedroSG94 avatar Dec 01 '23 10:12 pedroSG94

But is this way the displayService screen capture is not stop? can I stop the screen capture part and then apply the filter

I mean stopping this if (mediaProjection != null) { mediaProjection.stop(); mediaProjection = null; }

lchy12345 avatar Dec 01 '23 10:12 lchy12345

Hello,

No, the screen capture is not stopped but you haven't other way to do it for now. Visually you haven't problems this way

pedroSG94 avatar Dec 01 '23 10:12 pedroSG94

ic and thank you for your response

lchy12345 avatar Dec 03 '23 00:12 lchy12345