User avatar
bomba5
Posts: 10
Joined: Thu Jul 09, 2015 1:58 pm
Location: Catania, IT

RTSP Streaming audio/video

Thu Feb 18, 2016 5:59 pm

Hello,

I'd like to produce an RTSP stream of mixed audio and video coming from a raspberry pi to my computer.
Currently I'm achieving the task producing two separate tcpserversink, like this:

# SERVER
raspivid -t 0 -rot 180 -w 640 -h 480 -fps 20 -b 256000 -o - | gst-launch-1.0 -v \
fdsrc ! \
h264parse ! \
rtph264pay ! \
gdppay ! \
tcpserversink host=0.0.0.0 port=5000 \
alsasrc device=plughw:0 ! \
audioconvert ! \
audioresample ! \
opusenc ! \
rtpopuspay ! \
gdppay ! \
tcpserversink host=0.0.0.0 port=5001

# CLIENT
gst-launch-1.0 -v tcpclientsrc host=${TARGET_IP} port=5000 ! \
gdpdepay ! \
rtph264depay ! \
avdec_h264 ! \
autovideosink sync=false \
tcpclientsrc host=${TARGET_IP} port=5001 ! \
gdpdepay ! \
rtpopusdepay ! \
opusdec ! \
alsasink sync=false


Any clues?
J
---
bomba

RpiName
Posts: 712
Joined: Sat Jul 06, 2013 3:14 am

Re: RTSP Streaming audio/video

Thu Feb 18, 2016 7:00 pm

bomba5 wrote:I'd like to produce an RTSP stream of mixed audio and video coming from a raspberry pi to my computer.
although not rtsp, you may want to try webrtc with UV4L instead to get an audio + full hd video stream from the rpi2 to the browser:

http://linux-projects.org

User avatar
bomba5
Posts: 10
Joined: Thu Jul 09, 2015 1:58 pm
Location: Catania, IT

Re: RTSP Streaming audio/video

Thu Feb 18, 2016 7:30 pm

I'd like to stick to gstreamer for this simple task without adding other components to the system. Can you point me to an example anyways?
---
bomba

RpiName
Posts: 712
Joined: Sat Jul 06, 2013 3:14 am

Re: RTSP Streaming audio/video

Thu Feb 18, 2016 7:41 pm

bomba5 wrote:I'd like to stick to gstreamer for this simple task without adding other components to the system. Can you point me to an example anyways?
example of what exactly? install the uv4l packages according the instructions below, open firefox and access the webrtc page at the rpi address, click on 'start' to get the stream. there's really nothing to configure apart from an initial setup if you want use an usb sound card for the audio input (again, see the instructions). that's it.

instructions:
http://www.linux-projects.org/modules/s ... e&artid=14

demos:
https://www.youtube.com/playlist?list=P ... oQwvCcUOph

anmar
Posts: 1
Joined: Mon Feb 29, 2016 4:09 pm

Re: RTSP Streaming audio/video

Mon Feb 29, 2016 4:36 pm

The fastest way to do RTSP with gstreamer is with gst-rtsp-server/examples/test-launch, but it's not in raspbian repos.

You can also try something I built for that purpose: https://github.com/anmar/rpirtspd

It' basically uses rpicamsrc and alsasrc as sources and creates a rtsp server with 3 streams (test, video only, video+audio)

User avatar
gatherer
Posts: 14
Joined: Sat Oct 17, 2015 2:31 pm

Re: RTSP Streaming audio/video

Sat Mar 05, 2016 6:29 pm

anmar wrote:The fastest way to do RTSP with gstreamer is with gst-rtsp-server/examples/test-launch, but it's not in raspbian repos.

You can also try something I built for that purpose: https://github.com/anmar/rpirtspd

It' basically uses rpicamsrc and alsasrc as sources and creates a rtsp server with 3 streams (test, video only, video+audio)
Sounds interesting, can you supply more information how to install and use it?

User avatar
bomba5
Posts: 10
Joined: Thu Jul 09, 2015 1:58 pm
Location: Catania, IT

Re: RTSP Streaming audio/video

Fri Mar 25, 2016 2:10 pm

anmar wrote:The fastest way to do RTSP with gstreamer is with gst-rtsp-server/examples/test-launch, but it's not in raspbian repos.

You can also try something I built for that purpose: https://github.com/anmar/rpirtspd

It' basically uses rpicamsrc and alsasrc as sources and creates a rtsp server with 3 streams (test, video only, video+audio)
Very good project Anmar. I've been writing my RTSP server using rpicamsrc and alsasrc, implementing the same argument parsing as raspivid.

One quick suggestion for yours: dig https://cgit.freedesktop.org/cgit/?url= ... netclock.c
it would be useful to have timestampings on the RTSP streams.

http://gstreamer-devel.966125.n4.nabble ... 76219.html
Do you experience the same behaviour I describe here?
---
bomba

Return to “Camera board”