Reputation: 21
I have to use gstreamer 0.10 and try to stream a mp4 file.
For that I tried
gst-launch-0.10 filesrc location=./test.mp4 ! qtdemux ! queue ! h264parse ! video/x-h264,mapping=/stream ! udpsink rtsp://192.168.192.100:12345/test
and received a warning: WARNING: erroneous pipeline: no element "h264parse"
How can I stream the file as rtsp stream?
Upvotes: 1
Views: 7422
Reputation: 91
Here are the steps that worked for me:
sudo apt-get install libgstrtspserver-1.0 libgstreamer1.0-dev
wget https://github.com/GStreamer/gst-rtsp-server/blob/master/examples/test-launch.c
gcc test-launch.c -o test-launch $(pkg-config --cflags --libs gstreamer-1.0 gstreamer-rtsp-server-1.0)
./test-launch "filesrc location=<full-path-to-your-mp4-video-file
> ! qtdemux ! queue ! h264parse ! rtph264pay name=pay0 pt=96"
At the client machine, to test, I run ffplay or VLC Player:
ffplay rtsp://<your-server-ip
>:8554/test
Upvotes: 2
Reputation: 29
To get h264parse plugin, run "sudo apt install gstreamer1.0-plugins-bad"
Pipelines
Sender
gst-launch-1.0 filesrc location= ~/file.mp4 ! qtdemux ! queue ! h264parse ! rtph264pay config-interval=10 ! udpsink host=ip_address_to_stream_to port=9999 -v
Receiver
gst-launch-1.0 udpsrc port=9999 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, payload=(int)96, encoding-name=(string)H264" ! rtph264depay ! identity silent=0 ! avdec_h264 ! videoconvert ! ximagesink
Upvotes: 2