[DISCUSSION] Patch WMC to run on Windows 10 final & possible alternatives

Discussion in 'Windows 10' started by ricktendo64, May 8, 2015.

  1. acer-5100

    acer-5100 MDL Guru

    Dec 8, 2018
    4,001
    2,969
    150
    #10561 acer-5100, Apr 10, 2023
    Last edited: Apr 10, 2023
    Keep in mind that speaking of TVheadend I'm a newbie as well

    No idea about what you ask, I just add some transcoding profile(s) and they work, no matter if audio is transcoded or left unchanged as well.

    Then given TVH has the ability to stream as TS or as MKV I guess it remuxes...

    Probably dvblink does its dirty work providing WMC with exactly what it expects
     
  2. Kévin Chalet

    Kévin Chalet MDL Member

    Apr 11, 2019
    177
    157
    10
    Sorry, I should have been more specific (all this stuff is far from being easy and there are lots of complicated terms... :wacko:)

    There are actually two kinds of TS streams made available by Tvheadend:
    - The mu(ltiple)xed MPTS stream: it's the raw TS stream directly returned by the demodulator/tuner and matching the frequency you set: it generally contains multiple streams at the same time, corresponding to all the channels included in the DVB-T(2) multiplex. You can access it via http://[Tvheadend IP]:9981/stream/mux/[ID of the multiplex] and if you open that link with VLC, you can switch between each channel via Playback -> Programs.
    - The demu(ltiple)xed SPTS stream: it's the raw TS stream corresponding to the video/audio/subtiles of a single channel, extracted by Tvheadend from the MPTS stream (and likely the one you're using with DVBLink). You can access it via http://[Tvheadend IP]:9981/stream/channel/[ID of the channel].

    Given HDHomeRun allows creating a terrestrial or cable tuner that is very close to what a physical tuner would look like, I guess it's not unreasonable that it is expecting a MPTS stream from the virtual tuner. You're likely right that DVBLink must do something like a remux to make WMC happy :giggle:

    I'll keep digging. Hopefully, I should also be able to give DVBLink a try.
     
  3. Kévin Chalet

    Kévin Chalet MDL Member

    Apr 11, 2019
    177
    157
    10
    Thanks to acer, I was able to give DVBLink 4.1 a try, and except the frequent (and quite annoying) "PlayReady update incomplete" errors that require switching to a different channel before switching back to the channel you want, it works fairly well (acer confirmed he was also seeing similar errors from time to time so I'm not the only one impacted, I guess).

    That said, I spent more time on my Tvheadend + HDHRProxyIPTV experimentation and found out why I was getting a "service unavailable" error when applying the webtv-h264-aac-mpegts stream profile: while it includes "mpegts" in its name, the process is unfortunately lossy and important data present in the original TS stream is lost during the transcoding: the TS transport stream ID and the service ID, that are both required by Windows Media Center to validate it's the correct channel (they are replaced by Tvheadend by dummy values).

    While not perfect, Tvheadend 4.3 introduced a new MPEG-TS Spawn profile type that allows invoking any program to manually handle the transcoding part.
    After compiling the latest Tvheadend bits locally, I was able to leverage this new feature with ffmpeg to transcode a channel stream and restore the correct TS metadata needed by WMC:

    Code:
    ffmpeg -i - -f mpegts -mpegts_transport_stream_id 0x0006 -mpegts_service_id 0x0601 -metadata service_provider="SMR6" -metadata service_name="TF1" -c:a copy -c:v [preferred video codec] -hide_banner -loglevel panic pipe:1
    It certainly requires more configuration than DVBLink, but the BDA integration seems way more reliable on my test machine (I didn't see any error when switching channels).

    It's great to see we have viable options to keep using our favorite media center app :evil2:
     
  4. acer-5100

    acer-5100 MDL Guru

    Dec 8, 2018
    4,001
    2,969
    150

    We have a different background and a different history so we find hard to adapt on each other's method.


    I never cared about TS, I cared about the content, I get the channel numbers from the DVBLINK GUI, and the EPG from XML collected by the great EPG grabber, so I never cared about additional infos on the TS stream...

    I have one channel, one stream, one epg info. I don't even use the TS container in HDheadend, during my experiments i fount that the MKV container works better for my personal usage, and has less glitches in MPC-HC, VLC and Android clients
     
  5. Kévin Chalet

    Kévin Chalet MDL Member

    Apr 11, 2019
    177
    157
    10
    Not caring about the TS details isn't a problem with DVBLink, but not with the HDHomeRun BDA drivers as they are real (tho' remote) ATSC, DVB-T(2) or DVB-C tuners.
    When you think about it, it's indeed logical to feed them with TS streams that respect the typical constraints of ATSC/DVB streams :yes:
     
  6. acer-5100

    acer-5100 MDL Guru

    Dec 8, 2018
    4,001
    2,969
    150
    Yes, I understand.

    I'm not saying is a wrong approach, just saying I'm not used to it, because a ten year habit
     
  7. Joni

    Joni MDL Junior Member

    May 28, 2009
    59
    7
    0
    I should reinstall Windows and I was thinking of maybe installing win11. Does WMC work in it? If it does work is there anything that doesn't work vs in win10?
     
  8. acer-5100

    acer-5100 MDL Guru

    Dec 8, 2018
    4,001
    2,969
    150
    Frankly, if you want to play with win 11 install it in a virtual machine, so you can delete it in one click after you realize what is it...

    Nothing different than installing it on a recent W10

    Aside W11 itself, nothing I'm aware of...
     
  9. Kévin Chalet

    Kévin Chalet MDL Member

    Apr 11, 2019
    177
    157
    10
    Not sure what your actual use case is, but Windows Server 2019 and 2022 are also great candidates: they benefit from a very long support policy and no longer require importing the Windows BDA drivers infrastructure as it's included in recent versions of Windows Server (with 2008 and 2012, you had to copy a bunch of system files from a Windows client machine).

    Note: you need to install the "WiFi LAN service" feature, even if you don't have a WiFi card on your machine (otherwise, WMC won't launch).
     
  10. acer-5100

    acer-5100 MDL Guru

    Dec 8, 2018
    4,001
    2,969
    150
    #10570 acer-5100, May 11, 2023
    Last edited: May 11, 2023
    Not entirely correct.


    Speaking of servers

    Windows Home Server 2011 works out of the box.

    Storage Server 2008 R2 essentials (misleading name for a better brother of WHS 2011) works out of the box

    Server 2012 Essentials works out of the box (but there isn't a patched version of WMC for it, so not a solution suggested to newbies).

    Server 2012 R2 Essentials (or Server 2012 R2 with the essential role enabled) works after you install the WSEMP (windows server essentials media pack), you need also the LAV codecs installed.

    Sever 2016 TP4 (Test Preview 4) Works out of the box and (I guess) still supports the Cable Cards being a 1511 build

    Server 2016/2019/2022 and Server 11 (2025 I guess) works out of the box.

    No problem also using my unofficial servers 2017 (16299), 2018 (17134) and 2020 (1904x)

    Absolutely correct, I spent a day to figure out that the first time I faced the problem (practically you need just a couple of wlan related dlls, no need to have really the role working).
     
  11. jonaand

    jonaand MDL Senior Member

    Aug 4, 2012
    362
    31
    10
    for install in windows 10 19045.3031
    what is the last version of media center that should i use
    thanks
     
  12. Joni

    Joni MDL Junior Member

    May 28, 2009
    59
    7
    0
    Thanks I'll try Server 2022. I remember it was a thing once running server as desktop OS. I think is was Server 2003. Win11 hasn't been all that bad I hate the UI and some things they did with the settings are just stupid but other than that it has been ok.
     
  13. acer-5100

    acer-5100 MDL Guru

    Dec 8, 2018
    4,001
    2,969
    150
    #10575 acer-5100, Jun 8, 2023
    Last edited: Jun 8, 2023

    Let's separate the two arguments.

    Using a Server as Workstation is a thing now more than it was 10/20 years ago, given the servers are light (almost) crapfree, while recent W10/W11 are just giant spywares.

    But speaking of WMC using a Server as Server is obviously a well known scenario, NextPVR, DVBLINK, TVheadend, ServerWMC and alike are all server programs
     
  14. acer-5100

    acer-5100 MDL Guru

    Dec 8, 2018
    4,001
    2,969
    150
    #10577 acer-5100, Jul 6, 2023
    Last edited: Jul 6, 2023
    Just a couple of random thoughts, that maybe are clear to me and @Kévin Chalet , but not to the people are reading.

    #1 TVheadend is a Linux only program, but can be easily run in Windows via a WSL1 machine (In wsl1 setup the tuner is still managed by Windows and its drivers)

    #2 Using WSL2 you can access the physical tuner via USB-IP, but that way didn't prove rock solid in my experience, the same is applicable to traditional VMware /VIrtualbox VMs

    #3 the recent HDhomerun drivers are over 100MB (and requires recent .net and or VC libraries) while older ones are around 10MB and are much tolerant about system requirements. With older ones you may get errors about not being able to setup UPNP ports, you can just ignore those errors, everything still works as expected.

    #4 Speaking of older drivers... the ones coming from around 2012 still support XP, so technically it may be possible to use the above setup in XP MCE (transcoding to MPEG1/2, not to H264), that would be another advantage over DVBLInk (that on client side requires at least Vista with TV Pack installed)

    I tried to get it working in XP MCE, The tuner are recognized, the scan feature works (I see the server running while MCE scans for channels) but at the end no channel is found, and I have no idea on how to inject the tuning data manually on XP MCE (maybe @Kévin Chalet has something to say about that).

    #5 In counties like Italy, where (almost) all channels are already migrated to H264, transcoding everything to MPEG2, not just new H265/HEVC channels, is a great way to serve older machines that may have accelerated support for MPEG but not for H264, reducing the CPU usage from something like 60/70/80% to just 5/10% (and avoiding to waste energy in heat, while keeping the fans silent)

    #6 A bit annoying part of the whole thing is that HDHomerun doesn't work correctly if launched as a service, and there is no built in way to hide it other than minimizing it to the taskbar.

    I solved this using "Actual Windows Minimizer", (I think the name is pretty self explanatory)

    upload_2023-7-6_11-28-25.png

    Curiously enough that SW comes from the some SW house that makes "Actual Multiple Monitors" that (unwillingly) fixes most of the annoyances of WMC (black screen on RDP, odd scaling problems on High resolution monitors and so on)



    Likely I'm forgetting a lot of things, but I'll integrate later, if needed.
     
  15. acer-5100

    acer-5100 MDL Guru

    Dec 8, 2018
    4,001
    2,969
    150
    @Kévin Chalet

    Tested briefly your program. It does quickly exactly what's supposed to do, and that's amazing

    It's perfect for the average WMC user, which traditionally understand almost nothing about what's under the hood.

    But for a bit more complex scenario it can be problematic.

    It writes the HdhrProxy file in the current directory, which is unharmful, but also overwrites the WMC configuration W/O asking any confirmation, which potentially means it destroys hours of days of work/refinement.

    So, for sure would be very welcome a prompt after the .ini is generated, but before the WMC setting is injected.

    Also would be nice to have an option to feed it (alternatively) with an already made .ini, instead of just the TVH address.

    That would be very handy if you have an already working .ini, or if you had to fix/mod something in the ini generated from a previous run

    A way could be, just look in the current directory.

    If no ini is present ask for TVheadend address (then ask if you want to inject the data in WMC)

    If the .ini is already there, ask if you want to use it or if you want to generate a new one, then proceed like above.
     
  16. acer-5100

    acer-5100 MDL Guru

    Dec 8, 2018
    4,001
    2,969
    150