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

mpegts/network/mux_create #5

Open
zywek123 opened this issue Jun 2, 2023 · 2 comments
Open

mpegts/network/mux_create #5

zywek123 opened this issue Jun 2, 2023 · 2 comments

Comments

@zywek123
Copy link

zywek123 commented Jun 2, 2023

Hello.
How should I enter the parameters containing the mux configuration? I tried mpegts/network/mux_create?uuid=net&conf=json in python as well as mpegts/network/mux_create?uuid=net, json=json containing {"conf": {"keys"}} all taken from mpegts/network/mux_class including class, event, caption and even props still in config, also props without config and config without props, config without class, events and caption also does not work, I get 400 bad request. From src/api/mpegts.c I am not able to deduce much. Can I ask for an example or guide me what I am doing wrong?

@dave-p
Copy link
Owner

dave-p commented Jun 2, 2023

I've never tried to use that function, just documented it from the TVheadend source.

The work is done by input/mpegts/iptv/iptv.c, input/mpegts/mpegts_network.c or input/mpegts/mpegts_network_dvb.c depending on what kind of network you are adding a mux to.

I've tried to add another mux to my DVB-S setup through the API (using curl) but all attempts produce a 400 error. Unfortunately because of the way the api is written there is no information available on what went wrong.

@dave-p
Copy link
Owner

dave-p commented Jun 3, 2023

OK got it working.

I enabled debug and trace of the "http" subsystem of TVH, then added a new mux manually through the GUI. The debug log showed what the browser had sent to TVH when I added the mux. I could then replicate that using the api.

My curl command was
curl -d uuid=62d279b29fff2de0ff1245dad5154500 -d @mux2.json "http://192.168.1.1:9981/api/mpegts/network/mux_create"
and the file containing the JSON was

conf=
{"enabled":1,
"epg":0,
"epg_module_id":"",
"delsys":"DVBS",
"frequency":12440000,
"symbolrate":29500000,
"polarisation":"V",
"modulation":"QPSK",
"fec":"8/9",
"scan_state":0,
"charset":"",
"rolloff":"AUTO",
"pilot":"AUTO",
"dvb_satip_dvbc_freq":0,
"dvb_satip_dvbt_freq":0,
"tsid_zero":false,
"pmt_06_ac3":0,
"eit_tsid_nocheck":false,
"sid_filter":0,
"stream_id":-1,
"pls_mode":"ROOT",
"pls_code":1}

I was adding a DVB-S mux; other network types will need different parameters.

The trick of using http debug won't work for all APIs, as the GUI doesn't always seem to use that protocol.

I'll add more detail to the api docs later.

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

2 participants