mediamtx
mediamtx copied to clipboard
NVENC - DTS is not monotonically increasing
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
- start the server version 19.0.1 or higher
- publish with OBS Studio using Nvidia (NVENC)
- read with any rtmp capable media player
Did you attach the server logs?
no
Did you attach a network dump?
yes rtmp-dts.zip
Exact same problem here.
Same issue here on 0.20.0. 0.19.0 does not have this issue.
Perhaps related to 9bd8b2cfb6279ec42e9722a1a7c74d07efeb60d5
Version 0.20.2 works for me.
0.20.2 isn't perfect afterall. It works much much better, but it can still fail with the same error message.
moved to #1002 since the PTS-to-DTS algorithm is the same in both RTMP and HLS.
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.