0

I am playing the media file on RTSP by fetching the streams directly from some server. I am getting DTS discontinuity in stream error. I have tried with both FFMPEG and FFPLAY.

FFMPEG

I am using the following ffmpeg command:

ffmpeg -i rtsp://media:123456@10.10.167.20/41415308b3839f2 -f wav test.wav

As an output of this command, I am getting the following error:

enter image description here

FFPLAY

I am using the following ffplay command:

ffplay rtsp://media:123456@10.10.167.20/41415308b3839f2

As an output of this command, I am getting the following error:

enter image description here

Can anyone please tell me that when this error usually occurs? Is there any reason behind this and any workaround for this?

Bilal Ahmed Yaseen
  • 2,506
  • 2
  • 23
  • 48

1 Answers1

3

From the libavformat/utils.c, avformat_find_stream_info function:

/* Check for a discontinuity in dts. If the difference in dts
 * is more than 1000 times the average packet duration in the
 * sequence, we treat it as a discontinuity. */

Also note, that RTP does not define any mechanisms for recovering for packet loss.

So, if you lose packets in such manner that the dts difference between two read packets is more than 1000 times the average packets duration you get foregoing warning.

Edgar Rokjān
  • 17,245
  • 4
  • 40
  • 67
  • Thanks for your answer. I want to ask the reason behind this difference between two read packets. What I need to verify? Because few days ago I was getting streams normally, then why I started getting this packet loss now. – Bilal Ahmed Yaseen Feb 23 '16 at 05:40
  • @BilalAhmedYaseen I read your second question too but it's difficult for me to say what is the reason in this case. Maybe you have some problems with your network. Also you can try to reduce stream bitrate and check results. – Edgar Rokjān Feb 23 '16 at 09:19
  • Exactly, it feels me too that there may be some issue with the network. But I want to ask that generally in which circumstances this issue occurs? A how can I verify that this is due to network? – Bilal Ahmed Yaseen Feb 23 '16 at 09:42
  • @BilalAhmedYaseen, I hope this one may be helpful for you: http://stackoverflow.com/questions/2723671/how-to-debug-packet-loss to answer the above questions. – Edgar Rokjān Feb 23 '16 at 09:52