Negative Presentation Timestamp of RTSP
AnsweredI get a video stream with ffmpeg rtsp.
The presentation time of AVPacket is expressed as positive and suddenly it changes to negative.
There are quite a number of such sections.
Because of this, I can not get the recording timeline information.
Is this a bug or normal?
How do I get the correct presentation time?
ex) rtsp://demo:demo@100.32.247.140:7001/proxy/rtsp/ae310607-6bd9-931e-ba28-689bd8da3048/d7151446-cfee-8a0f-2155-41b7627ff0ac?stream=0&pos=1544547653322
code)
AVPacket packet;
AVFormatContext *pAvFmtCtx;
NSLog(@"=>dts: %lld, pts:%lld, duration:%lld, num:%d, den:%d, sec:%lld", packet->dts, packet->pts, packet->duration, pAvFmtCtx->streams[stream]->time_base.num, pAvFmtCtx->streams[stream]->time_base.den, sec/1000);
-----------------------------------------------------------------------------------------
=>dts: 295380, pts:295380, duration:12857, num:1, den:90000, sec:109
=>dts: 306090, pts:306090, duration:12857, num:1, den:90000, sec:113
=>dts: 291240, pts:291240, duration:6480, num:1, den:90000, sec:105
=>dts: 297720, pts:297720, duration:6480, num:1, den:90000, sec:108
=>dts: 318150, pts:318150, duration:12857, num:1, den:90000, sec:117
=>dts: -383130, pts:-383130, duration:6480, num:1, den:90000, sec:-133
=>dts: -376650, pts:-376650, duration:6480, num:1, den:90000, sec:-131
=>dts: 332910, pts:332910, duration:12857, num:1, den:90000, sec:122
=>dts: -376650, pts:-376650, duration:6480, num:1, den:90000, sec:-131
=>dts: -370170, pts:-370170, duration:6480, num:1, den:90000, sec:-129
=>dts: -367290, pts:-367290, duration:6480, num:1, den:90000, sec:-128
Thank you.
-
Dear Paul,
Thanks a lot for your report, it seems to be an issue worth investigating on our side. We are already working on it, I will come back to you as soon as we have any news.
Thank you again, hopefully we will have some news for you soon.
0 -
Hey Maxim - any updates here?
0 -
Hi Tony, Paul,
Sorry for late reply, we had a holiday season here. I just checked the status of the task, it is still in progress, no news so far, sorry.
I will try to push it a bit.
0 -
Hi Pual,
Is issue still reproducible?
0 -
The server still has the problem.
You can see the negative pts when you connect to the site below.server: v3.2.0.28341
rtsp://demo:demo@100.32.247.140:7001/{bc5a13a1-5823-711a-c675-7176604eee7e}?stream=0&pos=1551120562000
0 -
What tool do you use? The issue in first frames only or many times in random places?
ffprobe print such result:
ffprobe -show_frames -show_entries frame=pkt_dts_time "rtsp://demo:demo@100.32.247.140:7001/{bc5a13a1-5823-711a-c675-7176604eee7e}?stream=0&pos=1551120562000"
ffprobe version n3.1.9 Copyright (c) 2007-2017 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
libavutil 55. 28.100 / 55. 78.100
libavcodec 57. 48.101 / 57.107.100
libavformat 57. 41.100 / 57. 83.100
libavdevice 57. 0.101 / 57. 10.100
libavfilter 6. 47.100 / 6.107.100
libswscale 4. 1.100 / 4. 8.100
libswresample 2. 1.100 / 2. 9.100
libpostproc 54. 0.100 / 54. 7.100
[rtsp @ 0x17a61e0] CSeq 1 expected, 0 received.
Input #0, rtsp, from 'rtsp://demo:demo@100.32.247.140:7001/{bc5a13a1-5823-711a-c675-7176604eee7e}?stream=0&pos=1551120562000':
Metadata:
title : DWC-MB44iALPR - Parking Lot LPR
Duration: N/A, start: 0.438144, bitrate: N/A
Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 2560x1440 [SAR 1:1 DAR 16:9], 7 fps, 30 tbr, 90k tbn, 14 tbc
[FRAME]
pkt_dts_time=0.438144
[/FRAME]
[FRAME]
pkt_dts_time=-0.258000
[/FRAME]
[FRAME]
pkt_dts_time=-0.119000
[/FRAME]
[FRAME]
pkt_dts_time=0.015000
[/FRAME]
[FRAME]
pkt_dts_time=0.149000
[/FRAME]
[FRAME]
pkt_dts_time=0.315000
[/FRAME]
[FRAME]
pkt_dts_time=0.449000
[/FRAME]
[FRAME]
pkt_dts_time=0.581000
[/FRAME]
[FRAME]
pkt_dts_time=0.715000
[/FRAME]
[FRAME]
pkt_dts_time=0.881000
[/FRAME]
[FRAME]
pkt_dts_time=1.015000
[/FRAME]
[FRAME]
pkt_dts_time=1.150000
[/FRAME]
[FRAME]
pkt_dts_time=1.317000
[/FRAME]
[FRAME]
pkt_dts_time=1.448000
[/FRAME]
[FRAME]
pkt_dts_time=1.582000
[/FRAME]
[FRAME]
pkt_dts_time=1.7160000 -
I am not using tools.
Connect to rtsp with avformat_open_input of ffmpeg and make AVPacket with av_read_frame. The pts value of AVPacket was positive, but it is negative from the moment.0
Please sign in to leave a comment.
Comments
7 comments