Stream UDP + MPEG-TS to VLC time display

Angel Martin amartin at vicomtech.org
Wed Oct 3 04:31:10 PDT 2012


Dear all,

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. (RTSP is an alternative but I need to perform the stream server in
Windows where RTSP server is not available)

First of all, I have already test it with different VLC versions. Now I am
using VLC 2.0.3 where the issue persists.

(Another minor issue in Linux is due to the conflict of UDPSINK and VLC-SDP
in terms of translation of localhost in IPv6 ::1 and IPv4 127.0.0.1. This
means if i use udpsink port=5004 host=127.0.0.1 in linux Gstreamer calls
multiudpsink (multicast), I can only use localhost that is translated to
::1 (incompatible with SDP definition))

I am streaming an 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. For normal
(elementary) RTP streams, RTP timestamps are correleated with RTCP-SR.
Thus, you cannot synchronize MPEG-TS (over RTP) with something else (over
RTP)."

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/6199940/generate-pcr-from-pts

I have also checked that PCR data is properly included in 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) but the time diaplyed is always 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

(Another issue, justo to notice it, when I tried to run RTSP server and VLC
in Linux is that RTSP server generate SDP responses with "a=rtpmap:33
MP2T-ES/90000" and MP2T-ES is not recognized by VLC I had to modify RTSP
server to provide "a=rtpmap:33 MP2T/90000" in the SDP)

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".

Some idea/tip about what's wrong? / How to fix it?

Thank you in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20121003/bb570318/attachment.html>


More information about the gstreamer-devel mailing list