Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
6d32628b
Commit
6d32628b
authored
Jan 10, 2016
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/ccaption_dec: improve default style
Use monospaced font, and a black box outline.
parent
d86d7b24
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
8 deletions
+20
-8
ass.c
libavcodec/ass.c
+4
-3
ass.h
libavcodec/ass.h
+2
-1
ccaption_dec.c
libavcodec/ccaption_dec.c
+9
-1
microdvddec.c
libavcodec/microdvddec.c
+2
-1
movtextdec.c
libavcodec/movtextdec.c
+2
-1
sub-cc
tests/ref/fate/sub-cc
+1
-1
No files found.
libavcodec/ass.c
View file @
6d32628b
...
@@ -30,7 +30,7 @@ int ff_ass_subtitle_header(AVCodecContext *avctx,
...
@@ -30,7 +30,7 @@ int ff_ass_subtitle_header(AVCodecContext *avctx,
const
char
*
font
,
int
font_size
,
const
char
*
font
,
int
font_size
,
int
color
,
int
back_color
,
int
color
,
int
back_color
,
int
bold
,
int
italic
,
int
underline
,
int
bold
,
int
italic
,
int
underline
,
int
alignment
)
int
border_style
,
int
alignment
)
{
{
avctx
->
subtitle_header
=
av_asprintf
(
avctx
->
subtitle_header
=
av_asprintf
(
"[Script Info]
\r\n
"
"[Script Info]
\r\n
"
...
@@ -59,7 +59,7 @@ int ff_ass_subtitle_header(AVCodecContext *avctx,
...
@@ -59,7 +59,7 @@ int ff_ass_subtitle_header(AVCodecContext *avctx,
"%d,%d,%d,0,"
/* Bold, Italic, Underline, StrikeOut */
"%d,%d,%d,0,"
/* Bold, Italic, Underline, StrikeOut */
"100,100,"
/* Scale{X,Y} */
"100,100,"
/* Scale{X,Y} */
"0,0,"
/* Spacing, Angle */
"0,0,"
/* Spacing, Angle */
"
1,1,0,"
/* BorderStyle, Outline, Shadow */
"
%d,1,0,"
/* BorderStyle, Outline, Shadow */
"%d,10,10,10,"
/* Alignment, Margin[LRV] */
"%d,10,10,10,"
/* Alignment, Margin[LRV] */
"0
\r\n
"
/* Encoding */
"0
\r\n
"
/* Encoding */
...
@@ -69,7 +69,7 @@ int ff_ass_subtitle_header(AVCodecContext *avctx,
...
@@ -69,7 +69,7 @@ int ff_ass_subtitle_header(AVCodecContext *avctx,
!
(
avctx
->
flags
&
AV_CODEC_FLAG_BITEXACT
)
?
AV_STRINGIFY
(
LIBAVCODEC_VERSION
)
:
""
,
!
(
avctx
->
flags
&
AV_CODEC_FLAG_BITEXACT
)
?
AV_STRINGIFY
(
LIBAVCODEC_VERSION
)
:
""
,
ASS_DEFAULT_PLAYRESX
,
ASS_DEFAULT_PLAYRESY
,
ASS_DEFAULT_PLAYRESX
,
ASS_DEFAULT_PLAYRESY
,
font
,
font_size
,
color
,
color
,
back_color
,
back_color
,
font
,
font_size
,
color
,
color
,
back_color
,
back_color
,
-
bold
,
-
italic
,
-
underline
,
alignment
);
-
bold
,
-
italic
,
-
underline
,
border_style
,
alignment
);
if
(
!
avctx
->
subtitle_header
)
if
(
!
avctx
->
subtitle_header
)
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
...
@@ -86,6 +86,7 @@ int ff_ass_subtitle_header_default(AVCodecContext *avctx)
...
@@ -86,6 +86,7 @@ int ff_ass_subtitle_header_default(AVCodecContext *avctx)
ASS_DEFAULT_BOLD
,
ASS_DEFAULT_BOLD
,
ASS_DEFAULT_ITALIC
,
ASS_DEFAULT_ITALIC
,
ASS_DEFAULT_UNDERLINE
,
ASS_DEFAULT_UNDERLINE
,
ASS_DEFAULT_BORDERSTYLE
,
ASS_DEFAULT_ALIGNMENT
);
ASS_DEFAULT_ALIGNMENT
);
}
}
...
...
libavcodec/ass.h
View file @
6d32628b
...
@@ -40,6 +40,7 @@
...
@@ -40,6 +40,7 @@
#define ASS_DEFAULT_ITALIC 0
#define ASS_DEFAULT_ITALIC 0
#define ASS_DEFAULT_UNDERLINE 0
#define ASS_DEFAULT_UNDERLINE 0
#define ASS_DEFAULT_ALIGNMENT 2
#define ASS_DEFAULT_ALIGNMENT 2
#define ASS_DEFAULT_BORDERSTYLE 1
/** @} */
/** @} */
/**
/**
...
@@ -61,7 +62,7 @@ int ff_ass_subtitle_header(AVCodecContext *avctx,
...
@@ -61,7 +62,7 @@ int ff_ass_subtitle_header(AVCodecContext *avctx,
const
char
*
font
,
int
font_size
,
const
char
*
font
,
int
font_size
,
int
color
,
int
back_color
,
int
color
,
int
back_color
,
int
bold
,
int
italic
,
int
underline
,
int
bold
,
int
italic
,
int
underline
,
int
alignment
);
int
border_style
,
int
alignment
);
/**
/**
* Generate a suitable AVCodecContext.subtitle_header for SUBTITLE_ASS
* Generate a suitable AVCodecContext.subtitle_header for SUBTITLE_ASS
...
...
libavcodec/ccaption_dec.c
View file @
6d32628b
...
@@ -145,7 +145,15 @@ static av_cold int init_decoder(AVCodecContext *avctx)
...
@@ -145,7 +145,15 @@ static av_cold int init_decoder(AVCodecContext *avctx)
/* taking by default roll up to 2 */
/* taking by default roll up to 2 */
ctx
->
mode
=
CCMODE_ROLLUP
;
ctx
->
mode
=
CCMODE_ROLLUP
;
ctx
->
rollup
=
2
;
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
)
{
if
(
ret
<
0
)
{
return
ret
;
return
ret
;
}
}
...
...
libavcodec/microdvddec.c
View file @
6d32628b
...
@@ -370,7 +370,8 @@ static int microdvd_init(AVCodecContext *avctx)
...
@@ -370,7 +370,8 @@ static int microdvd_init(AVCodecContext *avctx)
}
}
return
ff_ass_subtitle_header
(
avctx
,
font_buf
.
str
,
font_size
,
color
,
return
ff_ass_subtitle_header
(
avctx
,
font_buf
.
str
,
font_size
,
color
,
ASS_DEFAULT_BACK_COLOR
,
bold
,
italic
,
ASS_DEFAULT_BACK_COLOR
,
bold
,
italic
,
underline
,
alignment
);
underline
,
ASS_DEFAULT_BORDERSTYLE
,
alignment
);
}
}
AVCodec
ff_microdvd_decoder
=
{
AVCodec
ff_microdvd_decoder
=
{
...
...
libavcodec/movtextdec.c
View file @
6d32628b
...
@@ -413,7 +413,8 @@ static int mov_text_init(AVCodecContext *avctx) {
...
@@ -413,7 +413,8 @@ static int mov_text_init(AVCodecContext *avctx) {
if
(
ret
==
0
)
{
if
(
ret
==
0
)
{
return
ff_ass_subtitle_header
(
avctx
,
m
->
d
.
font
,
m
->
d
.
fontsize
,
m
->
d
.
color
,
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
.
back_color
,
m
->
d
.
bold
,
m
->
d
.
italic
,
m
->
d
.
underline
,
m
->
d
.
alignment
);
m
->
d
.
underline
,
ASS_DEFAULT_BORDERSTYLE
,
m
->
d
.
alignment
);
}
else
}
else
return
ff_ass_subtitle_header_default
(
avctx
);
return
ff_ass_subtitle_header_default
(
avctx
);
}
}
...
...
tests/ref/fate/sub-cc
View file @
6d32628b
...
@@ -6,7 +6,7 @@ PlayResY: 288
...
@@ -6,7 +6,7 @@ PlayResY: 288
[V4+ Styles]
[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,
1
,1,0,2,10,10,10,0
Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,
3
,1,0,2,10,10,10,0
[Events]
[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment