mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
26.78k stars 2.84k forks source link

WebRTC stream support #12801

Open arekm opened 8 months ago

arekm commented 8 months ago

Please consider adding WebRTC support for mpv.

One use case here, possibly there are others:

WebRTC is used for streaming from local cameras on 3d printer related software (OctoPrint, Klipper). Usually using camera-streamer (https://github.com/ayufan/camera-streamer).

KlipperScreen (https://klipperscreen.readthedocs.io/en/latest/) utilises mpv (via python-mpv) and shows such streams on LCD screen. Unfortunately that currently doesn't work for WebRTC streams due to lack of support in mpv.

How to get example stream, assuming having working /dev/video0 camera:

camera-streamer --http-port=9090 --http-listen=0.0.0.0 # (--http-listen if not on local machine)

(additional options may be needed; like --camera-type=libcamera if using libcamera stack on raspberry pi with bookworm based OS etc)

go to that port with web browser and click "webrtc" there.

aicynide commented 8 months ago

Also support widevine videos

makidoll commented 1 month ago

Was just looking into webrtc support for ffmpeg and found these: https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=10012 https://github.com/metartc/ffmpeg-webrtc

ruihe774 commented 1 month ago

You can build mpv with third-party ffmpeg that supports WebRTC by yourself.