Comments (11)
- If you want to decrease them once and for all, just modify these macros in ff_ffplay_def.h
// buffer bytes
#define DEFAULT_HIGH_WATER_MARK_IN_BYTES (128 * 1024)
// buffer duration, in milliseconds
#define DEFAULT_MAX_HIGH_WATER_MARK_IN_MS (5 * 1000)
// buffer duration for the 1st time, in milliseconds
#define DEFAULT_FAST_HIGH_WATER_MARK_IN_MS (100)
- if you want to set them from application, add these api
// see how ijkmp_set_overlay_format() does
ijkmp_set_high_water_mark()
ffp_set_high_water_mark()
- if you want to change them from application while streaming, multiple-thread issues would be concerned. I would prefer to implement dynamic strategy inside read_thread() in ff_ffplay.c
from ijkplayer.
#define DEFAULT_HIGH_WATER_MARK_IN_BYTES (8 * 1024)
#define DEFAULT_MAX_HIGH_WATER_MARK_IN_MS (0.25 * 1000)
#define DEFAULT_NORMAL_HIGH_WATER_MARK_IN_MS (0.1 * 1000)
#define DEFAULT_FAST_HIGH_WATER_MARK_IN_MS (100)
I set them like these. It is still around 5 seconds...
from ijkplayer.
Could you uncomment this line in ff_ffplay.c and paste some log?
// ff_ffplay.c
#define FFP_SHOW_DEMUX_CACHE
from ijkplayer.
audio cache=%1923 (4784/250)
time cache=%1923 (4784/250)
size cache=%489 (39847/8192)
audio cache=%1942 (4830/250)
time cache=%1942 (4830/250)
size cache=%494 (40230/8192)
audio cache=%1960 (4876/250)
time cache=%1960 (4876/250)
size cache=%498 (40603/8192)
audio cache=%1979 (4922/250)
time cache=%1979 (4922/250)
size cache=%503 (40990/8192)
audio cache=%1997 (4968/250)
time cache=%1997 (4968/250)
size cache=%508 (41382/8192)
audio cache=%2016 (5014/250)
time cache=%2016 (5014/250)
size cache=%512 (41761/8192)
audio cache=%2034 (5060/250)
time cache=%2034 (5060/250)
size cache=%517 (42141/8192)
audio cache=%2053 (5106/250)
time cache=%2053 (5106/250)
size cache=%522 (42525/8192)
audio cache=%2071 (5152/250)
time cache=%2071 (5152/250)
size cache=%526 (42904/8192)
audio cache=%2090 (5198/250)
time cache=%2090 (5198/250)
size cache=%531 (43291/8192)
audio cache=%2090 (5198/250)
audio cache=%2108 (5244/250)
time cache=%2108 (5244/250)
size cache=%536 (43680/8192)
audio cache=%2127 (5290/250)
time cache=%2127 (5290/250)
size cache=%541 (44079/8192)
audio cache=%2145 (5336/250)
time cache=%2145 (5336/250)
size cache=%545 (44459/8192)
audio cache=%2145 (5336/250)
audio cache=%2164 (5382/250)
time cache=%2164 (5382/250)
size cache=%550 (44830/8192)
audio cache=%1868 (4646/250)
time cache=%1868 (4646/250)
size cache=%472 (38511/8192)
audio cache=%1886 (4692/250)
time cache=%1886 (4692/250)
size cache=%477 (38889/8192)
audio cache=%1905 (4738/250)
time cache=%1905 (4738/250)
size cache=%482 (39269/8192)
audio cache=%1923 (4784/250)
time cache=%1923 (4784/250)
size cache=%487 (39656/8192)
audio cache=%1942 (4830/250)
time cache=%1942 (4830/250)
size cache=%491 (40038/8192)
audio cache=%1960 (4876/250)
time cache=%1960 (4876/250)
size cache=%496 (40419/8192)
audio cache=%1979 (4922/250)
time cache=%1979 (4922/250)
size cache=%501 (40800/8192)
audio cache=%1997 (4968/250)
time cache=%1997 (4968/250)
size cache=%505 (41182/8192)
audio cache=%2016 (5014/250)
time cache=%2016 (5014/250)
size cache=%510 (41566/8192)
audio cache=%2034 (5060/250)
time cache=%2034 (5060/250)
size cache=%515 (41953/8192)
audio cache=%2053 (5106/250)
time cache=%2053 (5106/250)
size cache=%519 (42333/8192)
audio cache=%2071 (5152/250)
time cache=%2071 (5152/250)
size cache=%524 (42714/8192)
audio cache=%2090 (5198/250)
time cache=%2090 (5198/250)
size cache=%529 (43098/8192)
audio cache=%2108 (5244/250)
time cache=%2108 (5244/250)
size cache=%533 (43479/8192)
audio cache=%2108 (5244/250)
size cache=%532 (43403/8192)
audio cache=%2127 (5290/250)
time cache=%2127 (5290/250)
size cache=%537 (43782/8192)
audio cache=%1905 (4738/250)
time cache=%1905 (4738/250)
size cache=%483 (39400/8192)
audio cache=%1923 (4784/250)
time cache=%1923 (4784/250)
size cache=%488 (39787/8192)
audio cache=%1942 (4830/250)
time cache=%1942 (4830/250)
size cache=%493 (40173/8192)
audio cache=%1960 (4876/250)
time cache=%1960 (4876/250)
size cache=%498 (40573/8192)
audio cache=%1720 (4278/250)
time cache=%1720 (4278/250)
size cache=%438 (35709/8192)
audio cache=%1738 (4324/250)
time cache=%1738 (4324/250)
size cache=%442 (36063/8192)
audio cache=%1757 (4370/250)
time cache=%1757 (4370/250)
size cache=%447 (36432/8192)
audio cache=%1775 (4416/250)
time cache=%1775 (4416/250)
size cache=%451 (36802/8192)
audio cache=%1794 (4462/250)
time cache=%1794 (4462/250)
size cache=%456 (37171/8192)
audio cache=%1812 (4508/250)
time cache=%1812 (4508/250)
size cache=%460 (37533/8192)
audio cache=%1720 (4278/250)
time cache=%1720 (4278/250)
size cache=%437 (35619/8192)
audio cache=%1738 (4324/250)
time cache=%1738 (4324/250)
size cache=%442 (36003/8192)
audio cache=%1757 (4370/250)
time cache=%1757 (4370/250)
size cache=%446 (36385/8192)
audio cache=%1775 (4416/250)
time cache=%1775 (4416/250)
size cache=%451 (36765/8192)
audio cache=%1794 (4462/250)
time cache=%1794 (4462/250)
size cache=%456 (37157/8192)
audio cache=%1812 (4508/250)
time cache=%1812 (4508/250)
size cache=%461 (37543/8192)
audio cache=%1831 (4554/250)
time cache=%1831 (4554/250)
size cache=%465 (37921/8192)
audio cache=%1849 (4600/250)
time cache=%1849 (4600/250)
size cache=%470 (38305/8192)
audio cache=%1868 (4646/250)
from ijkplayer.
The DEFAULT_MAX_HIGH_WATER_MARK_IN_MS means the least buffer to resume.
Player only resume from "stalled buffering" when pre-read data above this size.
It effect the player start delay.
If you mean the max pre-reading size, I think it should be
// Player does pre-reading only below this size, in bytes
#define MAX_QUEUE_SIZE (15 * 1024 * 1024)
// MIN_FRAMES=5 in original ffplay, packets/frames in pre-reading queue.
#define MIN_FRAMES 50000
Which one did you mean when you mention ''5 seconds"?
Do you want to reduce the delay of the start, or reduce the pre-reading size?
from ijkplayer.
When I change stream on the server, in the app I see the change 5 seconds later. Then I decided to decrease the buffersize.
from ijkplayer.
Then you should reduce MIN_FRAMES or/and MAX_QUEUE_SIZE
from ijkplayer.
Does this API:
if you want to set them from application, add these api
// see how ijkmp_set_overlay_format() does
ijkmp_set_high_water_mark()
ffp_set_high_water_mark()
still exist?
from ijkplayer.
You can ,
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "max-buffer-size", 1024*1024);
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "packet-buffering", 0);
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "min-frames",5);
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "first-high-water-mark-ms",100);
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "next-high-water-mark-ms",100);
On IjkVideoView.
Also , you can learn variables from ,
https://github.com/Bilibili/ijkplayer/blob/master/ijkmedia/ijkplayer/ff_ffplay_def.h
https://github.com/Bilibili/ijkplayer/blob/master/ijkmedia/ijkplayer/ff_ffplay_options.h#L110
from ijkplayer.
HI @developeralp ,
Thank you!
I was using this before:
opts.setPlayerOptionIntValue(5 * 1000, forKey: "first-high-water-mark-ms")
opts.setPlayerOptionIntValue(50 * 1000, forKey: "next-high-water-mark-ms")
opts.setPlayerOptionIntValue(100 * 1000, forKey: "last-high-water-mark-ms")
opts.setPlayerOptionIntValue(10000, forKey: "min-frames")
opts.setPlayerOptionIntValue((128 * 1024 * 1024), forKey: "max-buffer-size")
Will re-evaluate today, as it did not seem to work.
Why did you set ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "packet-buffering", 0);
?
from ijkplayer.
can anyone, @rocxteady , @bbcallen @ened @developeralp @tewilove please tell me how to change the size of the video buffer? what's the size of video buffer by default?
from where it's calling the buffer to write into it and who takes the data out of the buffer?
I am getting an error
E/tv.danmaku.ijk.media.player.IjkMediaPlayer: Buffer (100%) 26468/14750
I have seen ijkfifobuffer is implemented but I want to know where the buffer is written actually? I have seen an array based contiguous allocation.
from ijkplayer.
Related Issues (20)
- 屏蔽声音问题
- 按照官方步骤编辑 运行官方demo 报 Showing All Messages Linker command failed with exit code 1 (use -v to see invocation)
- 一直无法播放RTSP视频流
- No accelerated colorspace conversion found from yuv422p to rgba.
- ipcamera 时间校准接口有吗
- ijkplayer 边播边录像。遇到没有音频的视频,录像失败,报sample rate 为0 怎么处理
- iOS k0.8.8 Could not find or use auto-linked framework 'CoreAudioTypes': framework 'CoreAudioTypes' not found,怎么解决? HOT 5
- 播放视频地址为下载地址,播放不了
- WARNING: arm-linux-androideabi-pkg-config not found, library detection may fail. tools/do-compile-ffmpeg.sh: line 309: 14111 Segmentation fault: 11 make clean 构建出现了这问题,电脑是Apple的M1.. HOT 1
- 进度条拖动快进快退崩溃 HOT 4
- 安卓m3u8是否支持循环播放功能 HOT 1
- format-opts : ijkapplication = -5476376652859717728 format-opts : ijkiomanager = -5476376655277537712
- 连相机rtsp几分钟后卡死在页面 HOT 1
- iOS 播放rtsp后,即使重新初始化播放器也无法播放http视频 HOT 1
- make: *** No rule to make target `install-libs-yes', needed by `install-libs'. HOT 1
- 在编译./compile-openssl.sh all 时报错 Invalid argument,报错信息如下,查看../include/openssl/opensslconf.h 发现文件大小为0,请问哪里出问题了 该如何解决
- 播放器crash HOT 1
- Android,加上参数编译支持pcm_alaw的音频解析,但是还是没有声音
- well-maintained derived project
- error: invalid argument '-std=c99' not allowed with 'C++' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ijkplayer.