Closed ligeirow closed 2 months ago
is there any solution regarding can not add frame,queue is full
Any solution for above issue?
yes i added
@humayoonsiddiqui did you manage this issue?
make sure you call RtspSurfaceView.start()
method in onViewCreated()
rather than in onCreateView()
if use it in a fragment, and after checking if (!view.isStarted())
. that was my problem. hope it helps
@BarrelOfTea I do everything as you wrote, but after some time of the application, for example, 4-5 minutes, I get in the logs
FrameQueue: Cannot add frame, queue is full
And the picture freezes.
@alexeyvasilyev I understood what the problem was. Some streams send too many frames. One frame is small, another is large. A large frame takes about 100 milliseconds to process. During this time, several frames are added to the queue. And it turns out that the library does not have time to process all the frames. Hence the delay and then the queue overflow.
But I don't know how to solve this problem yet.
@SFocus, by large frames, do you mean the resolution is too high? If there is an original app for your camera, maybe you could try setting a lower resolution in it, and then launching your app again
@BarrelOfTea I tried changing the resolution but it doesn't work. https://rtsp.stream/ here you can create a free account and there will be 2 streams. One is a cartoon that plays normally, the other stream does not work with this application.
@SFocus, I have looked into the code of the library and noticed an interesting thing: in FrameQueue
class (here), "Cannot add frame, queue is full" is shown not only in the push()
method when it tries to put a frame into queue and there is no room for it, but also in the pop()
method, when there is an InterruptedException
. Seems like the author forgot to change the message for a different exception. So maybe the problem lies not in a queue being full, but in a thread being interrupted. I suggest you try copying the module rather than adding it into Gradle dependencies (so that it is a part of you code and you can modify it) and change the message for InterruptedException
in the pop()
method to see what is actually a problem in your case.
@BarrelOfTea I saw that, but that's clearly not the problem. I have already tried to change the code myself and fix the problem. But so far, I have made a solution based on GStreamer library and it works great.
@SFocus , may I know how you use the library in you project? I am working on app that reads video from RTSP and converts output into a series of bitmaps. Currently I am facing the same "cant add frame queue is full" issue, and I was wondering whether GStream could suit my purposes too.
@BarrelOfTea I'm working on playing a local stream where I need minimal latency.
Most probably issue is fixed in 2.0.9 just released
Good day issue is not resolved as of version [2.0.11], the video would play ok for a few minutes but would randomly give the error "FrameQueue: Cannot add frame, queue is full" the timing for the error is never consistent so I am not sure what triggers it. Increasing the size of the the videoFrameQueue does not do much. Tried removing the last frames from the queue when the limit is reached but the video feed still remains frozen. I guess the issue here is how to safely handle "full queues" even if some frames have to be dropped.
Are there any solutions to this problem yet? i also have the problem, that my image freezes after a while and the log is full with this specific error message. Could it be possible because i'm running it in an emulator?
I am also getting the same error. Is this due to the emulator?
Does not happen in latest version.
W/FrameQueue: Cannot add frame, queue is full
app run but stop in 6 seconds
D/EGL_emulation: app_time_stats: avg=18.24ms min=3.35ms max=108.95ms count=38 W/System: A resource failed to call close. D/BufferPoolAccessor2.0: bufferpool2 0x7b75ffe54dd8 : 4(25165824 size) total buffers - 4(25165824 size) used buffers - 0/4 (recycle/alloc) - 4/69 (fetch/transfer) D/BufferPoolAccessor2.0: evictor expired: 1, evicted: 1 D/CCodecBuffers: [c2.goldfish.h264.decoder#383:1D-Input.Impl[N]] codec released a buffer owned by client (index 1) W/CCodec: [c2.goldfish.h264.decoder] previous call to queue exceeded timeout E/MediaCodec: Codec reported err 0x80000000/UNKNOWN_ERROR, actionCode 0, while in state 6/STARTED E/VideoDecodeThread: RTSP video thread [192.168.1.174:554] stopped due to 'null'