开发者

Playing H264 stream from a local socket with gstreamer

开发者 https://www.devze.com 2023-02-09 09:03 出处:网络
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 gstre

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!


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消