Stream Video using Netcat and VLC

netcatraspberry pivlc

I'm trying to use netcat on Linux server to stream video to my windows client using VLC

I started running netcat on Linux:

 cat /media/HD1/myMovie.mkv | nc -l 8668

In VLC Windows Client I tried to:

Open VLC > Open network stream vlc > rtp://@serverIP:8668

Without success.

Best Answer

I had been looking for such a solution this weekend. Since i found one i thought to share it for future researchers.

PC 1 = Server. The PC in my lan having my movie stored

$ netcat -l -p 8111 <mymovie.mp4      # -p 8111 :port 8111. Can be any port
#OR 
$ cat mymovie.mp4 |netcat -l -p 8111  # -l : listening mode

PC 2 = Client. The PC connected to my TV

$ netcat 192.168.1.116 8111 |vlc -         # Change IP accordingly to find PC1
#OR 
$ cat </dev/tcp/192.168.1.116/8111 |vlc -  # in Bash

Instead of vlc you can use mpv or any other video player as soon as read from standard input is supported.

Next Weekend Task:
Serve mymovie.mp4 to client alongside with subtitles srt file

Related Question