Project

General

Profile

IPTV Services problem

Added by Juraj Bobak almost 9 years ago

Hello. I have a problem with "Services". It's a bit complicated so here is the description.

I installed tvheadend in version "4.1~374~g2218885-dirty" from github some time ago and today v4.0.7 package from releases download page. I added IPTV network, set all muxes and channels for services and it was working perfectly. But then after some time I could not play some channels. I found out, that the new "Service ID" for mux was added and the previous service with another "Service ID" was unusable. These changes were related also to "Service name" and sometimes also to count of audio streams. So provider changed it. From this I understood, that tvheadend is scanning Muxes, but I don't know what is the condition for scanning like when or why. Maybe the previous "Service" didn't work, so tvheadend scanned it again.

The main problem is, that when this happens and new service is added to Mux, channel is not updated with this new service and I have to do this manualy through web frontend, because the previous pair "Channel <-> Service Name" is disabled and new "Service Name" in tab "Services" has empty "Channel" column.

I tried many different settings what I found, but nothing helped. I used also https://tvheadend.org/projects/tvheadend/wiki/Custom_MPEG-TS_Input to "direct copy" the stream, where I set also my own "Service ID" with "-mpegts_service_id" switch, but this solution is not good enough. The problems are FullHD channels. If I want also to map all audio/subtitle streams, I run into issues like stuttering with ffmpeg and node.js/avconv solution it is even worse.

So there is no pipe:// solution for me so far. Is there some way to automatically pair newly added mux service to the channel? Or other solution?

Thanks for help


Replies (2)

RE: IPTV Services problem - Added by Guillem C almost 8 years ago

Hi,

I have the same problem.

Any solutions?

Thank you!

RE: IPTV Services problem - Added by Juraj Bobak almost 8 years ago

Hi,

I made a workaround.

Description:
When new service appears, the file in muxes directory changes. This is true for version HTS Tvheadend 4.1-2415~ge5f5a42-dirty (for example 4.0.7 had directories with service files). I'm using incrontab [[https://linux.die.net/man/5/incrontab]] to detect this change. Example how to setup incrontab is also in service_channel_fix.php file. Read man page if you want to know more.
So when this event fired, script service_channel_fix.php is called and in parameter $# can be stored name of the file that changed. The file name is also MUX ID where new service was added. The rest is up to service_channel_fix.php script. It parses channels stored for old services, stores the channel(s) to new service and also deletes the old not working services.

Change that file with your parameters. Alter USER and PASS values, SERVER_PORT, etc.
I could not find out how to force incrontab log output of file so I'm storing buffer to variable and at the end storing it to LOG_FILE declared on line 20. Change also if you want.
If you don't want to delete old services, just delete or comment out these two lines:

if (count($oldServiceIds))
deleteServices($oldServiceIds);

Scrpt uses php-cgi to run the script. Change it for your environment. Also chmod the file with +x

Use it at your own risk.
Hope it helps :)

    (1-2/2)