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
Video starts playing late #1097
Comments
Which file format is the video? |
MP4 for sure |
MP4 videos are handled by this library: https://github.com/jhiesey/videostream @jhiesey has 100x my experience in the subject, he might be able to help with this issue. |
Mp4 is good but you need to encode the video with some flags at the begining in order to be able to stream it. Try a basic player with a webseed to see if it is webtorrent related. The flags are called moov if you need reference. |
@yciabaud We tried the -movflags faststart ffmpeg option but no luck, their is still the same delay before the player starts the video. |
Can you provide the torrent with the webseeds in order to have a look? |
http://179.43.145.194/sintel.html |
Loads for me after 2 seconds at 4 MB downloaded
… On Apr 13, 2017, at 5:56AM, davidupx ***@***.***> wrote:
http://179.43.145.194/sintel.html <http://179.43.145.194/sintel.html>
As you can see, the video starts playing only after downloading about >10MB,
knowing that for users who have a medium-speed connection, 10MB means a few minutes of patience to see the first frame...
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#1097 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AB6fN4kE4T3_BzzPsUOr7jxdfDGNOB38ks5rvf9ZgaJpZM4M4L8M>.
|
Loads for me at 7MB. Multiple pieces are being downloaded concurrently but a piece can't be used until it's completely downloaded, so some of those extra MBs are probably devoted to future pieces that aren't needed to play the first frame. But if there are enough peers available in the network, we'll try to connect and get data from them anyway. Maybe this can be improved but then we'd need to have an idea of how much bandwidth is available to the client... This all sounds really hard and I haven't taken a close look at the download strategy code in a long time. I'm -1 on changing anything to address this. |
I'm a bit late to this issue, but I'll take a look this weekend to see if there's anything that can be improved on the videostream side. @yciabaud @davidupx I'm not surprised the faststart option doesn't make much difference. In either case videostream will request the beginning of the file first and then almost immediately seek to the correct moov offset (either still near the beginning with the option passed or near the end without it). Webtorrent needs to download different torrent pieces but not much else changes. In contrast, with http the GET request would have to be cancelled if there's a need to seek to the end, which would usually require killing the connection. In other words, webtorrent doesn't have nearly as much overhead when seeking as http does. |
@jhiesey Thanks for your reply, I hope you can improve the situation. |
Alright, didn't get to it this weekend. Hopefully early this week. |
What version of WebTorrent?
v0.98.16
What operating system and Node.js version?
CentOS 6.8 - node 6.10
What browser and version? (if using WebTorrent in the browser)
Chrome 57 - Firefox 52
What did you expect to happen?
Video starts playing as soon as first frame is downloaded
What actually happened?
The video size is 500MB, 2 webseeds are being used and are fetched from torrent file (urlList parameter), the chunk size is 512KB.
The video starts playing after downloading about 15MB which is kind of late compared to classic streaming.
Where should I be looking in order to make the video start playing sooner?
The text was updated successfully, but these errors were encountered: