Page 1 of 1

How does the VLC player play the Audio/Video with timestamp

Posted: 13 Mar 2017 09:11
by pluto1027
Hi.

I tried to play my streaming file(VIDEO :MJPEG framerate 30, AUDIO: PCM SampleBits 44100, SampleRate 16, Channels 2) in my device as the RTSP server,
and it will connect to my iphone by RTP and play in the VLC player (as RTSP client)
But I can only see the video just run few seconds, and the audio always played the same sound.

I guessed it is the timestamp issue, so I did an experience:
I recorded a MJPEG video(remove audio), and sent one frame per second from my device.
And attached the pts increment to 2000 between every frame.

Send_time(sec) Frame_num pts timestamp
0 frame_0 0 2000000000
1 frame_1 2000 2000180000
2 frame_2 4000 2000360000
3 frame_3 6000 2000540000
...
29 frame_29 58000 2005220000

Because the VLC player should play the video according by the timestamp, and the payload type (m=video 0 RTP/AVP 26 => clock=90000).
I expect the video will show frame_0 in 0 sec, frame_1 in 2 sec, frame_2 in 4 sec, frame_3 in 6 sec, ... frame_29 in 58 sec.
But the real condition in my VLC player is frame_0 in 0 sec, frame_1 in 2 sec, frame_2 in 3 sec, frame_3 in 4 sec, ... frame-29 in 31 sec.
Could someone help me ? Thanks.

---------------------------------------------------------------
The following information is from my RTSP DESCRIBE:
i=MJPG
t=0 0
a=type:broadcast
a=control:*
a=range:npt=0-60.50
a=x-qt-text-nam:Motion JPEG.
a=x-qt-text-inf:MJPG
m=video 0 RTP/AVP 26
c=IN IP4 0.0.0.0
b=AS:12288
a=frmerate:30.0
a=control:track1

Re: How does the VLC player play the Audio/Video with timestamp

Posted: 14 Mar 2017 18:51
by RĂ©mi Denis-Courmont
This does not look like a valid SDP.

Re: How does the VLC player play the Audio/Video with timestamp

Posted: 15 Mar 2017 02:19
by pluto1027
Thanks for your reply.
Could you explain more detail?
Did you mean I lose some parameters form my RTSP DESCRIBE?

The following is the total information.
RTSP_DESCRIBE:
v=0
o=- 33520935 1 IN IP4 192.168.1.1
s=Motion JPEG. Streamed by live555.
i=MJPG
t=0 0
a=tool:iCatchTek
a=type:broadcast
a=control:*
a=range:npt=0-60.50
a=x-qt-text-nam:Motion JPEG. Streamed by live555.
a=x-qt-text-inf:MJPG
m=video 0 RTP/AVP 26
c=IN IP4 0.0.0.0
b=AS:12288
a=frmerate:30.0
a=control:track1

Re: How does the VLC player play the Audio/Video with timestamp

Posted: 15 Mar 2017 04:27
by pluto1027
There are actually two issues when I try to play RTP streaming.

1.
I tried to play my streaming file(VIDEO :MJPEG framerate 30, AUDIO: PCM SampleBits 44100, SampleRate 16, Channels 2) in my device as the RTSP server,
and it will connect to my iphone by RTP and play in the VLC player (as RTSP client)
But I can only see the video just run few seconds, and the audio always played the same sound.
=>This issue only happened in the VLC player on iphone & ipad, but it can play normally in the VLC play on my Windows PC.

2.
My experiment:I recorded a MJPEG video(remove audio), and sent one frame per second from my device.
And attached the pts increment to 2000 between every frame.
in my VLC player is frame_0 in 0 sec, frame_1 in 2 sec, frame_2 in 3 sec, frame_3 in 4 sec, ... frame-29 in 31 sec.
=>This issue happened in the VLC player on iphone, ipad and Windows PC.