[Live-devel] How to play a MPEG2-TS (H264 transport stream) live stream
leonardo.citraro at dos-web.net
leonardo.citraro at dos-web.net
Sat Apr 9 06:40:53 PDT 2016
Il 2016-04-08 21:20 Ross Finlayson ha scritto:
> Unfortunately I am a bit confused by your explanation of what you are
> trying to do.
>
> From what I can tell, you are trying to receive a H.264 video
> RTSP/RTP stream - using a RTSP client - then, somehow, convert this
> H.264 video stream into a MPEG Transport Stream. What you then want
> to do with the resulting Transport Stream (play it? re-stream it?
> just
> save it to a file?) is not clear to me.
>
> In any case, you should start by using our demo applications,
> *unmodified*. Only once you have gotten these to work should you
> think about modifying code.
>
> I suggest starting by doing the following:
> 1/ Run “openRTSP” to receive your H.264 video RTSP/RTP stream. This
> will write the resulting H.264 video data into a file, whose name
> begins with “video-“.
> 2/ Rename this video file to “in.264”
> 3/ Run our “testH264VideoToTransportStream” demo application. This
> should give you a MPEG Transport Stream file named “out.ts”.
>
> If you do all of this, is the file “out.ts” useful to you? (What do
> you want to do with this?)
>
> If (and only if) you reach this point successfully, we can then talk
> about how you can streamline steps 1/ to 3/ by making a (small)
> modification to our “testH264VideoToTransportStream” code. As
>
>
> Ross Finlayson
> Live Networks, Inc.
> http://www.live555.com/
>
>
> _______________________________________________
> live-devel mailing list
> live-devel at lists.live555.com
> http://lists.live555.com/mailman/listinfo/live-devel
Thank you for the quick reply. That is correct, I am trying to receive
a H.264 video
RTSP/RTP stream - using a RTSP client - then, I convert this H.264
video stream into a MPEG Transport Stream. Successively, I would like to
send those packets via TCP to a server as live streaming but primarily I
want to make sure I can play the video. Therefore, what a would like to
do is to output the packet to stdout and pipe them into vlc like so:
./testRTSPClient | vlc -. Your suggestions are also correct, I did all
the three points you mentioned already and all of them worked fine,
however, I absolutely need to work with the frame directly and not via
files or pipes. I managed to modify the testRTSPClient.cpp in order to
obtain MPEG2-TS packets in the array fReceiveBuffer correctly but when I
output them to stdout and pipe them to vlc there is a problem, vlc do
not recognize the stream. Without modifying the testRTSPClient and by
putting the header \0\0\0\1 in front of each frame I am able to play the
stream with VLC without problems.
Hope the question is more clear.
Bests
Leonardo Citraro
More information about the live-devel
mailing list