diff --git a/README.html b/README.html index 5f01f11..05ba82f 100644 --- a/README.html +++ b/README.html @@ -19,7 +19,7 @@

For systems with Intel integrated graphics, hardware GPU decoding with the gstreamer VAAPI plugin is preferable. VAAPI is open-source, and in addition to Intel, can support some AMD GPU’s (the open-source “Nouveau” drivers for NVIDIA graphics are also in principle supported when VAAPI is supplemented with firmware extracted from the proprietary NVIDIA drivers).

For NVIDIA graphics with the proprietary drivers, the nvdec plugin (recently renamed nvh264dec) can be used for accelerated video decoding on the NVIDIA GPU with CUDA. The nvdec plugin is part of gstreamer1.0-plugins-bad, but is generally not included in binary packages, as NVIDIA’s proprietary Video Codec SDK must be downloaded, and three header files from it must be added to the gstreamer source before the plugin can be compiled. Users must do this themselves: see these instructions, and adapt them as necessary for your GStreamer installation. This plugin should be used with the -vd nvdec (or nvh264dec) and -vs glimagesink uxplay options.

Note to packagers: OpenSSL-3.0.0 solves GPL v3 license issues.

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.

@@ -86,8 +86,9 @@

Also: image transforms that had been added to RPiPlay have been ported to UxPlay:

-f {H|V|I} 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).

-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 decoding 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 the default value “videoconvert”. When using video4linux hardware decoding by a GPU,-vc v4l2convert will also use the GPU for video conversion. Using quotes “…” allows some parameters to be included with the converter name.

+

-vp parser choses the GStreamer pipeline’s h264 parser element, default is h264parse. Using quotes “…” allows options to be added.

+

-vd decoder chooses the GStreamer pipeline’s h264 decoder element, instead of letting decodebin pick it for you. Software decoding 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 element, instead of the default value “videoconvert”. When using video4linux hardware decoding by a GPU,-vc 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 fpsdisplaysink (which shows the streaming framerate in fps). Using quotes “…” allows some parameters to be included with the videosink name. For example, fullscreen mode is supported by the vaapisink plugin, and is obtained using -vs "vaapisink fullscreen=true"; this also works with waylandsink. The syntax of such options is specific to a given plugin, and some choices of videosink might not work on your system.

-vs 0 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.

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

diff --git a/README.md b/README.md index 037f554..7ea3482 100644 --- a/README.md +++ b/README.md @@ -76,24 +76,22 @@ Users must do this themselves: see [these instructions](https://gist.github.com/ adapt them as necessary for your GStreamer installation. This plugin should be used with the `-vd nvdec` (or nvh264dec) and `-vs glimagesink` uxplay options. -* **support for Raspberry Pi** (_work in progress_): the R Pi platform has long been - supported by [RPiPlay](http://github.com/FD-/RPiPlay) using the deprecated 32-bit-only omx (OpenMAX) decoder, now - removed from latest Raspberry Pi OS (Bullseye), leading to user interest in getting UxPlay to work - on the R Pi (at least on model 4). UxPlay can work with software h264 video decoding (option `-avdec`), but without hardware decoding - has unacceptable latency on the Pi. The Video4Linux2 GStreamer plugin v4l2h264dec (from gstreamer1.0-plugins-good) is now the - appropriate choice for accelerated - hardware video decoding by the Broadcom GPU on the Pi. UxPlay options can be used to create GStreamer video pipelines to use - non-VAAPI hardware decoders, and a new UxPlay option `-rpi` creates a pipeline that should be appropriate for the Raspberry Pi, - and when it has worked, it has worked well. However, it usually does not work because of a "caps" mismatch between source and - sink, which could be fixable with GStreamer "know-how" (perhaps involving using the "capssetter" element). The GStreamer - video pipeline is "` (decrypted h264 stream from iOS)! queue ! h264parse ! decodebin ! videoconvert ! autovideosink sync=false`" - and the uxplay options `-vp , -vd, -vc ,-vs` can be used to - replace `h264parse, decodebin, videoconvert, autovideosink` by the user's - choices. (`-rpi` is equivalent - to `-vd v4l2h264dec -vc v4l2convert`). The first frame in the h264 video stream sends the "caps" - details (SPS, PPS) to h264parse. UxPlay users with the R Pi (model 4 recommended) are invited to experiment and report any - successes. (The uxplay `-d` option will display the actual video pipeline being - used, `export GST_DEBUG=2` before running uxplay will display GStreamer errors and warnings.) +* **possible support for Raspberry Pi** (_not working_): the CPU of the Raspberry Pi is not powerful + enough for GStreamer to decode the h264 video stream using software decoding (option `-avdec` ) without unacceptable latency. + The Pi has a Broadcom GPU for accelerated hardware h264 decoding, and in the past this has been + supported by [RPiPlay](https://github.com/FD-/RPiPlay) using the deprecated 32-bit omx (OpenMax) driver. Unfortunately, with the move + to a 64-bit OS, this has been removed from recent Raspberry Pi OS (Bullseye), and there has been user interest in making UxPlay work on the Pi. + The designated replacement for OpenMAX is Video4linux2, and the options that + _should_ work with UxPlay are `-vd v4l2h264dec -vc v4l2convert`, which are from gstreamer1.0-plugins-good. + This has occasionally worked, and when it did, it worked well, with no + appreciable latency. Unfortunately, the v4l2h264dec GStreamer plugin usually fails to match the "caps" (capacities) of the h264 + source to the videosink, and h264 hardware decoding fails. It is + not clear whether there is any workaround before an updated v4l2h264dec plugin becomes available. GStreamer-knowledgeable users + who wish to experiment can see if any video pipeline modifications can provide a workaround: + the pipeline is ` (video stream from appsrc) ... ! h264parse ! decodebin ! videoconvert ! autovideosink ... `; the elements h264parse, + decodebin, videoconvert, and autovideosink can respectively be modified with options -vp, -vd, -vc, and -vs. Please report any successes! + (See [this](https://github.com/raspberrypi/firmware/issues/1673), which suggests some workaround involving "capssetter" might be possible; + `export GST_DEBUG=GST_CAPS:5` may be useful in debugging the pipeline. ### Note to packagers: OpenSSL-3.0.0 solves GPL v3 license issues. @@ -349,12 +347,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 +**-vp _parser_** choses the GStreamer pipeline's h264 parser element, default is h264parse. Using + quotes "..." allows options to be added. + +**-vd _decoder_** chooses the GStreamer pipeline's h264 decoder element, instead of letting decodebin pick it for you. Software decoding 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 the default +**-vc _converter_** chooses the GStreamer pipeline's videoconverter element, instead of the default value "videoconvert". When using video4linux hardware decoding by a GPU,`-vc v4l2convert` will also use the GPU for video conversion. Using quotes "..." allows some parameters to be included with the converter name. diff --git a/README.txt b/README.txt index f095215..3f611c7 100644 --- a/README.txt +++ b/README.txt @@ -100,33 +100,35 @@ and adapt them as necessary for your GStreamer installation. This plugin should be used with the `-vd nvdec` (or nvh264dec) and `-vs glimagesink` uxplay options. -- **support for Raspberry Pi** (*work in progress*): the R Pi platform - has long been supported by [RPiPlay](http://github.com/FD-/RPiPlay) - using the deprecated 32-bit-only omx (OpenMAX) decoder, now removed - from latest Raspberry Pi OS (Bullseye), leading to user interest in - getting UxPlay to work on the R Pi (at least on model 4). UxPlay can - work with software h264 video decoding (option `-avdec`), but - without hardware decoding has unacceptable latency on the Pi. The - Video4Linux2 GStreamer plugin v4l2h264dec (from - gstreamer1.0-plugins-good) is now the appropriate choice for - accelerated hardware video decoding by the Broadcom GPU on the Pi. - UxPlay options can be used to create GStreamer video pipelines to - use non-VAAPI hardware decoders, and a new UxPlay option `-rpi` - creates a pipeline that should be appropriate for the Raspberry Pi, - and when it has worked, it has worked well. However, it usually does - not work because of a "caps" mismatch between source and sink, which - could be fixable with GStreamer "know-how" (perhaps involving using - the "capssetter" element). The GStreamer video pipeline is - "`(decrypted h264 stream from iOS)! queue ! h264parse ! decodebin ! videoconvert ! autovideosink sync=false`" - and the uxplay options `-vp , -vd, -vc ,-vs` can be used to replace - `h264parse, decodebin, videoconvert, autovideosink` by the user's - choices. (`-rpi` is equivalent to - `-vd v4l2h264dec -vc v4l2convert`). The first frame in the h264 - video stream sends the "caps" details (SPS, PPS) to h264parse. - UxPlay users with the R Pi (model 4 recommended) are invited to - experiment and report any successes. (The uxplay `-d` option will - display the actual video pipeline being used, `export GST_DEBUG=2` - before running uxplay will display GStreamer errors and warnings.) +- **possible support for Raspberry Pi** (*not working*): the CPU of + the Raspberry Pi is not powerful enough for GStreamer to decode the + h264 video stream using software decoding (option `-avdec` ) without + unacceptable latency. The Pi has a Broadcom GPU for accelerated + hardware h264 decoding, and in the past this has been supported by + [RPiPlay](https://github.com/FD-/RPiPlay) using the deprecated + 32-bit omx (OpenMax) driver. Unfortunately, with the move to a + 64-bit OS, this has been removed from recent Raspberry Pi OS + (Bullseye), and there has been user interest in making UxPlay work + on the Pi. The designated replacement for OpenMAX is Video4linux2, + and the options that *should* work with UxPlay are + `-vd v4l2h264dec -vc v4l2convert`, which are from + gstreamer1.0-plugins-good. This has occasionally worked, and when it + did, it worked well, with no appreciable latency. Unfortunately, the + v4l2h264dec GStreamer plugin usually fails to match the "caps" + (capacities) of the h264 source to the videosink, and h264 hardware + decoding fails. It is not clear whether there is any workaround + before an updated v4l2h264dec plugin becomes available. + GStreamer-knowledgeable users who wish to experiment can see if any + video pipeline modifications can provide a workaround: the pipeline + is + `(video stream from appsrc) ... ! h264parse ! decodebin ! videoconvert ! autovideosink ...`; + the elements h264parse, decodebin, videoconvert, and autovideosink + can respectively be modified with options -vp, -vd, -vc, and + -vs. Please report any successes! (See + [this](https://github.com/raspberrypi/firmware/issues/1673), which + suggests some workaround involving "capssetter" might be possible; + `export GST_DEBUG=GST_CAPS:5` may be useful in debugging the + pipeline. ### Note to packagers: OpenSSL-3.0.0 solves GPL v3 license issues. @@ -452,18 +454,21 @@ 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 decoding is done by -avdec\_h264; various hardware decoders include: vaapi264dec, nvdec, +**-vp *parser*** choses the GStreamer pipeline's h264 parser element, +default is h264parse. Using quotes "..." allows options to be added. + +**-vd *decoder*** chooses the GStreamer pipeline's h264 decoder element, +instead of letting decodebin pick it for you. Software decoding 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 the default value "videoconvert". When using video4linux -hardware decoding by a GPU,`-vc v4l2convert` will also use the GPU for -video conversion. Using quotes "..." allows some parameters to be -included with the converter name. +**-vc *converter*** chooses the GStreamer pipeline's videoconverter +element, instead of the default value "videoconvert". When using +video4linux hardware decoding by a GPU,`-vc 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, diff --git a/uxplay.1 b/uxplay.1 index f533666..2494c06 100644 --- a/uxplay.1 +++ b/uxplay.1 @@ -58,8 +58,6 @@ UxPlay 1.48: An open\-source AirPlay mirroring server based on RPiPlay .TP \fB\-vs\fR 0 Streamed audio only, with no video display window. .TP -\fB\-rpi\fR Video settings for Raspberry Pi 4 (h264 decoding in GPU). -.TP \fB\-avdec\fR Force software h264 video decoding with libav decoder. .TP \fB\-as\fI sink\fR Choose the GStreamer audiosink; default "autoaudiosink" diff --git a/uxplay.cpp b/uxplay.cpp index 67b46e9..c318b09 100644 --- a/uxplay.cpp +++ b/uxplay.cpp @@ -237,7 +237,7 @@ static void print_info (char *name) { 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("-rpi Video settings for Raspberry Pi 4 (h264 decoding in GPU).\n"); + // printf("-rpi Video settings for Raspberry Pi 4 (h264 decoding in GPU).\n"); printf("-vs 0 Streamed audio only, with no video display window\n"); printf("-avdec Force software h264 video decoding with libav decoder\n"); printf("-as ... Choose the GStreamer audiosink; default \"autoaudiosink\"\n"); @@ -485,11 +485,11 @@ int main (int argc, char *argv[]) { } else if (arg == "-avdec") { video_decoder.erase(); video_decoder = "avdec_h264"; - } else if (arg == "-rpi") { - video_decoder.erase(); - video_decoder = "v4l2h264dec"; - video_converter.erase(); - video_converter = "v4l2convert"; + // } else if (arg == "-rpi") { /*undocumented option, may be removed */ + // video_decoder.erase(); + // video_decoder = "v4l2h264dec"; + // video_converter.erase(); + // video_converter = "v4l2convert"; } else if (arg == "-FPSdata") { show_client_FPS_data = true; } else if (arg == "-reset") {