Opened 9 years ago

Last modified 9 years ago

#4110 new defect

Non-monotonous DTS in output stream and stream stall

Reported by: Daniel Schultze 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 Daniel Schultze 9 years ago.
Log with errors
ffmpeg-build.txt (1.8 KB ) - added by Daniel Schultze 9 years ago.
Build log
ffmpeg-file-to-rtmp.txt (2.0 KB ) - added by Daniel Schultze 9 years ago.

Download all attachments as: .zip

Change History (11)

by Daniel Schultze, 9 years ago

Attachment: ffmpeg-restream.txt added

Log with errors

by Daniel Schultze, 9 years ago

Attachment: ffmpeg-build.txt added

Build log

by Daniel Schultze, 9 years ago

Attachment: ffmpeg-file-to-rtmp.txt added

comment:1 by Daniel Schultze, 9 years ago

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 by Daniel Schultze, 9 years ago

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

comment:3 by Carl Eugen Hoyos, 9 years ago

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

comment:4 by Daniel Schultze, 9 years ago

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 by Carl Eugen Hoyos, 9 years ago

Does it also happen with file input?

comment:6 by Daniel Schultze, 9 years ago

I have not been able to reproduce with file input.

comment:7 by Daniel Schultze, 9 years ago

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 9 years ago by Daniel Schultze (previous) (diff)

comment:8 by Daniel Schultze, 9 years ago

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.