MERGING MediaPortal Url Source Splitter & IPTV Filter (2 Viewers)

bounguine

Portal Pro
November 7, 2005
233
15
50
St.Petersburg
Home Country
Russian Federation Russian Federation
Just one thought from sleepy bounguine.
1. If you insist on pre-scanning.
When a user has 10-100 channels, it is obviously normal.
But in case of handreds or thousands of channels (like in my case) at least the time for scanning is the trouble.
I'm not talking again about bothering the broadcasting server.
2. If you simply upload the playlist and send request for the params on demand (when watching TV), the problems tend to go away.
Simply put fake params into db when uploading and correct them when watching.

As for timeout I can say nothing.
Probably, it should be more by default.
 

georgius

Retired Team Member
  • Premium Supporter
  • October 31, 2010
    1,376
    654
    Bratislava
    Home Country
    Slovakia Slovakia
    georgius, I tried what you said.

    1. Timeout
    I set OpenConnectionTimeout in Database Editor to 100000.
    No effect.
    The logs can be helpful, 100 seconds is more than sufficient value.

    I restarted TVServer and now the table for this tab is grey (no records) and there's no way to upload data from db.
    What can I do?
    My fault, there is parsing error in TV plugin for client port min and max value. I attached fixed plugin DLL, replace yours DLL in TV service, after that you should be able to see channels from DB or from playlist.

    Then I went to Playlist editor and did the same.
    The *.m3u now is unreadable:
    rtsp://localhost####Url=rtsp%3a%2f%2flocalhost%3a555%2f%3fsrc%3d1%26freq%3d11727%26msys%3ddvbs2%26plts%3doff%26fec%3d34%26pol%3dh%26ro%3d0.35%26sr%3d27500%26mtype%3d8psk%26tnr%3d1%2c11727%2c27500%2c10750%2c0%2c0%2c9%2c3%2c552%2c551%2c550%2c2611%2c6%2c360%2c25%2c0%2c1%2c253%2c-1%26pids%3d0%2c18%2c20%2c550%2c551%2c552%2c553&RtspClientPortMax=7200&RtspClientPortMin=6200&RtspOpenConnectionTimeout=100000&RtspIgnoreRtpPayloadType=1&RtspSameConnectionTcpPreference=1&RtspUdpPreference=0
    It is readable by filter and by plugin. You can see, that parameters are separated by '&' and parameter name and value are separated by '='. The parameters' values are encoded to URL (https://msdn.microsoft.com/en-us/library/4fkewx0t(v=vs.110).aspx) and also '+' is replaced by '%20'.

    Just once the channel started normally.
    Now this tab after restaring TVServer is also grey, as the changed playlist is not loaded anymore.
    Logs can be helpful, fixed DLL attached.

    2. Ergonomocs.
    Coming back to what I said before.
    I'm having more than 5 000 channels and a lot of TV-sources.
    No way for me to use scanning IPTV through GUI, mapping, sorting, etc., clicking on the last icon to get the right params for 729 channels from 545-tv.com as you advised or manually choose channels to set OpenConnectionTimeout
    It's abnormal. Or I will spend my whole life clicking something.
    I use only scripts and work with db or any configs you will point to.
    Yes, you are talking with a lazy ex-Linux user who used TVHeadend, which scanns even DVB itself.
    Just put the sat position, diseqc port and 1 mux. After a while you will see all the channels from the sattelite.
    I'm still dreaming of "apt-get update && apt-get upgrade" in Windows.
    Joke.
    Yes, I'm dreaming about "apt-get update && apt-get upgrade" in Windows too, but this will not happen. OpenConnectionTimeout can be set for all RTSP urls in easier way. Go to plugin, switch to RTSP section, change OpenConnectionTimeout, press Apply settings, go to Database section and press Apply settings. Then all RTSP urls should have set open connection timeout. If you wish to apply open connection timeout by script, you have to construct proper filter URL (the unreadable one).

    Unfortunately, my question about automating the process of retieving params for 545-tv.com is still not answered.
    Without the answer I'm not able to put the channels into db correctly.
    Is there any way to invoke via script getting the right params for the channels?
    This is not possible.

    If stream is surely FTA, then you can set Set stream as not scrambled in Mpeg2TsParser parameter.
    Putting DVBViewer channels directly to db and setting status to FTA is not a problem via a script. Just one field per line.
    I'm not 100% sure, but I think that TV server checks stream when opened if it is FTA and does not care about FTA value in DB. And in some cases this checking results in scrambled value, even if channel is not scrambled.

    Setting OpenConnectionTimeout through changing some kind of config will not be a problem, if you would point to the config path.
    I will bulk override the default settings, if it is needed for every particular channel.
    Filter does not have config or any other form of configuration. Everything is passed in "unreadable" URL. So, you have to construct right URL for each channel.

    3. Timeout, Ergonomocs and some philosophy.
    At first, how come a user know what timeout to choose?
    Try every channel of 5 000?
    But if DVBViewer or any other source will response 3 seconds later next time?
    This is only a piece of SW, which must choose the timout. Itself.
    Why VLC is doing it for me?
    If everything works, he/she doesn't have to do anything. If not, he/she asks for help and provides logs. And if it is possible, we helps. The VLC and DVBViewer have probably bigger timeouts, but they are user programs, so user see what is happening. The TV server is service, so client programs (MP or Kodi, maybe others) don't know what is happening, until stream is correctly opened or timeout occurs. Also you can have more than one IPTV card and TV service tries to open channel on all possible cards. With big timeout it will take very long time and user looking on MP screen doesn't know, what is happening. When using IPTV is also assumed that you are directly connected to provider's network, so responses should be very fast. So, I think that timeout is set to reasonable value for such case.

    4. Lyrics.
    Guys, I really appreciate what you do.
    And many thanks for helping me.
    I understand that a dev will love what he has done, but why not look at what others did.
    Just for fun.
    Sorry for saying 'VLC' again:
    - you simply load *.m3u (2-3 seconds, no torturing broadcasting server) +100500,
    - SW chooses the right timeout (2-3 seconds and you will watch tv) +100500,
    - no need to read help and operate hundreds of options (I read VODserver help - too many 'If ... do. ElseIf ... do' - I simply want to put 1 line to use ffmpeg!)
    TV server works in another way. It must know the stream parameters at least to know, if it is on correct channel. You don't want to watch or record another program as you set. VLC doesn't care about that.

    For a conclusion.
    Sorry, if I said something wrong.
    The simplier for a user, the better.

    Really need you help to make it work for me.
    You're right, the simplier for a user, the better. But in many cases it's not possible. Especially in IPTV and network things. And especially RTSP :) Every tested RTSP provider has something specific.
     

    Attachments

    • MediaPortalIptvFilterAndUrlSourceSplitter.zip
      61.5 KB

    georgius

    Retired Team Member
  • Premium Supporter
  • October 31, 2010
    1,376
    654
    Bratislava
    Home Country
    Slovakia Slovakia
    Maybe you noticed (but hopefully not) that in crash case, is sent small crash dump to https://drdump.com (I attached last crash dump, if you want to check). I was notified that somebody using RTSP has experienced crash, but he/she was using version 2.2.14.5982, which was published here in forum. The crash dump file name have to be
    Code:
    C:\ProgramData\Team MediaPortal\MPUrlSourceSplitterCrash\MPUrlSourceSplitter-2016-05-24-00-30-05-330.dmp
    RTSP users, can you check, if you have such file and if yes, can you attach at least logs? I think that crash dump will be bigger file, so until it is necessary, I will not ask for it.
     

    Attachments

    • 8936253.zip
      222 KB

    mike1

    MP Donator
  • Premium Supporter
  • September 7, 2012
    88
    8
    58
    Home Country
    Germany Germany
    Hi Georgius,
    since it is no longer possible to watch Sky with MP - i try to use a Enigma based TV receiver as tv source.
    It works well - but just the running channel of the receiver is working. Channel change from MP does not work.
    After analyzing i found that there is a zap - command for channel change necessary for the Enigma Receiver.
    The original mru looks like this:
    #EXTM3U
    #EXTVDBPOWER:urlwget=http://192.168.2.33/web/powerstate?newstate=0
    #EXTINF:0, 01. Das Erste HD
    #EXTVDBOPT:urlwget=http://192.168.2.33/web/zap?sRef=1:0:19:283D:3FB:1:C00000:0:0:0:
    #EXTVDBOPT:waitms=2000
    http://192.168.2.33:8001/1:0:19:283D:3FB:1:C00000:0:0:0:
    My question:
    Could you add the possiblity to send the "zap" - URL before stream? May be as optional field in your DB editor?
    http://192.168.2.33/web/zap?sRef=1:0:19:283D:3FB:1:C00000:0:0:0:
    That would offer MP users to get Sky back to MP :)
    Thanks for answering:)
    I think that with new protocol it can be done. It seems that between zap command and channel url is something like 2 seconds gap - at least by m3u file, but these options are unknown for me.

    Hi Georgius,
    do you think about to do ito_O?

    Hi Georgius,
    better time now ;-)?
    If not - may be yout could pint me to the right source - so i could try myself? I only use the iptv for scrambled channels from the Receiver - so i just would add the zap - command before each http post...
     

    bounguine

    Portal Pro
    November 7, 2005
    233
    15
    50
    St.Petersburg
    Home Country
    Russian Federation Russian Federation
    Now let’s refresh what we have.

    1. RTSP from DVBViewer
    Scanning – with workaround (delete “16,17,” from the link).
    Watching YV is not yet possible.

    2. Getting channel parameters before putting channels into DB with a script.
    This is not possible.

    Yet another workaround.
    Download astra.zip from attachment and unzip elsewhere.
    This is a free Windows version (old version #4.4. with limited features – no channel reserving, no full rtsp support, no epg parsing and sending it through a file or http) of professional Linux SW for cable operators.
    Open cdm and copy:
    [path_to_executable]\astra.exe --analyze [http_link] --log [path_to_log_file]\[log_file]
    , where:
    [path_to_executable] – folder with unzipped astra (without [ and ]),
    [http_link] -the link to be analyzed (without [ and ]),
    [path_to_log_file]\[log_file] – path to and the name of the log-file (any, without [ and ])

    Press Enter in cmd or parse line by line the *.m3u for every http-link with a script and put the link inside the command above.
    As log-file is formed once and contains information about all the links analyzed, to make parsing easier delete the log-file each time you send a command to astra.
    The output will contain:

    PmtPid and ServiceId
    May 28 15:04:54: INFO: PAT: pid: 7777 PMT pnr: 6666

    TransportId
    May 28 15:04:54: INFO: SDT: tsid: 1

    So you may use the values, set NetworkId to 1, freeToAir to 1 and put the parameters together with the link into Tuningdetail table.

    3. FTA channels.
    I'm not 100% sure, but I think that TV server checks stream when opened if it is FTA and does not care about FTA value in DB. And in some cases this checking results in scrambled value, even if channel is not scrambled.
    Yes, from time to time MP treats FTA channels as crypted by mistake during scanning and you will not able to watch them until changing freeToAir to 1

    4. Putting channels into DB without analyzing channels when using astra as VOD-server.
    Simply make a config-file with any name (e.g. astra.conf).
    Fill it like this:
    make_channel({
    name = "[channel_name]",
    input = { "[http-link]#set_pnr=[ServiceId]&map.pmt=[PmtPid]" },
    output = { "[output_link]:[port]" },
    })
    , where:
    [channel_name] – channel name (any, without [ and ]),
    [http-link] – the link to be broadcasted (without [ and ]),
    [ServiceId] – any value from 1 to 65535 (without [ and ]),
    [PmtPid] – any value from 1 to 65535 (without [ and ]),
    [output_link] – http, upd or rtp output link (without [ and ]) and [port] – output port (any free port, use a new port (e.g. port value +1) for every channel, without [ and ]) – example: http://127.0.0.1:1239,
    Repeat the procedure for every channel manually or with a script.

    Open cmd copy the link below and press Enter to start astra.
    You may also do this by script.

    [path_to_executable]\astra.exe --stream [path_to_config_file]\[config_file] --log [path_to_log_file]\[log_file] --debug
    , where:
    [path_to_executable] – folder with unzipped astra (without [ and ]),
    [path_to_config_file]\[config_file] – path to and the name of the config-file (any - e.g. astra.conf) - see above, without [ and ])
    [path_to_log_file]\[log_file] – path to and the name of the log-file (any, without [ and ])

    Now you may use the ServiceId, PmtPid, set TransportId to 1, NetworkId to 1, freeToAir to 1 and put the parameters together with the output_link into Tuningdetail table.
    If you want to use manual scanning of *.m3u formed with links broadcasted by astra you may omit #set_pnr=[ServiceId]&map.pmt=[PmtPid]

    5. Scanning problems
    I set stream analysis timeout to 10000 and all other timeouts to 5000 stored changes to DB.
    But scanning locks not all the channels (working perfectly in VLC).
    1 try – Channel 1 is locked, Channel 2 is not locked.
    2 try – Channel 2 is not locked, Channel 2 is locked.
    At the end of every try MP crashes.
    Logs are attached
     

    Attachments

    • astra.zip
      562.9 KB

    georgius

    Retired Team Member
  • Premium Supporter
  • October 31, 2010
    1,376
    654
    Bratislava
    Home Country
    Slovakia Slovakia
    5. Scanning problems
    I set stream analysis timeout to 10000 and all other timeouts to 5000 stored changes to DB.
    But scanning locks not all the channels (working perfectly in VLC).
    1 try – Channel 1 is locked, Channel 2 is not locked.
    2 try – Channel 2 is not locked, Channel 2 is locked.
    At the end of every try MP crashes.
    Logs are attached
    Stream analysis timeout is relevant only if you are testing url in TV service plugin. From logs I see that you were working only with HTTP urls, which have default timeout 5000. How long it takes VLC to open HTTP url (e.g. the first one http://127.0.0.1:1239)?
     

    bounguine

    Portal Pro
    November 7, 2005
    233
    15
    50
    St.Petersburg
    Home Country
    Russian Federation Russian Federation
    With my my script scanning take less.

    May 29 00:47:16: INFO: Starting Astra 4.4.182
    May 29 00:47:17: INFO: Bitrate: 0 Kbit/s
    May 29 00:47:18: INFO: PAT: tsid: 1
    May 29 00:47:18: INFO: PAT: pid: 7777 PMT pnr: 6666
    May 29 00:47:18: INFO: PAT: crc32: 0xCDADFF85
    May 29 00:47:18: INFO: PMT: pnr: 6666
    May 29 00:47:18: INFO: PMT: pid: 256 PCR
    May 29 00:47:18: INFO: VIDEO: pid: 256 type: 0x02
    May 29 00:47:18: INFO: AUDIO: pid: 257 type: 0x03
    May 29 00:47:18: INFO: PMT: crc32: 0xE87C7D6D
    May 29 00:47:18: INFO: SDT: tsid: 1
    May 29 00:47:18: INFO: SDT: sid: 6666

    Plus 1 second to put the line into DB
     

    bounguine

    Portal Pro
    November 7, 2005
    233
    15
    50
    St.Petersburg
    Home Country
    Russian Federation Russian Federation
    Just one thought more.
    You are always talking about scanning and some timeouts.
    As I said, I'll never use MP scanning and using timeouts when putting a link into DB for me is a wrong concept.
    What your SW should do from my point of view:
    - parse *.m3u (static or downloaded from http source automatically once per time X) automatically,
    - substitute in db http-links, pmt pid, etc, if changed, for existing idTuning or add new ones, if a user changed status in intermediate db from e.g. "not insert" to "insert",
    - wait until the process of parsing http-links, pmt pid, etc,from *.m3u is finished (1 second, 1 minute, 1 momth, etc) or loop scanning
     

    bounguine

    Portal Pro
    November 7, 2005
    233
    15
    50
    St.Petersburg
    Home Country
    Russian Federation Russian Federation
    My script is underdone, as I'm busy on my work and using Microsoft after Linux is always is a great joke.
    So I'll at least describe tomorrow or the day after tomorrow how my script works.
    To be short:
    - it scans channels itself from *.m3us without user,
    - it adds new channel and tuningdetail or adds/updates tuningdetail for an existing channel from different sources,
    - deletes tuningdetail if not broadcasted and channels if tuningdetail is exist anymore.

    My concept is like in TVHeadend (Linux) - user must not click "Scan"
     

    Users who are viewing this thread

    Top Bottom