当前位置:网站首页>Inaccurate problem of flutter fijkplayer seekto
Inaccurate problem of flutter fijkplayer seekto
2022-07-26 08:27:00 【Peanut - Summer】
ijkplayer and ffplay In the open rtmp Streaming video , Most people will encounter 5~10 Second delay , stay ffplay When the play , If you add -fflags nobuffer It can shorten the playback rtmp Video delay in 1s Inside , And in the IjkMediaPlayer Add
mediaPlayer.setOption(1, "analyzemaxduration", 100L);
mediaPlayer.setOption(1, "probesize", 10240L);
mediaPlayer.setOption(1, "flush_packets", 1L);
mediaPlayer.setOption(4, "packet-buffering", 0L);
mediaPlayer.setOption(4, "framedrop", 1L);
1: Set whether to turn on tone change
mediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER,"soundtouch",isModifyTone?0:1);
2: Set whether to turn on loop filtering : 0 Turn on , High picture quality , High decoding overhead ,48 close , Poor picture quality , Low decoding overhead
mediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_CODEC,"skip_loop_filter",isSkipLoopFilter?0:48L);
3: Set the maximum detection time before playing
mediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT,"analyzemaxduration",100L);
4: Set the detection time before playing 1, Achieve the first screen second on effect
mediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT,"analyzeduration",1);
5: Detection before playback Size, The default is 1M, A little smaller will make the picture faster
mediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT,"probesize",1024*10);
6: Every time I deal with one packet Then refresh io Context
mediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT,"flush_packets",1L);
7: Whether to turn on pre buffering , Generally, live broadcast projects will be opened , Achieve the effect of seconds on , However, it brings the experience of playing frame dropping and blocking
mediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER,"packet-buffering",isBufferCache?1:0);
8: Playback reconnection times
mediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER,"reconnect",5);
9: Maximum buffer size , Company kb
mediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER,"max-buffer-size",maxCacheSize);
10: Frame skipping , discharge CPU When processing is slow , Do frame skipping , Make sure the playback process , Picture and sound synchronization
mediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER,"framedrop",5);
11: Maximum fps
mediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER,"max-fps",30);
12: Set the hard decoding method
jkPlayer Support hard decoding and soft decoding . The video angle will not be rotated during soft decoding. You need to pass it at this time onInfo Of what == IMediaPlayer.MEDIA_INFO_VIDEO_ROTATION_CHANGED To get the angle , Rotate the picture by yourself . Or turn on hard decoding , However, hard decoding is easy to cause black screen silence ( Hardware compatibility issues ), The following is the code related to setting hard decoding
mediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "mediacodec", 1);
mediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "mediacodec-auto-rotate", 1);
mediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "mediacodec-handle-resolution-change", 1);
13.SeekTo Set optimization
Some videos are SeekTo When , Will jump back to the position before dragging , This is because of the key frame of the video , Popular is FFMPEG Are not compatible , Video compression is too strong ,seek Only key frames are supported , This occurs in the original video file i Fewer frames
mediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "enable-accurate-seek", 1);
14. solve m3u8 File drag problem such as : One 3 How many hours of audio files , Start playing for a few seconds , Then drag to 2 About an hour or so , want loading 10 minute
mediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "fflags", "fastseek");// Set up seekTo Can fast seek Go to the specified location and play
Important records , List of questions
1. After setting , High bit rate m3u8 Play Caton , The sound and picture are not synchronized , Or just pictures , No sound , Or the sound and picture are not synchronized
// Some videos are SeekTo When , Will jump back to the position before dragging , This is because of the key frame of the video , Popular is FFMPEG Are not compatible , Video compression is too strong ,seek Only key frames are supported , This occurs in the original video file i Fewer frames
mediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "enable-accurate-seek", 1);
// Detection before playback Size, The default is 1M, A little smaller will make the picture faster
mediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "probesize", 1024 * 10);reference Android That's it
边栏推荐
- One click deployment lamp and LNMP architecture
- 各位老师,请问在flinkcdc中,sqlserver如何获取到ddl?
- 2022-7-5 personal qualifying 2 competition experience
- NLP (natural language processing) natural language processing learning
- On some concepts involved in journal papers compilation + journal query methods
- flink oracle cdc 读取数据一直为null,有大佬知道么
- Flex three column layout
- 请问现在flinkcdc支持sqlserver实例名方式连接吗?
- Basic music theory rhythm connection problem, very important
- 2022 / 7 / 16 exam summary
猜你喜欢

22-07-12 personal training match 1 competition experience

vscode 实用快捷键

宇宙第一 IDE 霸主,换人了。。。

Take out brother is the biggest support in this society

2022-7-9 personal qualifying 6 competition experience
分享高压超低噪声LDO测试结果(High Voltage Ultra-low Noise LDO)

QSS add resource file of QT

BGP选路原则

C # get the information of the selected file

C# 获取选择文件信息
随机推荐
Introduction to arrays -- array
Special Lecture 3 number theory + game theory learning experience (should be updated for a long time)
A little awesome, 130000 a month+
C # get the information of the selected file
Exam summary on June 30, 2022
Kotlin中room数据库的使用
flex三列布局
sed作业
Condition judgment function of MySQL function summary
请问flink sql client 在sink表,有什么办法增大写出速率吗。通过sink表的同步时
shell编程
OSPF summary
99 multiplication table and inverted triangle 99 multiplication table
Function default parameters, arrow functions, and remaining parameters in ES6 - explanation
BGP -- Border Gateway Protocol
I am 35 years old.
C# 获取选择文件信息
Team members participate in 2022 China multimedia conference
2022-7-4 personal qualifying 1 competition experience
Share high voltage ultra low noise LDO test results