libobs: Update libcaption library

(This commit also modifies deps/libcaption)

Closes obsproject/obs-studio#1354
This commit is contained in:
Matthew Szatmary
2018-06-28 11:22:44 -07:00
committed by jp9000
parent f84e490ebe
commit a8517f3698
49 changed files with 3275 additions and 7665 deletions

View File

@@ -1,10 +1,10 @@
# version
v0.6
v0.8
Matthew Szatmary m3u8@twitch.tv / matt@szatmary.org
# libcaption
libcaption is a small library written in C to aid in the creating and parsing of closed caption data for use in the twitch player, open sourced to use within community developed broadcast tools. To maintain consistency across platforms libcaption aims to implement a subset of EIA608, CEA708 as supported by the Apple iOS platform.
libcaption is a library written in C to aid in the creating and parsing of closed caption data, open sourced under the MIT license to use within community developed broadcast tools. To maintain consistency across platforms libcaption aims to implement a subset of EIA608, CEA708 as supported by the Apple iOS platform.
608 support is currently limited to encoding and decoding the necessary control and preamble codes as well as support for the Basic North American, Special North American and Extended Western European character sets.
@@ -23,10 +23,10 @@ H.264 utility functions are limited to wrapping the 708 payload into a SEI NALU.
|BNA|P|Q|R|S|T|U|V|W|X|Y|Z|[|é|]|í|ó|
|BNA|ú|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|
|BNA|p|q|r|s|t|u|v|w|x|y|z|ç|÷|Ñ|ñ|█|
|SNA|®|°|½|¿|™|¢|£|♪|à| |è|â|ê|î|ô|û|
|SNA|®|°|½|¿|™|¢|£|♪|à| |è|â|ê|î|ô|û|
|WES|Á|É|Ó|Ú|Ü|ü||¡|*|'|—|©|℠|•|“|”|
|WEF|À|Â|Ç|È|Ê|Ë|ë|Î|Ï|ï|Ô|Ù|ù|Û|«|»|
|WEP|Ã|ã|Í|Ì|ì|Ò|ò|Õ|õ|{|}|\\|^|_|\||~|
|WEP|Ã|ã|Í|Ì|ì|Ò|ò|Õ|õ|{|}|\|^|_|||~|
|WEG|Ä|ä|Ö|ö|ß|¥|¤|¦|Å|å|Ø|ø|┌|┐|└|┘|
* BNA = Basic North American character set
@@ -36,64 +36,16 @@ H.264 utility functions are limited to wrapping the 708 payload into a SEI NALU.
* WEP = Extended Western European character set : Portuguese
* WEG = Extended Western European character set : German/Danish
## Limitations
Current B-frame support for caption creation is minimal. libcaption ensures no re-ordering of captions is required
on playback.
------
eia608_screen_t is the default internal representation. `screens` can be
converted to and from SEI messages 608/708 buffers and SRT files
## JSON format
A JSON rendered format is provided for convenience of integration. The JSON
format is as follows:
```
{
"format": "eia608",
"mode": "pop-on",
"roll-up": 0,
"data": [
{ "row":0, "col":0, "char":"A", "style":"white" },
{ "row":0, "col":1, "char":"B", "style":"white" },
// ...
]
}
```
### `format`
The only current valid value is `"eia608"`. This field exists for
future expansion. Any values other than `"eia608"`, and the object should be
ignored for now.
### `mode`
Defines the method by which screen contents are adjusted in response to
new data, such as content in excess of the normal grid size.
Possible modes are:
`"clear"`: Generated when a screen is initialized, but not entered a "loading"
state. `"clear"` mode occurs frequently when the display is to be erased.
`"pop-on"`: Normally used for pre recorded content where. A pop-on screen should
completely replace all previous screen contents.
`"paint-on"`: Normally used for live content. In this mode, new characters
appear one or two at a time. The `data` array does include the complete state of
the screen. In practice, it may not be different that `"pop-on"`.
An internal "loading" mode also exists.
### `roll-up`
Normally used for live content such as news broadcasts. Text is moved up the
screen as new rows appear. The number of rows to be displayed is also encoded in
the JSON key `"roll-up"` where value is an integer of `0`, `1`, `2`, `3`, or `4`.
Like `"paint-on"`, the `data` array does include the complete state of the screen.
### `data`
Contains a object for every character to be displayed. The screen is a grid of
15 rows and 32 columns. The position of the character is available in the `row`
and `col` fields. The character itself is in the `char` field. The full
character set is available in the document, but any valid UTF-8 should be
supported for future. The style field will contain one of the following values:
`"white"`, `"green"`, `"blue"`, `"cyan"`, `"red"`, `"yellow"`, `"magenta"`, `"italics"`
Characters with the `"italics"` style should be displayed in white.
## Build Directions
# Mac Os/Linux
Install build dependencies (git, cmake, a compiler such as xcode, gcc or clang and optionally re2c and ffmpeg)
* run `cmake . && make`
* or to compile without re2c `cmake -DENABLE_RE2C=OFF . && make`
* finally `sudo make install` to install
# Windows
I have never tested libcaption in windows. It is written in pure C with no dependencies,
so there is no reason it would not work.