Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
08d149d6
Commit
08d149d6
authored
Dec 31, 2012
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/subtitles: support charenc option.
parent
3a0a959d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
filters.texi
doc/filters.texi
+4
-0
vf_ass.c
libavfilter/vf_ass.c
+7
-1
No files found.
doc/filters.texi
View file @
08d149d6
...
...
@@ -4678,6 +4678,10 @@ Set the filename of the subtitle file to read. It must be specified.
Specify the size of the original video, the video for which the ASS file
was composed. Due to a misdesign in ASS aspect ratio arithmetic, this is
necessary to correctly scale the fonts if the aspect ratio has been changed.
@item charenc
Set subtitles input character encoding. @code{subtitles} filter only. Only
useful if not UTF-8.
@end table
If the first key is not specified, it is assumed that the first value
...
...
libavfilter/vf_ass.c
View file @
08d149d6
...
...
@@ -50,6 +50,7 @@ typedef struct {
ASS_Renderer
*
renderer
;
ASS_Track
*
track
;
char
*
filename
;
char
*
charenc
;
uint8_t
rgba_map
[
4
];
int
pix_step
[
4
];
///< steps per pixel for each plane of the main output
int
original_w
,
original_h
;
...
...
@@ -253,6 +254,7 @@ AVFilter avfilter_vf_ass = {
static
const
AVOption
subtitles_options
[]
=
{
COMMON_OPTIONS
{
"charenc"
,
"set input character encoding"
,
OFFSET
(
charenc
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
CHAR_MIN
,
CHAR_MAX
,
FLAGS
},
{
NULL
},
};
...
...
@@ -261,6 +263,7 @@ AVFILTER_DEFINE_CLASS(subtitles);
static
av_cold
int
init_subtitles
(
AVFilterContext
*
ctx
,
const
char
*
args
)
{
int
ret
,
sid
;
AVDictionary
*
codec_opts
=
NULL
;
AVFormatContext
*
fmt
=
NULL
;
AVCodecContext
*
dec_ctx
=
NULL
;
AVCodec
*
dec
=
NULL
;
...
...
@@ -306,7 +309,9 @@ static av_cold int init_subtitles(AVFilterContext *ctx, const char *args)
avcodec_get_name
(
dec_ctx
->
codec_id
));
return
AVERROR
(
EINVAL
);
}
ret
=
avcodec_open2
(
dec_ctx
,
dec
,
NULL
);
if
(
ass
->
charenc
)
av_dict_set
(
&
codec_opts
,
"sub_charenc"
,
ass
->
charenc
,
0
);
ret
=
avcodec_open2
(
dec_ctx
,
dec
,
&
codec_opts
);
if
(
ret
<
0
)
goto
end
;
...
...
@@ -341,6 +346,7 @@ static av_cold int init_subtitles(AVFilterContext *ctx, const char *args)
}
end:
av_dict_free
(
&
codec_opts
);
if
(
dec_ctx
)
avcodec_close
(
dec_ctx
);
if
(
fmt
)
...
...
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