how can i adjust BUFFER SIZE?
catrinne opened this issue · 4 comments
hello?
i try to use this for real time streaming system.
server side is raspberry: raspivid -t 0 --hflip -o - -w 720 -h 400 -fps 24 | nc -l -p 8160
client side is this app.
if i increase FPS, there are long latency.
if i decrease FPS this app has too many buffering.
when i use 'MX player' (from google play) it work well.
i think the 'BUFFERING' is only difference.
Does this app have way to change BUFFERING SIZE ?
you can try in 1.2.1 version
I add setVideoOption function
// open cache
videoPlayerWidget.setVideoOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "packet-buffering", 1L);
// set buffer size 100KB
videoPlayerWidget.setVideoOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "buffer_size", 100 * 1024);
i tried it, but there is still buffering circle.
i don't want to use buffering mechanism.
when i reduce FPS (raspivid option) latency is reduced also,
and when latency is equal to zero, buffering mechanism is activated.
are there other solution?
you can try open Hard decoding
videoPlayerWidget.setVideoOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "mediacodec", 1);
I don't use a native player, so there are some problems that I can't solve.
i wrote code double. it works.
thanks very much.
videoPlayerWidget.setVideoOption(OPT_CATEGORY_PLAYER2, "packet-buffering", 0L);
videoPlayerWidget.setVideoOption(OPT_CATEGORY_FORMAT2, "buffer_size", 0L);
MxVideoPlayerWidget.startFullscreen(this, MxVideoPlayerWidget.class, "tcp://192.168.1.98:8160", "test");
videoPlayerWidget.setVideoOption(OPT_CATEGORY_PLAYER2, "packet-buffering", 0L);
videoPlayerWidget.setVideoOption(OPT_CATEGORY_FORMAT2, "buffer_size", 0L);