0

I am trying to stream a video file using gstreamer from one device to another over RTP. At the sender side I am using the following command :

gst-launch filesrc location=/home/kuber/Desktop/MELT.MPG ! mpegparse ! rtpsend ip=localhost

But this gives the following error : no element "rtpsend" , I downloaded all the rtp tools and still the same error. Am I using rtpsend in some wrong way? Also can someone give me the command line code for streaming video file(locally stored in my laptop and not the testvideosrc file) from one device to another? strong text

user1795516
  • 451
  • 1
  • 8
  • 18

1 Answers1

1

Assuming this is a MPEG1/2 elementary stream (because you are using mpegparse) that you want to send out You need to use rtpmpvpay after your mpegparse and then give the output to udpsink.

mpegparse ! rtpmpvpay ! udpsink host="hostipaddr" port="someport"

I am not aware of any rtpsend plugin as such. The above holds true for any streaming on rtp.

Do a gst-inspect | grep rtp to see all the payloaders, depayers

If it is a mpegps stream you need to first do a mpegpsdemux before the rest of the pipeline.

EDIT:

Why not remove mpegparse? don't see why you need it. You should learn to look at the source and sink requirements in gst-inspect of the component, that will tell you the compatibility that is needed between nodes. Recieving will be reverse udpsrc port="portno" ! capsfilter caps="application/x-rtp, pt=32, ..enter caps here" ! rtpmpvdepay !

av501
  • 6,645
  • 2
  • 23
  • 34
  • well its a mpeg1/2 stream and I tried using the rtpmpvpay! in the following code now: "gst-launch filesrc location=/home/kuber/Desktop/MELT.MPG ! mpegpsdemux ! mpegparse ! rtpmpvpay ! udpsink host=localhost port=1234" This gives the following error : erroneous pipeline: could not link mpegparse0 to rtpmpvpay0 @av501 - Im not sure how to remove this error. Also could you give me the receiving side command line code too? – user1795516 Dec 14 '12 at 22:18
  • why not remove mpegparse? don't see why you need it. You should learn to look at the source and sink requirements in gst-inspect of the component, that will tell you the compatibility that is needed between nodes. Recieving will be reverse udpsrc port="portno" ! capsfilter caps="application/x-rtp, pt=32, ..enter caps here" ! rtpmpvdepay ! – av501 Dec 14 '12 at 22:22
  • the problem is that as soon as I remove the mpegparse and just use : gst-launch-0.10 filesrc location=/home/kuber/Desktop/test.mp4 ! rtpmpvpay ! udpsink host=localhost port=1234 I get the following error: Setting pipeline to PAUSED ... Pipeline is PREROLLING ... Pipeline is PREROLLED ... Setting pipeline to PLAYING ... New clock: GstSystemClock Got EOS from element "pipeline0". Execution ended after 20591150 ns. Setting pipeline to PAUSED ... Setting pipeline to READY ... Setting pipeline to NULL ... Freeing pipeline ... Basically the EOS stream error. – user1795516 Dec 14 '12 at 22:55
  • So , I am using the following at the server side which is throwing EOS error: gst-launch filesrc location=/home/kuber/Desktop/test.mpg ! rtpmpvpay ! udpsink host=localhost port=1234 Also at the client side I am recieving this stream using : udpsrc port=1234 ! capsfilter caps="application/x-rtp, pt=32, media=(string)video, clock-rate=44100, width=16, height=16, encoding-name=(string)L16,encoding-params=(string)1, channels=(int)1, channel-position=(int)1, payload=(int)96" ! rtpmpvdepay ! xvimagesink ! Could you just try this in your system and tell me where its going wrong for EOS error? – user1795516 Dec 15 '12 at 00:05
  • Your caps is for audio and you are sending video! – av501 Dec 15 '12 at 05:56
  • I get that, but the server is also giving me EOS error, and I am not sure why!? – user1795516 Dec 15 '12 at 06:48
  • Since you are reading from a file, it will run very very fast.. and dump all its contents into the udpport. Do a tcpdump you will see all the data there. EOS is not an error. It is saying it finished sending the file. Is simply did it very fast. – av501 Dec 15 '12 at 08:54
  • Great, I got thing organized but am facing the following : server side :gst-launch filesrc location=/home/kuber/Desktop/test.mp4 ! rtpmp4vpay ! udpsink host=localhost port=1234 Client side: gst-launch udpsrc uri=udp://localhost:1234 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP4V-ES, profile-level-id=(string)1, config=(string)000001b001000001b58913000001000000012000c48d88007d0a041e1463000001b24c61766335322e3132332e30, payload=(int)96, ssrc=(uint)298758266, clock-base=(uint)3097828288, seqnum-base=(uint)63478" ! rtpmp4vdepay ! autovideosink – user1795516 Dec 15 '12 at 22:27
  • Now I am running the client side first which is running smoothly and the pipeline looks fine. But as I run the server side to send the file it again reaches EOS but I dont get anything on console. Now when I do the similar thing with videotest src in place of a video file that I have it works fine. what am I doing wrong? – user1795516 Dec 15 '12 at 22:29
  • Your file is a mp4. That is not MP4V-ES. Unless you simply have named it .mp4 and it is a MP4V-ES. Mp4 is a container. mp4v-es is elementary stream. You need to read up on basics of containers/codecs/decoders etc. – av501 Dec 15 '12 at 22:49
  • Yes, I do realize that but on the other hand I need to finish this by tonight and then move on to the basics to get a better idea of what going on. finally I am using Client - gst-launch udpsrc uri=udp://localhost:1234 caps="application/x-rtp, pt=32, media=(string)video, clock-base=(int)44100, bitrate=128" ! rtpmp4vdepay ! filesink location=/home/kuber/Desktop/testfile.mp4 Server: gst-launch filesrc location=/home/kuber/Desktop/test.mp4 ! rtpmp4vpay ! udpsink host=localhost port=1234 the file is a mpeg-4 file and even though both the server and client are running . . . – user1795516 Dec 15 '12 at 23:43
  • the file I create is not getting populated, Could you give me the caps for a mpeg file, I will fill out the values myself. Thanks for your consistent help. :) – user1795516 Dec 15 '12 at 23:45
  • @Russell, why not ask a seperate question if you have a specific problem you are facing? Others will also be able to then help out :). – av501 Sep 06 '13 at 06:02