xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.

Opened 17 months ago

Last modified 16 months ago

#2995 new enhancement

Announce video stream as DLNA/UPnP media source

Reported by: amontero Owned by: amontero
Priority: major Milestone: 4.2
Component: network Version: 3.0.x
Keywords: Cc:


Usage scenario:
Nowadays, all TVs feature DLNA "client" (renderer in DLNA parlance). They can render multimedia streams available in the LAN from any available media server. It is also a standard widely supported by lots of devices and software (Playstation, VLC, Kodi).
By just announcing the stream to the LAN (via an optional switch), any of these devices could be used as a monitor without any direct (physical) cabling to PC/server.
I'm still not deep into xpra usage, but think of it as secondary desktop on your TV or to use a headless (no VGA, DVI, HDMI physical cabling) for a desktop. Or just easily exposing a single GUI app output to the LAN.

Since there is already a media stream, only doing a proper UPnP server LAN broadcast would do, since client devices would just connect to the stream.
My Python is not that awesome, but with proper guidance I can even take a stab at it.

Attachments (1)

video-stream.patch (7.9 KB) - added by Antoine Martin 17 months ago.
create a video stream URL

Download all attachments as: .zip

Change History (4)

comment:1 Changed 17 months ago by Antoine Martin

Status: newassigned

Since there is already a media stream

No there isn't. By default, screen updates are encoded using various codecs (not always video) and sent as discrete packets.

A DLNA connection would require running a WindowVideoSource in video mode (only h264 enabled) with the full_frames_only=True.
The URL would need to hit a script path to create it, similar to what we already do for audio with IE in http_audio_mp3_request. Authentication could be done using an OTP, or none to begin with. (generating qrcodes for those URLs might be useful too #2627)
There would need to be some wiring added to WindowSource so that it doesn't send any packets via the regular queue_packet function. (and disable congestion notifications)
Rate control may need this override to trigger damage_packet_acked as soon as the buffer is written out to the http connection.

Overall, this does not look too hard to implement.

Changed 17 months ago by Antoine Martin

Attachment: video-stream.patch added

create a video stream URL

comment:2 Changed 17 months ago by Antoine Martin

Owner: changed from Antoine Martin to amontero
Status: assignednew

With the patch above and a TCP server on port 10000, you can hit this URL to download a video stream of window 2 (you can skip &wid=2 if there is only one window):

wget "http://localhost:10000/video?encoding=h264&wid=2"

It needs a lot more work:

  • code is hacked together, needs tidying up and moving to a dedicate handler class
  • error handling
  • if the window is resized... the video stream won't be
  • not tested with desktop and shadow mode, should work
  • the stream uses raw h264 - you can play it with mplayer but probably not with other devices, it should be using h264+mp4 to get a container format


I don't have time to chase this.

comment:3 Changed 16 months ago by migration script

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/2995

Note: See TracTickets for help on using tickets.