alvr-org / ALVR

Stream VR games from your PC to your headset via Wi-Fi
MIT License
5.52k stars 488 forks source link

Playback video/audio stream on a second device #227

Open iphands opened 4 years ago

iphands commented 4 years ago

Hi, I would like to be able to see the same audio and video that ALVR is streaming to my headset on a PC. Is there way to have a second client watch the UDP stream and decode audio video for real time playback?

Thanks for all your hard work, ALVR and your fork are awesome!

zmerp commented 4 years ago

That is a thing I can consider while I rewrite the networking code (planned for ALVR v13).

iphands commented 4 years ago

Woot! Is this one the tracker https://github.com/JackD83/ALVR/issues/11 for that rewrite?

zmerp commented 4 years ago

Not exactly, I'm working on a step by step rewrite of the whole codebase. The networking rewrite will be in Rust (instead of C++), will add choice between TCP, UDP or QUIC for every stream (audio, video, microphone, tracking data).

iphands commented 4 years ago

That sounds fantastic! Wish I knew more rust and could help out... as it stands I've only done some trivial stuff there. Once the rewrite / split occurs... do you have any idea on the client that could play these streams? I wonder if it makes sense to write a bespoke player? Something specialized to the ALVR stream.

zmerp commented 4 years ago

It would make sense to make a h264/HEVC stream that VLC or other programs can read. This should be as simple as transmitting the video packets on a separate socket, so VLC can easily bind to it.

zmerp commented 1 year ago

Recently a new websocket was added at localhost:8082/api/video-mirror, but noone was able to make it work. The wesocket just streams a sequence of raw NALs, VLC should be able to recognize it but it doesn't.

alansartorio commented 1 year ago

I was able to view the mirror stream with this command

curl -s "http://localhost:8082/api/video-mirror" \
    -H "Connection: Upgrade" \
    -H "Upgrade: websocket" \
    -H "sec-websocket-key: anything" \
    -o - \
    | mpv --hwdec=yes --untimed -

Sometimes I have to run it a couple of times until it works.