0
votes

GStreamer Extended Family,

Consider me a beginner in GStreamer. I am trying to stream a recorded H264 file using gst-rtsp-server. So I can play/pause/seek the video from VLC player.

Here is what I have done so far:

Recorded the H264 encoded video from IP camera's RTP H264 stream using following pipeline:

gst-launch-1.0.exe -e -v rtspsrc location=rtsp://192.168.16.155/live.sdp ! rtph264depay ! h264parse ! mp4mux ! filesink location=record/video.h264

Then, I am streaming the recorded video.h264 using following pipeline:

gst-launch-1.0.exe -v filesrc location=record/video.h264 ! qtdemux ! h264parse ! rtph264pay config-interval=1 pt=96 ! udpsink host=127.0.0.1 port=5000

I am able to view the recorded video in VLC player by setting up a SDP file as shown below.

v=0 m=video 5000 RTP/AVP 96 c=IN IP4 127.0.0.1 a=rtpmap:96 H264/90000

But, I am not able to pause or seek the video. The above pipeline keeps playing the video even though the VLC player is not connected to port 5000.

Btw.. I tried using gst-rtsp-server's test-mp4 example to stream video.h264 but the VLC player times out the connection. The test-mp4 console output only shows single message i.e. "stream ready at rtsp://127.0.0.1:8554/test.

Can someone point me into a right direction to stream a recorded video using GStreamer and play/pause/seek control from VLC player over RTSP ?

Thanks, Arm

2

2 Answers

0
votes

For the test-mp4:
- Remember that you must use a mp4 video with it.
- IIRC, the mp4 fle must contains both video and audio (because the pipeline in test-mp4 will play both).
- After run test-mp4, check IP of the server (machine running test-mp4). In this case you stream loopback to same PC, so you can use loopback IP 127.0.0.1
- Then, on client side, open VLC and select Open Network Stream, and input the rtsp URL as : rtsp://<Server IP>:8554/test
For example, if server IP is 192.168.1.1, then URL is rtsp://192.168.1.1:8554/test

For rtsp-server:
- Just follow the example in test-mp4
- But keep in mind some points:
+ You must write an application to use rtsp-server, cannot use with gst-launch
+ All pay elements (rtph264pay in this case) must be set name=pay* with * is a number (pay0, pay1, pay2...)

-1
votes

Here is how I was able to stream the recorded H264 video file over RTSP/RTP if you are facing the same problem.

Modify the rtsp pipeline launch string of test-mp4 sample as shown below: "filesrc location=\"%s\" ! qtdemux " "! h264parse ! rtph264pay pt=96 name=pay0 " ")"