【发布时间】:2018-12-18 11:36:18
【问题描述】:
我正在使用 vlcj 读取位于 URL 的媒体文件。
我遇到了一些视频流问题,我为 vlcj 启用了详细输出,日志看起来很奇怪:向正在流式传输文件的服务器发出了许多请求(只有一个文件有 10 个请求)。我注意到在第一次调用后端之后,第二个是用一个组成的“范围”标题(或者可能有一个逻辑,但我错过了它)。之后,再次发出相同的请求,并在某个时候更改“Range”标头值并保持为新值,依此类推。
问题是vlc发出这么多请求是否正常,重复请求的目的是什么。
我也在此处发布正在提出的请求。
> [1dcb6130] http stream debug: outgoing request: streaming?id=1011122
> HTTP/1.1
>
> Host: hostname.com
>
> Accept: */*
>
> Accept-Language: en_US
>
> User-Agent: VLC/3.0.4 LibVLC/3.0.4
>
> Range: bytes=0-
>
>
>
>
> [1dcb6130] http stream debug: incoming response: HTTP/1.1 200 200
>
> Date: Tue, 18 Dec 2018 10:35:54 GMT
>
> Server: Apache/2.4.6 (CentOS) mod_jk/1.2.42
>
> Set-Cookie: JSESSIONID=ASD43SAD123SAD34;path=/;HttpOnly
>
> Accept-Ranges: bytes
>
> Content-Length: 31380626
>
> Content-Type: video/mp4
>
> [1dcb6130] http stream debug: outgoing request: GET
> /streaming?id=12345678 HTTP/1.1
>
> Host: hostname.com
>
> Accept: */*
>
> Accept-Language: en_US
>
> User-Agent: VLC/3.0.4 LibVLC/3.0.4
>
> Cookie: JSESSIONID=ASD43SAD123SAD34
>
> Range: bytes=31188554-
>
>
>
>
> [1dcb6130] http stream debug: incoming response: HTTP/1.1 200 200
>
> Date: Tue, 18 Dec 2018 10:35:54 GMT
>
> Server: Apache/2.4.6 (CentOS) mod_jk/1.2.42
>
> Set-Cookie: JSESSIONID=0ASD43SAD123SAD34;path=/;HttpOnly
>
> Accept-Ranges: bytes
>
> Content-Length: 192072
>
> Content-Type: video/mp4 [1dcb6130] http stream debug: outgoing
> request: GET /streaming?id=12345678 HTTP/1.1
>
> Host: hostname.com
>
> Accept: */*
>
> Accept-Language: en_US
>
> User-Agent: VLC/3.0.4 LibVLC/3.0.4
>
> Cookie: JSESSIONID=0ASD43SAD123SAD34
>
> Range: bytes=31188554-
>
>
>
>
> [1dcb6130] http stream debug: connection failed [1dcb6130] http
> stream debug: resolving hostname.com ... [1dcb6130] http stream
> debug: outgoing request: GET /streaming?id=12345678 HTTP/1.1
>
> Host: hostname.com
>
> Accept: */*
>
> Accept-Language: en_US
>
> User-Agent: VLC/3.0.4 LibVLC/3.0.4
>
> Cookie: JSESSIONID=0ASD43SAD123SAD34
>
> Range: bytes=31188554-
>
>
>
>
> [1dcb6130] http stream debug: incoming response: HTTP/1.1 200 200
>
> Date: Tue, 18 Dec 2018 10:35:55 GMT
>
> Server: Apache/2.4.6 (CentOS) mod_jk/1.2.42
>
> Set-Cookie: JSESSIONID=ASD43SAD123SAD34;path=/;HttpOnly
>
> Accept-Ranges: bytes
>
> Content-Length: 192072
>
> Content-Type: video/mp4
>
> [1dcb6130] http stream debug: outgoing request: GET
> /streaming?id=12345678 HTTP/1.1
>
> Host: hostname.com
>
> Accept: */*
>
> Accept-Language: en_US
>
> User-Agent: VLC/3.0.4 LibVLC/3.0.4
>
> Cookie: JSESSIONID=ASD43SAD123SAD34
>
> Range: bytes=4847078-
>
>
>
>
> [1dcb6130] http stream debug: connection failed [1dcb6130] http
> stream debug: resolving hostname.com ... [1dcb6130] http stream
> debug: outgoing request: GET /streaming?id=12345678 HTTP/1.1
>
> Host: hostname.com
>
> Accept: */*
>
> Accept-Language: en_US
>
> User-Agent: VLC/3.0.4 LibVLC/3.0.4
>
> Cookie: JSESSIONID=ASD43SAD123SAD34
>
> Range: bytes=4847078-
>
>
>
>
> [1dcb6130] http stream debug: incoming response: HTTP/1.1 200 200
>
> Date: Tue, 18 Dec 2018 10:36:21 GMT
>
> Server: Apache/2.4.6 (CentOS) mod_jk/1.2.42
>
> Accept-Ranges: bytes
>
> Content-Length: 26533548
>
> Content-Type: video/mp4
>
>
>
>
> [1dcb6210] prefetch stream error: cannot seek (to offset 4847078)
> [1dcbd7e8] avi demux warning: failed reading data [1dcb6130] http
> stream debug: outgoing request: GET /streaming?id=12345678 HTTP/1.1
>
> Host: hostname.com
>
> Accept: */*
>
> Accept-Language: en_US
>
> User-Agent: VLC/3.0.4 LibVLC/3.0.4
>
> Cookie: JSESSIONID=ASD43SAD123SAD34
>
> Range: bytes=4900374-
>
>
>
>
> [1dcb6130] http stream debug: connection failed [1dcb6130] http
> stream debug: resolving hostname.com ... [1dcb6130] http stream
> debug: outgoing request: GET /streaming?id=12345678 HTTP/1.1
>
> Host: hostname.com
>
> Accept: */*
>
> Accept-Language: en_US
>
> User-Agent: VLC/3.0.4 LibVLC/3.0.4
>
> Cookie: JSESSIONID=ASD43SAD123SAD34
>
> Range: bytes=4900374-
>
>
>
>
> [1dcb6130] http stream debug: incoming response: HTTP/1.1 200 200
>
> Date: Tue, 18 Dec 2018 10:36:22 GMT
>
> Server: Apache/2.4.6 (CentOS) mod_jk/1.2.42
>
> Accept-Ranges: bytes
>
> Content-Length: 26480252
>
> Content-Type: video/mp4
>
>
>
>
> [1dcb6210] prefetch stream error: cannot seek (to offset 4900374)
> [1dcb6130] http stream debug: outgoing request: GET
> /streaming?id=12345678 HTTP/1.1
>
> Host: hostname.com
>
> Accept: */*
>
> Accept-Language: en_US
>
> User-Agent: VLC/3.0.4 LibVLC/3.0.4
>
> Cookie: JSESSIONID=ASD43SAD123SAD34
>
> Range: bytes=4847078-
>
>
>
>
> [1dcb6130] http stream debug: connection failed [1dcb6130] http
> stream debug: resolving hostname.com ... [1dcb6130] http stream
> debug: outgoing request: GET /streaming?id=12345678 HTTP/1.1
>
> Host: hostname.com
>
> Accept: */*
>
> Accept-Language: en_US
>
> User-Agent: VLC/3.0.4 LibVLC/3.0.4
>
> Cookie: JSESSIONID=ASD43SAD123SAD34
>
> Range: bytes=4847078-
>
>
>
>
> [1dcb6130] http stream debug: incoming response: HTTP/1.1 200 200
>
> Date: Tue, 18 Dec 2018 10:36:23 GMT
>
> Server: Apache/2.4.6 (CentOS) mod_jk/1.2.42
>
> Set-Cookie: JSESSIONID=ASD43SAD123SAD34;path=/;HttpOnly
>
> Accept-Ranges: bytes
>
> Content-Length: 26533548
【问题讨论】:
标签: video-streaming vlcj