VLC RTP/MPEG-TS live stream time display
Posted: 03 Oct 2012 13:13
Hi,
I run VLC playing a RTP + MpegTS + H264 stream (provided by a simple Gstreamer pipeline) represented by an SDP, but the displayed time is always 00:00.
First of all, I have already test it with different VLC versions. Now I am using VLC 2.0.3 where the issue persists.
I am live streaming a UDP + MPEGTS + H264 with the following pipeline:
gst-launch --gst-debug=mpegtsmux:5 videotestsrc do-timestamp=true is-live=true ! video/x-raw-yuv, framerate=(fraction)30/1 ! ffmpegcolorspace ! timeoverlay font-desc="Verdana bold 50px" ! ffmpegcolorspace ! queue ! x264enc byte-stream=true bitrate=500 key-int-max=5 tune=zerolatency ! video/x-h264 ! mpegtsmux name=mux m2ts-mode=false pat-interval=3000 pmt-interval=3000 ! video/mpegts ! video/mpegts ! rtpmp2tpay pt=33 ! udpsink port=5004 host=127.0.0.1 sync=false enable-last-buffer=false
According to the VLC staff VLC always uses the MPEG-TS PCR when dealing with MPEG-TS, including over RTP, ignoring the RTP timestamp.
So the timing capability lays on the PCR data of the MPEG-TS. I have already checked that the PCR data is inside the stream with "mpegtsmux" pluging of gstreamer. It implements the code described in the following post:
http://stackoverflow.com/questions/6199 ... r-from-pts
I have also checked that PCR data is inside the stream with a MPEG-2 Transport Stream packet analyser (http://www.pjdaniel.org.uk/mpeg/)
I checked that the TimeStamps are there with the next pipeline:
gst-launch --gst-debug=2 udpsrc uri=udp://localhost:5004 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP2T-ES, payload=(int)33" ! gstrtpjitterbuffer latency=200 ! application/x-rtp ! rtpmp2tdepay ! video/mpegts ! mpegtsdemux name=demux ! video/x-h264 ! queue ! decodebin name=dec ! ffmpegcolorspace ! timeoverlay font-desc="Verdana bold 50px" valignment=1 ! directdrawsink
I tried also to send the PCR inside the Adaptation field with the first packet of each new TimeStamp (30fps = TS increments of 3000 for RTP 90000khz) by hacking mpegtsmux plugin... displayed time "00:00"
VLC open the SDP file that contains the following data:
v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
c=IN IP4 127.0.0.1
t=0 0
a=tool:GStreamer
a=type:broadcast
a=range:npt=now-
m=video 5004 RTP/AVP 33
a=rtpmap:33 MP2T/90000
a=control:mpegts-transport
The time is not displayed by the VLC (always 00:00). The expected result is a displayed time equal to the one "watermarked" inside the video. This means if the stream is running for 30seconds when VLC player connects it, the VLC displayed time should be "00:30".
I have also tried to modify "a=range:npt=now-" to other values, but the result is the same... "00:00"
Some idea/tip about what's wrong? / How to fix it?
Thank you in advance.
I run VLC playing a RTP + MpegTS + H264 stream (provided by a simple Gstreamer pipeline) represented by an SDP, but the displayed time is always 00:00.
First of all, I have already test it with different VLC versions. Now I am using VLC 2.0.3 where the issue persists.
I am live streaming a UDP + MPEGTS + H264 with the following pipeline:
gst-launch --gst-debug=mpegtsmux:5 videotestsrc do-timestamp=true is-live=true ! video/x-raw-yuv, framerate=(fraction)30/1 ! ffmpegcolorspace ! timeoverlay font-desc="Verdana bold 50px" ! ffmpegcolorspace ! queue ! x264enc byte-stream=true bitrate=500 key-int-max=5 tune=zerolatency ! video/x-h264 ! mpegtsmux name=mux m2ts-mode=false pat-interval=3000 pmt-interval=3000 ! video/mpegts ! video/mpegts ! rtpmp2tpay pt=33 ! udpsink port=5004 host=127.0.0.1 sync=false enable-last-buffer=false
According to the VLC staff VLC always uses the MPEG-TS PCR when dealing with MPEG-TS, including over RTP, ignoring the RTP timestamp.
So the timing capability lays on the PCR data of the MPEG-TS. I have already checked that the PCR data is inside the stream with "mpegtsmux" pluging of gstreamer. It implements the code described in the following post:
http://stackoverflow.com/questions/6199 ... r-from-pts
I have also checked that PCR data is inside the stream with a MPEG-2 Transport Stream packet analyser (http://www.pjdaniel.org.uk/mpeg/)
I checked that the TimeStamps are there with the next pipeline:
gst-launch --gst-debug=2 udpsrc uri=udp://localhost:5004 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP2T-ES, payload=(int)33" ! gstrtpjitterbuffer latency=200 ! application/x-rtp ! rtpmp2tdepay ! video/mpegts ! mpegtsdemux name=demux ! video/x-h264 ! queue ! decodebin name=dec ! ffmpegcolorspace ! timeoverlay font-desc="Verdana bold 50px" valignment=1 ! directdrawsink
I tried also to send the PCR inside the Adaptation field with the first packet of each new TimeStamp (30fps = TS increments of 3000 for RTP 90000khz) by hacking mpegtsmux plugin... displayed time "00:00"
VLC open the SDP file that contains the following data:
v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
c=IN IP4 127.0.0.1
t=0 0
a=tool:GStreamer
a=type:broadcast
a=range:npt=now-
m=video 5004 RTP/AVP 33
a=rtpmap:33 MP2T/90000
a=control:mpegts-transport
The time is not displayed by the VLC (always 00:00). The expected result is a displayed time equal to the one "watermarked" inside the video. This means if the stream is running for 30seconds when VLC player connects it, the VLC displayed time should be "00:30".
I have also tried to modify "a=range:npt=now-" to other values, but the result is the same... "00:00"
Some idea/tip about what's wrong? / How to fix it?
Thank you in advance.