bilibili / ijkplayer

Android/iOS video player based on FFmpeg n3.4, with MediaCodec, VideoToolbox support.
GNU General Public License v2.0
32.44k stars 8.11k forks source link

use ffconcat sometimes cant use seekTo() #1611

Open ShawnAnn opened 8 years ago

ShawnAnn commented 8 years ago

Dear author,I found a problem and My ijkplayer version is tv.danmaku.ijk.media:ijkplayer-java:0.4.5.1. When I set a m3u8 file as the video path,it works well.When I use ffconcat file as the path,it works well,too.So here comes the question,I use ffconcat file like this: ffconcat version 1.0 file 'http://xxxx' duration 186 file 'http://xxx' duration 210 ... and I can use seekTo() without any probrem,but when i use like: ffconcat version 1.0 file 'http://xxxx' duration 186.4 file 'http://xxx' duration 210.8 ... if I seekTo 13:00 ,the video will go to almost 26:00,just change int to float.I dont hnow why,can anyone help me?Thank you very much.

bbcallen commented 8 years ago

Take a look at libavformat/hls.c

ShawnAnn commented 8 years ago

Today I change my version to 0.6.0,and I add ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "safe", 0); ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "protocol_whitelist", "concat,ffconcat,file,subfile,http,https,tls,rtp,tcp,udp,crypto"); when I use player.play(path) to play the video,path maybe like "storage/sdcard0/ffconcat.concat",then my app crash.how can i use correctly?

Android4MediaPlayer commented 8 years ago

Any log?

ShawnAnn commented 8 years ago

no log...just crash.If i change path like ffconcat://storage/sdcard0/ffconcat.concat wont crash.So,i wanna know why?

bbcallen commented 8 years ago

Crash may be fixed in https://github.com/Bilibili/FFmpeg/commit/17871003bc7c36c16ec9e502e70c4eacebcb26f6

Try update to master, remember also update ffmpeg source.

ShawnAnn commented 8 years ago

Thanks for your reply.Fiexed.

ShawnAnn commented 8 years ago

hey man, thanks for your reply. It seems that I have got another problem here. There is not sound in the beginning of the video, I meant at the start of the video. Then the video starts to have sound after 2-3 seconds, plus the video seems to be stuck over the times. It takes 5-10 seconds to play the video smoothly.

ShawnAnn commented 8 years ago

ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "opensles", 0); it works