Skip to content

Bug: SetMediaInputCursor not accurate for Media Source #1190

Open

Description

@casperboone

Operating System Info

Other

Other OS

macOS 14.1.1

OBS Studio Version

Other

OBS Studio Version (Other)

30.0.2

obs-websocket Version

5.1.0

OBS Studio Log URL

https://obsproject.com/logs/JsPbzqbyrpKDSjQQ

OBS Studio Crash Log URL

No response

Expected Behavior

I would like to seek to very specific positions in a video. For instance 28442 ms (possibly rounded to a frame).

I would to play out video with alpha so I cannot use the VLC video source.

Current Behavior

Using a Media Source, the following happens:

Seeking to  20000
-> Result:  20040
Seeking to  20210
-> Result:  20040
Seeking to  20290
-> Result:  20040
Seeking to  20450
-> Result:  20040
Seeking to  28242
-> Result:  26600
Seeking to  32242
-> Result:  32280
Seeking to  36242
-> Result:  36280

Using a VLC Video Source, the following correct behavior happens:

Seeking to  20000
-> Result:  20000
Seeking to  20210
-> Result:  20210
Seeking to  20290
-> Result:  20290
Seeking to  20450
-> Result:  20450
Seeking to  28242
-> Result:  28242
Seeking to  32242
-> Result:  32242
Seeking to  36242
-> Result:  36242

Steps to Reproduce

  1. Create a video source
  2. Call SetMediaInputCursor with a position (with milisecond precision)
  3. Call GetMediaInputStatus to verify the result by reading mediaCursor

Anything else we should know?

Not sure if this an OBS websocket issue or that OBS has an inaccurate implementation of setting the input cursor.

Activity

  1. lrq51678 commented on Mar 30, 2024

    @lrq51678

    Hello,has this problem been resolved? I have also experienced this situation

  2. jwetzell commented on Sep 19, 2024

    @jwetzell

    I see very similar behavior when receiving the mediaCursor time as well as well. I loaded a media source to 1:30 and it is reporting a mediaCursor value of 83500? that seems 3 seconds off.

  3. chnoma commented on Dec 29, 2024

    @chnoma

    This is still an issue. For me it seems to be snapping to three second increments, rounded down, e.g.:
    0 -> 0
    1500 -> 0
    2500 -> 0
    3000 -> 3000
    5500 -> 3000
    6000 -> 6000
    and so on

    OBS Version: 31.0.0
    Operating system: EndeavourOS / Linux
    Websocket Version: 5.5.4

  4. chnoma commented on Dec 29, 2024

    @chnoma

    After looking into it and doing a couple tests, I don't think this has much to do with obs-websocket.
    The issue seems to come from using AVSEEK_FLAG_BACKWARD here:
    https://github.com/obsproject/obs-studio/blob/a0e4e3734126a7e76a871fa671be952de5c13dd8/shared/media-playback/media-playback/media.c#L531

    To work as intended I think it would need to seek forward after doing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions