Log in

View Full Version : PGS4NET: A New PGS/SUP Library for .NET


wswartzendruber
4th July 2023, 23:58
Greetings!

As a few of you may know, I have been dabbling in PGS bitstreams for a while now and went so far as building some basic CLI utilities in Rust. Seeing that PGS/SUP utilities are both sparse and not necessarily well-behaved, and also seeing that libraries aren't readily available, I set out to create one for .NET.

Well, I have just pushed the 0.0.1 release to NuGet (https://www.nuget.org/packages/PGS4NET/0.0.1). It targets .NET Standard 2.0.

I don't expect this initial release to be all that useful. For one thing, it only has segment-level support, so it doesn't know anything about display sets, let alone epochs. In fact, it doesn't even have RLE implemented yet.

Coming Up Next

My objectives for the next release are:

1. RLE compression/decompression
2. Display set composition/decomposition

Licensing

PGS4NET is made available under the MPLv2 license. If anyone has questions about how this works, Mozilla has a MPL 2.0 FAQ (https://www.mozilla.org/en-US/MPL/2.0/FAQ/) page setup.

It's basically permissive as far as use as-is goes, but you don't get to distribute changes without sharing them back.

Logo

I also made this nifty logo in Inkscape:

https://wswartzendruber.net/images/pgs4net.png

Katie Boundary
9th July 2023, 17:48
I have no idea what you just said. Will this eventually lead to an AVIsynth subtitling filter that actually works? SUPtext, SupTitle, and VSfilter have all been non-functional for me.

wswartzendruber
10th July 2023, 15:51
I have no idea what you just said. Will this eventually lead to an AVIsynth subtitling filter that actually works? SUPtext, SupTitle, and VSfilter have all been non-functional for me.
If AviSynth can host .NET assemblies, then that's a foreseeable outcome.

wswartzendruber
11th July 2023, 03:51
0.0.2 is live (https://www.nuget.org/packages/PGS4NET/0.0.2) with the same API, except for the addition of RLE support.

The existing ReadSegment() and WriteSegment() extension methods will now provide more detailed information if EOF is encountered prematurely.

Up next: Display Set composition/decomposition support.

wswartzendruber
2nd September 2023, 21:27
Version 0.1.0 is out now. (https://www.nuget.org/packages/PGS4NET/0.1.0#readme-body-tab) The big thing here is display set support. That is, PGS subtitles can be interfaced with either at the base segment level, or at the next-higher display set level.

There's also XMLDoc for everything, as shown below:

https://wswartzendruber.net/images/pgs4net-0.1.0-intellisense.png

The async support shown is true, native async. It's not fake async by wrapping a sync operation in a threaded wrapper.

Up next is Epoch support. The next release of the library will likely be the one most people will be interested in.