Luca Carlon
Luca Carlon

Reputation: 9996

Playing H264 stream from a local socket with gstreamer

I'm facing the problem of playing a H.264 stream using gstreamer (this stream comes from RTP packets without RTSP). My application sends data to a local socket and I would like gstreamer to play this stream. Do you have any idea how I can do this or any link where I can start reading about this? I suppose I need to provide some information about this stream as well. I really don't know what to provide. Any link for this as well? May I do all this with a command line pipeline or do I need to write a little application using gstreamer to accomplish this task? Thanks for any information!

Upvotes: 2

Views: 3841

Answers (2)

enthusiasticgeek
enthusiasticgeek

Reputation: 2734

Try this

gst-launch -v rtspsrc location="rtsp://<user>:<password>@localhost/folder/media.amp" debug=1 ! rtpmp4vdepay ! mpeg4videoparse ! ffdec_mpeg4 ! ffmpegcolorspace! autovideosink

Change the location property as per your requirements.

Upvotes: 0

max taldykin
max taldykin

Reputation: 12908

Try this script

#! /bin/bash
gst-launch -v                 \
  udpsrc                      \
    multicast-group=127.0.0.1 \
    port=${PORT}              \
    caps="application/x-rtp   \
         ,media=video         \
         ,clock-rate=90000    \
         ,encoding-name=H264" \
  ! gstrtpjitterbuffer        \
  ! rtph264depay              \
  ! ffdec_h264                \
  ! xvimagesink
  • udpsrc listens for UDP packets on ${PORT}
  • rtph264depay gets H.264 data from RTP packet
  • ffdec_h264 decodes H.264 stream

Upvotes: 1

Related Questions