befovy / fijkplayer

ijkplayer for flutter. ijkplayer 的 flutter 封装。 Flutter video/audio player. Flutter media player plugin for android/iOS based on ijkplayer. fijkplayer 是基于 ijkplayer 封装的 flutter 媒体播放器,开箱即用,无需编译 ijkplayer
https://fijkplayer.befovy.com
MIT License
1.65k stars 354 forks source link

m3u8视频 seekTo(0) 调用失败 #112

Open fantasy525 opened 5 years ago

fantasy525 commented 5 years ago

Describe the bug 当播放m3u8视频结束后调用start,视频不会重新开始播放 日志

 SetStuffTimer
I/flutter ( 7155): [inf] 2019-11-19 21:59:57.791819 [fijk] FijkPlayer{id:5} invoke start
D/IJKMEDIA( 7155): IjkMediaPlayer_start
D/IJKMEDIA( 7155): ijkmp_start()
D/IJKMEDIA( 7155): ijkmp_start()=0
D/IJKMEDIA( 7155): ijkmp_get_msg: FFP_REQ_START
D/IJKMEDIA( 7155): FFP_MSG_BUFFERING_START:
E/IJKMEDIA( 7155): https://1254467417.vod2.myqcloud.com/2f4e0c50vodtransgzp1254467417/39dc43de5285890791990694950/v.f32849.m3u8: error while seeking
D/IJKMEDIA( 7155): ijkmp_get_msg: FFP_MSG_SEEK_COMPLETE
D/IJKMEDIA( 7155): FFP_MSG_SEEK_COMPLETE:
D/IJKMEDIA( 7155): FFP_MSG_BUFFERING_END:
I/flutter ( 7155): buffer start
I/flutter ( 7155): SetStuffTimer
I/flutter ( 7155): [inf] 2019-11-19 21:59:57.815968 [fijk] FijkPlayer{id:5} state changed to FijkState.started <= FijkState.completed
I/flutter ( 7155): player state = FijkState.started
I/flutter ( 7155): SetStuffTimer
I/flutter ( 7155): buffer end
I/IJKMEDIA( 7155): ffp_toggle_buffering: completed: OK
D/IJKMEDIA( 7155): ijkmp_get_msg: FFP_MSG_COMPLETED
D/IJKMEDIA( 7155): FFP_MSG_COMPLETED:
I/flutter ( 7155): [inf] 2019-11-19 21:59:57.920727 [fijk] FijkPlayer{id:5} state changed to FijkState.completed <= FijkState.started
I/flutter ( 7155): player state = FijkState.completed
I/flutter ( 7155): 展示 stuff
I/flutter ( 7155): SetStuffTimer
I/flutter ( 7155): [inf] 2019-11-19 21:59:57.967737 [fijk] FijkPlayer{id:5} invoke start
D/IJKMEDIA( 7155): IjkMediaPlayer_start
D/IJKMEDIA( 7155): ijkmp_start()
D/IJKMEDIA( 7155): ijkmp_start()=0
D/IJKMEDIA( 7155): ijkmp_get_msg: FFP_REQ_START
D/IJKMEDIA( 7155): FFP_MSG_BUFFERING_START:
I/flutter ( 7155): buffer start
I/flutter ( 7155): SetStuffTimer
I/flutter ( 7155): [inf] 2019-11-19 21:59:57.972149 [fijk] FijkPlayer{id:5} state changed to FijkState.started <= FijkState.completed
I/flutter ( 7155): player state = FijkState.started
I/flutter ( 7155): SetStuffTimer
E/IJKMEDIA( 7155): https://xxxxx.m3u8: error while seeking
D/IJKMEDIA( 7155): ijkmp_get_msg: FFP_MSG_SEEK_COMPLETE
D/IJKMEDIA( 7155): FFP_MSG_SEEK_COMPLETE:
D/IJKMEDIA( 7155): FFP_MSG_BUFFERING_END:
I/flutter ( 7155): buffer end
I/IJKMEDIA( 7155): ffp_toggle_buffering: completed: OK
D/IJKMEDIA( 7155): ijkmp_get_msg: FFP_MSG_COMPLETED
D/IJKMEDIA( 7155): FFP_MSG_COMPLETED:
I/flutter ( 7155): [inf] 2019-11-19 21:59:58.137821 [fijk] FijkPlayer{id:5} state changed to FijkState.completed <= FijkState.started
I/flutter ( 7155): player state = FijkState.completed
I/flutter ( 7155): 展示 stuff
I/IJKMEDIA( 7155): ffp_toggle_buffering: eof

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

fijkplayer version 0.1.10

:octocat: From gitme Android

fantasy525 commented 5 years ago

@befovy 我试了试直接seekTo到0不行,seekTo到1就可以

befovy commented 5 years ago

我看上面日志中出现过 https://xxxxx.m3u8: error while seeking 。 这是 ffmpeg 中进行 m3u8 文件 seek 过程中出错了。

befovy commented 4 years ago

可以查到 ffmpeg 邮件列表有相关讨论,ffmpeg 4.0 应该已经打了这个patch。 https://trac.ffmpeg.org/ticket/6850

https://patchwork.ffmpeg.org/project/ffmpeg/patch/1514888905-30126-1-git-send-email-mymoeyard@gmail.com/

@fantasy525 可以看看新版本还有没有 seekTo 0 的问题吗?

yiky84119 commented 4 years ago

seek 0 还是不行,seek 1可以

bookyo commented 4 years ago

m3u8 设置成loop 0 ,会在播放完毕之后直接卡住。

E/IJKMEDIA(25162): https://www.leimulamu.com/videos/202006/12/5ee0f21bd6334d5540c43be8/e3d14c/index.m3u8: error while seeking
D/IJKMEDIA(25162): FFP_MSG_BUFFERING_START:
D/IJKMEDIA(25162): ijkmp_get_msg: FFP_MSG_SEEK_COMPLETE
D/IJKMEDIA(25162): FFP_MSG_SEEK_COMPLETE:
D/IJKMEDIA(25162): FFP_MSG_BUFFERING_END:
E/IJKMEDIA(25162): https://www.leimulamu.com/videos/202006/12/5ee0f21bd6334d5540c43be8/e3d14c/index.m3u8: error while seeking
D/IJKMEDIA(25162): FFP_MSG_BUFFERING_START:
D/IJKMEDIA(25162): ijkmp_get_msg: FFP_MSG_SEEK_COMPLETE
D/IJKMEDIA(25162): FFP_MSG_SEEK_COMPLETE:
D/IJKMEDIA(25162): FFP_MSG_BUFFERING_END:
E/IJKMEDIA(25162): https://www.leimulamu.com/videos/202006/12/5ee0f21bd6334d5540c43be8/e3d14c/index.m3u8: error while seeking
D/IJKMEDIA(25162): FFP_MSG_BUFFERING_START:
D/IJKMEDIA(25162): ijkmp_get_msg: FFP_MSG_SEEK_COMPLETE
D/IJKMEDIA(25162): FFP_MSG_SEEK_COMPLETE:
D/IJKMEDIA(25162): FFP_MSG_BUFFERING_END:
E/IJKMEDIA(25162): https://www.leimulamu.com/videos/202006/12/5ee0f21bd6334d5540c43be8/e3d14c/index.m3u8: error while seeking
D/IJKMEDIA(25162): FFP_MSG_BUFFERING_START:
D/IJKMEDIA(25162): ijkmp_get_msg: FFP_MSG_SEEK_COMPLETE
D/IJKMEDIA(25162): FFP_MSG_SEEK_COMPLETE:
D/IJKMEDIA(25162): FFP_MSG_BUFFERING_END:
E/IJKMEDIA(25162): https://www.leimulamu.com/videos/202006/12/5ee0f21bd6334d5540c43be8/e3d14c/index.m3u8: error while seeking
D/IJKMEDIA(25162): FFP_MSG_BUFFERING_START:
D/IJKMEDIA(25162): ijkmp_get_msg: FFP_MSG_SEEK_COMPLETE
D/IJKMEDIA(25162): FFP_MSG_SEEK_COMPLETE:
D/IJKMEDIA(25162): FFP_MSG_BUFFERING_END:

一直重复显示如上日志,应该也是seekTo的问题。有什么解决方案么?