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
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
webrtc-java
Copyright 2019 Alex Andres
Copyright 2019-2026 Alex Andres

EXTERNAL COMPONENTS

Expand Down
59 changes: 37 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,41 +13,56 @@ The library provides a comprehensive set of Java classes that map to the WebRTC

## Features

- **Complete WebRTC API implementation** - Includes peer connections, media devices, data channels, and more
- **Client API** - A high-level layer that negotiates by itself, keeps your code off WebRTC's threads, and closes everything with one call; with WHIP and WHEP sessions, and video views for Swing and, with the `webrtc-java-javafx` module, JavaFX
- **Cross-platform support** - Works on Windows, macOS, and Linux (x64, ARM, ARM64)
- **Media capabilities** - Audio and video capture from cameras and microphones
- **Desktop capture** - Screen and application window sharing
- **Video processing** - Change camera and desktop frames before they are sent, e.g. to blur a background, draw an overlay or blank out part of the screen
- **Hardware video codecs** - Encode and decode H.264, H.265, VP9 and AV1 on the GPU with NVENC/NVDEC, Media Foundation, VA-API and VideoToolbox, falling back to software
- **Custom video codecs** - Plug video encoders and decoders written in Java into WebRTC next to the built-in ones, or limit the codecs a factory offers
- **Media file playback** - Send video and audio files over a peer connection in place of a camera and microphone, with the optional FFmpeg-based `webrtc-java-media` module
- **Call recording** - Record what a peer connection sends or receives into MKV, WebM or MP4 files, without re-encoding, with the `webrtc-java-media` module
- **Encoded transforms** - Read, change or drop encoded audio and video frames on their way through a sender or receiver, e.g. for end-to-end encryption, like insertable streams in the browser
- **Encoded frame injection** - Send audio and video that is already encoded, such as a camera's H.264 stream or a recording, through a sender without re-encoding it
- **Data channels** - Bidirectional peer-to-peer data exchange
- **Statistics API** - Detailed metrics for monitoring connection quality
- **Simple integration** - Available as a Maven dependency
- **Native performance** - Thin JNI layer with minimal overhead
**Calls and data**

- **[Client API](https://jrtc.dev/guide/client-api)** - High-level calls that negotiate by themselves, keep your code off WebRTC's threads and close with one call
- **[WHIP and WHEP](https://jrtc.dev/guide/client-api#whip-and-whep)** - Publish to and play from streaming servers
- **[Peer connections](https://jrtc.dev/guide/networking/peer-connection-config)** - The full native API, modeled on the W3C JavaScript API
- **[Data channels](https://jrtc.dev/guide/data/data-channels)** - Reliable or unreliable peer-to-peer messaging
- **[Statistics](https://jrtc.dev/guide/monitoring/rtc-stats)** - Detailed metrics on connection quality

**Audio and video**

- **[Cameras and microphones](https://jrtc.dev/guide/media/media-devices)** - Capture from any local device
- **[Screen sharing](https://jrtc.dev/guide/video/desktop-capture)** - Share the full desktop or single application windows
- **[Video processing](https://jrtc.dev/guide/video/camera-capture#changing-frames-before-they-are-sent)** - Blur a background, draw an overlay or blank out part of the screen before frames are sent
- **[Video views](https://jrtc.dev/guide/client-api#handlers-on-the-ui-thread)** - Ready-made components that show video in Swing, or in JavaFX with the `webrtc-java-javafx` module

**Codecs and encoded media**

- **[Hardware codecs](https://jrtc.dev/guide/advanced/video-codecs#hardware-encoding)** - H.264, H.265, VP9 and AV1 on the GPU with NVENC/NVDEC, Media Foundation, VA-API and VideoToolbox, falling back to software
- **[Custom codecs](https://jrtc.dev/guide/advanced/video-codecs#adding-a-codec)** - Plug in video encoders and decoders written in Java, or limit the codecs a factory offers
- **[End-to-end encryption](https://jrtc.dev/guide/advanced/encoded-transforms)** - Read, change or drop encoded audio and video frames, like insertable streams in the browser
- **[Pre-encoded media](https://jrtc.dev/guide/advanced/encoded-transforms#injecting-encoded-frames)** - Send a camera's H.264 stream or a recording without re-encoding it

**Optional modules**

- **[Media playback](https://jrtc.dev/guide/media/media-files)** (`webrtc-java-media`) - Stream video and audio files or RTSP sources into a call, decoded with FFmpeg
- **[Call recording](https://jrtc.dev/guide/media/media-recording)** (`webrtc-java-media`) - Save what a call sends or receives into MKV, WebM or MP4 files, without re-encoding

**Platforms**

Prebuilt native libraries behind a thin JNI layer:

| OS | x64 | arm64 | arm32 |
|---------|:---:|:-----:|:-----:|
| Windows | ✓ | ✓ | |
| macOS | ✓ | ✓ | |
| Linux | ✓ | ✓ | ✓ |

## Getting Started

For more detailed information, check out the documentation:

- [Quickstart](https://jrtc.dev/guide/get-started) - Get up and running quickly with webrtc-java
- [Client API](https://jrtc.dev/guide/client-api) - Calls, media and data channels without the threading pitfalls
- [Guides](https://jrtc.dev/guide/) - Comprehensive documentation on using the library
- [Examples](https://jrtc.dev/guide/examples) - Sample code demonstrating various features
- [Media Files](https://jrtc.dev/guide/media/media-files) - Sending video and audio files with the media module
- [Media Recording](https://jrtc.dev/guide/media/media-recording) - Recording calls into media files with the media module
- [Encoded Transforms](https://jrtc.dev/guide/advanced/encoded-transforms) - Reading and changing encoded frames, e.g. for end-to-end encryption
- [Video Codecs](https://jrtc.dev/guide/advanced/video-codecs) - Adding video codecs implemented in Java, or limiting the built-in ones
- [Build Notes](https://jrtc.dev/guide/build) - Instructions for building the library from source
- [Unreleased Docs](https://jrtc.dev/next/) - Documentation of the main branch, including features not released yet

## License

Copyright (c) 2019 Alex Andres
Copyright (c) 2019-2026 Alex Andres

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Expand Down
46 changes: 46 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,23 @@
<artifactId>central-publishing-maven-plugin</artifactId>
</plugin>
</plugins>

<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<!-- The project's license and notice go into every jar, where they reach
those who get the library from Maven Central rather than from this
repository. Every module sits directly below the root. -->
<resource>
<directory>${project.basedir}/..</directory>
<targetPath>META-INF</targetPath>
<includes>
<include>LICENSE</include>
<include>NOTICE</include>
</includes>
</resource>
</resources>
</build>

<profiles>
Expand All @@ -264,6 +281,35 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
<!-- The javadoc jar is made of what javadoc writes, not of the resources,
so the license and notice are put next to the pages before it is
packed. The notice covers the parts of the API docs taken from the
W3C specification. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>javadoc-licenses</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/reports/apidocs/META-INF</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}/..</directory>
<includes>
<include>LICENSE</include>
<include>NOTICE</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
Expand Down
10 changes: 10 additions & 0 deletions webrtc-java-media/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@ foreach(RUNTIME_LIB ${FFMPEG_RUNTIME_LIBS})
COMMENT "Collecting ${RUNTIME_LIB} for the platform jar")
endforeach()

# The project's own license and notice go along as well, at the top of
# META-INF as in the Java jars.
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory "${NATIVES_DIR}/META-INF"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../LICENSE"
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../NOTICE"
"${NATIVES_DIR}/META-INF"
COMMENT "Collecting the webrtc-java license and notice for the platform jar")

#
# The LGPL asks for its text to travel with the FFmpeg libraries, along with
# a notice saying what they are and where their source is. Both go under
Expand Down
9 changes: 9 additions & 0 deletions webrtc-jni/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,15 @@ install(FILES
COMPONENT Runtime
)

# The project's own license and notice go along as well, at the top of
# META-INF as in the Java jars.
install(FILES
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../LICENSE"
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../NOTICE"
DESTINATION "${CMAKE_INSTALL_PREFIX}/META-INF"
COMPONENT Runtime
)

if(WIN32 OR LINUX)
install(FILES
"${CMAKE_CURRENT_SOURCE_DIR}/dependencies/nvenc/LICENSE"
Expand Down
Loading