Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

obs_source_media_set_time is inaccurate #11680

Closed
chnoma opened this issue Dec 29, 2024 · 0 comments
Closed

obs_source_media_set_time is inaccurate #11680

chnoma opened this issue Dec 29, 2024 · 0 comments

Comments

@chnoma
Copy link

chnoma commented Dec 29, 2024

Operating System Info

Other

Other OS

Endeavour OS / Arch Linux

OBS Studio Version

Other

OBS Studio Version (Other)

31.0.0 via AUR

OBS Studio Log URL

https://obsproject.com/logs/OERJPFBG4NSg3gCK

OBS Studio Crash Log URL

No response

Expected Behavior

When setting via obs-websocket, I expected the video to be able to seek to sub-second intervals.

Current Behavior

The video seeks to fixed intervals, which I believe to align with key frames.

Steps to Reproduce

  1. Open OBS
  2. Add a Media Source
  3. Enable the websocket server
  4. Connect to the websocket server via any method you prefer
  5. Issue a "SetMediaInputCursor" command at a small number
  6. Verify the media source snaps to zero, instead of the intended time
  7. Repeat at larger intervals to determine the 'step size' for the particular video
    ...

Anything else we should know?

I ran into this issue while using OBS Websocket and looked into it further.
Here, it can be seen that the requested time is passed to libobs unmodified, so I don't think it's an issue with the websocket.
If there's another way to call this function directly, I would appreciate the confirmation.

I'm not at all experienced in either FFmpeg or OBS code, but I believe the issue comes from seek_to in the media-playback library, specifically here. AVSEEK_FLAG_BACKWARD is passed to av_seek_frame, which causes it to roll back to the closest keyframe to seek_target.

@chnoma chnoma closed this as completed Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant