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

[docs] Add the explanation on how LeoFS handle streaming media #1098

Closed
mocchira opened this issue Aug 2, 2018 · 14 comments
Closed

[docs] Add the explanation on how LeoFS handle streaming media #1098

mocchira opened this issue Aug 2, 2018 · 14 comments
Assignees
Milestone

Comments

@mocchira
Copy link
Member

mocchira commented Aug 2, 2018

There has been questions about how LeoFS handle streaming media files at

so it'd be good to have the explanation about it on the official docs.

@mocchira mocchira added this to the 1.4.3 milestone Aug 2, 2018
@mocchira mocchira self-assigned this Aug 2, 2018
@FunnyRyan
Copy link

mp4 also can't be load by video.js

URL :http://backet01.leofs.mydomain.com:8080/2.mp4

Connection: keep-alive
Date: Thu, 02 Aug 2018 16:34:36 GMT
Content-Length: 0
Server: LeoFS
Content-Type: video/mp4
ETag: "d41d8cd98f00b204e9800998ecf8427e"
Last-Modified: Thu, 02 Aug 2018 15:27:10 GMT
x-amz-meta-leofs-from-cache: True/via memory
X-From-Cache: True/via memory

@mocchira
Copy link
Member Author

mocchira commented Aug 2, 2018

@FunnyRyan It looks like uploading "2.mp4" failed because the response header from LeoFS included Content-Length: 0 so uploading the "2.mp4" file may fail (or just uploading 0 byte size for some reason).

Can you tell us how you uploaded the file?

  • The original file size of "2.mp4"
  • S3 Client you use
  • How you use it
  • HTTP Request Header sent to LeoFS
  • HTTP Response Body from LeoFS
  • Access Log on LeoFS
  • Error log on LeoFS (if it exists)

@FunnyRyan
Copy link

FunnyRyan commented Aug 3, 2018

I uploaded this video again with DragonDisk, still can't play it.
http://backet01.leofs.xiaohost.com:8080/2.mp4
Connection: keep-alive
Date: Fri, 03 Aug 2018 06:22:28 GMT
Content-Length: 659938
Server: LeoFS
Content-Type: video/mp4
ETag: "0788294c879201c7d8d0221c5bc166be"
Last-Modified: Fri, 03 Aug 2018 01:17:41 GMT
x-amz-meta-leofs-from-cache: True/via memory
X-From-Cache: True/via memory

But the picture can be accessed
http://backet01.leofs.xiaohost.com:8080/20180803141901.png

@mocchira
Copy link
Member Author

mocchira commented Aug 3, 2018

@FunnyRyan Thanks for sharing the accessible links. I did sniff HTTP req/res and It seems LeoFS respond to GET with Range requests properly however the client (video.js) don't think of the response from LeoFS as valid ones. Since LeoFS may violate the HTTP spec regarding Range/Content-Range headers, I will look into the issue further.

@mocchira
Copy link
Member Author

mocchira commented Aug 3, 2018

@FunnyRyan It seems that on my dev-box

  • I can play the video (two guys are fighting each other at some office?) on Edge & Firefox
  • I can't play on Chrome

So there might be problems related to Chrome.

@FunnyRyan
Copy link

Product managers and programmers are playing because of functional requirements

I can't play it on my phone or PC Chrome

but working on IE...or Media Player

@mocchira
Copy link
Member Author

mocchira commented Aug 3, 2018

I can't play it on my phone or PC Chrome
but working on IE...or Media Player

I see. It seems that working environments (IE, Edge, Firefox) issue GET and get the full content through 200 response OTOH NOT working envs (Chrome etc) issue GET with Range and get the full content through 206 response so the latest Chrome doesn't think of the 206 response from LeoFS as valid one for some reason. I'll get back to you once I find the root problem.

Memo: HTTP headers sniffed by DevTools

- General
equest URL: http://backet01.leofs.xiaohost.com:8080/2.mp4
Request Method: GET
Status Code: 206 Partial Content
Remote Address: 173.255.242.49:8080
Referrer Policy: no-referrer-when-downgrade

- Response Headers
Connection: keep-alive
Content-Length: 659938
Content-Range: bytes 0-659937/659938
Content-Type: video/mp4
Date: Fri, 03 Aug 2018 07:26:04 GMT
Last-Modified: Fri, 03 Aug 2018 01:17:41 GMT
Server: LeoFS

- Request Headers
Accept: */*
Accept-Encoding: identity;q=1, *;q=0
Accept-Language: en-US,en;q=0.9,ja;q=0.8
Connection: keep-alive
Host: backet01.leofs.xiaohost.com:8080
Range: bytes=0-
Referer: http://backet01.leofs.xiaohost.com:8080/2.mp4
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36

@mocchira
Copy link
Member Author

mocchira commented Aug 4, 2018

@FunnyRyan it turns out that I can play the video (2.mp4) on Chrome. so let me ask you about your system

  • LeoFS version
  • OS (including version)
  • System Architecture
    • ex)
      • Browser <-> LeoGateway <-> LeoStorage
      • Browser <-> Nginx <-> LeoGateway <-> LeoStorage
      • Browser <-> HAProxy <-> LeoGateway <-> LeoStorage

On my dev-box,

  • Browser (the latest Edge, Firefox, Chrome) <-> LeoGateway <-> LeoStorage
  • Browser (the latest Edge, Firefox, Chrome) <-> Nginx <-> LeoGateway <-> LeoStorage

works as expected with LeoFS 1.4.1 and 1.4.2 on Ubuntu 16.04.

@FunnyRyan
Copy link

soft version :
LeoFS v1.4.2
LeoGateway && LeoStorage working on CentOS Linux release 7.5.1804 (Core)

my Browser version was:
Chrome 67.0.3396.99

Chrome<-> LeoGateway <-> LeoStorage

@mocchira
Copy link
Member Author

mocchira commented Aug 6, 2018

@FunnyRyan Thanks. I will try to reproduce with the environment almost similar to yours.

@mocchira
Copy link
Member Author

mocchira commented Aug 6, 2018

@FunnyRyan Also I may ask you make http://backet01.leofs.xiaohost.com:8080/2.mp4 accessible again when I fail to reproduce the issue with your setting on my dev-box in order to capture the packets flowed between the browser and LeoGateway.

@FunnyRyan
Copy link

I uploaded another mp4 video yesterday, and the strange thing is that it works.
so,i rebuild server's system....
I am now trying to build a leofs with multiple machines and then testing it...

@mocchira
Copy link
Member Author

mocchira commented Aug 6, 2018

@FunnyRyan OK. Let me know once you finish to test on the new cluster.

@FunnyRyan
Copy link

FunnyRyan commented Aug 8, 2018

It is seem to be stable now.....i used a unsupported version of Erlang 19.3......so i change it to 18.3 on centos7.

this is the video which doesn't play on chrome last time i building on single servers
http://s3.xiaohost.com:8080/bucket1/2.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants