I am using MIP SDK Mobile for Android with the example “LiveVideoSample” combined with “VideoPushSample”. After approximately 40 minutes of video stream, it is suspended
The log obtained is this:
2020-08-04 11:49:41.891 32267-8317/com.milestonesys.mobilesdk.videopushsample D/skia: onFlyCompress
2020-08-04 11:49:42.041 32267-32278/com.milestonesys.mobilesdk.videopushsample W/art: Suspending all threads took: 7.596ms
2020-08-04 11:49:42.046 32267-32278/com.milestonesys.mobilesdk.videopushsample I/art: Background partial concurrent mark sweep GC freed 6662(1222KB) AllocSpace objects, 5(7MB) LOS objects, 39% free, 15MB/25MB, paused 8.367ms total 35.403ms
2020-08-04 11:49:42.067 32267-24981/com.milestonesys.mobilesdk.videopushsample E/HTTPConnection: Content type is not correct 'null'!
I see that the problem comes from the video push sample where when freeing memory, it interrupts the live video stream. Some parts of the code:
I would like to know if you can help me so that the video stream is not interrupted.
Thank you!
Hello,
The code samples you’ve listed are related to Push-to-talk (audio push) part of the video push - is the error still there if you don’t do audio push?
If you look at the memory usage (in the android studio profiler), is it steadily rising in those 40 minutes the app is running?
If so, probably there is a memory leak somewhere, or the garbage collector is not able to catch up with freeing the memory. You could try to use static buffers in short2byte and catchAudioData functions, which are reused every time, instead of dynamically allocating new ones on each call, and see if this helps
Best regards,
Plamen Parvanov
Plamen, thanks for the reply.
I couldn’t remove the audio components from the example, but I’ll be testing. I was checking the registry again and I think there are 2 error possibilities that generate the problem of connection and interruption of the video.
I attach the error file. I think error 1 comes from connection error and error 2 comes from exoplayer. Is this correct?
Regarding memory I see that there is a slow progressive increase in memory, starting from 70MB to 95MB in an hour. I will try to use static buffers in short2byte and catchAudioData functions.
------------------------------------------------------------------------------------------------------
Plamen,
I ask one more question, if you can help me and it doesn’t bother you, which is about optimizing the UI on LiveVideo that seems a bit stuck. Maybe you can help me in this function, if you can optimize some part of the code so that there is a little more fluidity in ImageView
Image is not available
Thank you very much for all your help,
Regards!
Hello,
Regarding memory, the increase is not that big so probably memory is not the issue.
Then, the first error does look like a connection error but it’s also throws an illegal state exception that says exoplayer is accessed from the wrong thread. So maybe it’s worth it to investigate that?
I’m not sure what you mean by optimizing the UI (the image you posted is not available). If the UI freezes at moments, probably there is some long operation (like network access) on the main thread. Try to move all the network operations to a separate thread and see if this helps
Best regards,
Plamen Parvanov
Plamen, thanks for the reply.
I am investigating the exoplayer error.
Regarding the live video streaming user interface, I would like to know if you can help me with the code offered by milestone to make it look more fluid. Can you see the images right now with the code? (I’m just running the live video example)
Thank you!