通过vlcj进行多个请求

问题描述 投票:0回答:1

我使用vlcj用于读取位于一个URL的媒体文件。

我有一些视频流的问题,我启用了vlcj详细输出和日志看起来很奇怪:有哪个是流文件(10只有一个文件)的服务器提出了许多要求。我注意到,在第一次调用后端之后,第二个SI与由“范围”头制作(或可能有一个逻辑,但我错过了它)。此后,同样的请求再次提出并在某些时候的“范围”标头值改变,并保持在新的价值等等。

这个问题会如果是正常的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
1个回答
0
投票

我冒昧猜测,并说,这与您尝试以流通过HTTP协议的视频文件的事实做。

由于HTTP流使用的文件检索视频的多个请求的“播放列表”,将流单个视频时进行。 (你不会希望有能够发挥它之前下载完整的文件,因为它不会被“流”了,但打本地下载的文件。)

如果它只是一个单一的文件或许请求几个MB的:每次从同一文件的请求s到能够缓存文件,而不是下载它。

© www.soinside.com 2019 - 2024. All rights reserved.