I'm facing开发者_运维知识库 the problem of playing a H.264 stream using gstreamer (this stream comes from RTP packets without RTSP). My application sends data to a local socket and I would like gstreamer to play this stream. Do you have any idea how I can do this or any link where I can start reading about this? I suppose I need to provide some information about this stream as well. I really don't know what to provide. Any link for this as well? May I do all this with a command line pipeline or do I need to write a little application using gstreamer to accomplish this task? Thanks for any information!
Try this script
#! /bin/bash
gst-launch -v \
udpsrc \
multicast-group=127.0.0.1 \
port=${PORT} \
caps="application/x-rtp \
,media=video \
,clock-rate=90000 \
,encoding-name=H264" \
! gstrtpjitterbuffer \
! rtph264depay \
! ffdec_h264 \
! xvimagesink
udpsrc
listens for UDP packets on ${PORT}rtph264depay
gets H.264 data from RTP packetffdec_h264
decodes H.264 stream
Try this
gst-launch -v rtspsrc location="rtsp://<user>:<password>@localhost/folder/media.amp" debug=1 ! rtpmp4vdepay ! mpeg4videoparse ! ffdec_mpeg4 ! ffmpegcolorspace! autovideosink
Change the location property as per your requirements.
精彩评论