mirror of
https://github.com/mpv-player/mpv
synced 2025-02-01 20:52:05 +00:00
sub: add option for stretching image subtitles to screen
Probably makes users happy who want bitmap subtitles to show up in the screen margins, and stops them from doing idiotic crap with vf_expand. Fixes #2098.
This commit is contained in:
parent
5594333337
commit
57043d9269
@ -20,6 +20,7 @@ Interface changes
|
||||
::
|
||||
|
||||
--- mpv 0.10.0 will be released ---
|
||||
- add --stretch-image-subs-to-screen
|
||||
- add "playlist/N/title" property
|
||||
- add --video-stereo-mode=no to disable auto-conversions
|
||||
- add --force-seekable, and change default seekability in some cases
|
||||
|
@ -1388,6 +1388,18 @@ Subtitles
|
||||
|
||||
Disabled by default.
|
||||
|
||||
``--stretch-image-subs-to-screen=<yes|no>``
|
||||
Stretch DVD and other image subtitles to the screen, ignoring the video
|
||||
margins. This has a similar effect as ``--sub-use-margins`` for text
|
||||
subtitles, except that the text itself will be stretched, not only just
|
||||
repositioned. (At least in general it is unavoidable, as an image bitmap
|
||||
can in theory consist of a single bitmap covering the whole screen, and
|
||||
the player won't know where exactly the text parts are located.)
|
||||
|
||||
This option does not display subtitles correctly. Use with care.
|
||||
|
||||
Disabled by default.
|
||||
|
||||
``--sub-ass``, ``--no-sub-ass``
|
||||
Render ASS subtitles natively (enabled by default).
|
||||
|
||||
|
@ -331,6 +331,7 @@ const m_option_t mp_opts[] = {
|
||||
OPT_FLAG("sub-visibility", sub_visibility, 0),
|
||||
OPT_FLAG("sub-forced-only", forced_subs_only, 0),
|
||||
OPT_FLAG("stretch-dvd-subs", stretch_dvd_subs, 0),
|
||||
OPT_FLAG("stretch-image-subs-to-screen", stretch_image_subs, 0),
|
||||
OPT_FLAG("sub-fix-timing", sub_fix_timing, 0),
|
||||
OPT_CHOICE("sub-auto", sub_auto, 0,
|
||||
({"no", -1}, {"exact", 0}, {"fuzzy", 1}, {"all", 2})),
|
||||
|
@ -187,6 +187,7 @@ typedef struct MPOpts {
|
||||
float sub_speed;
|
||||
int forced_subs_only;
|
||||
int stretch_dvd_subs;
|
||||
int stretch_image_subs;
|
||||
|
||||
int sub_fix_timing;
|
||||
char *sub_cp;
|
||||
|
@ -272,6 +272,8 @@ static void get_bitmaps(struct sd *sd, struct mp_osd_res d, double pts,
|
||||
}
|
||||
if (priv->avctx->codec_id == AV_CODEC_ID_HDMV_PGS_SUBTITLE)
|
||||
video_par = -1;
|
||||
if (opts->stretch_image_subs)
|
||||
d.ml = d.mr = d.mt = d.mb = 0;
|
||||
int insize[2];
|
||||
get_resolution(sd, insize);
|
||||
osd_rescale_bitmaps(res, insize[0], insize[1], d, video_par);
|
||||
|
Loading…
Reference in New Issue
Block a user