Streaming Network content in android phone using gstreamer

I'm new to Gstreamer. I'm trying to do network streaming using gstreamer. I could achieve that using below gst commands. Its working fine for me.

At transmitter : gst-launch-1.0 -v filesrc location=/home/user/Downloads/big_buck_bunny_480p_h264.mov ! decodebin ! x264enc ! rtph264pay ! udpsink host=127.0.0.1 port=5000

At receiver : gst-launch-1.0 -v udpsrc port=5000 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! decodebin ! videoconvert ! autovideosink

Here , I'm using same Ubuntu PC for transmitting and receiving the video.

But now I want to play the received video on my android phone instead of ubuntu PC. I mean the ubuntu PC should act as transmitter and Android phone as receiver. Is there any way to achieve this ?

The android phone is connected to network 10.xx.yy.zz . (Android phone and Ubuntu PC are in same LAN) So I changed the udpsink host at transmitter as 10.xx.yy.zz . Now I was expecting the video to be played on android device . But it didnt . I'm getting following log messages at transmitter and receiver side

At Transmitter: /GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0.GstPad:sink: caps = video/x-h264, codec_data=(buffer)0164001effe1001a6764001eacd940d83de6f011000003000100000300308f162d9601000568ebecb22c, stream-format=(string)avc, alignment=(string)au, level=(string)3, profile=(string)high, width=(int)854, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)24/1 /GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0: timestamp = 456403579 /GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0: seqnum = 50171 Pipeline is PREROLLED ... Setting pipeline to PLAYING ... New clock: GstSystemClock

At Receiver: (string)H264, payload=(int)96" ! rtph264depay ! decodebin ! videoconvert ! autovideosink Setting pipeline to PAUSED ... /GstPipeline:pipeline0/GstUDPSrc:udpsrc0.GstPad:src: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96 /GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96 Pipeline is live and does not need PREROLL ... Setting pipeline to PLAYING ... New clock: GstSystemClock

Please help. Thanks in advance.


For android you can use vlc for that.. maybe you would need sdp file for this stream, like in this question - check comments.

Or you can do that without sdp by using mpegtsmux like in this answer.. on vlc you would then go with "Open live stream" and put there udp://@:5000 (where 5000 is the port which you used at sender pipe)

To the IP question - if its on same LAN as Ubuntu PC yes it will work(if not edit your question with details).

You can try with another PC(instead android) and vlc - using mpegtsmux as I described above.

链接地址: http://www.djcxy.com/p/43998.html

上一篇: Gstreamer应用程序的g722:捕获SIGSEGV

下一篇: 在android手机中使用gstreamer流式传输网络内容