openatv / enigma2

openatv-gui
GNU General Public License v2.0
200 stars 317 forks source link

gstreamer not work with https on openatv 6.4 #2233

Closed tempzi13 closed 2 years ago

tempzi13 commented 2 years ago

Hello! We try to play m3u (#SERVICE 4097:0:1:3:f998:2018:0:0:0:0:https%3A...), but get error: 22:20:22.9835 service/servicemp3.cpp:2295 gstBusCall Gstreamer error: Could not open resource for reading. (5, 1873) from hlsdemux0 How he can update gstreamer?

P.S. #SERVICE 5002:0:1:3:f998:2018:0:0:0:3:https%3A... (exteplayer3) - work good, but not record file.

openatv 6.4 HITUBE 4K Combo Plus

4l3x2k commented 2 years ago

m3u is not parsed by GStreamer I think

m3u is kind of playlist which GStreamer won't handle

you'll have to find a way to create one url for each playlist entry

plugins that do this are mediaportal (simplelist), e2m3u2bouquet or jedimaker

I do not know any player that is installed per default that can handle m3u

EDIT you should update GStreamer only via package feed by software update

If you want to test other GStreamer versions you would need to change bibtbake recipes in oe-alliance-core and build it yourself

tempzi13 commented 2 years ago

GStreamer can work with m3u with tool, for example: gst-launch-1.0 http://path/to/your/stream.m3u8 ! hlsdemux ! tsdemux ! queue ! video/x-h264 ! h264parse ! qtmux ! filesink And exteplayer3 shows with my first https source.

But, today I tried another https simple source - it's work with GStreamer (recording also work). Probably, it's problem with certificates.

4l3x2k commented 2 years ago

Please keep an eye on this and report back

If it is really security related you should file an issue to https://github.com/oe-alliance/oe-alliance-core/issues

This is openatv's enigma2 which leverages certs from oe-alliance

tempzi13 commented 2 years ago

Thanks, problem solved. I copied certificate from site to /usr/share/ca-certificates/mozilla, added it to /etc/ca-certificates.conf and called update-ca-certificates. Now the stream is working.

There is one problem left, custom User-Agent not working with 4097 provider:

SERVICE 4097:0:1:3:f998:2018:0:0:0:0:http%3A//...video.m3u#User-Agent=MyUserAgent:

4l3x2k commented 2 years ago

Mmm. This should work for rtsp and http streams ...

You could try to stop enigma (init 4) and add

config.mediaplayer.useAlternateUserAgent

to /etc/enigma2/settings.

Then start enigma2 (init 3).

There is no option to set this configuration via GUI but it should be respected by servicemp3.

tempzi13 commented 2 years ago

Yes, I've already tried this. I filled it so: config.mediaplayer.alternateUserAgent="My UserAgent" config.mediaplayer.useAlternateUserAgent=true

SERVICE 5002 - worked SERVICE 4097 - not worked

4l3x2k commented 2 years ago

I don't know why it does not work with default gstreamer backend.

The default gstreamer backend by openatv is mediagstreamer.

No exteplayer, no gstplayer (used by serviceapp). No servicehisilocon (used by zgemma, gfutures, abcom, maxytec).

Please close this issue as resolved by updating certificates and create a new one for user agent if you do not want to use 5002.

4l3x2k commented 2 years ago

I created the following bouquet to test the user agent being sent

cat /etc/enigma2/userbouquet.favourites.tv 
#NAME Favourites (TV)
#SERVICE 4097:0:3:4:5:6:7:8:9:10:http%3a//localhost%3a1337/test:T E S T
#SERVICE 4097:0:3:4:5:6:7:8:9:10:http%3a//localhost%3a1337/test#User-Agent=Bla:T E S T UA1
#SERVICE 4097:0:3:4:5:6:7:8:9:10:http%3a//localhost%3a1337/test#User-Agent=Bla Blub:T E S T UA2

and repeatedly started a pseudo server

nc -l 127.0.0.1:1337
GET /test HTTP/1.1
Host: localhost:1337
User-Agent: Enigma2 HbbTV/1.1.1 (+PVR+RTSP+DL;openATV;;;)
icy-metadata: 1
Connection: Keep-Alive

nc -l 127.0.0.1:1337
GET /test HTTP/1.1
Host: localhost:1337
User-Agent: Bla
icy-metadata: 1
User-Agent: Bla
Connection: Keep-Alive

nc -l 127.0.0.1:1337
GET /test HTTP/1.1
Host: localhost:1337
User-Agent: Bla Blub
icy-metadata: 1
User-Agent: Bla Blub
Connection: Keep-Alive

EDIT

Please report any issues regarding this to

Issue closed

tempzi13 commented 2 years ago

Hello! Thanks. I repeated your experiment.

SERVICE 4097:0:1:6:f998:2018:0:0:0:0:http%3A//localhost%3A9000/test#User-Agent=TestAgent:test1

Headers: ... User-Agent: "My UserAgent" icy-metadata: 1 User-Agent: TestAgent Connection: Keep-Alive

So, alternateUserAgent and UserAgent in serviceRef are working (and alternateUserAgent must be without quotation marks). But the stream still doesn't work. The problem is that m3u response is encoded in gzip.

4l3x2k commented 2 years ago

You can try to install

gstreamer1.0-plugins-bad-bz2

from feed but it is actually bzip.

Another way would be downloading the m3u, gunzip the data and store the m3u local and point your player to that m3u.

If you build images yourself you can try to add https://github.com/Snec/gst-gz.