Hi Asad,
There are few possabilities for constructing a gstreamer pipline.
According to the NXP/Freescale Linux User’s Guide, a RTSP pipeline looks like:
Manual Pipeline:
$GSTL rtspsrc location=$RTSP_URI name=source
! queue ! $video_rtp_depacketize_plugin ! $vpu_dec ! $video_sink_plugin source.
! queue ! $audio_rtp_depacketize_plugin ! $audio_parse_plugin ! beepdec !
$audio_sink_plugin
Playbin:
$GSTL $PLAYBIN uri=$RTSP_URI
To simply play the video on the screen, try the following:
gst-launch-0.10 playbin2 uri=rtsp://USERNAME:PASSWORD@CAMADDRESS:PORT
The manual pipeline required to do the same can vary depending on the video encoding. For h264, try (video only):
gst-launch-0.10 rtspsrc location=rtsp://USERNAME:PASSWORD@CAMADDRESS:PORT ! queue ! rtph264depay ! vpudec ! autovideosink
To output the video stream directly to a file, try:
gst-launch-0.10 rtspsrc location=rtsp://USERNAME:PASSWORD@CAMADDRESS:PORT ! rtph264depay ! filesink location=filename.264
Need to transcode?
To transcode to MPEG-4 and output to file (video only), try:
gst-launch-0.10 rtspsrc location=rtsp://USERNAME:PASSWORD@CAMADDRESS:PORT ! rtph264depay ! vpudec ! vpuenc codec=0 ! mp4mux ! filesink location=video.mp4
If you want to implement a framegrabber that outputs frames to JPEG files, try:
gst-launch-0.10 rtspsrc location=rtsp://USERNAME:PASSWORD@CAMADDRESS:PORT ! rtph264depay ! vpudec ! vpuenc codec=12 ! multifilesink location=frame%05d.jpg
Some of these pipeline elements may require additional Gstreamer plugins to be installed. For example, as @sanchayan.maity mentioned, you install the RTSP plugin as follows:
opkg update
opkg install gst-plugins-good-rtsp
You may want to install all of gst-plugins-good and possibly some of those in gst-plugins-bad. If you need to find a plugin to install, you can try searching for one using opkg list
. For example:
opkg list | grep gst-plugins | less
Just keep in mind that the most efficient gstreamer elements are generally those included in the BSP which are hardware accelerated (ie. vpudec, vpuenc, etc).