mediamtx icon indicating copy to clipboard operation
mediamtx copied to clipboard

NVENC - DTS is not monotonically increasing

Open cnieuweboer opened this issue 2 years ago • 4 comments

Which version are you using?

v19.0.1 (and up)

Which operating system are you using?

  • [ ] Linux amd64 standard
  • [ ] Linux amd64 Docker
  • [ ] Linux arm64 standard
  • [ ] Linux arm64 Docker
  • [ ] Linux arm7 standard
  • [ ] Linux arm7 Docker
  • [ ] Linux arm6 standard
  • [ ] Linux arm6 Docker
  • [x] Windows amd64 standard
  • [ ] Windows amd64 Docker (WSL backend)
  • [ ] macOS amd64 standard
  • [ ] macOS amd64 Docker
  • [ ] Other (please describe)

Describe the issue

OBS using the Nvidia encoder NVENC results in an error message (with different times of course) "closed (DTS is not monotonically increasing, was 3.9s, now is 3.799333334s)". This happens a few seconds after the stream is played out with any rtmp capable media player.

I tested MPC-HC 1.9.23 and VLC 3.0.17.2. Also tested multiple Nvidia drivers (latest versions 517.46, previous versions 516.94 and 516.59), and multiple OBS version including the latest 28.0.2. Tested all sorts of Nvidia encoder settings in OBS, VBR, CBR, CQP, keyframe at 0 or 2, lookahead and visual tuning enabled or disabled. Tested on different computers, one using a GTX1080ti videocard and one using an RTX3090.

That all didn't make any difference. Using the x264 encoder in OBS works fine. Server version before 19.0.1 work fine.

Describe how to replicate the issue

  1. start the server version 19.0.1 or higher
  2. publish with OBS Studio using Nvidia (NVENC)
  3. read with any rtmp capable media player

Did you attach the server logs?

no

Did you attach a network dump?

yes rtmp-dts.zip

cnieuweboer avatar Sep 28 '22 16:09 cnieuweboer

Exact same problem here.

binxie33 avatar Oct 01 '22 02:10 binxie33

Same issue here on 0.20.0. 0.19.0 does not have this issue.

Perhaps related to 9bd8b2cfb6279ec42e9722a1a7c74d07efeb60d5

uniflare avatar Oct 11 '22 16:10 uniflare

Version 0.20.2 works for me.

cnieuweboer avatar Nov 08 '22 00:11 cnieuweboer

0.20.2 isn't perfect afterall. It works much much better, but it can still fail with the same error message.

cnieuweboer avatar Nov 09 '22 21:11 cnieuweboer

moved to #1002 since the PTS-to-DTS algorithm is the same in both RTMP and HLS.

aler9 avatar Aug 08 '23 11:08 aler9

This issue is being locked automatically because it has been closed for more than 6 months. Please open a new issue in case you encounter a similar problem.

github-actions[bot] avatar Feb 10 '24 15:02 github-actions[bot]