Giter Club home page Giter Club logo

spp2pgs's Introduction

Spp2Pgs

Converts general subtitles to HDMV PG streams.
In other words, converts .ass files to .sup files.

The project generates a command line application and a CLR dll file.
Core of them is a static library, libspp2pgs.

An external dll, xy-VSSppf, is introduced to deal with subtitle files.
It's based on a forked version of xy-VSFilter, rendering and providing subtitles in a more easy way.

Here is a breif description for all the four parts.

Spp2Pgs*.exe

An executable converts subtitles to .sup files.
Usage:
Spp2Pgs -i "X:\Saya1011con.ass" -s 1080 -r 23 "X:\Saya1011con.sup"
Type Spp2Pgs -h for more help.

libspp2pgs & Spp2PgsNet*.dll

The core and its CLR library wrapper for .NET framework applications.
Three classes play the main role:

  • PgsEncoder, encoding and writing a pgs file.
  • FrameStream, reading subtitles and rendering subtitles into image.
  • Spp2Pgs, an entrance for all other things. Also reading images from FrameStream and sending them to PgsEncoder.

And this is a SAMPLE for C#:

//class MySettings : IS2PSettings { ... }
//class MyLogger : IS2PLogger { ... }

using (Spp2Pgs tS2P = new Spp2Pgs(new MySettings(), new MyLogger()))	//Create Spp2Pgs obj
using (var tCtx = tS2P.CreateSubPicProviderContext())	//Create SppContext Obj, necessary for creating Spp
using (var tOutputStream = new FileStream(@"X:\Sayas1011con.sup", FileMode.Create))	//Create output file
using (var tOutput = tS2P.CreatePgsEncoder(tOutputStream, BdViFormat.Vi1080i, BdViFrameRate.Vi23)) //Create PgsEncoder
{
    tOutput.RegistAnchor(0);    //Ensure an epoch at pts==0

	//Create Spp, necessary for processing subtitle files
	using (var tSpp = tS2P.CreateSubPicProvider(tCtx, new FileInfo(@"X:\Illya.ass")))
	{
		//Create Advisor, providing additional info for FrameStream.
		var tAdv =
			tS2P.CreateSppFrameStreamAdvisor(tSpp, BdViFormat.Vi1080p, BdViFrameRate.Vi23,	//Rendering format and rate
			-1, -1, 0);	//Rendering subtitle from begin to end, without an offset.
		//Create FrameStream
		using (var tInput = tS2P.CreateFrameStream(tSpp, tAdv))
		{
			//Encode from a FrameStream to a PgsEncoder
			tS2P.Encode(tInput, tOutput, null);
			//Done.
		}
	}
}

xy-VSSppf*.dll

xy-VobSub SubPicProvider Factory. This is a COM dll, exposing an ISubPicProviderAlfa interface to Spp2Pgs.
It's a necessary part for Spp2Pgs.

Special Thanks

spp2pgs's People

Contributors

subelf avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.