Synchronous hook for frame change

Open
#9,745 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
c, lua
Domain
api, cli

Research direction

Start by reviewing mpv's existing hook API and the Lua mp.observe_property("time-pos") behavior described in the issue. Determine how a synchronous frame-change hook would interact with the requested aspect-ratio and vertical-shift updates; the work is done when those changes reliably apply to the intended frame.

Written by the indexing model from the issue text.

Description

meta:feature-request

Before requesting a new feature make sure it hasn't been requested yet.
https://github.com/mpv-player/mpv/labels/meta%3Afeature-request

Expected behavior of the wanted feature

I need a hook for frame change that is executed synchronusly.

Alternative behavior of the wanted feature
Log file

I wrote a LUA script to change the aspect ratio and vertical shift based on a meta data file in the movie directory. The reason is to handle movies and shows with changing aspect ratios properly. Automatic cropping is not an option at all, because on some movies (e.g. from Christopher Nolan) I have to select the correct frame (center is not always correct) for my 2.4:1 constant height screen. So the correct framing has to be evaluated manually and written to a file once.

My problem is that mp.observe_property("time-pos") is asynchronous and the change of zoom/shift doesn't always hit the desired frame. Sometimes it comes one frame too late and so on. So I ask for a synchronous hook or an option to make observe_property() synchronous. Thank you.

Dominant language
C
Stars
37k
Forks
3.5k
Avg merge
1d 10h
Merged PRs (30d)
22

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mpv-player/mpv

All issues in mpv-player/mpv

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.