diff options
author | Clément Bœsch <u@pkh.me> | 2016-01-10 16:19:50 +0100 |
---|---|---|
committer | Clément Bœsch <u@pkh.me> | 2016-01-10 16:28:14 +0100 |
commit | 6d32628bf34972bf6b600c6560a25c329afb62f8 (patch) | |
tree | 593d60e7204bb67e0d756d37f94ec880043a74ee /libavcodec | |
parent | d86d7b2486cd5c31db8e820d8a89554abf19567e (diff) | |
download | ffmpeg-streaming-6d32628bf34972bf6b600c6560a25c329afb62f8.zip ffmpeg-streaming-6d32628bf34972bf6b600c6560a25c329afb62f8.tar.gz |
lavc/ccaption_dec: improve default style
Use monospaced font, and a black box outline.
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/ass.c | 7 | ||||
-rw-r--r-- | libavcodec/ass.h | 3 | ||||
-rw-r--r-- | libavcodec/ccaption_dec.c | 10 | ||||
-rw-r--r-- | libavcodec/microdvddec.c | 3 | ||||
-rw-r--r-- | libavcodec/movtextdec.c | 3 |
5 files changed, 19 insertions, 7 deletions
diff --git a/libavcodec/ass.c b/libavcodec/ass.c index 336c308..56d452f 100644 --- a/libavcodec/ass.c +++ b/libavcodec/ass.c @@ -30,7 +30,7 @@ int ff_ass_subtitle_header(AVCodecContext *avctx, const char *font, int font_size, int color, int back_color, int bold, int italic, int underline, - int alignment) + int border_style, int alignment) { avctx->subtitle_header = av_asprintf( "[Script Info]\r\n" @@ -59,7 +59,7 @@ int ff_ass_subtitle_header(AVCodecContext *avctx, "%d,%d,%d,0," /* Bold, Italic, Underline, StrikeOut */ "100,100," /* Scale{X,Y} */ "0,0," /* Spacing, Angle */ - "1,1,0," /* BorderStyle, Outline, Shadow */ + "%d,1,0," /* BorderStyle, Outline, Shadow */ "%d,10,10,10," /* Alignment, Margin[LRV] */ "0\r\n" /* Encoding */ @@ -69,7 +69,7 @@ int ff_ass_subtitle_header(AVCodecContext *avctx, !(avctx->flags & AV_CODEC_FLAG_BITEXACT) ? AV_STRINGIFY(LIBAVCODEC_VERSION) : "", ASS_DEFAULT_PLAYRESX, ASS_DEFAULT_PLAYRESY, font, font_size, color, color, back_color, back_color, - -bold, -italic, -underline, alignment); + -bold, -italic, -underline, border_style, alignment); if (!avctx->subtitle_header) return AVERROR(ENOMEM); @@ -86,6 +86,7 @@ int ff_ass_subtitle_header_default(AVCodecContext *avctx) ASS_DEFAULT_BOLD, ASS_DEFAULT_ITALIC, ASS_DEFAULT_UNDERLINE, + ASS_DEFAULT_BORDERSTYLE, ASS_DEFAULT_ALIGNMENT); } diff --git a/libavcodec/ass.h b/libavcodec/ass.h index 14a1ed2..621a7ba 100644 --- a/libavcodec/ass.h +++ b/libavcodec/ass.h @@ -40,6 +40,7 @@ #define ASS_DEFAULT_ITALIC 0 #define ASS_DEFAULT_UNDERLINE 0 #define ASS_DEFAULT_ALIGNMENT 2 +#define ASS_DEFAULT_BORDERSTYLE 1 /** @} */ /** @@ -61,7 +62,7 @@ int ff_ass_subtitle_header(AVCodecContext *avctx, const char *font, int font_size, int color, int back_color, int bold, int italic, int underline, - int alignment); + int border_style, int alignment); /** * Generate a suitable AVCodecContext.subtitle_header for SUBTITLE_ASS diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c index e3cdcc1..ca497e5 100644 --- a/libavcodec/ccaption_dec.c +++ b/libavcodec/ccaption_dec.c @@ -145,7 +145,15 @@ static av_cold int init_decoder(AVCodecContext *avctx) /* taking by default roll up to 2 */ ctx->mode = CCMODE_ROLLUP; ctx->rollup = 2; - ret = ff_ass_subtitle_header_default(avctx); + ret = ff_ass_subtitle_header(avctx, "Monospace", + ASS_DEFAULT_FONT_SIZE, + ASS_DEFAULT_COLOR, + ASS_DEFAULT_BACK_COLOR, + ASS_DEFAULT_BOLD, + ASS_DEFAULT_ITALIC, + ASS_DEFAULT_UNDERLINE, + 3, + ASS_DEFAULT_ALIGNMENT); if (ret < 0) { return ret; } diff --git a/libavcodec/microdvddec.c b/libavcodec/microdvddec.c index 9035892..46d6d14 100644 --- a/libavcodec/microdvddec.c +++ b/libavcodec/microdvddec.c @@ -370,7 +370,8 @@ static int microdvd_init(AVCodecContext *avctx) } return ff_ass_subtitle_header(avctx, font_buf.str, font_size, color, ASS_DEFAULT_BACK_COLOR, bold, italic, - underline, alignment); + underline, ASS_DEFAULT_BORDERSTYLE, + alignment); } AVCodec ff_microdvd_decoder = { diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c index 257d598..8d0e814 100644 --- a/libavcodec/movtextdec.c +++ b/libavcodec/movtextdec.c @@ -413,7 +413,8 @@ static int mov_text_init(AVCodecContext *avctx) { if (ret == 0) { return ff_ass_subtitle_header(avctx, m->d.font, m->d.fontsize, m->d.color, m->d.back_color, m->d.bold, m->d.italic, - m->d.underline, m->d.alignment); + m->d.underline, ASS_DEFAULT_BORDERSTYLE, + m->d.alignment); } else return ff_ass_subtitle_header_default(avctx); } |