Commit 100bfac6 authored by Jan Ekström's avatar Jan Ekström

add libaribb24 ARIB STD-B24 caption decoder

* Outputs ASS lines with basic coloring and font scaling for each
  given region.
* Sets the default style to the resolution of the subtitle plane
  (for example, 960x540 / 36pt font for profile A).
* Has options to:
  * Disable ruby text (which is coded as regions which have
    half-height text in libaribb24).
    Enabled by default as without positioning ruby text only
    confuses as it is usually coded in the beginning of the decoded
    subtitle line.
  * Set the working directory, in which libaribb24 will read
    configuration as well as into which it may save broadcast extra
    symbols as PNG.
    Unset by default.

The unconventional library check can be explained by the library's
current master branch being licensed as LGPLv3, but at the time of
writing the latest official release is still licensed under GPLv3.

Thus, one either has to wait for the following release, or enable
GPLv3.
parent 5c515b5f
......@@ -17,6 +17,7 @@ version <next>:
- maskfun filter
- hcom demuxer and decoder
- ARBC decoder
- libaribb24 based ARIB STD-B24 caption support (profiles A and C)
version 4.1:
......
......@@ -218,6 +218,7 @@ External library support:
--enable-jni enable JNI support [no]
--enable-ladspa enable LADSPA audio filtering [no]
--enable-libaom enable AV1 video encoding/decoding via libaom [no]
--enable-libaribb24 enable ARIB text and caption decoding via libaribb24 [no]
--enable-libass enable libass subtitles rendering,
needed for subtitles and ass filter [no]
--enable-libbluray enable BluRay reading using libbluray [no]
......@@ -1683,6 +1684,7 @@ EXTERNAL_LIBRARY_NONFREE_LIST="
EXTERNAL_LIBRARY_VERSION3_LIST="
gmp
libaribb24
liblensfun
libopencore_amrnb
libopencore_amrwb
......@@ -3094,6 +3096,7 @@ hevc_videotoolbox_encoder_select="videotoolbox_encoder"
libaom_av1_decoder_deps="libaom"
libaom_av1_encoder_deps="libaom"
libaom_av1_encoder_select="extract_extradata_bsf"
libaribb24_decoder_deps="libaribb24"
libcelt_decoder_deps="libcelt"
libcodec2_decoder_deps="libcodec2"
libcodec2_encoder_deps="libcodec2"
......@@ -6080,6 +6083,9 @@ enabled gnutls && require_pkg_config gnutls gnutls gnutls/gnutls.h gn
enabled jni && { [ $target_os = "android" ] && check_headers jni.h && enabled pthreads || die "ERROR: jni not found"; }
enabled ladspa && require_headers "ladspa.h dlfcn.h"
enabled libaom && require_pkg_config libaom "aom >= 1.0.0" aom/aom_codec.h aom_codec_version
enabled libaribb24 && { check_pkg_config libaribb24 "aribb24 > 1.0.3" "aribb24/aribb24.h" arib_instance_new ||
{ enabled gpl && require_pkg_config libaribb24 aribb24 "aribb24/aribb24.h" arib_instance_new; } ||
die "ERROR: libaribb24 requires version higher than 1.0.3 or --enable-gpl."; }
enabled lv2 && require_pkg_config lv2 lilv-0 "lilv/lilv.h" lilv_world_new
enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
enabled libass && require_pkg_config libass libass ass/ass.h ass_library_init
......
......@@ -194,6 +194,31 @@ without this library.
@chapter Subtitles Decoders
@c man begin SUBTILES DECODERS
@section libaribb24
ARIB STD-B24 caption decoder.
Implements profiles A and C of the ARIB STD-B24 standard.
@subsection libaribb24 Decoder Options
@table @option
@item -aribb24-base-path @var{path}
Sets the base path for the libaribb24 library. This is utilized for reading of
configuration files (for custom unicode conversions), and for dumping of
non-text symbols as images under that location.
Unset by default.
@item -aribb24-skip-ruby-text @var{boolean}
Tells the decoder wrapper to skip text blocks that contain half-height ruby
text.
Enabled by default.
@end table
@section dvbsub
@subsection Options
......
......@@ -957,6 +957,7 @@ OBJS-$(CONFIG_PCM_ALAW_AT_ENCODER) += audiotoolboxenc.o
OBJS-$(CONFIG_PCM_MULAW_AT_ENCODER) += audiotoolboxenc.o
OBJS-$(CONFIG_LIBAOM_AV1_DECODER) += libaomdec.o
OBJS-$(CONFIG_LIBAOM_AV1_ENCODER) += libaomenc.o
OBJS-$(CONFIG_LIBARIBB24_DECODER) += libaribb24.o ass.o
OBJS-$(CONFIG_LIBCELT_DECODER) += libcelt_dec.o
OBJS-$(CONFIG_LIBCODEC2_DECODER) += libcodec2.o codec2utils.o
OBJS-$(CONFIG_LIBCODEC2_ENCODER) += libcodec2.o codec2utils.o
......
......@@ -677,6 +677,7 @@ extern AVCodec ff_qdmc_at_decoder;
extern AVCodec ff_qdm2_at_decoder;
extern AVCodec ff_libaom_av1_decoder;
extern AVCodec ff_libaom_av1_encoder;
extern AVCodec ff_libaribb24_decoder;
extern AVCodec ff_libcelt_decoder;
extern AVCodec ff_libcodec2_encoder;
extern AVCodec ff_libcodec2_decoder;
......
......@@ -677,6 +677,7 @@ enum AVCodecID {
AV_CODEC_ID_ASS,
AV_CODEC_ID_HDMV_TEXT_SUBTITLE,
AV_CODEC_ID_TTML,
AV_CODEC_ID_ARIB_CAPTION,
/* other specific kind of codecs (generally used for attachments) */
AV_CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs.
......@@ -2993,6 +2994,9 @@ typedef struct AVCodecContext {
#define FF_PROFILE_PRORES_4444 4
#define FF_PROFILE_PRORES_XQ 5
#define FF_PROFILE_ARIB_PROFILE_A 0
#define FF_PROFILE_ARIB_PROFILE_C 1
/**
* level
* - encoding: Set by user.
......
......@@ -3133,7 +3133,14 @@ static const AVCodecDescriptor codec_descriptors[] = {
.long_name = NULL_IF_CONFIG_SMALL("Timed Text Markup Language"),
.props = AV_CODEC_PROP_TEXT_SUB,
},
{
.id = AV_CODEC_ID_ARIB_CAPTION,
.type = AVMEDIA_TYPE_SUBTITLE,
.name = "arib_caption",
.long_name = NULL_IF_CONFIG_SMALL("ARIB STD-B24 caption"),
.props = AV_CODEC_PROP_TEXT_SUB,
.profiles = NULL_IF_CONFIG_SMALL(ff_arib_caption_profiles),
},
/* other kind of codecs and pseudo-codecs */
{
......
This diff is collapsed.
......@@ -170,4 +170,10 @@ const AVProfile ff_mjpeg_profiles[] = {
{ FF_PROFILE_UNKNOWN }
};
const AVProfile ff_arib_caption_profiles[] = {
{ FF_PROFILE_ARIB_PROFILE_A, "Profile A" },
{ FF_PROFILE_ARIB_PROFILE_C, "Profile C" },
{ FF_PROFILE_UNKNOWN }
};
#endif /* !CONFIG_SMALL */
......@@ -35,5 +35,6 @@ extern const AVProfile ff_av1_profiles[];
extern const AVProfile ff_sbc_profiles[];
extern const AVProfile ff_prores_profiles[];
extern const AVProfile ff_mjpeg_profiles[];
extern const AVProfile ff_arib_caption_profiles[];
#endif /* AVCODEC_PROFILES_H */
......@@ -28,7 +28,7 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 58
#define LIBAVCODEC_VERSION_MINOR 46
#define LIBAVCODEC_VERSION_MINOR 47
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment