Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ set(modules
VTKStreaming::WEBM
)

# VideoToolbox is an Apple-only system framework; only build the hardware
# encoder backend that uses it on macOS. Non-Apple builds are unaffected.
if(APPLE)
list(APPEND modules VTKStreaming::VTEncode)
endif()

include(VTKSDKPythonWheelHelper)
vtksdk_build_modules(${SKBUILD_PROJECT_NAME} MODULES ${modules})
vtksdk_generate_package_init(${SKBUILD_PROJECT_NAME} MODULES ${modules})
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
This module provides classes to encode and stream frames
from a VTK OpenGL render window using video codecs.
It supports video encoding with VP9 (through [libvpx](https://chromium.googlesource.com/webm/libvpx/))
and H.264/H.265 (through [NVENC](https://developer.nvidia.com/nvidia-video-codec-sdk/download)).
and H.264/H.265 through hardware encoders: [NVENC](https://developer.nvidia.com/nvidia-video-codec-sdk/download)
on NVIDIA GPUs, and [VideoToolbox](https://developer.apple.com/documentation/videotoolbox)
on macOS (Apple Silicon and Intel).

## Installation

Expand Down Expand Up @@ -127,7 +129,7 @@ pip install wheelhouse/vtk_streaming-*.whl

1. [examples/simple_encoder_decoder.py](./examples/simple_encoder_decoder.py) - Live VP9 encode/decode round-trip with two render windows side by side.
2. [examples/resize_encoder_decoder.py](./examples/resize_encoder_decoder.py) - VP9 encode/decode round-trip that survives window resizes.
3. [examples/simple_nvenc_record.py](./examples/simple_nvenc_record.py) - Record a render window for later playback using NVENC. This needs `ffplay` to playback the .h264 file.
3. [examples/simple_hardware_encoder_record.py](./examples/simple_hardware_encoder_record.py) - Record a render window for later playback using whichever hardware H.264 encoder `vtkEncoderFactory` selects (Apple VideoToolbox on macOS, NVENC on NVIDIA GPUs). This needs `ffplay` to playback the .h264 file.

## Getting help

Expand Down
3 changes: 2 additions & 1 deletion Streaming/Encode/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
set(classes
set(classes
vtkVideoEncoder
vtkEncoderFactory # TEMP: interim encoder selector; delete for VTK 9.7 (override attributes)
)

vtk_module_add_module(VTKStreaming::Encode
Expand Down
Loading
Loading