catalinii / minisatip

minisatip is an SATIP server for linux using local DVB-S2, DVB-C, DVB-T or ATSC cards
https://minisatip.org
327 stars 80 forks source link

Implementation of smooth undecrypted packets #1001

Closed lars18th closed 1 year ago

lars18th commented 1 year ago

Now when "drop_encrypted == 2" instead of filter out all non-PCR packets, we convert all undecrypted packets to TS packets with stuffing removing the PES payload. This will maintain the number of TS packets and the CC counters. Therefore, the resulting bitrate is identical to that of the original encrypted stream. And that it's more easy to handle for regular hardware and software decoders. Producing then a more smooth play when some part of the stream can't be decrypted.

lars18th commented 1 year ago

Hi @catalinii ,

I'm using this patch for around 4 months. Previously I've used another one for one year that recreates PTS and DTS values of undecrypted packets. However, this is be far more robust with Android TV, Fire TV, VideoLAN, FFmpeg and similar decoders. So I want to share it with others. My recomendation is by default enable it (with -E -E). But I prefer to not change the semantics of any already implemented parameter, so for this reason the current use of the -E parameter (with one instance and without it) continues equal.

Regards.

Jalle19 commented 1 year ago

Would there be any downside to doing this the new way when -E is specified? That way we wouldn't need two different modes.

lars18th commented 1 year ago

Hi @Jalle19 ,

No downside on use this alternative mode. But one difference exists between them: the current mode 1 reduces the bitrate to the minimum, while the new mode 2 maintains the original bitrate. Therefore, if the user wants to do some external check based on bitrate to identify/detect the error, then the mode 1 continues to be valid. This ancient mode (implemented by myself) only pass PCR timestamps because they're mandatory to not break the specs of a MPEG-TS. So, both modes are usefull. And because I don't want to break anything I prefer to leave the same behaviour when the users enable the -E parameter.

In summary, it seems to me IMHO that we can leave both modes. You agree?

Jalle19 commented 1 year ago

Sounds good

Jalle19 commented 1 year ago

@catalinii can we merge this?

catalinii commented 1 year ago

Ues thanks for the reminder