Opened 4 years ago

Last modified 4 years ago

#4110 new defect

Non-monotonous DTS in output stream and stream stall

Reported by: danomite Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
In 2.4.3 and master/HEAD commit 00df32f6a9c497a6ec6b71cf6c2360957a6d7e6c

When publishing a live camera stream the error message:

Non-monotonous DTS in output stream and stream stall

appears and the stream stalls, depending on how far back the time stamp is the stream could be stalled for that long.

I am using nginx-rtmp-module to serve the stream.

How to reproduce:

% /home/danomite/bin/ffmpeg -v debug -err_detect explode -i out.flv -f flv -c:v copy -an rtmp://localhost:1935/mytv/outstream

Attachments (3)

ffmpeg-restream.txt (7.0 KB) - added by danomite 4 years ago.
Log with errors
ffmpeg-build.txt (1.8 KB) - added by danomite 4 years ago.
Build log
ffmpeg-file-to-rtmp.txt (2.0 KB) - added by danomite 4 years ago.

Download all attachments as: .zip

Change History (11)

Changed 4 years ago by danomite

Log with errors

Changed 4 years ago by danomite

Build log

Changed 4 years ago by danomite

comment:1 Changed 4 years ago by danomite

These are the step I use to make the problem happen:

  1. Attempt to publish camera stream but non-monotonous warnings happen and all the players stall when that happens. (Using 2.4.3 release from my own build, the command for the build is in ffmpeg-restream.txt. The command I used is in ffmpeg-restream.txt but the log is after my rebuild)
  2. Rebuild ffmpeg using master/HEAD
  3. Attempt to publish camera stream via ffmpeg-restream.txt, but non-monotonous warnings happen and all the players stall when that happens.
  4. Record the camera stream and no warning came up out.flv
  5. Publish file to stream get some warnings and the file doesn't publish ffmpeg-file-to-rtmp.txt

comment:2 Changed 4 years ago by danomite

File nonmonotonous-example-10MB.flv submitted to ffmpeg ftp.

comment:3 Changed 4 years ago by cehoyos

Do I understand correctly that this issue is only reproducible with rtmp output?

comment:4 Changed 4 years ago by danomite

I've been able to reproduce with rtp multicast output as well.

ffmpeg -err_detect explode -rtsp_transport tcp -i rtsp://mycamera:8554/mystream -f rtp -an -vcodec copy rtp://224.0.0.1:8002 

comment:5 Changed 4 years ago by cehoyos

Does it also happen with file input?

comment:6 Changed 4 years ago by danomite

I have not been able to reproduce with file input.

comment:7 Changed 4 years ago by danomite

Using rtpdump and multicast output, as noted above, I was able to capture the time stamps going in reverse order.

To capture the stream:
rtpdump -F ascii 224.0.0.1 8002 > rtpdump.log
To parse the reverse timestamps out of the log:
cat rtpdump.log | cut -d' ' -f13 | cut -d'=' -f2 | uniq | awk '$1 > p { printf("gt ") } p = $1' | grep -v '^gt'
From the listing of the time stamps one can use less to search for them and see the contents of the stream at that point.

Last edited 4 years ago by danomite (previous) (diff)

comment:8 Changed 4 years ago by danomite

When I re-encode the video from the camera to the same format, the error goes away.

ffmpeg -err_detect explode -rtsp_transport tcp -i rtsp://mycamera:8554/mystream -f rtp -an -vcodec libx264 rtp://224.0.0.1:8002
Note: See TracTickets for help on using tickets.