rtp streaming

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

rtp streaming

Deroo Stijn
Hi all,

I'm struggling with the following.  I want to encode a video file to h264 format, and stream it via rtp over the network.  Attached you find the c code (test6.c) that does the server side job.  On the client side I run the script attached (client-H264-PCMA.sh) to play the rtp stream.

My server output can be found in output.txt.

However, on the client side, 1 frame of the video stream is shown, and that's it.  The video doesn't play, only one image is shown.  If I trace with wireshark however, I can see a lot of udp (rtp) packets containing the stream.

I struggled a lot to get the c code right to use the decodebin element, but I think like it's done in my code does the job?!

Someone any idea why the stream isn't playing?

Thanks in advance!

Kind regards,
Stijn.
 

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

test6.c (8K) Download Attachment
client-H264-PCMA.sh (4K) Download Attachment
output.txt (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: rtp streaming

Thomaz Barros
Can you use the pipelines built on these codes with gst-launch command without problem? I'm trying the same thing and there is a delay in my streaming. I'm using these pipelines:

Server:

#!/bin/sh
# change this to send the RTP data and RTCP to another host
DEST=127.0.0.1

# tuning parameters to make the sender send the streams out of sync. Can be used
# ot test the client RTCP synchronisation.
#VOFFSET=900000000
VOFFSET=0
AOFFSET=0

# H264 encode from the source

#VELEM="videotestsrc is-live=1 pattern=1"
VELEM="v4l2src device=/dev/video0"

#VCAPS="video/x-raw-yuv,width=
352,height=288,framerate=15/1"
VCAPS="ffmpegcolorspace"
VSOURCE="$VELEM ! $VCAPS"
#VENC="ffenc_h263p ! rtph263ppay"
VENC=" timeoverlay ! x264enc ! rtph264pay "

VRTPSINK="udpsink port=5000 host=$DEST ts-offset=$VOFFSET name=vrtpsink"
VRTCPSINK="udpsink port=5001 host=$DEST sync=false async=false name=vrtcpsink"
VRTCPSRC="udpsrc port=5005 name=vrtpsrc"

PIPELINE="gstrtpbin name=rtpbin
          $VSOURCE ! $VENC ! rtpbin.send_rtp_sink_2
            rtpbin.send_rtp_src_2 ! $VRTPSINK
            rtpbin.send_rtcp_src_2 ! $VRTCPSINK
          $VRTCPSRC ! rtpbin.recv_rtcp_sink_2"

echo $PIPELINE

gst-launch -v $PIPELINE

Client:
#!/bin/sh

VIDEO_CAPS="application/x-rtp,
media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264"

DEST=127.0.0.1

LATENCY=100

gst-launch -v gstrtpbin name=rtpbin latency=$LATENCY
               \
         udpsrc caps=$VIDEO_CAPS port=5000 ! rtpbin.recv_rtp_sink_0
               \
               rtpbin. ! rtph264depay ! h264parse  ! ffdec_h264 !
autovideosink                     \
         udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0
               \
         rtpbin.send_rtcp_src_0 ! udpsink host=$DEST port=5005
sync=false async=false






------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: rtp streaming

Tristan Matthews-2
In reply to this post by Deroo Stijn
2010/8/11 Deroo Stijn <[hidden email]>
Hi all,

I'm struggling with the following.  I want to encode a video file to h264 format, and stream it via rtp over the network.  Attached you find the c code (test6.c) that does the server side job.  On the client side I run the script attached (client-H264-PCMA.sh) to play the rtp stream.

That script is to receive both audio and video. You should modify it to only expect video.
 

My server output can be found in output.txt.

However, on the client side, 1 frame of the video stream is shown, and that's it.  The video doesn't play, only one image is shown.  If I trace with wireshark however, I can see a lot of udp (rtp) packets containing the stream.

I struggled a lot to get the c code right to use the decodebin element, but I think like it's done in my code does the job?!

Someone any idea why the stream isn't playing?

Thanks in advance!

Kind regards,
Stijn.


------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




--
Tristan Matthews
email: [hidden email]
web: http://tristanswork.blogspot.com

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: rtp streaming

Deroo Stijn

Tristan,

 

Thanks!  This solved indeed my problem.  The stream is now playing.  

 

However, it isn’t very smooth.  The client output says: “There may be a timestamping problem, or this computer is too slow.”  Can this be because of my computer is too slow, or should I look further to a timestamp problem?

 

Another strange thing is that vlc can’t play this rtp stream?

 

Kind regards,

Stijn.

 


From: Tristan Matthews [mailto:[hidden email]]
Sent: woensdag 11 augustus 2010 18:36
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] rtp streaming

 

2010/8/11 Deroo Stijn <[hidden email]>

Hi all,

I'm struggling with the following.  I want to encode a video file to h264 format, and stream it via rtp over the network.  Attached you find the c code (test6.c) that does the server side job.  On the client side I run the script attached (client-H264-PCMA.sh) to play the rtp stream.


That script is to receive both audio and video. You should modify it to only expect video.
 


My server output can be found in output.txt.

However, on the client side, 1 frame of the video stream is shown, and that's it.  The video doesn't play, only one image is shown.  If I trace with wireshark however, I can see a lot of udp (rtp) packets containing the stream.

I struggled a lot to get the c code right to use the decodebin element, but I think like it's done in my code does the job?!

Someone any idea why the stream isn't playing?

Thanks in advance!

Kind regards,
Stijn.


------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




--
Tristan Matthews
email: [hidden email]
web: http://tristanswork.blogspot.com


------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel