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

Transcoding the parameters are no longer set in the generated m3u8 file #890

Closed
pr2git opened this issue Dec 30, 2018 · 41 comments
Closed

Comments

@pr2git
Copy link
Contributor

pr2git commented Dec 30, 2018

Hi,

In former version of OWIF when we use the transcoded icon the generated url look like:

http://stb_ip:8002/1:0:1:E08:2D50:13E:820000:0:0:0:?bitrate=2000000?width=720?height=480?aspectratio=2?interlaced=0

Now we only have:

http://stb_ip:8002/1:0:1:E08:2D50:13E:820000:0:0:0:

The options: bitrate= width= height= aspectratio= interlaced= are no longer set in the transcoded url.

Can you please have a look at this bug?

Thanks,

Pr2

@jbleyel
Copy link
Contributor

jbleyel commented Dec 30, 2018

Why do you need the parameters on the icon?

@pr2git
Copy link
Contributor Author

pr2git commented Dec 30, 2018

Do you mean that we no longer need them?

@jbleyel
Copy link
Contributor

jbleyel commented Dec 30, 2018

No, the question is why do you need the extra parameters on the icon.
I only talk about the link destination.
You can't change the values of the parameters if you click on the icon and therefore you don't need them.

@pr2git
Copy link
Contributor Author

pr2git commented Dec 30, 2018

When clicking on the transcode button the link generates a m3u8 file which is downloaded.
Most users probably simply associate it with a player and don't even know what they are doing so they never open up this file and just enjoy viewing the program.
But when you download it locally and open it up with a file editor, you no longer see the possible options. So it was nice when those options were always defined in the .m3u8 file so people willing to test different values just can modify it and then play it to saw the result.
Without showing them, those parameters will be forgotten and then never used again and they are useful because they override the STB defined streamproxy values, so it was nice when we saw them in the m3u8 generated file for transcoding.
The current approach is, according to me a regression, compared to former way to generate the .m3u8 file for transcoding.

@jbleyel
Copy link
Contributor

jbleyel commented Dec 30, 2018

Sorry. No.
If you are an advanced user you have to read the api documentation.
-> https://github.com/E2OpenPlugins/e2openplugin-OpenWebif/wiki/OpenWebif-API-documentation#streamm3u

BUT .. The current documentation needs to be updated.
Try and error of parameters is not the right way.

@jbleyel jbleyel closed this as completed Dec 30, 2018
@jbleyel
Copy link
Contributor

jbleyel commented Dec 30, 2018

I have checked the source .
See here.
https://github.com/E2OpenPlugins/e2openplugin-OpenWebif/blob/master/plugin/controllers/models/stream.py#L92

I think there is something wrong on your image.
The m3u8 file includes the parameter if you have this file "/proc/stb/encoder/0/apply"

@pr2git
Copy link
Contributor Author

pr2git commented Dec 30, 2018

The documentation you refer to is absolutely not relevant to the point discussed here, I am not writing a plugin calling API, I am a normal user generating a .m3u8 file from the webif and editing it and then playing it with my player to see what best work for my setup.

My image is working fine since I test on a VU+ Solo4K where the streaming port is 8002 (and streaming is not possible on port 8001), so we are not in the particular case that you point me out.

@jbleyel
Copy link
Contributor

jbleyel commented Dec 30, 2018

If you box is one of these models:

if model in ("Duo4K", "Uno4K", "Uno4K SE", "Ultimo4K", "Solo4K", "Solo²", "Duo²", "Solo SE", "Quad", "Quad Plus", "UHD Quad 4k", "UHD UE 4k") or machinebuild in ('dags7356', 'dags7252', 'gb7252', 'gb7356'):

You get an m38u without any extra parameters.
There is an: elif fileExists("/proc/stb/encoder/0/apply"):
This means only if you are not have one of the models below.
Thats the problem.

Summary:
If your box model is not one of ("Duo4K", "Uno4K", "Uno4K SE", "Ultimo4K", "Solo4K", "Solo²", "Duo²", "Solo SE", "Quad", "Quad Plus", "UHD Quad 4k", "UHD UE 4k")
and if your box machinebuild is not one of ('dags7356', 'dags7252', 'gb7252', 'gb7356') and not one of ('ew7356', 'formuler1tc', 'tiviaraplus'):
and if you have this file /proc/stb/encoder/0/apply
Then you will get the extra parameters.

jbleyel added a commit that referenced this issue Dec 30, 2018
@jbleyel
Copy link
Contributor

jbleyel commented Dec 30, 2018

Check my last commit.

@WanWizard
Copy link
Contributor

WanWizard commented Jan 1, 2019

The point here is that OpenPLi's streamproxy supports per-URL transcoding parameters on all hardware that supports transcoding, on both ports 8001 and 8002.

This is not the case for images that use VU+' original transtreamproxy, which require the transcodingsetup plugin to set the parameters (which will then be the same for all transcoding requests).

The only relevance is the port number, as boxes supporting per URL transcoding (xtrend, gfutures) only support port 8001 by default (OpenPLi doesn't install the streamproxy by default on these boxes, as it is not needed).

@anudanan
Copy link
Contributor

anudanan commented Jan 1, 2019

I´ve tested the changes and now it works on openpli with streamproxy to set the parameter over the URL parameter. Great

@eriksl
Copy link
Member

eriksl commented Jan 4, 2019

Why the test on /proc/stb/encoder/0/apply?

If you want to assess xtrend/gfutures interface, use test on /dev/dvb/encoder
If you want to assess broadcom interface, use test on /dev/dvb/bcm_enc0

Also the original xtrend interface had a bug regarding http usage, parameters where expected to be in this format: http://host?var1=val1**?**var2=val2**?**var3=val3 but that's wrong. It's supposed to be http://host?var1=val1**&**var2=val2**&**var3=val3

This bug has been resolved, at least in OpenPLi's enigma2, so OWIF should actually use the proper layout.

@jbleyel
Copy link
Contributor

jbleyel commented Jan 4, 2019

Hi Erik,

why test ../apply, because this folder exists on all VU+ models with transcoding.
We can easily add additional folder checks for other box types.
Caution!! This is only for transcoding and not all broadcom chips have all transcoding features.

if fileExists("/proc/stb/encoder/0/apply") or fileExists("/proc/dvb/encoder")

--

Why not & as url param? Yes, there was a bug.
But, are you sure about the fix in other distributions e.g. openvix, openatv, ...

@eriksl
Copy link
Member

eriksl commented Jan 4, 2019

I think you don't understand completely what I am saying.

All receivers (not just VU+, but also Axas, Xsarius, etc) that use the broadcom transcoding interface have a device node called "/dev/bcm_enc0" (sorry, not /dev/dvb/bcm_enc0 like I said earlier). If a second encoder is present, there will also be a /dev/bcm_enc1 device node.

If you test for these you will know, I think, everything you need to know. If any of these is present, there is a Broadcom style interface available (so using either streamproxy or transtreamproxy on port 8002 or 8003).

If, on the other hand a device node /dev/encoder0 is present (and in the same way /dev/encoder1), there will be transcoding available using the "xtrend" interface, so using enigma on port 8001.

I don't understand why OWIF would need to know more? I very much dislike the lists of receiver models hardcoded in OWIF.

Also I would appreciate it if OWIF would start using correct http syntax, as described above.

@jbleyel
Copy link
Contributor

jbleyel commented Jan 4, 2019

Hi Erik,
on my box (Ultimo4K) i have all of these:

  • /proc/stb/encoder/0/apply
  • /dev/bcm_enc0
  • /dev/bcm_enc1
  • /dev/encoder0
  • /dev/encoder1

How can i check what port do i have to use?
That's why we have to check the model.
Some models use config.plugins.transcodingsetup.port and some models use 8001.
But how can i easily check this.
-> https://github.com/E2OpenPlugins/e2openplugin-OpenWebif/blob/master/plugin/controllers/models/stream.py#L85
-> https://github.com/E2OpenPlugins/e2openplugin-OpenWebif/blob/master/plugin/controllers/models/stream.py#L92

In other words, we don't need to check the models.
We only have to know the correct transcoding port.

@jbleyel
Copy link
Contributor

jbleyel commented Jan 4, 2019

Hi Erik,

Please check this:
https://gist.github.com/jbleyel/81c72b5dc7c799fb5c8fdf2c1bc355dc

I won't commit before testing.

@jbleyel
Copy link
Contributor

jbleyel commented Jan 4, 2019

Hi Erik,

I have found a different check for transcoding on OWF.
How about this?

#: get transcoding feature
def getTranscoding():
	transcoding = False
	if os.path.isfile("/proc/stb/encoder/0/bitrate"):
		if os.path.exists(eEnv.resolve('${libdir}/enigma2/python/Plugins/SystemPlugins/TransCodingSetup/plugin.pyo')) or os.path.exists(eEnv.resolve('${libdir}/enigma2/python/Plugins/SystemPlugins/TranscodingSetup/plugin.pyo')) or os.path.exists(eEnv.resolve('${libdir}/enigma2/python/Plugins/SystemPlugins/MultiTransCodingSetup/plugin.pyo')):
			transcoding = True

	return transcoding

@anudanan
Copy link
Contributor

anudanan commented Jan 4, 2019

If tested the code from eric on my unok4se with openpli 7.0
https://gist.github.com/jbleyel/81c72b5dc7c799fb5c8fdf2c1bc355dc

it works fine for live TV and recorded movies with streaming and trancoded streaming

I can´t test the xtrend version

@eriksl
Copy link
Member

eriksl commented Jan 4, 2019

Hi Erik,
on my box (Ultimo4K) i have all of these:

  • /proc/stb/encoder/0/apply
  • /dev/bcm_enc0
  • /dev/bcm_enc1
  • /dev/encoder0
  • /dev/encoder1

How can i check what port do i have to use?
That's why we have to check the model.
Some models use config.plugins.transcodingsetup.port and some models use 8001.
But how can i easily check this.
-> https://github.com/E2OpenPlugins/e2openplugin-OpenWebif/blob/master/plugin/controllers/models/stream.py#L85
-> https://github.com/E2OpenPlugins/e2openplugin-OpenWebif/blob/master/plugin/controllers/models/stream.py#L92

In other words, we don't need to check the models.
We only have to know the correct transcoding port.

Apparently I am wrong here. It used to be like I described, but apparently either Broadcom (SDK) or VU+ added a device node for /dev/encoder0 at some point, which does nothing, in the end, which is a PITA.

On the other hand, I am pretty sure the "poort 8001" receivers will NOT have /dev/bcm_enc*.

@eriksl
Copy link
Member

eriksl commented Jan 4, 2019

What does this check determine -> /proc/stb/encoder/0/bitrate

I think both Broadcom (8002) and Xtrend (8001) have them, I am not sure, I don't have "Xtrend" transcoding receivers ready at the moment.

Maybe we should have a brainstorm which combinations are possible and how OWIF should best detect them and handle them.

I can supply the data for OpenPLi, either using Xtrend (enigma) transcoding or Broadcom transcoding (using the streamproxy which apparently no other image builder is using).

If the streamproxy is available, you could detect it's presence searching for the file /etc/enigma2/streamproxy.conf. It it's there, you can assume streamproxy, running by default at port 8002 and 8003, although the listening ports may be overriden with "listen = " lines, like this:
listen = 8002:transcode
listen = 8003:transcode
If it's not present, you could check for the presence of /dev/bcm_enc0, which would mean a Broadcom transcoding interface is present, but using a different interface (e.g. transtreamproxy from VU+) and then the port is set using the transcoding setup plugin? For now we have included a dummy transcoding setup plugin just to make the port known to OWIF. If that could be arranged in another way, that would be great.

If no /dev/bcm_enc0 is present, check for /dev/encoder0, if it is present, assume Xtrend style transcoding, using port 8001.

If none is present, no transcoding is available.

How about something like that?

For detecting streamproxy you could also scan the process list, but I think that's less efficient.

jbleyel added a commit that referenced this issue Jan 4, 2019
@jbleyel
Copy link
Contributor

jbleyel commented Jan 4, 2019

Hi Erik,

this check

https://github.com/E2OpenPlugins/e2openplugin-OpenWebif/blob/master/plugin/controllers/defaults.py#L26

is very very old and it seams ok and working because without return "True" you won't get the transcoding icon.
I will let this as it is for now.

@WanWizard
Copy link
Contributor

Just fired up my ET10000:

I has:

  • /dev/encoder0
  • /dev/encoder1
  • /proc/stb/encoder/0/apply

I doesn't have:

  • /dev/bcm_enc0
  • /dev/bcm_enc1

Any other boxes need checking?

@jbleyel
Copy link
Contributor

jbleyel commented Jan 4, 2019

Hi @WanWizard , Thanks.
We should check boxes with
machinebuild in ('ew7356', 'formuler1tc', 'tiviaraplus') because they had a different detection in the previous code.

@eriksl
Copy link
Member

eriksl commented Jan 4, 2019

Hi Erik,

this check

https://github.com/E2OpenPlugins/e2openplugin-OpenWebif/blob/master/plugin/controllers/defaults.py#L26

is very very old and it seams ok and working because without return "True" you won't get the transcoding icon.
I will let this as it is for now.

This check works (at least the lines following) because the dummy Transcoding Setup plugin in OpenPLi is called TranscodingSetup (v.s. TransCodingSetup). I don't like it very much though.

I don't understand the "bitrate" test though, checking for /proc/stb/encoder would be sufficient to establish transcoding availability.

@WanWizard
Copy link
Contributor

I don't know the first and the last, they are not supported by OpenPLi.

I do have a "Formuler F1", but I wasn't aware that there was a trancoding version for it. I've looked in the OE-A core, and appearently there are "al" drivers used in Russia than also seem to support transcoding.

The drivers OE-A uses are not available on the Formuler server, so I guess they aren't that standard...

@anudanan
Copy link
Contributor

anudanan commented Jan 4, 2019

My uno4kse has,

  • /proc/stb/encoder/0/apply
  • /dev/bcm_enc0
  • /dev/encoder0

I think the same is on uno4 and solo4k

@eriksl
Copy link
Member

eriksl commented Jan 5, 2019

Yes, that is typical for VU+, they're using Broadcom/SDK transcoding, just like many other brands.

Only Zgemma, Xtrend and Mut@nt (and derivatives) have another interface.

The "unofficial" driver for the Formuler 1 (which we have been aware of) are most probably using the Xtrend interface.

@eriksl
Copy link
Member

eriksl commented Jan 5, 2019

Does anybody know something from these models: ew7356, formuler1tc, tiviaraplus? Maybe from the OWIF source itself? If they're marked as "transcoding using port 8002" then I think that says enough. Then they'll also have the Broadcom interface, including /dev/bcm_enc0.

@pr2git
Copy link
Contributor Author

pr2git commented Jan 5, 2019

Thanks to google I found this:
ew7356 is in fact an EVO Enfinity X2
http://evostb.com/?q=product&id=263
Claims to support Transcoding and is using Broadcom BCM7346B2 (chipset 7356)

triviaraplus is Triviar Alpha Plus and is BCM7356

Formuler 1 TC the TC means transcoding seems also to be a BCM7356.

Hope this help.

@jbleyel
Copy link
Contributor

jbleyel commented Jan 5, 2019

Then we had probably a bug in the previous code because of using 8001 as transcoder port for BCM7356.

	elif machinebuild in ('ew7356', 'formuler1tc', 'tiviaraplus'):	
		transcoder_port = 8001

@eriksl
Copy link
Member

eriksl commented Jan 5, 2019

Who knows... Based on the fact the Formuler uses drivers that have an overall appearance very much like the XTrend (1/2gen) and (1gen) Mut@nt drivers, I'd bet on XTrend interface. That would imply using port 8001 would be correct. The other ones I have no information on. What SoC is used, has no influence on the interface, BTW.

@eriksl
Copy link
Member

eriksl commented Jan 5, 2019

Jörg, I saw you last commits, they seem like a big improvement to me, thx.

@anudanan
Copy link
Contributor

anudanan commented Jan 5, 2019

Great; I will test it soon on my unokse with openpli
@erik:
Do know, why streamproxy on my box works successfully with transcoded streaming without the changes in httpserver.py. You know I have Auth enable on the HTTP port and streaming without auth.

@anudanan
Copy link
Contributor

anudanan commented Jan 5, 2019

I´ve tested now with the newest stream.py and httpserver.py (with a little workaround for the auth parameter which streamproxy will use). Streaming and trancoded streaming of live channels and recorded movies. Everthing is fine on un4kse/openpli 7.0

@eriksl
Copy link
Member

eriksl commented Jan 5, 2019

I will re-pin OWIF in OpenPLi 7.0RC, so you will have it with the latest change and then auth should work without patching.

@anudanan
Copy link
Contributor

anudanan commented Jan 6, 2019

It works now without the workaround. I´ve copied the changed sourcefiles from openwebif to my box

Thx

@jbleyel
Copy link
Contributor

jbleyel commented Jan 6, 2019

What workaround?

@anudanan
Copy link
Contributor

anudanan commented Jan 6, 2019

It is this topic

https://forums.openpli.org/topic/65009-streamproxy-and-authentication/

In short:
In the past before you changed httpserver.py the streamproxy can´t work in the setup with HTTP Auth is true and HTTP Auth for streaming is false.

streamproxy looks at the OWIF paramter config.OpenWeb.auth in the settings file and not at the config.OpenWeb.auth_for_streaming.

To simulate that streamproxy has an knowledge how auth_for_streaming is set I´ve done the following workaround in openwebif plugin.py and httpserver.py on my box:

I´ve made next tests today to check if my idea for streamproxy to use the OWIF config.openWebif.auth_for_streaming instead of config.openWebif.auth to decide if streaming use auth or not.
Because it is easier for me to change phython code on enigma I have made a change to OWIF plugin.py and httpproxy.py
It use a new parameter config.openWebif.http_auth instead of config.openWebif,auth for enable/disable HTTP Auth.
The old parameter config.openWebif.auth has in my code now the same value as the config.openWebif.auth_for_streaming for simulating the use of auth_for_streaming of streamproxy
With this code (which is not good for public because it is better to change streamproxy) everything works fine
If I use a mobile client (for example tellymote) which is only possible to use auth for HTTP OWIF port but not for the streaming ports, it works fine with the HTTP auth is enabled and streaming auth is disabled

If I use a mobile client which is able to auth both (HTTP OWIF port and streamingport) it work fine with HTTP auth and streaming port auth is enabled.

I know it is a bad workaround but it works
Erik was wonderd that it works because HTTP auth is on and streamproxy can connect OWIF without auth with my workaround.

@anudanan
Copy link
Contributor

anudanan commented Jan 6, 2019

Sorry all together,
I´ve made a big misstake during my latest tests to verify streaming without auth. I´ve copied the python sources to the wrong path.
It doesn´t work with out my workaround so it seem to be that streamproxy must use config.OpenWeb.auth_for_streaming instead of config.OpenWeb.auth as I thought in the past

@eriksl
Copy link
Member

eriksl commented Jan 6, 2019

Please continue in forum.

@jbleyel
Copy link
Contributor

jbleyel commented Jan 6, 2019

a ok. i know this.

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

No branches or pull requests

5 participants