Skip to content

decklink: Support different frame rate on decklink output#6492

Draft
norihiro wants to merge 5 commits intoobsproject:masterfrom
norihiro:deckout-different-video-sample
Draft

decklink: Support different frame rate on decklink output#6492
norihiro wants to merge 5 commits intoobsproject:masterfrom
norihiro:deckout-different-video-sample

Conversation

@norihiro
Copy link
Contributor

@norihiro norihiro commented May 16, 2022

Description

Dependency:

Support different video frame rates on Decklink output.

  • When the frame rate of decklink output is larger than that of OBS, frames will be duplicated to output enough frames.
  • When the frame rate of decklink output is smaller than that of OBS, frames will be decimated.

This PR is based on the other PR #1865. The PR #1865 should be merged earlier than this PR. Please have a look at the last commit of this PR.

Motivation and Context

I want to set different frame rate on decklink output than OBS's frame rate.

On Intensity Pro 4K, it is required to set 525i59.94 for analog composite output but different sampling rate is required for streaming.

How Has This Been Tested?

  • Set 720p50 on decklink output, set OBS's frame rate to 30 fps, confirmed there is no Late Frame log message.
  • Set 1080p24 on decklink output, set OBS's frame rate to 30 fps, confirmed the number of buffered video frames does not increase.
  • Set 1080p30 on decklink output, set OBS's frame rate to 30 fps, confirmed one frame is output for every OBS's frame.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@norihiro norihiro marked this pull request as draft May 16, 2022 14:35
@norihiro
Copy link
Contributor Author

One design choice I have not decided yet is how to determine the number of frames to duplicate (nFrame in the code).
In this PR, I calculate based on the difference of frame rates for OBS and decklink-output.
Another idea I have, but not implemented in above commit, is monitoring GetBufferedVideoFrameCount and feedback to nFrame. This will not robust for the fluctuation of rendering time. However, it will compensate gradual increase of buffering on the devices without the ability of the timing adjustment (bmdDeckLinkConfigClockTimingAdjustment). Doing so, also need to implement something similar on WriteAudio.

@cg2121 cg2121 added the Enhancement Improvement to existing functionality label May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Improvement to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants