Gstreamer - use existing socket, fdsrc/fdsink

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Gstreamer - use existing socket, fdsrc/fdsink

karol221-10
Hello guys. I have 'big' problem with gstreamer.
I created basic client/server app, using tcp sockets. Everything worked
fine.
But my goal was different. I wanted to send video 'in my tcp session' from
client to server.
Everything worked fine, when I used tcpclientsink/tcpserversrc. But this
solution had some disadvantages for me:
Primarly, using one port, only one client can be connected to server.
Later, I tried to use fdsrc/fdsink elements. In fd parameter, I inserted
socket integer number (socket is file descriptor, of course). But this
solution didn't work. Packets were sent from client to server, but server
didn't recognize it. How can I solve this problem?

My pipelines:
Working, but only one client per server:
client: videotestsrc ! x264enc ! mpegtsmux ! tcpclientsink host=192.168.1.40
port=3000
server: tcpserversrc ! tsdemux ! h264parse ! avdec_h264 ! autovideosink

Not working:
client: videotestsrc ! x264enc ! mpegtsmux ! fdsink fd=x (instead of x -
socket file descriptor)
server: fdsrc fd=x ! tsdemux ! h264parse ! avdec_h264 ! autovideosink



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer - use existing socket, fdsrc/fdsink

Tim Müller
On Sun, 2017-09-17 at 11:23 -0700, karol221-10 wrote:

Hi,

> Packets were sent from client to server, but
> server didn't recognize it.
>
> Not working:
> client: videotestsrc ! x264enc ! mpegtsmux ! fdsink fd=x (instead of
> x - socket file descriptor)
> server: fdsrc fd=x ! tsdemux ! h264parse ! avdec_h264 !
> autovideosink 

What kind of socket is this? Do you expect multiple clients to send on
the same socket?

In any case, try

  fdsrc fd=x ! filesink location=foo.ts

and see if you can play the foo.ts file afterwards.

I'm not sure how this solves your problem btw (multiple clients).

Do you want a separate playback pipeline server-side for each client?

Cheers
 -Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com

Join us at the GStreamer Conference!
21-22 October 2017 in Prague, Czech Republic
http://gstreamer.freedesktop.org/conference/

Join us at the GStreamer Conference!
21-22 October 2017 in Prague, Czech Republic
http://gstreamer.freedesktop.org/conference/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel