mirror of
https://github.com/morgan9e/UxPlay
synced 2026-04-14 00:04:13 +09:00
uxplay 1.48 make video pipeline configurable for hardware h264 decoders
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<h1 id="uxplay-1.47-airplayairplay-mirror-server-for-linux-macos-and-unix.">UxPlay 1.47: AirPlay/AirPlay-Mirror server for Linux, macOS, and Unix.</h1>
|
||||
<h1 id="uxplay-1.48-airplayairplay-mirror-server-for-linux-macos-and-unix.">UxPlay 1.48: AirPlay/AirPlay-Mirror server for Linux, macOS, and Unix.</h1>
|
||||
<p>Highlights:</p>
|
||||
<ul>
|
||||
<li>GPLv3, open source.</li>
|
||||
@@ -8,12 +8,12 @@
|
||||
<li>Uses GStreamer, with options to select different output “videosinks” and “audiosinks”.</li>
|
||||
<li>Support for server behind a firewall.</li>
|
||||
</ul>
|
||||
<p>This project is a GPLv3 open source unix AirPlay2 Mirror server for Linux, macOS, and *BSD. It is now hosted at the github site <a href="https://github.com/FDH2/UxPlay">https://github.com/FDH2/UxPlay</a> (where development and user-assistance now takes place), although it initially was developed by <a href="http://github.com/antimof/Uxplay">antimof</a> using code from <a href="https://github.com/FD-/RPiPlay">RPiPlay</a>, which in turn derives from <a href="https://github.com/KqsMea8/AirplayServer">AirplayServer</a>, <a href="https://github.com/juhovh/shairplay">shairplay</a>, and <a href="https://github.com/EstebanKubata/playfair">playfair</a>. (The antimof site is mainly inactive, but periodically posts updates pulled from the <a href="https://github.com/FDH2/UxPlay">main UxPlay site</a>).</p>
|
||||
<p>This project is a GPLv3 open source unix AirPlay2 Mirror server for Linux, macOS, and *BSD. <em>It is now hosted at the github site <a href="https://github.com/FDH2/UxPlay">https://github.com/FDH2/UxPlay</a> (where development and user-assistance now takes place)</em>, although it initially was developed by <a href="http://github.com/antimof/Uxplay">antimof</a> using code from <a href="https://github.com/FD-/RPiPlay">RPiPlay</a>, which in turn derives from <a href="https://github.com/KqsMea8/AirplayServer">AirplayServer</a>, <a href="https://github.com/juhovh/shairplay">shairplay</a>, and <a href="https://github.com/EstebanKubata/playfair">playfair</a>. (The antimof site is mainly inactive, but periodically posts updates pulled from the <a href="https://github.com/FDH2/UxPlay">main UxPlay site</a>).</p>
|
||||
<p>Its main use is to act like an AppleTV for screen-mirroring (with audio) of iOS/iPadOS/macOS clients (iPhones, iPads, MacBooks) in a window on the server display (with the possibility of sharing that window on screen-sharing applications such as Zoom) on a host running Linux, macOS, or other unix. UxPlay supports a “legacy” form of Apple’s AirPlay Mirror protocol introduced in iOS 12; client devices running iOS/iPadOS 9.3.5 or later are supported, as is a (non-free) Windows-based AirPlay-client software emulator, AirMyPC. (Details of what is publically known about Apple’s AirPlay2 protocol can be found <a href="https://github.com/SteeBono/airplayreceiver/wiki/AirPlay2-Protocol">here</a> and <a href="https://emanuelecozzi.net/docs/airplay2">here</a>).</p>
|
||||
<p>The UxPlay server and its client must be on the same local area network, on which a <strong>Bonjour/Zeroconf mDNS/DNS-SD server</strong> is also running (only DNS-SD “Service Discovery” service is strictly necessary, it is not necessary that the local network also be of the “.local” mDNS-based type). On Linux and BSD Unix servers, this is usually provided by <a href="https://www.avahi.org">Avahi</a>, through the avahi-daemon service, and is included in most Linux distributions (this service can also be provided by macOS, iOS or Windows servers).</p>
|
||||
<p>Connections to the UxPlay server by iOS/MacOS clients can be initiated both in AirPlay Mirror mode (which streams lossily-compressed AAC audio while mirroring the client screen, or in the alternative AirPlay Audio mode which streams Apple Lossless (ALAC) audio without screen mirroring (the accompanying metadata and cover art in this mode is not displayed). <em>Switching between these two modes during an active connection is possible: in Mirror mode, close the mirror window and start an Audio mode connection, switch back by initiating a Mirror mode connection.</em> <strong>Note that Apple DRM (as in Apple TV app content on the client) cannot be decrypted by UxPlay, and (unlike with a true AppleTV), the client cannot run a http connection on the server instead of streaming content from one on the client.</strong></p>
|
||||
<p>UxPlay uses GStreamer Plugins for rendering audio and video, and does not offer the alternative Raspberry-Pi-specific audio and video renderers available in <a href="https://github.com/FD-/RPiPlay">RPiPlay</a>. It is tested on a number of systems, including (among others) Debian 10.11 “Buster” and 11.2 “Bullseye”, Ubuntu 20.04 and 21.10, Linux Mint 20.2, Pop!_OS 21.10 (NVIDIA edition), Rocky Linux 8.5 (a CentOS successor), OpenSUSE 15.3, Arch Linux 5.16.8, macOS 10.15.7, FreeBSD 13.0.</p>
|
||||
<p>Using Gstreamer means that video and audio are supported “out of the box”, using a choice of plugins. Gstreamer decoding is plugin agnostic, and uses accelerated decoders if available. For Intel integrated graphics, the VAAPI plugin is preferable, (but don’t use it with NVIDIA).</p>
|
||||
<p>Using Gstreamer means that video and audio are supported “out of the box”, using a choice of plugins. Gstreamer decoding is plugin agnostic, and uses accelerated decoders if available. For Intel integrated graphics, the VAAPI plugin is preferable. VAAPI is convenient for Intel and some AMD systems. For NVIDIA graphics, the proprietary nvdec (or nvh264dec) plugin can be used with the NVIDIA GPU if you manage to build and install it; v4l2h264dec would be the appropriate choice for the Broadcom GPU in the Raspberry Pi 4, if you can get it working (UxPlay does not run well on the Raspberry PI if GPU hardware h264 decoding is not used, as its CPU is not powerful enough for satisfactory software h264 video decoding). The -vd, -vc, and -vs options can be used to create GStreamer video pipelines to use non-VAAPI hardware decoders.</p>
|
||||
<h3 id="note-to-packagers-openssl-3.0.0-solves-gpl-v3-license-issues.">Note to packagers: OpenSSL-3.0.0 solves GPL v3 license issues.</h3>
|
||||
<p>Some Linux distributions such as Debian do not allow distribution of compiled GPL code linked to OpenSSL-1.1.1 because its “dual OpenSSL/SSLeay” license has some incompatibilities with GPL, unless all code authors have explicitly given an “exception” to allow such linking (the historical origins of UxPlay make this impossible to obtain). Other distributions treat OpenSSL as a “System Library” which the GPL allows linking to.</p>
|
||||
<p>For “GPL-strict” distributions, UxPlay can be built using OpenSSL- 3.0.0, which has a new <a href="https://www.openssl.org/blog/blog/2021/09/07/OpenSSL3.Final/">GPLv3-compatible license</a>.</p>
|
||||
@@ -79,6 +79,8 @@
|
||||
<p>Also: image transforms that had been added to RPiPlay have been ported to UxPlay:</p>
|
||||
<p><strong>-f {H|V|I}</strong> implements “videoflip” image transforms: H = horizontal flip (right-left flip, or mirror image); V = vertical flip ; I = 180 degree rotation or inversion (which is the combination of H with V).</p>
|
||||
<p><strong>-r {R|L}</strong> 90 degree Right (clockwise) or Left (counter-clockwise) rotations; these are carried out after any <strong>-f</strong> transforms.</p>
|
||||
<p><strong>-vd <em>decoder</em></strong> chooses the GStreamer pipeline’s h264 decoder, instead of letting decodebin pick it for you. Software deconing is done by avdec_h264; various hardware decoders include: vaapi264dec, nvdec, nvh264dec, v4l2h264dec (these require that the appropriate hardware is available). Using quotes “…” allows some parameters to be included with the decoder name.</p>
|
||||
<p><strong>-vc <em>converter</em></strong> chooses the GStreamer pipeline’s videoconverter, instead of letting videoconvert choose what to do. When using video4linux hardware decoding by a GPU, v4l2convert will also use the GPU for video conversion. Using quotes “…” allows some parameters to be included with the converter name.</p>
|
||||
<p><strong>-vs <em>videosink</em></strong> chooses the GStreamer videosink, instead of letting autovideosink pick it for you. Some videosink choices are: ximagesink, xvimagesink, vaapisink (for intel graphics), gtksink, glimagesink, waylandsink, osximagesink (for macOS), or fpsdisplaysink (which shows the streaming framerate in fps). Using quotes “…” allows some parameters to be included with the videosink name. For example, <strong>fullscreen</strong> mode is supported by the vaapisink plugin, and is obtained using <code>-vs "vaapisink fullscreen=true"</code>; this also works with <code>waylandsink</code>. The syntax of such options is specific to a given plugin, and some choices of videosink might not work on your system.</p>
|
||||
<p><strong>-vs 0</strong> suppresses display of streamed video, but plays streamed audio. (The client’s screen is still mirrored at a reduced rate of 1 frame per second, but is not rendered or displayed.) This feature (which streams audio in AAC audio format) is now probably unneeded, as UxPlay can now stream superior-quality Apple Lossless audio without video in Airplay non-mirror mode.</p>
|
||||
<p><strong>-avdec</strong> forces use of software h264 decoding using Gstreamer element avdec_h264 (libav h264 decoder). This option should prevent autovideosink choosing a hardware-accelerated videosink plugin such as vaapisink.</p>
|
||||
@@ -114,6 +116,7 @@
|
||||
<p>This triggers an unending stream of error messages, and means that the audio decryption key (also used in video decryption) was not correctly extracted from data sent by the client. This should not happen for iOS 9.3 or later clients. However, if a client uses the same older version of the protocol that is used by the Windows-based AirPlay client emulator <em>AirMyPC</em>, the protocol can be switched to the older version by the setting <code>OLD_PROTOCOL_CLIENT_USER_AGENT_LIST</code> in lib/global.h. UxPlay reports the client’s “User Agent” string when it connects. If some other client also fails to decrypt all audio and video, try adding its “User Agent” string in place of “xxx” in the entry “AirMyPC/2.0;xxx” in global.h and rebuild uxplay.</p>
|
||||
<p>Note that Uxplay declares itself to be an AppleTV3,2 with a sourceVersion 220.68; this can also be changed in global.h. It is crucial for UxPlay to declare this old value of sourceVersion, as this prompts the Apple client to use a less-encrypted “legacy” protocol needed by third-generation Apple TV’s, which are 32-bit devices that cannot run modern tvOS; it is probably not necessary for UxPlay to claim to be such an old AppleTV model.</p>
|
||||
<h1 id="changelog">ChangeLog</h1>
|
||||
<p>1.48 2022-02-24 Made the video pipeline fully configurable, for use with hardware h264 decoding.</p>
|
||||
<p>1.47 2022-02-05 Added -FPSdata option to display (in the terminal) regular reports sent by the client about video streaming performance. Internal cleanups of processing of video packets received from the client. Added -reset n option to reset the connection after n ntp timeouts (also reset after “connection reset by peer” error in video stream).</p>
|
||||
<p>1.46 2022-01-20 Restore pre-1.44 behavior (1.44 may have broken hardware acceleration): once again use decodebin in the video pipeline; introduce new option “-avdec” to force software h264 decoding by libav h264, if needed (to prevent selection of vaapisink by autovideosink). Update llhttp to v6.0.6. UxPlay now reports itself as AppleTV3,2. Restrict connections to one client at a time (second client must now wait for first client to disconnect).</p>
|
||||
<p>1.45 2022-01-10 New behavior: close video window when client requests “stop mirroring”. (A new “no close” option “-nc” is added for users who wish to retain previous behavior that does not close the video window).</p>
|
||||
|
||||
24
README.md
24
README.md
@@ -1,4 +1,4 @@
|
||||
# UxPlay 1.47: AirPlay/AirPlay-Mirror server for Linux, macOS, and Unix.
|
||||
# UxPlay 1.48: AirPlay/AirPlay-Mirror server for Linux, macOS, and Unix.
|
||||
|
||||
Highlights:
|
||||
|
||||
@@ -12,8 +12,8 @@ Highlights:
|
||||
* Support for server behind a firewall.
|
||||
|
||||
This project is a GPLv3 open source unix AirPlay2 Mirror server for Linux, macOS, and \*BSD.
|
||||
It is now hosted at the
|
||||
github site [https://github.com/FDH2/UxPlay](https://github.com/FDH2/UxPlay) (where development and user-assistance now takes place), although it initially was developed by
|
||||
*It is now hosted at the
|
||||
github site [https://github.com/FDH2/UxPlay](https://github.com/FDH2/UxPlay) (where development and user-assistance now takes place)*, although it initially was developed by
|
||||
[antimof](http://github.com/antimof/Uxplay) using code
|
||||
from [RPiPlay](https://github.com/FD-/RPiPlay), which in turn derives from
|
||||
[AirplayServer](https://github.com/KqsMea8/AirplayServer),
|
||||
@@ -59,7 +59,12 @@ Rocky Linux 8.5 (a CentOS successor), OpenSUSE 15.3, Arch Linux 5.16.8, macOS 10
|
||||
|
||||
Using Gstreamer means that video and audio are supported "out of the box", using a choice of plugins.
|
||||
Gstreamer decoding is plugin agnostic, and uses accelerated decoders if
|
||||
available. For Intel integrated graphics, the VAAPI plugin is preferable, (but don't use it with NVIDIA).
|
||||
available. For Intel integrated graphics, the VAAPI plugin is preferable. VAAPI is convenient for Intel and some AMD systems.
|
||||
For NVIDIA graphics, the proprietary nvdec (or nvh264dec) plugin can be used with the NVIDIA GPU if you manage to build and install it; v4l2h264dec
|
||||
would be the appropriate choice for the Broadcom GPU in the Raspberry Pi 4, if you can get it working (UxPlay
|
||||
does not run well on the Raspberry PI if GPU hardware h264 decoding is not used, as its CPU is not powerful enough for
|
||||
satisfactory software h264 video decoding). The -vd, -vc, and -vs options
|
||||
can be used to create GStreamer video pipelines to use non-VAAPI hardware decoders.
|
||||
|
||||
### Note to packagers: OpenSSL-3.0.0 solves GPL v3 license issues.
|
||||
|
||||
@@ -314,6 +319,15 @@ Also: image transforms that had been added to RPiPlay have been ported to UxPlay
|
||||
**-r {R|L}** 90 degree Right (clockwise) or Left (counter-clockwise)
|
||||
rotations; these are carried out after any **-f** transforms.
|
||||
|
||||
**-vd _decoder_** chooses the GStreamer pipeline's h264 decoder, instead of letting
|
||||
decodebin pick it for you. Software deconing is done by avdec_h264; various hardware decoders
|
||||
include: vaapi264dec, nvdec, nvh264dec, v4l2h264dec (these require that the appropriate hardware is
|
||||
available). Using quotes "..." allows some parameters to be included with the decoder name.
|
||||
|
||||
**-vc _converter_** chooses the GStreamer pipeline's videoconverter, instead of letting videoconvert
|
||||
choose what to do. When using video4linux hardware decoding by a GPU, v4l2convert will also use
|
||||
the GPU for video conversion. Using quotes "..." allows some parameters to be included with the converter name.
|
||||
|
||||
**-vs _videosink_** chooses the GStreamer videosink, instead of letting
|
||||
autovideosink pick it for you. Some videosink choices are: ximagesink, xvimagesink,
|
||||
vaapisink (for intel graphics), gtksink, glimagesink, waylandsink, osximagesink (for macOS), or
|
||||
@@ -483,6 +497,8 @@ devices that cannot run modern tvOS; it is probably
|
||||
not necessary for UxPlay to claim to be such an old AppleTV model.
|
||||
|
||||
# ChangeLog
|
||||
1.48 2022-02-24 Made the video pipeline fully configurable, for use with hardware h264 decoding.
|
||||
|
||||
1.47 2022-02-05 Added -FPSdata option to display (in the terminal) regular reports sent by the client about video streaming
|
||||
performance. Internal cleanups of processing of video packets received from the client. Added -reset n option
|
||||
to reset the connection after n ntp timeouts (also reset after "connection reset by peer" error in video stream).
|
||||
|
||||
33
README.txt
33
README.txt
@@ -1,4 +1,4 @@
|
||||
UxPlay 1.47: AirPlay/AirPlay-Mirror server for Linux, macOS, and Unix.
|
||||
UxPlay 1.48: AirPlay/AirPlay-Mirror server for Linux, macOS, and Unix.
|
||||
======================================================================
|
||||
|
||||
Highlights:
|
||||
@@ -19,9 +19,9 @@ Highlights:
|
||||
- Support for server behind a firewall.
|
||||
|
||||
This project is a GPLv3 open source unix AirPlay2 Mirror server for
|
||||
Linux, macOS, and \*BSD. It is now hosted at the github site
|
||||
Linux, macOS, and \*BSD. *It is now hosted at the github site
|
||||
<https://github.com/FDH2/UxPlay> (where development and user-assistance
|
||||
now takes place), although it initially was developed by
|
||||
now takes place)*, although it initially was developed by
|
||||
[antimof](http://github.com/antimof/Uxplay) using code from
|
||||
[RPiPlay](https://github.com/FD-/RPiPlay), which in turn derives from
|
||||
[AirplayServer](https://github.com/KqsMea8/AirplayServer),
|
||||
@@ -75,8 +75,15 @@ OpenSUSE 15.3, Arch Linux 5.16.8, macOS 10.15.7, FreeBSD 13.0.
|
||||
Using Gstreamer means that video and audio are supported "out of the
|
||||
box", using a choice of plugins. Gstreamer decoding is plugin agnostic,
|
||||
and uses accelerated decoders if available. For Intel integrated
|
||||
graphics, the VAAPI plugin is preferable, (but don't use it with
|
||||
NVIDIA).
|
||||
graphics, the VAAPI plugin is preferable. VAAPI is convenient for Intel
|
||||
and some AMD systems. For NVIDIA graphics, the proprietary nvdec (or
|
||||
nvh264dec) plugin can be used with the NVIDIA GPU if you manage to build
|
||||
and install it; v4l2h264dec would be the appropriate choice for the
|
||||
Broadcom GPU in the Raspberry Pi 4, if you can get it working (UxPlay
|
||||
does not run well on the Raspberry PI if GPU hardware h264 decoding is
|
||||
not used, as its CPU is not powerful enough for satisfactory software
|
||||
h264 video decoding). The -vd, -vc, and -vs options can be used to
|
||||
create GStreamer video pipelines to use non-VAAPI hardware decoders.
|
||||
|
||||
### Note to packagers: OpenSSL-3.0.0 solves GPL v3 license issues.
|
||||
|
||||
@@ -401,6 +408,19 @@ degree rotation or inversion (which is the combination of H with V).
|
||||
**-r {R\|L}** 90 degree Right (clockwise) or Left (counter-clockwise)
|
||||
rotations; these are carried out after any **-f** transforms.
|
||||
|
||||
**-vd *decoder*** chooses the GStreamer pipeline's h264 decoder, instead
|
||||
of letting decodebin pick it for you. Software deconing is done by
|
||||
avdec\_h264; various hardware decoders include: vaapi264dec, nvdec,
|
||||
nvh264dec, v4l2h264dec (these require that the appropriate hardware is
|
||||
available). Using quotes "..." allows some parameters to be included
|
||||
with the decoder name.
|
||||
|
||||
**-vc *converter*** chooses the GStreamer pipeline's videoconverter,
|
||||
instead of letting videoconvert choose what to do. When using
|
||||
video4linux hardware decoding by a GPU, v4l2convert will also use the
|
||||
GPU for video conversion. Using quotes "..." allows some parameters to
|
||||
be included with the converter name.
|
||||
|
||||
**-vs *videosink*** chooses the GStreamer videosink, instead of letting
|
||||
autovideosink pick it for you. Some videosink choices are: ximagesink,
|
||||
xvimagesink, vaapisink (for intel graphics), gtksink, glimagesink,
|
||||
@@ -629,6 +649,9 @@ to be such an old AppleTV model.
|
||||
ChangeLog
|
||||
=========
|
||||
|
||||
1.48 2022-02-24 Made the video pipeline fully configurable, for use with
|
||||
hardware h264 decoding.
|
||||
|
||||
1.47 2022-02-05 Added -FPSdata option to display (in the terminal)
|
||||
regular reports sent by the client about video streaming performance.
|
||||
Internal cleanups of processing of video packets received from the
|
||||
|
||||
@@ -121,9 +121,13 @@ void video_renderer_init(logger_t *render_logger, const char *server_name, vide
|
||||
assert(renderer);
|
||||
|
||||
gst_init(NULL,NULL);
|
||||
GString *launch = g_string_new("appsrc name=video_source stream-type=0 format=GST_FORMAT_TIME is-live=true ! queue ! ");
|
||||
GString *launch = g_string_new("appsrc name=video_source stream-type=0 format=GST_FORMAT_TIME is-live=true ! ");
|
||||
g_string_append(launch, "queue ! ");
|
||||
g_string_append(launch, "h264parse ! ");
|
||||
g_string_append(launch, decoder);
|
||||
g_string_append(launch, " ! ");
|
||||
g_string_append(launch, converter);
|
||||
g_string_append(launch, " ! ");
|
||||
append_videoflip(launch, &videoflip[0], &videoflip[1]);
|
||||
g_string_append(launch, videosink);
|
||||
g_string_append(launch, " name=video_sink sync=false");
|
||||
|
||||
14
uxplay.1
14
uxplay.1
@@ -1,11 +1,11 @@
|
||||
.TH UXPLAY "1" "February 2022" "1.47" "User Commands"
|
||||
.TH UXPLAY "1" "February 2022" "1.48" "User Commands"
|
||||
.SH NAME
|
||||
uxplay \- start AirPlay server
|
||||
.SH SYNOPSIS
|
||||
.B uxplay
|
||||
[\fI\,-n name\/\fR] [\fI\,-s wxh\/\fR] [\fI\,-p \/\fR[\fI\,n\/\fR]] [more \fI OPTIONS \/\fR ...]
|
||||
.SH DESCRIPTION
|
||||
UxPlay 1.47: An open\-source AirPlay mirroring server based on RPiPlay
|
||||
UxPlay 1.48: An open\-source AirPlay mirroring server based on RPiPlay
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B
|
||||
@@ -37,7 +37,15 @@ UxPlay 1.47: An open\-source AirPlay mirroring server based on RPiPlay
|
||||
.TP
|
||||
\fB\-t\fR n Relaunch server if no connection existed in last n seconds
|
||||
.TP
|
||||
\fB\-vs\fI sink\fR Choose the GStreamer videosink; default "autovideosink"
|
||||
\fB\-vd\fI dec \fR Choose GStreamer h264 decoder; default "decodebin"
|
||||
.IP
|
||||
some choices: avdec_h264,vaapih264dec,nvdec,nvh264dec,v4l2h264dec.
|
||||
.TP
|
||||
\fB\-vc\fI cnv \fR Choose GStreamer videoconverter; default "videoconvert"
|
||||
.IP
|
||||
another choice when using v4l2h264dec: v4l2decode.
|
||||
.TP
|
||||
\fB\-vs\fI sink\fR Choose the GStreamer videosink; default "autovideosink"
|
||||
.IP
|
||||
some choices: ximagesink,xvimagesink,vaapisink,glimagesink,
|
||||
.IP
|
||||
|
||||
46
uxplay.cpp
46
uxplay.cpp
@@ -44,7 +44,7 @@
|
||||
#include "renderers/video_renderer.h"
|
||||
#include "renderers/audio_renderer.h"
|
||||
|
||||
#define VERSION "1.47"
|
||||
#define VERSION "1.48"
|
||||
|
||||
#define DEFAULT_NAME "UxPlay"
|
||||
#define DEFAULT_DEBUG_LOG false
|
||||
@@ -77,8 +77,8 @@ static std::string audiosink = "autoaudiosink";
|
||||
static bool use_audio = true;
|
||||
static bool new_window_closing_behavior = true;
|
||||
static bool close_window;
|
||||
static std::string decoder = "decodebin ! ";
|
||||
static std::string converter = "videoconvert ! ";
|
||||
static std::string video_decoder = "decodebin";
|
||||
static std::string video_converter = "videoconvert";
|
||||
static bool show_client_FPS_data = false;
|
||||
static unsigned int max_ntp_timeouts = NTP_TIMEOUT_LIMIT;
|
||||
|
||||
@@ -226,13 +226,17 @@ static void print_info (char *name) {
|
||||
printf(" \"-p tcp n\" or \"-p udp n\" sets TCP or UDP ports separately\n");
|
||||
printf("-m Use random MAC address (use for concurrent UxPlay's)\n");
|
||||
printf("-t n Relaunch server if no connection existed in last n seconds\n");
|
||||
printf("-vs Choose the GStreamer videosink; default \"autovideosink\"\n");
|
||||
printf("-vd ... Choose the GStreamer h264 decoder; default \"decodebin\"\n");
|
||||
printf(" choices: avdec_h264,vaapih264dec,nvdec,nvh264dec,v4l2h264dec\n");
|
||||
printf("-vc ... Choose the GStreamer videoconverter; default \"videoconvert\"\n");
|
||||
printf(" another choice when using v4l2h264decode: v4l2convert\n");
|
||||
printf("-vs ... Choose the GStreamer videosink; default \"autovideosink\"\n");
|
||||
printf(" some choices: ximagesink,xvimagesink,vaapisink,glimagesink,\n");
|
||||
printf(" gtksink,waylandsink,osximagesink,fpsdisplaysink, etc.\n");
|
||||
printf("-vs 0 Streamed audio only, with no video display window\n");
|
||||
printf("-avdec Force software h264 video decoding with libav h264 decoder\n");
|
||||
printf("-as Choose the GStreamer audiosink; default \"autoaudiosink\"\n");
|
||||
printf(" choices: pulsesink,alsasink,osssink,oss4sink,osxaudiosink,etc.\n");
|
||||
printf("-as ... Choose the GStreamer audiosink; default \"autoaudiosink\"\n");
|
||||
printf(" choices: pulsesink,alsasink,osssink,oss4sink,osxaudiosink\n");
|
||||
printf("-as 0 (or -a) Turn audio off, streamed video only\n");
|
||||
printf("-reset n Reset after 3n seconds client silence (default %d, 0 = never)\n", NTP_TIMEOUT_LIMIT);
|
||||
printf("-nc do Not Close video window when client stops mirroring\n");
|
||||
@@ -443,6 +447,14 @@ int main (int argc, char *argv[]) {
|
||||
} else if (arg == "-h" || arg == "-v") {
|
||||
print_info(argv[0]);
|
||||
exit(0);
|
||||
} else if (arg == "-vd") {
|
||||
if (!option_has_value(i, argc, arg, argv[i+1])) exit(1);
|
||||
video_decoder.erase();
|
||||
video_decoder.append(argv[++i]);
|
||||
} else if (arg == "-vc") {
|
||||
if (!option_has_value(i, argc, arg, argv[i+1])) exit(1);
|
||||
video_converter.erase();
|
||||
video_converter.append(argv[++i]);
|
||||
} else if (arg == "-vs") {
|
||||
if (!option_has_value(i, argc, arg, argv[i+1])) exit(1);
|
||||
videosink.erase();
|
||||
@@ -462,20 +474,8 @@ int main (int argc, char *argv[]) {
|
||||
} else if (arg == "-nc") {
|
||||
new_window_closing_behavior = false;
|
||||
} else if (arg == "-avdec") {
|
||||
decoder.erase();
|
||||
decoder = "h264parse ! avdec_h264 ! ";
|
||||
converter.erase();
|
||||
converter = "videoconvert ! ";
|
||||
} else if (arg == "-nvdec") {
|
||||
decoder.erase();
|
||||
decoder = "h264parse ! nvh264dec ! "; /* undocumented option for NVIDIA graphics (may be removed without warning) */
|
||||
converter.erase();
|
||||
converter = "videoconvert ! ";
|
||||
} else if (arg == "-v4l2") {
|
||||
decoder.erase();
|
||||
decoder = "h264parse ! v4l2h264dec ! "; /* undocumented option for Raspberry PI (may be removed without warning) */
|
||||
converter.erase();
|
||||
converter = "v4l2convert ! ";
|
||||
video_decoder.erase();
|
||||
video_decoder = "avdec_h264";
|
||||
} else if (arg == "-FPSdata") {
|
||||
show_client_FPS_data = true;
|
||||
} else if (arg == "-reset") {
|
||||
@@ -522,7 +522,8 @@ int main (int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
if (use_video) {
|
||||
video_renderer_init(render_logger, server_name.c_str(), videoflip, decoder.c_str(), converter.c_str(), videosink.c_str());
|
||||
video_renderer_init(render_logger, server_name.c_str(), videoflip,
|
||||
video_decoder.c_str(), video_converter.c_str(), videosink.c_str());
|
||||
video_renderer_start();
|
||||
}
|
||||
|
||||
@@ -560,7 +561,8 @@ int main (int argc, char *argv[]) {
|
||||
if (use_audio) audio_renderer_stop();
|
||||
if (use_video && close_window) {
|
||||
video_renderer_destroy();
|
||||
video_renderer_init(render_logger, server_name.c_str(), videoflip, decoder.c_str(), converter.c_str(), videosink.c_str());
|
||||
video_renderer_init(render_logger, server_name.c_str(), videoflip,
|
||||
video_decoder.c_str(), video_converter.c_str(), videosink.c_str());
|
||||
video_renderer_start();
|
||||
}
|
||||
if (reset_loop) goto reconnect;
|
||||
|
||||
Reference in New Issue
Block a user