Skip to content

M3U8分段视频在seekTo的时候需要很长时间才能播放,这时间跟拖动距离有关,怎样才能缩短时间? #2874

Open
@drivedreams

Description

@drivedreams

这是我用的M3U8地址:http://hot.vrs.sohu.com/ipad1479474_4601450223274_4680795.m3u8?plat=17&prod=ad

现象:1.播放整个的大视频seekTo时,没有问题,很快就可以继续播放。
2.对M3U8地址视频使用seekTo时可能出现两种情况:1.缓冲很长时间后可以播放 2.缓冲一段时间后视频暂停,点击播放视频从头开始播放。
3.如果seekTo的位置已经预缓冲完成则seekTo可以很快播放。
4.通过Log及播放信息可以看出,缓冲很长时间这个过程中,一直有数据进行下载,且速度并不慢。

请教各位大神帮忙分析下,这个问题很头疼,现在都是用这中分段的视频,缓冲时间过长太影响体验,谢谢了!

Activity

0ct0cat

0ct0cat commented on Mar 22, 2017

@0ct0cat

maybe you need modify the ffmpeg.make the probe size smaller.

0ct0cat

0ct0cat commented on Mar 22, 2017

@0ct0cat

the default probe is 5s. too long

Nimger

Nimger commented on Mar 23, 2017

@Nimger

使用IJKFFMoviePlayerController的话,我也碰到这问题,后来我直接改用IJKAVMoviePlayerController来显示,拖动进度就很快了,看了下IJKFFMoviePlayerController的日志,拖动的时候,会一个个ts请求下去,直到找到需要的ts,这样不慢才怪,不知道有什么法子直接定位到所需要的ts

Android4MediaPlayer

Android4MediaPlayer commented on Mar 25, 2017

@Android4MediaPlayer

有sample url吗

0ct0cat

0ct0cat commented on Mar 27, 2017

@0ct0cat

IJKAVMoviePlayerController use the ios defalut mediaplayer. not ffplay.
if yout want use ffplay,pls use IJKFFMoviePlayerController.
when the play seek to position.Reduced the probe size make it fast.

drivedreams

drivedreams commented on Mar 28, 2017

@drivedreams
Author
drivedreams

drivedreams commented on Mar 28, 2017

@drivedreams
Author

Hi 0ct0cat,
I checked the codes of ijkplayer, IJKFFMoviePlayerController is used in IOS. How to resolve my problem on android?

0ct0cat

0ct0cat commented on Mar 29, 2017

@0ct0cat

there is a member probesize in AVFormatContext ,you can set it's value to control the demuxer probe size.
this method can use on android & ios

aasdsjk

aasdsjk commented on Mar 29, 2017

@aasdsjk

how to set probesize ,and where can i set it's value?

0ct0cat

0ct0cat commented on Mar 30, 2017

@0ct0cat

just like this
pls->ctx->probesize = 32 * 1024;
in hls.c
hls_read_header

aasdsjk

aasdsjk commented on Mar 30, 2017

@aasdsjk

thank you

aasdsjk

aasdsjk commented on Mar 30, 2017

@aasdsjk

I haved tried this, and i make pls->ctx->probesize = 4 * 1024. But it is not helpful. Does it work?

drivedreams

drivedreams commented on Apr 5, 2017

@drivedreams
Author

Hi 0ct0cat,
Could you try my Video address? I has tried a lot of ways to do it, but still can not resolved it. I have to use Vitamio as a temporary resolution.

0ct0cat

0ct0cat commented on Apr 7, 2017

@0ct0cat

@drivedreams
i test this stream,it's can't seek.
maybe there is a problem in mpegts.c.
after seek, hls.c work normal,it's can find right url to read and down ts data.
but the av_read_frame stop work.i think it's demux's bug.

drivedreams

drivedreams commented on Apr 9, 2017

@drivedreams
Author

39 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @nicolasiJasica@drivedreams@0ct0cat@linjiansheng@dongdong945

        Issue actions

          M3U8分段视频在seekTo的时候需要很长时间才能播放,这时间跟拖动距离有关,怎样才能缩短时间? · Issue #2874 · bilibili/ijkplayer