how to easily create a stream that could be seen on a terminal?
As a network experiment, I'd like to be able to stream some content to people that connected to a certain port of my computer, as if it were aa or caca output.
I know it's possible to use mplayer to be able to see video on the terminal of the local computer and so I thought that it shouldn't be too difficult to try to stream it into the network. How can that be easily achieved? Thanks in advance. |
Try using netcat (nc)?
On server side (sending out the stream) Code:
nc -l portnumber Code:
nc ip-addr portnumber Code:
nc ip-addr portnumber | mplayer - You'll need something like icecast for that which is more "suited" but increases in complexity. |
I thought of netcat but I would have to feed it the multimedia stream.... and my question was pointed more or less in that direction. Say, something along the lines of:
Code:
multimedia-encoder --whatever-options-to-produce-the-stream-content sourcefile.avi | nc -l 4567 Code:
telnet ip-address 4567 |
Quote:
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 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 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. |
I understand what you mean.... but actually, in my example, sourcefile.avi is what you would like to stream out.
|
I suggest experimenting. A common method of outputting a file into a program is with cat.
Code:
cat file | program (Ctrl + c will cancel any output the cat command does) |
All times are GMT -5. The time now is 09:10 AM. |