Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于ijkplayer播放视频时提前收到MPMovieFinishReasonPlaybackEnded #38

Closed
domingoxx opened this issue Jul 4, 2014 · 9 comments

Comments

@domingoxx
Copy link

我使用ijkplayer做多个文件播放
方式是一开始就初始化两个播放器
先开始播放第一个
第一个播放结束 就开始播放第二个 销毁第一个 创建下一个
这里出现的问题是 在播放第二段的时候 也就是第一段播放完了 接着播放的二段
这个途中却提前收到了MPMovieFinishReasonPlaybackEnded 时间 不知道这是不是bug

还有个就是貌似存在内存泄漏 内存没有完全回收

@bbcallen
Copy link
Contributor

bbcallen commented Jul 4, 2014

看看 libavformat/concatdec.c
内存泄露看看 profile,确认一下有没有调用shutdown并且销毁 view

@domingoxx
Copy link
Author

哎 concat也是一头雾水 不知道是哪里出错了。
内存泄漏问题倒是解决了

@domingoxx
Copy link
Author

请问能给一个concat的示例吗

@jgfntu
Copy link

jgfntu commented Jul 5, 2014

我有类似的需求,例如30分钟的视频,但是是5分钟一段的mp4,目前做的只是在上层做预加载,一段快结束了,接着放第二段,但是总归会有播放器的重启时间间隔,体验不好。
一直想在ffmpeg的avformat里面仿照HLS的解析写一个,如果我把5分钟一段的MP4写成类似M3U8的列表,然后做类似解析,不知是否可行?或者说与TS的m3u8的区别是什么?毕竟TS都是几秒的分段,并且对于mp4来说做seek之类的操作好像都比较麻烦。
vitamio倒是提供了setDataSegments(String[] uris, String cacheDir)的接口,给若干url,然后vitamio会缓冲一会儿才开始播放(莫非是获取了各段mp4的header信息后才开始播放的),是否有更好的方式来实现这个需求?

@bbcallen
Copy link
Contributor

bbcallen commented Jul 6, 2014

http://www.ffmpeg.org/ffmpeg-formats.html#Syntax
m3u8理论上也可以。

@domingoxx
Copy link
Author

昨天终于搞定了concat协议的问题,
问题是: 文件必须要加上 ffconcat version 1.0
然后使用了concat协议导致无法获取时间长度 需要为每个分段设置时长 ‘ duration <时长>’

m3u8还是没解决 不知道是我标签没写对还是怎么 总之现在有解决方案了 = =

@jgfntu
Copy link

jgfntu commented Jul 7, 2014

我昨天也试过了concat几段mp4的网络视频,可以正常播放,不过有可能是mp4切片的问题,段与段之间还是会有点卡顿一下感觉,可能还要调试一下看看;m3u8的话,还是直接用HLS的吧,挺好的。

@domingoxx
Copy link
Author

@simtice

时长是秒为单位 然后你可以检查下其中的URL是否能正常播放

只能帮到这里了.

liuming2049 pushed a commit to liuming2049/ijkplayer that referenced this issue Apr 6, 2021
feat: build android using ndk16 and clang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants