Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to view the stream generated from mkvserver via ffplay?

I want to live stream from one source(ffmpeg) to multiple clients for which I'm using mkvserver. I'm able to live stream a webcam from ffmpeg(client) to mkvserver(server) as follows:

On Server :

nc -l <port-number> | ./server

On Client :

ffmpeg -f avfoundation -framerate 30 -i 0 -b 900k -f matroska -r 20 tcp://<ip-address>:<port-number>

To view the genereted steam on server, I used the ffplay as:

ffplay tcp://<ip-address>:<port>

but I got the Connection timed out error. Please suggest a way to view the generated stream on the server via ffplay. Thanks!

like image 606
Chaitanya Avatar asked Jun 10 '19 07:06

Chaitanya


1 Answers

Let me recap for clarification.

You are streaming from the client with ffmpeg

ffmpeg -f avfoundation -framerate 30 -i 0 -b 900k -f matroska -r 20 tcp://<ip-address>:<port-number>

to the server which listen with NetCat in some port over TCP.

nc -l <port-number>

You are piping the NetCat outPut (client steam) to Matroska Server Mk2 (./server) which serve the streaming in real-time over http on all interfaces on port 8080.

nc -l <port-number> | ./server

So I think that ffplay should connect through http in port 8080 to view the output of Matroska Server Mk2 (./server).

ffplay http://ip-address:8080
like image 174
jlvaquero Avatar answered Nov 03 '22 01:11

jlvaquero