Skip to content

Commit

Permalink
Use correct fps mpv option
Browse files Browse the repository at this point in the history
In mpv 0.37.0 the `fps` option/property was renamed to
`container-fps-override` [0][1], and a compatibility alias was added so
both the new and old names worked. In the recently released mpv 0.39.0
that compatibility alias was removed [2][3], using the old name does not
work any more. Since VideoCut is currently using the old name, it does
currently not work with the latest mpv release.

mpv 0.37.0 was released in November 2023, so it is less than a year old.
Most distributions (like Debian stable) will ship a mpv version that
requires the old name, while other (like Arch) already ship a version that
requires the new name, which makes it necessary to support both names.

The solution is a simple version check to decide which name to use. I
choose 0.39.0 as the switch-over point, as to not change the current
behaviour.

[0] https://github.com/mpv-player/mpv/blob/release/0.37/DOCS/interface-changes.rst?plain=1#L103
[1] mpv-player/mpv@7aed492
[2] https://github.com/mpv-player/mpv/blob/release/0.39/DOCS/interface-changes.rst?plain=1#L41
[3] mpv-player/mpv@6e3d90d
  • Loading branch information
corubba committed Oct 6, 2024
1 parent f37cb88 commit 411660b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/MpvPlayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,8 @@ def setFPS(self,newFPS):
self.fps=newFPS
self.framecount=self.duration*newFPS #framecount prop not reliable
#often a difference between the mpv fps and the fmmpeg fps
self.mediaPlayer["fps"]=newFPS
property_name='container-fps-override' if self.mediaPlayer.mpv_version_tuple >= (0,39,0) else 'fps'
self.mediaPlayer[property_name]=newFPS

'''
def _onFps(self,name,val):
Expand Down

0 comments on commit 411660b

Please sign in to comment.