Quote:
But then it would only work for the first client that connects, right? How about producing content for anyone that connects?
|
Then it'd have to create a new connection for that user.
Use something designed for broadcasting media to multiple users
http://mpd.wikia.com/wiki/Icecast2
This example would not work
Code:
multimedia-encoder --whatever-options-to-produce-the-stream-content sourcefile.avi | nc -l 4567
You can't both save and pipe the file. Since it is being saved as sourcefile.avi, nothing is sent to stdout and nc has nothing to send to a user.
IF you want to both save a file and send it out, tee does this.
Code:
multimedia-encoder --whatever-options-to-produce-the-stream-content - | tee sourcefile.avi | nc -l 4567
This would cause the output to be saved as sourcefile.avi and piped to nc.
This can have unexpected consequences if the multimedia-encoder depends on the file extension to determine how to encode it (like ffmpeg/avconv) which can be overridden by manually defining the format.