libstreaming
libstreaming copied to clipboard
Wierd problems in recieved video
We have incorporated your library into out app to stream a short video to our Wowza server similar to your example 3. This is working but we consistently get videos like the following:
https://www.dropbox.com/s/w3hcblfctmkko3p/libstreaming.mp4
The 3 problems we are consistently getting are the following:
- The first second of video doesn't change
- There are strange glitches in some frames
- The quality starts very bad but gets very good by the end
I can see that the kbps is variable and we need it to be fixed. For us, it is much more important that the entire video is good quality rather then it keeping up with real-time. Is it possible to fix the video quality and buffer if it cant keep up with the stream?
Any idea why some of the frames have glitches? It is very important that we get a good quality video.
We have tested this on a Samsung Galaxy S3 and Nexus 4.
Many thanks.
Hi, could you try to pull the mediacodec branch and test that again. It's weird because I have no problem to stream with the Nexus 4.
Obtaining a fixed bit rate is difficult for multiple reasons:
- it depends on how constant is the frame rate of the camera, and I have found that it may vary with the luminosity on many android device.
- the H264 bitstream contains mostly type I and P frames (no B frames with the baseline profile) and I frames are far bigger than P frames, so basically the bit rate has a peak everytime a I frame is sent.
- the H264 hardware encoders and cameras differs accross android phones, so it's difficult to make libstreaming consistant...
What I will try do do in libstreaming soon, is take into account those variations of the frame rate. It will only work on android 4.1 and up phones that correctly support the MediaCodec API. When streaming with the MediaRecorder API, there is nothing we can do it the bitrate is not stable enough for your application.
Good luck !
Btw, If you are making a close source app you need to buy a commercial license for libstreaming, or you can comply with the GPLv3 and publish your source code (under the GPLv3)
@Joe-Palmer , were you able to solve your issue? If yes, do you remember how?
I'm currently running into a similar issue where the key frame is dropped in the beginning of the video so the video has a green overlay and it just fixes itself after 15-30 seconds. I have my mediaformat's KEY_I_FRAME_INTERVAL set to 1. But if I set it to 0 or -1, the initial key frame doesn't get dropped which is weird. However that is not an acceptable solution on my end since I need that KEY FRAME to generate every second.