0
votes

The video I transferred is already encoded. Why do I encode again when transferring?

example: gst-launch-1.0 -v filesrc location=123.mp4 ! decodebin ! x264enc ! rtph264pay ! udpsink host=192.168.10.186 port=9001

Just send the video without encoding. Can I view it on the other side?

for example:

server: gst-launch-1.0 -v filesrc location =123.mp4 ! udpsink host=192.168.10.186 port=9001

123.mp4 encoded h265

client: gst-launch-1.0 udpsrc port=9001 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H265, payload=(int)96" ! rtph265depay ! h265parse ! nvh265dec ! autovideosink

best regards

1
Your question isn't entirely clear... * In the example encoding pipeline, you're streaming out an RTP/H.264 stream. * In the decoding pipeline, you're expecting an RTP/H.265 stream. * You say you don't want to re-encode, but that would mean streaming MPEG.4 (or the specific video subformat, which can be either of the previous, or another codec)nielsdg
The commands I wrote were just examples: my pipiline in real scenario: sender: gst-launch-1.0 -v filesrc location = 123.mp4! decodebin! video / x-h265! rtph265pay! udpsink host = 192.168.10.186 port = 9001 Receiver: gst-launch-1.0 udpsrc port = 9001 caps = "application / x-rtp, media = (string) video, clock-rate = (int) 90000, encoding-name = (string) H2645"! rtph265depay! h265parse! nvh265dec! autovideosink sync = falseMuratakaydin
My question: 123.mp is already a compressed video as h265. why do we encode again when sending the video? Can't we send the compressed video directly without encoding and decode it by Receiver?Muratakaydin

1 Answers

0
votes

Okay, with the clarification that your input is assumed to be an MPEG4 file which contains an H.265: yes, then it's possible (if this is assumption doesn't hold, then this will not work).

The following should do the trick:

gst-launch-1.0 filesrc location=123.mp4 ! qtdemux ! h265parse config-interval=-1 ! rtph265pay  ! udpsink host=192.168.10.186 port=9001

Explanation:

  • the qtdemux will demux the MPEG4 container into the contained video/audio/subtitile streams (if there's more than one stream inside that container, you'll need to link to it multple times, or GStreamer will error out)
  • the h265parse config-interval=1 will make sure that your contains the correct SPS/PPS parameter sets. If the stream inside your original input file is not an H265 video stream, this will fail to link.
  • the rth265pay will translate this into RTP packets.
  • ... which the udpsink can then send over the specified socket

P.S.: you might also be interested in the rtpsink (which used to live out-of-tree, but is now included in the latest master of GStreamer)

P.P.S.: you should use an even port to send an RTP stream