jwplayer 在缓冲时跳过视频

发布于 2024-11-25 14:04:16 字数 823 浏览 1 评论 0原文

Jwplayer 在缓冲时会跳过视频流。我从一周前就注意到这个问题。但代码没有变化。播放器版本为 5.5.1641。问题似乎仅限于大型视频文件(超过 150mb,持续 2.35 秒)。它不会在相同的缓冲时间跳过,就像它在随机时间跳过视频一样。有时,2秒,有时,5秒,有时,20秒等等。我猜这可能是因为视频流下载时丢包。但我不确定。有人可以帮我吗?

            jwplayer($(this).attr('id')).setup({
                flashplayer: 'http://localhost/project1/public/upload/player.swf',
                file: 'http://localhost/project1/public/upload/' + $(this).html(),
                height:480,
                plugins: {
                    hd: { file: "http://localhost/project1/public/upload/" + $(this).html(), fullscreen: true }
                },
                width: 800,
                dock:false,
                controlbar:'none',
                provider: 'http',
                'http.startparam':'starttime',
                icons:false
            });

Jwplayer skips video streaming while it is buffering. I noticed this problem since a week before only. But there is no change in code. Player version is 5.5.1641. The problem seems to be with large video files only (more than 150mb for 2.35 seconds). It doesn't skip at the same buffer time, like, it skips the video at random time. Sometimes, 2 seconds, sometimes, 5, sometimes, 20 etc. I'm guessing this could be because of packet loss in video streams downloading. But I'm not sure. Can anyone plz help me on this ?

            jwplayer($(this).attr('id')).setup({
                flashplayer: 'http://localhost/project1/public/upload/player.swf',
                file: 'http://localhost/project1/public/upload/' + $(this).html(),
                height:480,
                plugins: {
                    hd: { file: "http://localhost/project1/public/upload/" + $(this).html(), fullscreen: true }
                },
                width: 800,
                dock:false,
                controlbar:'none',
                provider: 'http',
                'http.startparam':'starttime',
                icons:false
            });

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

土豪 2024-12-02 14:04:16

看来问题出在视频文件本身。由于网络浏览器无法像 vlc 播放器等那样,我们应该以较低的质量对视频进行编码。此外,桌面播放器可以播放浏览器无法播放的损坏视频。

这是我使用的 ffmpeg 编码设置。希望它对其他人有任何帮助。

ffmpeg -i source_video.flv -vcodec libx264 -f mp4 -threads 2 -cropleft 0 -croptop 0 -cropright 0 -cropbottom 0 -s 1024x560 -aspect 1.823 -pass 2 -b 229274368 -bf 3 -cmp 0 -dia_size 2 -preme 0 -mbcmp 0 -mbd 2 -me_method 6 -precmp 0 -qmax 51 -qmin 10 -g 300 -subcmp 0 -subq 5 -acodec libfaac -ab 144000 -vol 256 -ac 2 -flags aic+mv4+mv0 -refs 3 -deblockalpha 0 -deblockbeta 0 -level 41 -trellis 1 -coder 1  -y  encoded_video.mp4

It seems the problem is with video file itself. Becoz web browsers are not capable like vlc player etc, we should encode video in lower quality. Also, desktop players can play broken videos where we browsers cannot.

Here is the ffmpeg encoding settings I used. Hope it can be of any help for others.

ffmpeg -i source_video.flv -vcodec libx264 -f mp4 -threads 2 -cropleft 0 -croptop 0 -cropright 0 -cropbottom 0 -s 1024x560 -aspect 1.823 -pass 2 -b 229274368 -bf 3 -cmp 0 -dia_size 2 -preme 0 -mbcmp 0 -mbd 2 -me_method 6 -precmp 0 -qmax 51 -qmin 10 -g 300 -subcmp 0 -subq 5 -acodec libfaac -ab 144000 -vol 256 -ac 2 -flags aic+mv4+mv0 -refs 3 -deblockalpha 0 -deblockbeta 0 -level 41 -trellis 1 -coder 1  -y  encoded_video.mp4
合约呢 2024-12-02 14:04:16

我发现这个问题与代码无关,而是与我的网络主机上的超时设置有关。我给他们发了一封电子邮件,他们将下载超时时间增加到了最大值,我没有再遇到任何问题。

I found this issue to be not code related but to do with a time out setting on the my web host. I dropped them an email and they increased the download time out amount to the max and I had no further problems with this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文