ukn_unknown Kévin Chalet , first let me thank you for helping ... now I start to understand your proposal from document.
My pleasure! Thanks for taking the time to address that 😊
I just set up a Ubuntu 25.04 VM, built your dev_mpegts
branch locally and configured a DVB-T network with SAT>IP tuners pointing to my production Tvheadend server.
It worked beautifully and I can confirm that the basic MPEG-TS data is now passed through when creating a "transcode/lib-av with MPEG-TS/lib-av container" stream profile. Here's an example with the LCI channel:
Using my Tvheadend production server (version 4.3-2375~g653bd0400
):
===============================================================================
| SERVICES ANALYSIS REPORT |
|=============================================================================|
| Global PID's |
| TS packets: 63, PID's: 2 (clear: 2, scrambled: 0) |
|-----------------------------------------------------------------------------|
| PID Usage Access Bitrate |
| Total Global PID's ................................. C 23,331 b/s |
| Subt. Global PSI/SI PID's (0x00-0x1F) .............. C 23,331 b/s |
| 0x0000 PAT .......................................... C 18,887 b/s |
| 0x0011 SDT/BAT ...................................... C 4,444 b/s |
|=============================================================================|
| Service: 0x0001 (1), TS: 0x0001 (1), Original Netw: 0xFF01 (65281) |
| Service name: Service01, provider: FFmpeg |
| Service type: 0x01 (Digital television service) |
| TS packets: 7,499, PID's: 3 (clear: 3, scrambled: 0) |
| PMT PID: 0x1000 (4096), PCR PID: 0x0100 (256) |
|-----------------------------------------------------------------------------|
| PID Usage Access Bitrate |
| Total Digital television service ................... C 2,777,102 b/s |
| 0x0100 AVC video (682x384, high profile, level 3.0, C 2,516,760 b/s |
| 0x0101 MPEG-2 AAC Audio (fre) ....................... C 241,455 b/s |
| 0x1000 PMT .......................................... C 18,887 b/s |
| (C=Clear, S=Scrambled, +=Shared) |
===============================================================================
Using your branch:
===============================================================================
| SERVICES ANALYSIS REPORT |
|=============================================================================|
| Global PID's |
| TS packets: 83, PID's: 3 (clear: 3, scrambled: 0) |
|-----------------------------------------------------------------------------|
| PID Usage Access Bitrate |
| Total Global PID's ................................. C 22,908 b/s |
| Subt. Global PSI/SI PID's (0x00-0x1F) .............. C 22,908 b/s |
| 0x0000 PAT .......................................... C 15,732 b/s |
| 0x0010 NIT (Network: 0x20FA (8442) CNH) ............. C 3,588 b/s |
| 0x0011 SDT/BAT ...................................... C 3,588 b/s |
|=============================================================================|
| Service: 0x0308 (776), TS: 0x0003 (3), Original Netw: 0x20FA (8442) |
| Service name: LCI, provider: CNH |
| Service type: 0x01 (Digital television service) |
| TS packets: 5,869, PID's: 4 (clear: 4, scrambled: 0) |
| PMT PID: 0x01F4 (500), PCR PID: 0x01FE (510) |
|-----------------------------------------------------------------------------|
| PID Usage Access Bitrate |
| Total Digital television service ................... C 1,619,814 b/s |
| 0x01F4 PMT .......................................... C 15,732 b/s |
| 0x01FE AVC video (682x384, high profile, level 3.0, C 1,405,642 b/s |
| 0x01FF MPEG-2 AAC Audio (fre) ....................... C 198,440 b/s |
| 0x0200 MPEG-2 PES private data ...................... C 0 b/s |
| (C=Clear, S=Scrambled, +=Shared) |
===============================================================================
After injecting the channel in WMC's database with the correct MPEG-TS locators, you can watch TV without issues (note that you can already watch TV with the "official" Tvheadend release, but since all the channels will end up using the same hardcoded "1" service ID, the channels end up being merged automatically by WMC at some point):

The quality is terrible, but I used the default settings - that aren't really meant for quality to say the least 🤣 - to test your branch. Windows Media Center is also quite picky when it comes to codecs so I had to transcode to MPEG2 audio to hear something 😁
ukn_unknown I don't have WMC to test ... and for some unknown reason apollo is not able to make it work 🙁
I suspect that's simply because he didn't have a way to inject/update the channel with the correct MPEG-TS transport/network/service IDs: once you switch to your branch, the returned stream will now use the original identifiers and you need to change the channel data in WMC to use the same values, otherwise they won't match.
Technically, this is a potentially breaking change for users/apps that expect a stream with MPEG-TS service ID = 1. Should the transcode/lib-av profile be updated to offer the same settings as the pass
profile?

ukn_unknown we can discuss how we can add a workaround for WMC to fix the IPTV sources (but I consider #2 as independent of #1).
We have to look at the big picture with ... all our clients / users in mind. Let me know if you disagree with statement above.
Yeah, I fully agree it's an orthogonal (tho' related) thing. That said, I'm not sure it should be implemented at the IPTV level, since it's not specific to IPTV at all: I used IPTV in my example scenario, but you'd have the same issue in the following cases:
- When using two true MPEG-TS sources coming from DVB-T and DVB-C or DVB-S2 ; for instance, when using OTA with a cable fallback (in that case, the service IDs will be different between the two sources even if the "channel" is the same).
- When having a channel that points to a UHD service but falls back to a FHD service on the same DVB-T2 network if the first one temporarily doesn't work. In that case the service IDs will be different too.
Another way to address that would be to add new channel-bound settings allowing to override the MPEG-TS ONID/TSID/NID/SID of the original source to use static, user-defined values. Assuming you're using a stream profile preserving these, it should also work flawlessly 😁
Cheers!