-
-
Notifications
You must be signed in to change notification settings - Fork 578
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
[bug] wrong flv head under debug mode #99
Comments
How to reproduce it? Only adding winshining@debian:~/desktopl/streaming$ wget 'http://localhost:8080/live?app=myapp&stream=mystream_99' -O test.flv
winshining@debian:~/desktopl/streaming$ hexdump -C -n 128 test.flv winshining@debian:~/desktopl/streaming$ wget 'http://localhost:8080/live?app=myapp&stream=mystream_1' -O test.flv
winshining@debian:~/desktopl/streaming$ hexdump -C -n 128 test.flv |
I noticed that you've used HTTPS, it is also OK:
winshining@debian:~/workspace/nginx-http-flv-module$ hexdump -C -n 128 test.flv The possible reason is that the browser you've tested didn't interpret HTTP chunked response, the response HTTP header is:
So, the chunked format of FLV header is d\r\n F L V 01 05 00 00 00 09 00 00 00 00 \r\n, the hexadecimal of above is: |
Thanks for the help and apology for occupying your time. I look into the problem after reading your comment and find it a complicated problem chain possibly related to either Chrome or Nginx proxy. The proxy seems working incorrectly with chunked data. It firstly causes chrome to throw out net::ERR_INCOMPLETE_CHUNKED_ENCODING. As a side proof, you can also get a "network error" prompt soon after the download starts if you try to directly access the http-flv address. After a few seconds, chrome will stop showing the net::ERR_INCOMPLETE_CHUNKED_ENCODING error message in the development console, and you will be able to download the http-flv stream continuously. However, the problem still exists. Flv.js will raise the "Non-FLV, Unsupported media type" error, and "64 0d 0a 46 4c 56 01" could be seen in the downloaded .flv file, as I described in my above post. I have no idea why chrome stop popping the error prompt after a while and pass the wrong content down. The HTTP Response Headers are all the same. I just want to note this down here and will make more update if I have time to look deeper. |
I've never got You can specify the following directive in conf file:
from |
@adrianhans Hi, I reproduced the bug and fixed it. If HTTP/1.0 is used to request the playback, the format of the first package sent by server is not correct if
You can fetch the latest code to test. Looking forward to your reply. Thanks! |
the normal FLV HEAD (46 4C 56 01) is expected to be sent every time upon request.
however, if nginx-http-flv-module is compiled with debug enabled (./configure --with-debug), the FLV HEAD is prefix with 0x64 0x0d 0x0a, which makes it
64 0d 0a 46 4c 56 01
and unrecognizable for players such as flv.js
My environment is:
the error info from flv.js is "Non-FLV, Unsupported media type". the dumped http-flv data is as below:
$ hexdump -C -n128 live1.flv
00000000 64 0d 0a 46 4c 56 01 05 00 00 00 09 00 00 00 00 |d..FLV..........|
00000010 0d 0a 12 00 01 a8 00 00 00 00 00 00 00 05 00 00 |................|
00000020 00 00 01 99 12 01 00 00 00 02 00 0a 6f 6e 4d 65 |............onMe|
00000030 74 61 44 61 74 61 03 00 06 53 65 72 76 65 72 02 |taData...Server.|
00000040 00 44 4e 47 49 4e 58 20 48 54 54 50 2d 46 4c 56 |.DNGINX HTTP-FLV|
00000050 20 28 68 74 74 70 73 3a 2f 2f 67 69 74 68 75 62 | (https://github|
00000060 2e 63 6f 6d 2f 77 69 6e 73 68 69 6e 69 6e 67 2f |.com/winshining/|
00000070 6e 67 69 6e 78 2d 68 74 74 70 2d 66 6c 76 2d 6d |nginx-http-flv-m|
The text was updated successfully, but these errors were encountered: