ap2011
ap2011

Reputation: 1

Video Streaming application's requirements using GStreamer

I would like create an application for streaming video over wireless using GStreamer. My requirements are: H.264 Codec,RTP/MPEG2-TS stream and RTP protocol over network.
Could any one please explain that I need to create any plugin for that or existing plugins can provide all the functionalities? If yes then what are the plugins I should use? I would like to add one more point that I will capture the video using a phone and transmit from that device over the network to one or more specific addresses. Please reply . Thanks in advance.

Upvotes: 0

Views: 1695

Answers (2)

enthusiasticgeek
enthusiasticgeek

Reputation: 2734

Considering RTP (change host/ip as required) the following pipelines should help. As per your requirement you may replace ffenc_mpeg4 with x264enc pass=qual quantizer=20 tune=zerolatency, rtpmp4vpay with rtph264pay. Similarly on decoder side you may replace ffdec_mpeg4 with x264dec, rtpmp4vdepay with rtph264depay. Few other things may also be needed to be tweaked.

1) RTP send webcam and audio

gst-launch gstrtpbin name=rtpbin latency=0 v4l2src device=/dev/video0 ! typefind ! ffmpegcolorspace ! videoscale ! video/x-raw-yuv, width=640, height=480 ! videorate ! video/x-raw-yuv, framerate=30/1 ! ffenc_mpeg4 ! rtpmp4vpay send-config=true ! rtpbin.send_rtp_sink_0 rtpbin.send_rtp_src_0 ! udpsink port=5502 host=127.0.0.1 rtpbin.send_rtcp_src_0 ! udpsink port=5510 host=127.0.0.1 sync=false async=false udpsrc port=5510 ! rtpbin.recv_rtcp_sink_0 autoaudiosrc samplesperbuffer=1000 ! alawenc ! rtppcmapay ! rtpbin.send_rtp_sink_1 rtpbin.send_rtp_src_1 ! udpsink port=5504 host=127.0.0.1 rtpbin.send_rtcp_src_1 ! udpsink port=5512 host=127.0.0.1 sync=false async=false udpsrc port=5512 ! rtpbin.recv_rtcp_sink_1

2) RTP receive webcam and audio

gst-launch gstrtpbin name=rtpbin2 latency=0 udpsrc caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP4V-ES, profile-level-id=(string)1" port=5502 ! rtpbin2.recv_rtp_sink_0 rtpbin2. ! rtpmp4vdepay ! ffdec_mpeg4 ! videoscale ! video/x-raw-yuv, width=640, height=480 ! videorate ! video/x-raw-yuv, framerate=30/1 ! ffmpegcolorspace ! autovideosink udpsrc port=5510 ! rtpbin2.recv_rtcp_sink_0 rtpbin2.send_rtcp_src_0 ! udpsink host=127.0.0.1 port=5510 sync=false async=false udpsrc caps="application/x-rtp,media=(string)audio, clock-rate=(int)8000, encoding-name=(string)PCMA" port=5504 ! rtpbin2.recv_rtp_sink_1 rtpbin2. ! rtppcmadepay ! alawdec ! autoaudiosink buffer-time=10000 udpsrc port=5512 ! rtpbin2.recv_rtcp_sink_1 rtpbin2.send_rtcp_src_1 ! udpsink host=127.0.0.1 port=5512 sync=false async=false

Upvotes: 1

user689539
user689539

Reputation:

The gstrtpbin should handle all of your streaming needs. It will allow you to transmit an RTP stream to one or more addresses. For instruction on how to use it, the gstreamer source code has several examples in a few different languages. Gstreamer will also allow you to encode the video into an H.264 stream using the x264. This is included in the "ugly" plug-ins package.

Upvotes: 3

Related Questions