mpv icon indicating copy to clipboard operation
mpv copied to clipboard

60FPS Frame Interpolation Problem

Open lubuntulux opened this issue 11 years ago • 51 comments

Hi there!

I have recently stumbled upon mpv's frame interpolation functionality and cannot seem to make it work. http://www.reddit.com/r/linux/comments/2u3bpw/mpv_ver_073_can_interpolate_videos_to_60fps/ https://launchpad.net/~mc3man/+archive/ubuntu/mpv-tests

My setup: Lubuntu 14.04 , nvidia-352 xorg, GTX 750 TI, i3 4330, compiz and 42" Bravia TV Mpv (ffmpeg version), ffmpeg and x264 have been downloaded from mc3man's ppa as instructed by the post.

I have also used every code variation suggested by the OP and other members, both in the mpv.conf and directly from the terminal with -- .

For example:

vo=opengl:smoothmotion:smoothmotion-threshold=0.0 hwdec=no display-fps=60

I constantly get the following mpv output when I run it:

"[vo/opengl] Warning: option smoothmotion was replaced with interpolation and might be removed in the future. [vo/opengl] Warning: option smoothmotion-threshold was replaced with tscale-param1 and might be removed in the future."

I generally cannot detect a difference in image behavior with the interpolation option on/off.

I have also tried disabling composite.

Could I be missing some packages or depdencies, necessary for mpv to function properly? It's really frustrating since a lot of people seem to have been able to set it up.

Hopefully someone can help me out.

http://textuploader.com/wqxh

Regards

lubuntulux avatar Jun 16 '15 19:06 lubuntulux

I'm not immediately sure what could have gone wrong.

CC @haasn

ghost avatar Jun 16 '15 19:06 ghost

Holy shit that reddit thread is full of misinformation.

[vo/opengl] Warning: option smoothmotion was replaced with interpolation and might be removed in the future.

Well yes, “smoothmotion” doesn't exist anymore.

I generally cannot detect a difference in image behavior with the interpolation option on/off.

You could try posting a log with mpv -v --msg-level=vo=debug. Apart from that, there's nothing I can do to help you without knowing more specifics.

Could I be missing some packages or depdencies, necessary for mpv to function properly?

No, it requires no external dependencies.

haasn avatar Jun 16 '15 19:06 haasn

@haasn : thanks for the quick reply, here's the log:

jackson@jackson:~$ mpv -v --msg-level=vo=debug [cplayer] Command line options: '-v' '--msg-level=vo=debug' [cplayer] mpv git-f72028d (C) 2000-2015 mpv/MPlayer/mplayer2 projects [cplayer] built on 2015-06-09T04:39:21 [cplayer] ffmpeg library versions: [cplayer] libavutil 54.27.100 [cplayer] libavcodec 56.41.101 [cplayer] libavformat 56.34.100 [cplayer] libswscale 3.1.101 [cplayer] libavfilter 5.16.101 [cplayer] libswresample 1.2.100 [cplayer] [cplayer] Configuration: ./waf configure --enable-cdda --enable-pdf-build --prefix=/usr --confdir=/etc/mpv [cplayer] List of enabled features: alsa asm atomic-builtins atomics audio-input av-pix-fmt-mmal avcodec-chroma-pos-api avframe-metadata avframe-skip-samples build-date cdda cplayer debug-build dlopen drm dvbin dvdnav dvdread enca encoding fchmod gl gl-x11 glibc-thread-name glob iconv jack jpeg ladspa lcms2 libass libass-osd libav libavdevice libavfilter libbluray libbs2b libdl libguess libm librt libsmbclient libswresample libv4l2 linux-fstatfs lua nanosleep optimize oss-audio oss-audio-native posix posix-or-mingw posix-spawn pthreads pulse pvr resampler rubberband shm subprocess termios tv tv-v4l2 vaapi vaapi-glx vaapi-hwaccel vaapi-vpp vdpau vdpau-gl-x11 vdpau-hwaccel videodev vt.h x11 xext xinerama xrandr xss xv zlib [global] config path: '' -> '/home/jackson/.config/mpv' [global] config path: 'mpv.conf' -> '/home/jackson/.config/mpv/mpv.conf' [global] config path: 'config' -/-> '/home/jackson/.config/mpv/config' [global] config path: 'mpv.conf' -/-> '/home/jackson/.mpv/mpv.conf' [global] config path: 'config' -/-> '/home/jackson/.mpv/config' [global] config path: 'mpv.conf' -/-> '/etc/mpv/mpv.conf' [global] config path: 'config' -/-> '/etc/mpv/config' [cplayer] Reading config file /home/jackson/.config/mpv/mpv.conf [cplayer] Setting option 'vo' = 'opengl:smoothmotion:smoothmotion-threshold=0.0' (flags = 4) [cplayer] Warning: option smoothmotion was replaced with interpolation and might be removed in the future. [cplayer] Warning: option smoothmotion-threshold was replaced with tscale-param1 and might be removed in the future. [cplayer] Setting option 'hwdec' = 'no' (flags = 4) [cplayer] Setting option 'display-fps' = '60' (flags = 4) [cplayer] Setting option 'v' = '' (flags = 8) [cplayer] Setting option 'msg-level' = 'vo=debug' (flags = 8) [cplayer] mpv git-f72028d (C) 2000-2015 mpv/MPlayer/mplayer2 projects [cplayer] built on 2015-06-09T04:39:21 [cplayer] ffmpeg library versions: [cplayer] libavutil 54.27.100 [cplayer] libavcodec 56.41.101 [cplayer] libavformat 56.34.100 [cplayer] libswscale 3.1.101 [cplayer] libavfilter 5.16.101 [cplayer] libswresample 1.2.100 [cplayer] [cplayer] Usage: mpv [options] [url|path/]filename [cplayer] [cplayer] Basic options: [cplayer] --start=

lubuntulux avatar Jun 16 '15 19:06 lubuntulux

What I meant was: You need to use those options while actually playing back a file.

haasn avatar Jun 16 '15 19:06 haasn

Here's the log of a 1080p mkv: http://textuploader.com/n3cb

lubuntulux avatar Jun 16 '15 20:06 lubuntulux

Seems like it was working fine, at least until you paused.

haasn avatar Jun 16 '15 20:06 haasn

Can I use the debug command in conjunction with an interpolation parameter, in order for you review that log as well? Is it possible for you to determine anything from the previous log, in terms of why interpolation isn't working?

lubuntulux avatar Jun 16 '15 20:06 lubuntulux

Could it actually be, that interpolation is working, while my understanding of the process and subsequent image result and behavior is simply flawed?

I am comparing the output and "smoothness" to SVP on windows.

When using the interpolation command, the image is clear and smooth, as if I had turned down the refresh rate of my monitor to 24hz, in order to match the fps of the mkv, which is what I normally do on Linux. My monitor is set to 60hz, though. I should also note, that the image looks exactly the same, when not using the interpolation command.

However, it certainly does not seem to have achieved the level of smoothness one would expect from 60FPS video, regarding SVP etc.

lubuntulux avatar Jun 16 '15 20:06 lubuntulux

SVP and mpv's interpolation are not the same thing: https://github.com/mpv-player/mpv/wiki/Interpolation So comparing them is not really useful.

Argon- avatar Jun 16 '15 21:06 Argon-

Thank you for that link.

I understand, that it does not use the same interpolation process as SVP, hence producing a different image and behavior, however it still does not look anything like 60FPS video.

What else can I do to figure out this problem? I have read that people downgraded mesa in order to run mpv's frame interpolation properly. Could it be a problem with my kernel or version of Ubuntu?

I am quite stranded here.

lubuntulux avatar Jun 16 '15 21:06 lubuntulux

@haasn: Hab grad gesehen dass du ein Deutscher bist.:-) Du scheinst mir wirklich Ahnung von der Materie zu haben, und ich möchte es mir einfach nicht antun im unfreundlichen ubuntu DE Forum nach der Antwort zu betteln.

Fällt dir nichts mehr ein?

lubuntulux avatar Jun 16 '15 21:06 lubuntulux

the image is clear and smooth, as if I had turned down the refresh rate of my monitor to 24hz

Sounds like it's working as intended then.

haasn avatar Jun 16 '15 22:06 haasn

Yes, but the image looks exactly the same when I do not enter any interpolation parameters, which leads me to believe, that it isn't working as intended.

What else could I check for? Any other logs or data to provide?

lubuntulux avatar Jun 16 '15 22:06 lubuntulux

You are playing back a 24 Hz file on a 60 Hz monitor with interpolation turned off and it looks just as smooth?

haasn avatar Jun 16 '15 22:06 haasn

Yes, exactly the same.

When I just enter mpv /file path it looks the same as mpv --vo=opengl-hq:interpolation /file path. (If not slightly better).

lubuntulux avatar Jun 16 '15 22:06 lubuntulux

The image actually seems slightly smoother and displays less judder when I don't use any interpolation options.

Without interpolation options, it is as if I had turned down my monitor's refresh rate to 24hz, in order to match the file's fps, which is what I normally do with other players, so I know what it looks like.

When I turn it on, there is clear judder and lagging during panning shots and fast scenes, which does not occur when disabled.

lubuntulux avatar Jun 16 '15 23:06 lubuntulux

The image actually seems slightly smoother and displays less judder when I don't use any interpolation options.

Maybe your GPU is too slow.

ghost avatar Jun 17 '15 07:06 ghost

I strongly doubt that, seeing as I use a GTX750TI. My CPU (i3 4330 Dual Core) usage stays below 10% and GPU usage below 7% when interpolation options are added. The process is not initiated, and I simply cannot figure out why.

You have advised another member to verify whether vsynch might be occupied by compiz and hence unobtainable for mpv to use. I have SynchToVBlank enabled both in my Nvidia-Settings and Compiz, and will try to turn it off in the latter.
I have also edited my xorg.conf in order to enable Performance Mode and TripleBuffering. I will try to disable those as well.

Edit: DIsabling SynchtoVBlank or Composite and OpenGl settings in compiz did not help. Also disabling Triplebuffering and performance mode had no effect.

Do you have any other ideas?

lubuntulux avatar Jun 17 '15 08:06 lubuntulux

Here the output when I add an interpolation option: Interpolation isn't even mentioned.

jackson@jackson:~$ mpv --vo=opengl-hq:interpolation /media/jackson/b7d573e4-b6f9-42a9-bf71-1c9935c57738/abc.mkv Playing: /media/jackson/b7d573e4-b6f9-42a9-bf71-1c9935c57738/abc.mkv (+) Video --vid=1 (h264) (+) Audio --aid=1 --alang=ger () (ac3) Audio --aid=2 --alang=eng (dts) (+) Subs --sid=1 --slang=ger () (sub) AO: [pulse] 48000Hz 5.1(side) 6ch float VO: [opengl-hq] 1920x800 yuv420p AV: 00:00:49 / 01:41:35 (0%) A-V: 0.000

lubuntulux avatar Jun 17 '15 08:06 lubuntulux

This guy seemed to have the exact same problem and hardware. https://github.com/mpv-player/mpv/issues/1645

He stated, that he solved the problem with " vaapi-copy+opengl" and later on the 0.8.2 version of mpv. (What does he mean by that?)

Quote: "i managed to test another system, it is an i3-3110M with an intel HD4000 on board. While it confirmed my old findings (vdpau+opengl:smoothmotion not working), i managed to try vaapi-copy+opengl and there smoothmotion worked (even with the hq preset), while it failed on vaapi+opengl"

He also mentioned an additional parameter "speed", that made my video look exactly like 60FPS, without any skipped frames, judder or lag at all. --hwdec=vdpau --vo=opengl:smoothmotion --speed=2

lubuntulux avatar Jun 17 '15 12:06 lubuntulux