Skip to content
Permalink
Browse files

avcodec: add minimal teletext subtitle decoder

Based largely on VLC's modules/codec/telx.c.

Processes only teletext pages marked as subtitles, so depending
on the stream it might not produce any output.

Subtitles are rendered directly to ASS, with support for background
colors and a best-effort at screen positioning. The ASS packets
are emitted in real time (similar to ccaption_dec's real_time
option), with -1 durations. The decoder expects that the player
will remove all existing subtitles whenever a new packet arrives.

The teletext clear command is implemented using an empty subtitle,
which removes existing subtitles but does not render anything new.
  • Loading branch information
tmm1 committed Apr 25, 2018
1 parent d06b01f commit ba1cabeda654a72b7e6e52c82bc7b16abad55a45
Showing with 524 additions and 0 deletions.
  1. +1 −0 libavcodec/Makefile
  2. +1 −0 libavcodec/allcodecs.c
  3. +522 −0 libavcodec/teletextsubdec.c
@@ -593,6 +593,7 @@ OBJS-$(CONFIG_SVQ1_DECODER) += svq1dec.o svq1.o svq13.o h263data.o
OBJS-$(CONFIG_SVQ1_ENCODER) += svq1enc.o svq1.o h263data.o \
h263.o ituh263enc.o
OBJS-$(CONFIG_SVQ3_DECODER) += svq3.o svq13.o mpegutils.o h264data.o
OBJS-$(CONFIG_TELETEXTSUB_DECODER) += teletextsubdec.o ass.o
OBJS-$(CONFIG_TEXT_DECODER) += textdec.o ass.o
OBJS-$(CONFIG_TEXT_ENCODER) += srtenc.o ass_split.o
OBJS-$(CONFIG_TAK_DECODER) += takdec.o tak.o takdsp.o
@@ -634,6 +634,7 @@ extern AVCodec ff_subrip_encoder;
extern AVCodec ff_subrip_decoder;
extern AVCodec ff_subviewer_decoder;
extern AVCodec ff_subviewer1_decoder;
extern AVCodec ff_teletextsub_decoder;
extern AVCodec ff_text_encoder;
extern AVCodec ff_text_decoder;
extern AVCodec ff_vplayer_decoder;

0 comments on commit ba1cabe

Please sign in to comment.