ALVR icon indicating copy to clipboard operation
ALVR copied to clipboard

Playback video/audio stream on a second device

Open iphands opened this issue 5 years ago • 7 comments

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!

iphands avatar Jul 10 '20 21:07 iphands

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

zmerp avatar Jul 13 '20 18:07 zmerp

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

iphands avatar Jul 13 '20 20:07 iphands

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).

zmerp avatar Jul 14 '20 15:07 zmerp

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.

iphands avatar Jul 14 '20 17:07 iphands

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 avatar Jul 14 '20 17:07 zmerp

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.

zmerp avatar Feb 01 '23 20:02 zmerp

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.

alansartorio avatar Jul 01 '23 23:07 alansartorio