History

video: make --deinterlace and HW deinterlace filters always deinterlace

Before this, we made deinterlacing dependent on the video codec metadata (AVFrame.interlaced_frame for libavcodec). So even if --deinterlace=yes was set, we skipped deinterlacing if the flag wasn't set. This is very unreliable and there are many streams with flags incorrectly set. The potential problem is that this might upset people who alwase enabled deinterlace and hoped it worked. But it's likely these people were screwed by this setting anyway. The new behavior is less tricky and easier to understand, and this preferable. Maybe one day we could introduce a --deinterlace=auto, which does the right thing, but of course this would be hard to implement (esecially with hwdec). Fixes #5219.

wm4 committed 8 years ago

Commit 830f0ae1 parent 1dcf5117 files · +13 −8Browse files

Unified · Split

7 files
  1. DOCS/interface-changes.rst +3 −0
  2. DOCS/man/options.rst +2 −0
  3. DOCS/man/vf.rst +4 −4
  4. filters/f_auto_filters.c +1 −1
  5. video/filter/vf_d3d11vpp.c +1 −1
  6. video/filter/vf_vavpp.c +1 −1
  7. video/filter/vf_vdpaupp.c +1 −1
DOCS/interface-changes.rst+3−0
@@ -72,6 +72,9 @@ Interface changes · 71 unmodified lines
7272 will probably stall.
7373 - deprecate the OpenGL cocoa backend, option choice --gpu-context=cocoa
7474 when used with --gpu-api=opengl (use --vo=opengl-cb)
75+ - make --deinterlace=yes always deinterlace, instead of trying to check
76+ certain unreliable video metadata. Also flip the defaults of all builtin
77+ HW deinterlace filters to always deinterlace.
7578 --- mpv 0.28.0 ---
7679 - rename --hwdec=mediacodec option to mediacodec-copy, to reflect
7780 conventions followed by other hardware video decoding APIs
DOCS/man/options.rst+2−0
@@ -1036,6 +1036,8 @@ Video · 1035 unmodified lines
10361036 ``--deinterlace=auto`` was removed, which used to mean that the default
10371037 interlacing option of possibly inserted video filters was used.)
10381038
1039+ Note that this will make video look worse if it's not actually interlaced.
1040+
10391041 ``--frames=<number>``
10401042 Play/convert only first ``<number>`` video frames, then quit.
10411043
DOCS/man/vf.rst+4−4
@@ -488,8 +488,8 @@ Available mpv-only filters are: · 487 unmodified lines
488488 mpv bugs.
489489
490490 ``<interlaced-only>``
491− :no: Deinterlace all frames.
492− :yes: Only deinterlace frames marked as interlaced (default).
491+ :no: Deinterlace all frames (default).
492+ :yes: Only deinterlace frames marked as interlaced.
493493
494494 ``reversal-bug=<yes|no>``
495495 :no: Use the API as it was interpreted by older Mesa drivers. While
@@ -544,7 +544,7 @@ Available mpv-only filters are: · 48 unmodified lines
544544 Try to apply inverse telecine, needs motion adaptive temporal
545545 deinterlacing.
546546 ``interlaced-only=<yes|no>``
547− If ``yes`` (default), only deinterlace frames marked as interlaced.
547+ If ``yes``, only deinterlace frames marked as interlaced (default: no).
548548 ``hqscaling=<0-9>``
549549 0
550550 Use default VDPAU scaling (default).
@@ -558,7 +558,7 @@ Available mpv-only filters are: · 7 unmodified lines
558558 ``deint=<yes|no>``
559559 Whether deinterlacing is enabled (default: no).
560560 ``interlaced-only=<yes|no>``
561− If ``yes`` (default), only deinterlace frames marked as interlaced.
561+ If ``yes``, only deinterlace frames marked as interlaced (default: no).
562562 ``mode=<blend|bob|adaptive|mocomp|ivctc|none>``
563563 Tries to select a video processor with the given processing capability.
564564 If a video processor supports multiple capabilities, it is not clear
filters/f_auto_filters.c+1−1
@@ -76,7 +76,7 @@ static void deint_process(struct mp_filter *f) · 75 unmodified lines
7676 p->sub.filter =
7777 mp_create_user_filter(f, MP_OUTPUT_CHAIN_VIDEO, "d3d11vpp", NULL);
7878 } else if (mp_sws_supports_input(img->imgfmt)) {
79− char *args[] = {"mode", "send_field", "deint", "interlaced", NULL};
79+ char *args[] = {"mode", "send_field", NULL};
8080 p->sub.filter =
8181 mp_create_user_filter(f, MP_OUTPUT_CHAIN_VIDEO, "yadif", args);
8282 } else {
video/filter/vf_d3d11vpp.c+1−1
@@ -532,7 +532,7 @@ const struct mp_user_filter_entry vf_d3d11vpp = { · 531 unmodified lines
532532 .priv_size = sizeof(OPT_BASE_STRUCT),
533533 .priv_defaults = &(const OPT_BASE_STRUCT) {
534534 .deint_enabled = 1,
535− .interlaced_only = 1,
535+ .interlaced_only = 0,
536536 .mode = D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_BOB,
537537 },
538538 .options = vf_opts_fields,
video/filter/vf_vavpp.c+1−1
@@ -475,7 +475,7 @@ const struct mp_user_filter_entry vf_vavpp = { · 474 unmodified lines
475475 .priv_size = sizeof(OPT_BASE_STRUCT),
476476 .priv_defaults = &(const OPT_BASE_STRUCT){
477477 .deint_type = 2,
478− .interlaced_only = 1,
478+ .interlaced_only = 0,
479479 .reversal_bug = 1,
480480 },
481481 .options = vf_opts_fields,
video/filter/vf_vdpaupp.c+1−1
@@ -180,7 +180,7 @@ static const m_option_t vf_opts_fields[] = { · 179 unmodified lines
180180 OPT_FLOATRANGE("denoise", opts.denoise, 0, 0, 1),
181181 OPT_FLOATRANGE("sharpen", opts.sharpen, 0, -1, 1),
182182 OPT_INTRANGE("hqscaling", opts.hqscaling, 0, 0, 9),
183− OPT_FLAG("interlaced-only", interlaced_only, 0, OPTDEF_INT(1)),
183+ OPT_FLAG("interlaced-only", interlaced_only, 0),
184184 {0}
185185 };
186186

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t