forked from opensensorhub/osh-addons
-
Notifications
You must be signed in to change notification settings - Fork 2
Rtmp driver #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Rtmp driver #27
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
4441aaa
Add RTMP driver
kyle-fitzp ecd3b3b
Improve URL deconfliction
kyle-fitzp 399ee30
Add avformatcontext callback for open stream termination
kyle-fitzp 786790c
Only deconflict ports, not URLs
kyle-fitzp 5ca2b07
Remove stream path validation and stream key generation (commented ou…
kyle-fitzp 9edcb76
Remove host override
kyle-fitzp ae31dbf
Remove host override
kyle-fitzp abeba00
Update README
kyle-fitzp b35d275
Use singleton pattern to track ports, add javadoc and license
kyle-fitzp a219904
Corrected organization, url
kyle-fitzp d290917
Simplified isConnected method
kyle-fitzp 9c25778
Remove unnecessary references to static instance
kyle-fitzp c528b47
Fix organization
kyle-fitzp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # FFmpeg RTMP Driver | ||
|
|
||
| OSH sensor driver using FFmpeg to listen to RTMP streams. | ||
|
|
||
| This driver depends on the following modules at runtime: | ||
| * sensorhub-driver-ffmpeg | ||
|
|
||
| ## Config | ||
|
|
||
| ### Connection | ||
|
|
||
| * **Host** | ||
| - RTMP server host | ||
| - **UNSPECIFIED**: listen for remote connections. | ||
| - **LOCALHOST**: listen for local connections. | ||
| - **DOCKER_INTERNAL**: listen for connections inside a docker container. | ||
| * **Port** | ||
| - RTMP server port | ||
| - 1935 is the default port for RTMP. | ||
| - Any port may be used as long as it is not in use by another listener (or any other application). | ||
| - RTMP sensor driver modules track ports in use. To release ownership of a port, STOP the module. | ||
|
|
||
| ## Usage | ||
|
|
||
| ### Initialization | ||
|
|
||
| <p>To initialize the driver, provide a unique serial number in the configuration. | ||
| In connection, set the host and provide an unused port. Once initialized, other RTMP sensor driver modules cannot | ||
| use the same port. | ||
| <br><br><strong>Stop</strong> the module to free the port.</p> | ||
|
|
||
| ### Listening | ||
|
|
||
| <p>Once initialized, start the module to begin listening for RTMP connections. <strong>After</strong> the driver | ||
| is started, begin publishing the RTMP stream. | ||
| <br><br><strong>Note</strong>: The module does NOT attempt to validate the | ||
| username, password, RTMP app, or RTMP playpath. Only the host and port need to match.</p> | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| description = 'RTMP Video Driver' | ||
| ext.details = 'Driver to listen for and demux RTMP video streams' | ||
| version = '1.0.0' | ||
|
|
||
| dependencies { | ||
| implementation 'org.sensorhub:sensorhub-core:' + oshCoreVersion | ||
| implementation project(':sensorhub-driver-ffmpeg') | ||
| } | ||
|
|
||
| // add info to OSGi manifest | ||
| osgi { | ||
| manifest { | ||
| attributes('Bundle-Vendor': 'GeoRobotix Innovative Research') | ||
| attributes('Bundle-Activator': 'org.sensorhub.impl.sensor.rtmp.Activator') | ||
| } | ||
| } | ||
|
|
||
| // add info to maven pom | ||
| ext.pom >>= { | ||
| developers { | ||
| developer { | ||
| id 'kyle-fitzp' | ||
| name 'Kyle Fitzpatrick' | ||
| organization 'GeoRobotix Innovative Research' | ||
| organizationUrl 'https://georobotix.us' | ||
| } | ||
| } | ||
| } |
25 changes: 25 additions & 0 deletions
25
...s/video/sensorhub-driver-rtmp/src/main/java/org/sensorhub/impl/sensor/rtmp/Activator.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| /***************************** BEGIN LICENSE BLOCK *************************** | ||
| The contents of this file are subject to the Mozilla Public License, v. 2.0. | ||
| If a copy of the MPL was not distributed with this file, You can obtain one | ||
| at http://mozilla.org/MPL/2.0/. | ||
|
|
||
| Software distributed under the License is distributed on an "AS IS" basis, | ||
| WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | ||
| for the specific language governing rights and limitations under the License. | ||
|
|
||
| Copyright (C) 2026 GeoRobotix Innovative Research, Inc. All Rights Reserved. | ||
| ******************************* END LICENSE BLOCK ***************************/ | ||
|
|
||
| package org.sensorhub.impl.sensor.rtmp; | ||
|
|
||
| import org.osgi.framework.BundleActivator; | ||
| import org.sensorhub.utils.OshBundleActivator; | ||
|
|
||
|
|
||
| /* | ||
| * Needed to expose java services as OSGi services | ||
| */ | ||
| public class Activator extends OshBundleActivator implements BundleActivator | ||
| { | ||
|
|
||
| } |
38 changes: 38 additions & 0 deletions
38
...eo/sensorhub-driver-rtmp/src/main/java/org/sensorhub/impl/sensor/rtmp/RtmpDescriptor.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| /***************************** BEGIN LICENSE BLOCK *************************** | ||
| The contents of this file are subject to the Mozilla Public License, v. 2.0. | ||
| If a copy of the MPL was not distributed with this file, You can obtain one | ||
| at http://mozilla.org/MPL/2.0/. | ||
|
|
||
| Software distributed under the License is distributed on an "AS IS" basis, | ||
| WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | ||
| for the specific language governing rights and limitations under the License. | ||
|
|
||
| Copyright (C) 2026 GeoRobotix Innovative Research, Inc. All Rights Reserved. | ||
| ******************************* END LICENSE BLOCK ***************************/ | ||
|
|
||
| package org.sensorhub.impl.sensor.rtmp; | ||
|
|
||
| import org.sensorhub.api.module.IModule; | ||
| import org.sensorhub.api.module.IModuleProvider; | ||
| import org.sensorhub.api.module.ModuleConfig; | ||
| import org.sensorhub.impl.module.JarModuleProvider; | ||
| import org.sensorhub.impl.sensor.rtmp.config.RtmpConfig; | ||
|
|
||
|
|
||
| public class RtmpDescriptor extends JarModuleProvider implements IModuleProvider | ||
| { | ||
|
|
||
| @Override | ||
| public Class<? extends IModule<?>> getModuleClass() | ||
| { | ||
| return RtmpDriver.class; | ||
| } | ||
|
|
||
|
|
||
| @Override | ||
| public Class<? extends ModuleConfig> getModuleConfigClass() | ||
| { | ||
| return RtmpConfig.class; | ||
| } | ||
|
|
||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.