diff --git a/docs/.nojekyll b/docs/.nojekyll deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/about.md b/docs/about.md deleted file mode 100644 index 3184e3eeb..000000000 --- a/docs/about.md +++ /dev/null @@ -1,24 +0,0 @@ -# About nanocosmos - -https://www.nanocosmos.de - -nanocosmos, Berlin-based, 20 years of video and audio expertise, enables worldwide interactive live streaming with ultra-low latency for your business. - -nanoStream Cloud includes the unique nanoStream H5Live Player for ultra-low latency live video and audio playback on all HTML5 browsers and devices. - -Powerful Live Encoding can be added with our nanoStream Apps and SDKs and plugin-free in the browser with nanoStream WebRTC.live. - -nanoStream Cloud is a scalable solution for use cases where every second counts. You can use it completely end-to end or as low latency CDN to extend your existing live streaming workflows. Go live around the world in 1 second! - -# nanoStream Cloud - -nanoStream Cloud including the unique H5Live Player has come to set a new era in ultra-low latency live streaming. Following the rise of interactive use cases, nanocosmos cloud solution was created to fulfil all the needs of different live streaming businesses and use cases. nanoStream Cloud includes: - -nanoStream H5Live Player: unique, plugin-free, HTML5-based playout technology for ultra-low-latency on any desktop and mobile device, including Safari on iOS -bintu.live: easy dashboard management and REST API for creating and managing live streams, an auto-scaling origin/edge server setup for worldwide streaming -worldwide CDN: low-latency CDN for easily scaling live streams worldwide -nanoStream Cloud is super flexible and is available on different setup options: - -Fresh start - use nanoStream Cloud as your end-to-end solution or; -Integrate to your existing workflow - use nanoStream Cloud as your ultra-low latency CDN, and add nanoStream H5Live Player to your own web pages -nanoStream Cloud also has great Add-ons to power your live stream. Use the nanoStream Live Encoder SDK’s for desktop and mobile platforms or the browser-based WebRTC.live for true end-to-end live streaming. diff --git a/docs/cloud/cloud_getting_started.md b/docs/cloud/cloud_getting_started.md index 173d4e645..dc2ba40c3 100644 --- a/docs/cloud/cloud_getting_started.md +++ b/docs/cloud/cloud_getting_started.md @@ -35,13 +35,12 @@ Create your first live stream: In the top menu select `Stream`, then `create` ### Start a live stream broadcast -To start a live stream broadcast, you need a live encoder software, either based on an `RTMP Live Encoder application`, or the browser-based [nanoStream WebRTC.live broadcaster](https://www.nanocosmos.de/webrtc). +To start a live stream broadcast, you need a live encoder software, either based on an `RTMP Live Encoder application`, or the browser-based [nanoStream WebRTC.live broadcaster](http://docs.nanocosmos.de/docs/webrtc/nanostream_webrtc_introduction). -You can use [nanoStream Apps](https://www.nanocosmos.de/#nanostream), or 3rd part software like [OBS (Open Broadcaster)](https://obsproject.com/) or professional Live Encoders like [Elemental Live](https://www.elemental.com/products/aws-elemental-live). +You can use [nanoStream Apps](http://docs.nanocosmos.de/docs/nanostream/nanostream), or 3rd part software like [OBS (Open Broadcaster)](https://obsproject.com/) or professional Live Encoders like [Elemental Live](https://www.elemental.com/products/aws-elemental-live). > The primary ingest protocol is RTMP. - **Copy/paste the ingest URL to use it with your live encoder software** Example: @@ -130,7 +129,7 @@ Every tag added to a stream is directly displayed in the Stream Info. *See more info about tagging and how it is used in our Bintu Encoder and Player sample apps on our* [*blog*](https://www.nanocosmos.de/blog/2016/06/new-bintu-live-grouping-and-tagging-feature-for-streams/)*.* -The Bintu Encoder and Player sample apps are part of our [*mobile nanoStream SDKs*](https://www.nanocosmos.de/v6/demo.php) *for iOS and Android.* +The Bintu Encoder and Player sample apps are part of our [*mobile nanoStream SDKs*](http://docs.nanocosmos.de/docs/nanostream/android/nanostream-android-sdk) *for iOS and Android.* ----- @@ -158,7 +157,7 @@ Under `Keys` you will find your account’s API Key and Player Key to manage liv - [bintu.live dashboard](https://bintu.nanocosmos.de) - [bintu.live API documentation](https://bintu.nanocosmos.de/doc/) -- [Create a live streaming app in 5 minutes](https://www.nanocosmos.de/blog/2016/07/live-streaming-with-bintu-live/%22https://www.nanocosmos.de/v4/documentation/nanostream_end-to-end_live_streaming_in_5_minutes%3C/a) +- [Create a live streaming app in 5 minutes](cloud_ios_streaming_app) - [nanoStream and bintu.live](https://www.nanocosmos.de/blog/2016/07/nanostream-and-bintu-live/) - [Grouping & Tagging with bintu.live](https://www.nanocosmos.de/blog/2016/06/new-bintu-live-grouping-and-tagging-feature-for-streams/) - [nanoStream Presents End-to-End Live Streaming Software](https://www.nanocosmos.de/blog/2016/05/nanocosmos-presents-new-end-to-end-live-streaming-software/) diff --git a/docs/cloud/cloud_ios_streaming_app.md b/docs/cloud/cloud_ios_streaming_app.md index 5d88b26c4..fa2b10d16 100644 --- a/docs/cloud/cloud_ios_streaming_app.md +++ b/docs/cloud/cloud_ios_streaming_app.md @@ -87,9 +87,9 @@ From here on you would probably want to integrate the live streaming function in > These samples are pretty basic for better understanding what is going on. For a more complete sample on how to use nanoStream and bintu.live, see the samples `BintuEncoder` and `BintuPlayer` in the SDK `samples` folder.
-### More Info +### New to bintu.live? -See our blog posts about bintu.live [here](https://www.nanocosmos.de/blog/2016/07/live-streaming-with-bintu-live) +If you don't have a bintu.live account yet click [here](http://docs.nanocosmos.de/docs/cloud/cloud_getting_started) to learn how to create one.
### Getting help diff --git a/docs/extra.css b/docs/extra.css deleted file mode 100644 index f680e36a1..000000000 --- a/docs/extra.css +++ /dev/null @@ -1,31 +0,0 @@ -.wy-side-nav-search { - background-color: #FF9D30; -} -.wy-nav-content { - -} - .wy-menu-vertical span { - color: white; - - -} -.wy-menu-vertical li.current { - border-top: solid #ff9d30; - border-bottom: solid #ff9d30; -} - -.wy-menu-vertical li ul li.toctree-l3:after { - content: -} - -.wy-menu-vertical li ul li.toctree-l3 { - border-bottom: solid 1px black; - background-color: #c8c8c8; - -} - - -.wy-menu-vertical li ul li a.toctree-l4 { - padding-left: 4em; - margin-left: 1px; -} diff --git a/docs/faq/faq_WebRTC_broadcast.md b/docs/faq/faq_WebRTC_broadcast.md new file mode 100755 index 000000000..a0a2cf6f9 --- /dev/null +++ b/docs/faq/faq_WebRTC_broadcast.md @@ -0,0 +1,23 @@ +--- +id: faq_WebRTC_broadcast +title: Broadcast +sidebar_label: Broadcast +--- + +
How to start a broadcast? +Click [here](http://docs.nanocosmos.de/docs/cloud/cloud_introduction) to read more on *how to get started with broadcasting*. + +
+ +
How do I improve the quality of the stream? + + + +
+ +
I do not see a picture and hear no sound, what to do? + + + +
+ diff --git a/docs/faq/faq_WebRTC_devices.md b/docs/faq/faq_WebRTC_devices.md new file mode 100755 index 000000000..74ac2e58c --- /dev/null +++ b/docs/faq/faq_WebRTC_devices.md @@ -0,0 +1,52 @@ +--- +id: faq_WebRTC_devices +title: Devices +sidebar_label: Devices +--- + +
I do not see a preview of my camera. What can this be? + +This can have multiple reasons. First be sure to listen to the proper events for device handling - please listen to the event `StartPreviewError` to see why the camera/preview is not working correctly. + +
+ +
I am trying to preview my camera but I get an error message. What can this be? + +![error2browser](C:\Users\nano\Desktop\Markdown_faq\error2browser.png) + +1. There is no camera connected. +2. Camera is being used by another browser. + +
+ +
I want to toggle my video device. How can I achieve this? + +You can not switch cameras/devices while a broadcast is active. Please stop the broadcast, switch camera/device and then start the broadcast again. Unfortunately we do not have an example for device toggling, you receive a list of available devices in the `ReceivedDeviceList` event. Please also add at least logs to the error handlers so you can see if something goes wrong: + +```javascript +user.on("StartPreviewError", function(evt) { + // handle error +console.log((event.data.text); +}); +``` + +```javascript +user.on("StartBroadcastError", function(evt){ +// handle error +console.log((event.data.text); +}); +``` + +
+ +
How to start a preview? + + + +
+ +
How to start a screen capture? + + + +
\ No newline at end of file diff --git a/docs/faq/faq_WebRTC_general.md b/docs/faq/faq_WebRTC_general.md new file mode 100755 index 000000000..c8420418e --- /dev/null +++ b/docs/faq/faq_WebRTC_general.md @@ -0,0 +1,53 @@ +--- +id: faq_WebRTC_general +title: General +sidebar_label: General +--- + +
Do we support all types of cameras? + +We support all common cameras that can be connected to the PC via USB. + +
+ +
Do we support IP cameras? + +No, not yet. + +
+ +
Which browsers do we support? +Generally we support the two major desktop platforms Windows and MacOS and Android and iOS as mobile platforms. Because WebRTC is an “in development” technology there are minor restrictions regarding browser support. + +> Please see the below list for platform/browser combinations that we support officially. + +| | Chrome | Firefox | MS Edge | Safari | +| Windows | x | x | with limitations | - | +| MacOS | x | x | - | v11 | +| iOS | - | - | - | v11 | +| Android | x | - | - | - | + + + +![Tabelle](C:\Users\nano\Desktop\Markdown_faq\Tabelle.PNG) + +
+ +
Is Internet Explorer 11 on Windows 7 supported? + +For IE 11 Win 7 we provide a flash fallback with with limited but basic functionality. + +
+ +
Can I check capabilities? + +Yes, you can check the static capabilities array of the NanoPlayers class `NanoPlayer.capabilities`. If the array has values, the player is supported. Values can be `h5live`, `flash` and `native`. + +
+ +
How to check browser support during runtime? +You can call the function `RtcUser.checkSupport()`. It will give you information about support regarding the currently used browser. + +> You can find more information [here](http://docs.nanocosmos.de/docs/webrtc/nanostream_webrtc_api#rtcuserchecksupport) in the WebRTC Docs. + +
\ No newline at end of file diff --git a/docs/faq/faq_h5live_player_adjust_style.md b/docs/faq/faq_h5live_player_adjust_style.md new file mode 100755 index 000000000..9bac62ca5 --- /dev/null +++ b/docs/faq/faq_h5live_player_adjust_style.md @@ -0,0 +1,131 @@ +--- +id: faq_h5live_player_adjust_style +title: Adjust/Style +sidebar_label: Adjust/Style +--- + +
Can I style the player as audio player? + +Yes, you can style the player as audio player by passing + +```javascript +config.style.audioPlayer = true; +``` + +
+ +
Can I play video only or audio only streams? + +Yes. + + +
+ +
Can I customize the inline controls? + +No, but you can disable them by passing. + +``` +config.style.controls = false; +``` + +
+ +
Can I use a raw player without any styles? + +Yes, by passing the config property `style.view = false` all styles will be disabled. + +
+ +
Can I use an own external video element? + +Yes, by passing the `id` attribute of an existing html5 video element through the config property `playback.videoId`. The video will be inserted into the players container and existing styles will be overwritten and restored after a destroy. + +
+ +
Can I update the source? + +Yes, by executing the player’s function `updateSource` with an updated `config.source` object. + +
+ +
Is a fullscreen functionality available? + +Yes, over the native player controls. + +
+ +
Can I set the players size responsively? + +Yes, by passing over `style.width` and `style.height` the value `auto` and styling the players div. + +
+ +
Can I use a poster as placeholder for the video? + +But you can use a workaround by passing the id of an existing video tag with poster through the config (`config.playback.videoId`). This video element would be used by the player instead of creating a new one. See [here](http://docs.nanocosmos.de/docs/nanoplayer/nanoplayer_api_class). + +Another possibility can be that you grab the video element from the DOM after successful setup and then modify the poster attribute. + +```javascript +var video = document.querySelector("#playerDiv video"); +video.poster = ....; +``` + +
+ +
Can I change the background color of the player? +No, currently there is no way to configure the background-color of the video element, but you can have workarounds. You can select the video in the resolve function of the promise (see the sample) and then change the color or you can create a global css rule for video elements. Please see the following examples. + +```javascript +var player; + var config = { + "source": { + "bintu": { + "apiurl": "https://bintu.nanocosmos.de", + "streamid": "236af21e-fbf3-4ba3-889c-343ef3f0e7ca" + } + }, + "playback": { + "autoplay": true, + "automute": true, + "muted": false + }, + "style": { + "controls": true, + "width": "auto", + "height": "auto", + } +}; +document.addEventListener('DOMContentLoaded', function () { + player = new NanoPlayer("playerDiv"); + player.setup(config).then(function (config) { + console.log("setup success"); + console.log("config: " + JSON.stringify(config, undefined, 4)); + var video = document.querySelector('#playerDiv video'); + video.style.backgroundColor = '#123456'; + }, function (error) { + alert(error.message); + }); +}); +``` + +
+ +
Is there a simple code snippet available? + +Yes, … + +
+ +
Can I use the player within a mobile webview? + +Yes! … + +
+ +
Can I have multiple player instances in one page? + +Yes, … + +
\ No newline at end of file diff --git a/docs/faq/faq_h5live_player_bintu.md b/docs/faq/faq_h5live_player_bintu.md new file mode 100755 index 000000000..4f05b6b53 --- /dev/null +++ b/docs/faq/faq_h5live_player_bintu.md @@ -0,0 +1,36 @@ +--- +id: faq_h5live_player_bintu +title: bintu +sidebar_label: bintu +--- + +
How can I play a bintu stream? + +Use for the `config.source` object the subobject `bintu`. It’s only necessary to pass the property `streamid` + + +```javascript +var config = { + "source": { + "bintu": { + "apiurl": "https://bintu.nanocosmos.de", + "streamid": "39b2cc18-7116-43a4-81bd-f62b7a1a9dbc" + } + +} +``` + +
+ +
Can I check capabilities? + +Yes, you can check the static capabilities array of the NanoPlayers class `NanoPlayer.capabilities`. If the array has values, the player is supported. Values can be `h5live`, `flash` and `native`. + +
+ +
Is there an API documentation available? + +Yes, you can find it [here](http://docs.nanocosmos.de/docs/nanoplayer/nanoplayer_api_class). + +
+ diff --git a/docs/faq/faq_h5live_player_general.md b/docs/faq/faq_h5live_player_general.md new file mode 100755 index 000000000..2d4323531 --- /dev/null +++ b/docs/faq/faq_h5live_player_general.md @@ -0,0 +1,21 @@ +--- +id: faq_h5live_player_general +title: General +sidebar_label: General +--- + +
Which browsers/plattforms do we support?? + +The low-latency nanoStream h5Live Player runs on all full-featured HTML5 browsers including + +- Safari 10,11,12 on iOS and macOS +- Chrome 54 and higher on desktop and mobile +- Firefox 48 and higher +- Edge +- Internet Explorer 11 (starting Windows 8.1) + +For Internet Explorer 11 on Windows 7, H5Live player contains a Flash player fallback for RTMP. + +
+ + diff --git a/docs/faq/faq_h5live_player_general.md.zip b/docs/faq/faq_h5live_player_general.md.zip new file mode 100644 index 000000000..1c3087214 Binary files /dev/null and b/docs/faq/faq_h5live_player_general.md.zip differ diff --git a/docs/faq/faq_h5live_player_metrics.md b/docs/faq/faq_h5live_player_metrics.md new file mode 100755 index 000000000..335137a0f --- /dev/null +++ b/docs/faq/faq_h5live_player_metrics.md @@ -0,0 +1,14 @@ +--- +id: faq_h5live_player_metrics +title: Metrics +sidebar_label: Metrics +--- + +
Are there metrics available? +Yes, over the `nanoStream cloud analytics`. + +Please contact sales@nanocosmos.de + + +
+ diff --git a/docs/faq/faq_h5live_player_security.md b/docs/faq/faq_h5live_player_security.md new file mode 100755 index 000000000..6ca6e0071 --- /dev/null +++ b/docs/faq/faq_h5live_player_security.md @@ -0,0 +1,14 @@ +--- +id: faq_h5live_player_security +title: Security +sidebar_label: Security +--- + +
Can I use secured streaming? +Yes, the player supports secured streaming with the `nanoStream cloud` and `bintu`. + +Please contact our [sales team](mailto:sales@nanocosmos.de). + + +
+ diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index cf4b48cc2..000000000 --- a/docs/index.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Document - - - - - - - - - -
- - - - diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index 60fdabc3d..000000000 --- a/docs/index.md +++ /dev/null @@ -1,24 +0,0 @@ -# nanocosmos Developer Documentation -Welcome to the nanocosmos Developer Documentation for nanoStream products and services. nanoStream SDKs are native SDKs for iOS, Android, Windows, Mac, for live streaming with rtmp. nanoStream Cloud consists of a worldwide CDN, H5Live Player, and the Bintu API, our stream management service, - -## nanoStream Cloud Documentation - -[nanoStream Cloud Introduction](cloud/cloud_introduction) -[nanoStream Cloud Getting Started](cloud/cloud_getting_started) -[nanoStream Cloud / iOS App in 5 Minutes](cloud/cloud_ios_streaming_app) - -## Bintu Documentation - -### [Android](bintu/android/bintu-android-sdk.md) -A how to on the basic usage of the bintu.live sdk for android and its functionality. - -### [iOS](bintu/ios/bintu_ios_sdk.md) -A how to on the basic usage of the bintu.live sdk for iOS and its functionality including [the provided samples](bintu/ios/bintu_ios_sample.md). - -## nanoStream SDKs and Apps for Native Apps (RTMP) - -[nanoStream SDKs and Apps](nanostream/nanostream) - -## FAQ - -[FAQ Live Streaming](faq/faq_streaming) diff --git a/docs/mkdocs.md b/docs/mkdocs.md deleted file mode 100644 index 6642a100b..000000000 --- a/docs/mkdocs.md +++ /dev/null @@ -1,23 +0,0 @@ -# Welcome to MkDocs - -nanocosmos documentation - visit [nanocosmos.de](http://nanocosmos.de). - -## Docs - -* [web api]() - Create a new project. - -## Commands - -* `mkdocs new [dir-name]` - Create a new project. -* `mkdocs serve` - Start the live-reloading docs server. -* `mkdocs build` - Build the documentation site. -* `mkdocs help` - Print this help message. - -## Project layout - - mkdocs.yml # The configuration file. - docs/ - index.md # The documentation homepage. - ... # Other markdown pages, images and other files. - -For full documentation visit [mkdocs.org](http://mkdocs.org). diff --git a/docs/nanoplayer/nanoplayer_getting_started.md b/docs/nanoplayer/nanoplayer_getting_started.md index 3c93d5ccf..84aabe388 100644 --- a/docs/nanoplayer/nanoplayer_getting_started.md +++ b/docs/nanoplayer/nanoplayer_getting_started.md @@ -10,11 +10,9 @@ You can embed this code snippet to test the H5Live player on your page in no tim **Important:** replace `CUSTOM-STREAMID` with your own `streamid`. -
- -> **Note: ** +> **Note:** > -> If you don't know how to get your custom `streamid` click [here](www.testing.de) . +> If you don't know how to get your custom bintu.live `streamid` click [here](http://docs.nanocosmos.de/docs/cloud/cloud_getting_started) . ```html
@@ -167,246 +165,4 @@ Example `index.html`
Now you should see the player running in your browser window. -You can download the sample project [here](www.github.de). - - - ------- - -### Angular 4 - -Embedding the H5LivePlayer in your Vue.js project is simple: - -1. Include the provided `nanoplayer.3.min.js` script within your `index.html` in your `root` directory - -```html - -``` - -
- -Example `index.html` - -``` - - - - - - h5-live-player - - - -
- - -``` - -
- -2. Create a new Vue Component with a simple div as a placeholder that will contain player the content. - -```html -
-``` - -
- -3. Add a new variable called `config` to your `data() method` inside your component - - Important**: replace `CUSTOM-STREAMID` with your own `streamid` - -
- - > **Note: ** - > - > If you don't know how to get your custom `streamid` click [here](www.testing.de) . - -```html - - -``` - -
- -> **Note:** -> -> Change the `bintu` `streamid` inside the `config` object to the streamid of your created live stream. -> -> [Here](www.test.de) you can find a guide on how to create your own livestream with `bintu.live` - -
- -4. Instantiate the NanoPlayer inside the `mounted()` lifecycle hook - -```html - - -``` - -
-Now you should see the player running in your browser window. - -You can download the sample project [here](www.github.de). - - - ------- - -### React - -Embedding the H5LivePlayer in your Vue.js project is simple: - -1. Include the provided `nanoplayer.3.min.js` script within your `index.html` in your `root` directory - -```html - - -``` - -
- -Example `index.html` - -``` - - - - - - h5-live-player - - - -
- - - -``` - -
- -2. Create a new Vue Component with a simple div as a placeholder that will contain player the content. - -```html -
- -``` - -
- -3. Add a new variable called `config` to your `data() method` inside your component - - Important**: replace `CUSTOM-STREAMID` with your own `streamid` - -
- - > **Note: ** - > - > If you don't know how to get your custom `streamid` click [here](www.testing.de) . - -```html - - -``` - -
- -> **Note:** -> -> Change the `bintu` `streamid` inside the `config` object to the streamid of your created live stream. -> -> [Here](www.test.de) you can find a guide on how to create your own livestream with `bintu.live` - -
- -4. Instantiate the NanoPlayer inside the `mounted()` lifecycle hook - -```html - -``` - -
-Now you should see the player running in your browser window. - -You can download the sample project [here](www.github.de). - - - ------- \ No newline at end of file +You can download the sample project [here](www.github.de). \ No newline at end of file diff --git a/docs/nanoplayer/nanoplayer_gettingstarted_frameworks.md b/docs/nanoplayer/nanoplayer_gettingstarted_frameworks.md deleted file mode 100644 index cfc52b7bb..000000000 --- a/docs/nanoplayer/nanoplayer_gettingstarted_frameworks.md +++ /dev/null @@ -1,321 +0,0 @@ -## Frameworks - - - -### Vue.js - -Embedding the H5LivePlayer in your Vue.js project is simple: - -1. Include the provided `nanoplayer.3.min.js` script within your `index.html` in your `root` directory - -```html - -``` - - - -Example `index.html` - -``` - - - - - - h5-live-player - - - -
- - -``` - - - -2. Create a new Vue Component with a simple div as a placeholder that will contain player the content. - -```html -
-``` - - - -3. Add a new variable called `config` to your `data() method` inside your component -```html - -``` - - -> **Note:** -> -> Change the `bintu` `streamid` inside the `config` object to the streamid of your created live stream. -> -> [Here](www.test.de) you can find a guide on how to create your own livestream with `bintu.live` - - - -4. Instantiate the NanoPlayer inside the `mounted()` lifecycle hook - -```html - -``` - - - -Now you should see the player running in your browser window. - -You can download the sample project [here](www.github.de). - - - ------ - -### Angular 4 - -Embedding the H5LivePlayer in your Vue.js project is simple: - -1. Include the provided `nanoplayer.3.min.js` script within your `index.html` in your `root` directory - -```html - -``` - - - -Example `index.html` - -``` - - - - - - h5-live-player - - - -
- - -``` - - - -2. Create a new Vue Component with a simple div as a placeholder that will contain player the content. - -```html -
-``` - - - -3. Add a new variable called `config` to your `data() method` inside your component -```html - -``` - - -> **Note:** -> -> Change the `bintu` `streamid` inside the `config` object to the streamid of your created live stream. -> -> [Here](www.test.de) you can find a guide on how to create your own livestream with `bintu.live` - - - -4. Instantiate the NanoPlayer inside the `mounted()` lifecycle hook - -```html - -``` - - - -Now you should see the player running in your browser window. - -You can download the sample project [here](www.github.de). - - - ------ - - -### React - -Embedding the H5LivePlayer in your Vue.js project is simple: - -1. Include the provided `nanoplayer.3.min.js` script within your `index.html` in your `root` directory - -```html - -``` - - - -Example `index.html` - -``` - - - - - - h5-live-player - - - -
- - -``` - - - -2. Create a new Vue Component with a simple div as a placeholder that will contain player the content. - -```html -
-``` - - - -3. Add a new variable called `config` to your `data() method` inside your component -```html - -``` - - -> **Note:** -> -> Change the `bintu` `streamid` inside the `config` object to the streamid of your created live stream. -> -> [Here](www.test.de) you can find a guide on how to create your own livestream with `bintu.live` - - - -4. Instantiate the NanoPlayer inside the `mounted()` lifecycle hook - -```html - -``` - - - -Now you should see the player running in your browser window. - -You can download the sample project [here](www.github.de). \ No newline at end of file diff --git a/docs/nanoplayer/nanoplayer_introduction.md b/docs/nanoplayer/nanoplayer_introduction.md index 38454d769..5578d828d 100644 --- a/docs/nanoplayer/nanoplayer_introduction.md +++ b/docs/nanoplayer/nanoplayer_introduction.md @@ -69,13 +69,9 @@ h5live.rtmp.url=rtmp://streaming.server.com/live h5live.rtmp.streamname=myStreamName ``` - Below the video element you should see your URL then. The` “tech: h5live”` information shows you that the plugin-free H5Live technology is used. -Player API documentation: -[http://demo.nanocosmos.de/nanoplayer/docs/nanoplayer](http://demo.nanocosmos.de/nanoplayer/docs/nanoplayer) - ## nanoStream + bintu.live end-to-end streaming >H5Live integrates with nanoStream Live Encoder SDKs and nanoStream Cloud with bintu.live for complete end-to-end live streaming services in ultra-low latency. @@ -90,16 +86,13 @@ http://demo.nanocosmos.de/nanoplayer/release/nanoplayer.html?bintu.apiurl=https: >h5live can be used in combination with our nanoStream SDKs for Windows, Mac, iOS, Android or the plugin-free browser-based WebRTC.live solution to create plugin-free interactive live streaming applications. -## nanoStream Cloud Analytics and Player Metrics - -Todo ## More Information [Product Overview and Live Demo](https://www.nanocosmos.de/h5live) -[API Documentation](https://demo.nanocosmos.de/nanoplayer/docs/nanoplayer/) +[API Documentation](http://docs.nanocosmos.de/docs/nanoplayer/nanoplayer_api_class) -[H5Live FAQ](https://www.nanocosmos.de/blog/2017/05/nanostream-h5live-low-latency-faq/) +[H5Live FAQ](http://docs.nanocosmos.de/docs/faq/faq_streaming) ## Questions? please contact: diff --git a/docs/nanostream/android/android-advanced-settings.md b/docs/nanostream/android/android-advanced-settings.md deleted file mode 100644 index 25ba1b6ce..000000000 --- a/docs/nanostream/android/android-advanced-settings.md +++ /dev/null @@ -1,633 +0,0 @@ -nanoStream SDK for Android Advanced Settings/Usage -================================================== - -Resolution, Aspect Ratio and Orientation ----------------------------------------- - -### Resolution - -Resolution means the native resolution of the camera (input). In the most situations this will be the same for the output. To set the resolution there is a function in the `VideoSettings` object called `setResolution(Resolution res)`. If you set a resolution that the device doesn't support, nanoStream will automatically switch to the nearest resolution available on the device. A list of supported resolutions for the current video source can be obtained from `getCapabilities().listAvailableVideoResolutions()` on the `nanoStream` object. - -### Aspect Ratio - -Aspect ratio means the aspect ratio of the outgoing stream. The aspect ratio determines if the input video needs to be cropped. The aspect ratio can be set through the `setAspectRatio(AspectRatio aspectRatio)` function on the `VideoSettings` object. - -#### Supported Aspect Ratios - -| Aspect Ratio | AspectRatio value | -|:----------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Keep Input | AspectRatio.RATIO_KEEP_INPUT | -| 1:1 | AspectRatio.RATIO_1_1 | -| 4:3 | AspectRatio.RATIO_4_3 | -| 16:9 | AspectRatio.RATIO_16_9 | -| 3:4 | AspectRatio.RATIO_3_4 | -| 9:16 | AspectRatio.RATIO_9_16 | ### Orienta | The default stream orientation is landscape. If you switch to portrait the resolution will swap width and height, e.g. from 640x480 to 480x640. You can set the stream orientation on the `nanoStream` object with the `setStreamRotation` function. The stream orientation needs to be set before starting the stream, it is not possible to switch the orientation during the str | #### Supported Orientat | Orientation | Rotation Value | -| :-------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Landscape | Rotation.ROTATION_0 | -| Portrait | Rotation.ROTATION_90 | -| Landscape Upside Down | Rotation.ROTATION_180 | -| Portrait Upside Down | Rotation.ROTATION_270 | -| _270 | | -| _270 | | ### Example Combinations of Aspect Ratios and O | The input resolution is set to 640x480 here. The red rectangle marks up the active area that is included in the outp | Orientation | Aspect Ratio | Stream Area | -| :------------------------------------------------ | :---------------------------------------------------------------------------------------------------------------------|:-------------------------------------------- | -| Portrait[1](#fnAS1) | Keep Input | ![Screenshot](img/portrait_keep_input.png) | -| Portrait[1](#fnAS1) | 4:3 | ![Screenshot](img/portrait_4_3.png) | -| Portrait[1](#fnAS1) | 3:4 | ![Screenshot](img/portrait_3_4.png) | -| Portrait[1](#fnAS1) | 16:9 | ![Screenshot](img/portrait_16_9.png) | -| Portrait[1](#fnAS1) | 9:16 | ![Screenshot](img/portrait_9_16.png) | -| Landscape | Keep Input | ![Screenshot](img/landscape_keep_input.png) | -| Landscape | 4:3 | ![Screenshot](img/landscape_4_3.png) | -| Landscape | 3:4 | ![Screenshot](img/landscape_3_4.png) | -| Landscape | 16:9 | ![Screenshot](img/landscape_16_9.png) | -| Landscape | 9:16 | ![Screenshot](img/landscape_9_16.png) | -| png) | | | -| | | -| | | - -png) | - - - - -1: In this sample APP we crop the preview so it doesn't look ugly, so the stream is actually larger then the preview. - -### Example - -If you want to stream with a resolution of 640x360 but your device doesn't supports this resolution, you need to crop the resolution from 640x480 (this resolution is supported by the most devices) to 640x360. This can be done through the aspect ratio, so you need to set the aspect ratio to 16:9 to stream with a resolution of 640x360. - -### Implementation Example - -```java -public class MainActifity { - ... - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - nanoStreamSettings nss = new nanoStreamSettings(); - VideoSettings vs = new VideoSettings(); - ... - vs.setResolution(new Resolution(640, 480)); // default value - vs.setAspectRatio(AspectRatio.RATIO_16_9); // default value is AspectRatio.KEEP_INPUT - ... - streamLib = new nanoStream(nss); - streaLib.init(); - - streamLib.setStreamRotation(Rotation.ROTATION_0); // default value - ... - } - ... -} -``` - -RotationHelper --------------- - -### Description - -With the nanoStream SDK 4.3.1 release we added a 'RotationHelper' Class, this Class improves the Rotation handling. The RotationHelper class has two static Methods, 'getDeviceDefaultOrientation(Context context)' and 'getRotation(int orientation, boolean isDefaultOrientationLandscape)'. - -### getDeviceDefaultOrientation - -The return values are one of the following: - -- [Configuration.ORIENTATION_LANDSCAPE][4c50db80] -- [Configuration.ORIENTATION_PORTRAIT][4ec624ac] - -### getRotation - -#### Parameter - -The 'orientation' parameter of the 'getRoation' Method is one of the following: - -- [ActivityInfo.SCREEN_ORIENTATION_PORTRAIT][baf72420] -- [ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE][c47724c3] -- [ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT][a59fc893] -- [ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE][b1a7076f] - -The 'isDefaultOrientationLandscape' parameter is true or false. - -#### Return Values - -The return values given from 'RotationHelper.getRoation' can be used as a Parameter for 'setStreamRotation' and 'setPreviewRotation'. is the 'orientation' parameter non of the above described the 'getRotation' Method returns 'null'. - -### Implementation Example - -```java -import net.nanocosmos.nanoStream.streamer.Rotation; -import net.nanocosmos.nanoStream.streamer.RotationHelper; - -public class MainActivity extends Activity { - // ... - private boolean isDefaultOrientationLandscape = false; - private CustomOrientationEventListener orientation = null; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - // ... - streamLib = new nanoStream(/*settings*/); - - isDefaultOrientationLandscape = (RotationHelper.getDeviceDefaultOrientation(this) == android.content.res.Configuration.ORIENTATION_LANDSCAPE); - orientation = new CustomOrientationEventListener(this, SensorManager.SENSOR_DELAY_UI); - orientation.enable(); - } - - private class CustomOrientationEventListener extends OrientationEventListener { - private int lastScreenOrientation = 0; - public CustomOrientationEventListener(Context context, int rate) { - super(context, rate); - } - - @Override - public void onOrientationChanged(int orientation) { - if (null != streamLib) { - if(!streamLib.hasState(nanoStream.EncoderState.RUNNING)) { - if (isDefaultOrientationLandscape) { - orientation -= 90; - - if (orientation < 0) { - orientation += 360; - } - } - int screenOrientation = -1; - - if (orientation > 70 && orientation < 110) { - setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE); - screenOrientation = ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE; - } else if (orientation > 160 && orientation < 200) { - setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT); - screenOrientation = ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT; - } else if (orientation > 250 && orientation < 290) { - setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); - screenOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE; - } else if ((orientation > 340 && orientation <= 360) || (orientation >= 0 && orientation < 20)) { - setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); - screenOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; - } - - if (screenOrientation != lastScreenOrientation) { - Rotation rotation = RotationHelper.getRotation(screenOrientation, isDefaultOrientationLandscape); - if (null != rotation) { - try { - streamLib.setPreviewRotation(rotation); - streamLib.setStreamRotation(rotation); - streamLib.setAspectRatio(videoAspectRatio); - } catch (IllegalStateException e) { - Logging.log(Logging.LogLevel.ERROR, TAG, "Camera rotate failed", e); - } - } - lastScreenOrientation = screenOrientation; - } - } - } - } - } -} -``` -{!doc/nanostream/android/android_stream_type.md!} - -Local Recording ---------------- - -### Description - -The nanoStream Android SDK supports local file recording on the device in MP4 format. This document describes how to enable and configure nanoStream for local recording. - -### Steps to configure MP4 recording - -MP4 recording can be configured with two function calls on a nanoStreamSettings object. - -- Enabling MP4 recording: setRecordMp4(boolean) -- Setting up the file path: setMp4Path(String) - -### setRecordMp4(boolean) - -The setRecordMp4 function takes a boolean as parameter to enable/disable the recording function. - -### setMp4Path(String) - -The setMp4Path function takes a String as parameter. This string needs to be a valid file path (e.g. /sdcard/test.mp4). -It is recommended to use the getExternalStorageDirectory or getExternalStoragePublicDirectory functions from the -[Android Enviroment][8928e181] API, and add a file name to the returned path. Please find the code snippet below as an example. - -### Android Permission - -To be able to write to an external file path your Android app needs the following permissions to be added to the app manifest (AndroidMainfest.xml). - -```xml - - -``` - -#### Android 6.0 - -Due to the new permission handling in Android 6 (M) writing to external directories (DCIM) requires a permission by user. Writing to the applications own data directory (/Android/data/com.companyname.appname/) is not restricted. - -### Implementation Example - -```java -File externalFilePath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM); -File filePath = new File(externalFilePath, "myMp4File.mp4"); -String mp4FilePath = filePath.getAbsolutePath(); - -nanoStreamSettings nss = new nanoStreamSettings(); -nss.setRecordMp4(true); -nss.setMp4Path(mp4FilePath); -``` -{!docs/nanostream/android/android_bandwidth_control.md!} - -RTMP Quality Statistics ------------------------ - -### Description - -The RTMP Module provides the current RTMP Quality over the 'NanostreamEventListener'. These includes the 'output bit rate', 'buffer fullness', 'bit rate' and 'frame rate'. - -### Implementation Example - -```java -public class MainActivity extends Activity implements NanostreamEventListener { - private LinearLayout qualityView = null; - private TextView outputBitrate = null; - private TextView bufferFullness = null; - private TextView bitrate = null; - private TextView framerate = null; - - @Override - protected void onCreate(Bundle savedInstanceState) { - qualityView = (LinearLayout) findViewById(R.id.qualityView); - outputBitrate = (TextView) findViewById(R.id.outputBitrateText); - bufferFullness = (TextView) findViewById(R.id.bufferfillnessText); - bitrate = (TextView) findViewById(R.id.bitrateText); - framerate = (TextView) findViewById(R.id.framerateText); - - // Init nanoStream - } - - @Override - public void onNanostreamEvent(NanostreamEvent event) - { - if (event.GetType() == NanostreamEvent.TYPE_RTMP_QUALITY) - { - this.runOnUiThread(new ViewQualityRunnable(event)); - } - } - - private class ViewQualityRunnable implements Runnable - { - private NanostreamEvent m_event; - private DecimalFormat format; - - public ViewQualityRunnable(NanostreamEvent m_event) - { - super(); - this.m_event = m_event; - format = new DecimalFormat("#0.00"); - } - - @Override - public void run() - { - if (qualityView.getAlpha() == 0 && m_event.GetParam1() != 0 && m_event.GetParam2() != 0 && m_event.GetParam3() != 0 && m_event.GetParam4() != 0) - { - qualityView.setAlpha(0.5f); - } - int qualityColor = Color.YELLOW; - if (m_event.GetParam2() >= 1000) - { - qualityColor = Color.rgb(255, 0, 0); - } else if (m_event.GetParam2() >= 750) - { - qualityColor = Color.YELLOW; - } else if (m_event.GetParam2() <= 750) - { - qualityColor = Color.GREEN; - } - - outputBitrate.setText(Long.toString(m_event.GetParam1() / 1000) + "kbit/s"); - outputBitrate.setTextColor(qualityColor); - bufferFullness.setText(format.format(((double) m_event.Ge| bufferFullness. | bitrate.setText(Long.toString(m | framerate.setText(m_event.GetPa | Camera Zoom | The nanoStream Android SDK supports camera zoom, if the internal camera supports it. Therefor there are a few funct | Function | Return Type | returns | -|:------------------------------|:--------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `hasZoom()` | `booelan` | true if zoom is supported by the video source / device | -| `getZoomRatios()` | `List` | list with of ale zoom ratios | -| `getZoom()` | `int` | the index of the `List` that returned from `getZommRatios()` | -| `setZoom(int)` | `int` | the new index of the `List` that returned from `getZommRatios()` | -| turned from `getZommRatios()` | | | -| | | | -| turned from `getZommRatios()` | | | -| | | | -| | | | -| turned from `getZommRatios()` | | | -| | | | - | - -| -| -turned from `getZommRatios()` | - -It is recommended to use `pinch to zoom`, therefor you need to implement a `ScaleGestureDetector.SimpleOnScaleGestureListener`, and a `pinch2zoom` function, that takes the `scalefactor` from the `SimpleOnScaleGestureListener` as a int parameter, take a look at the [Implementation Example](#implementation_example_7). - -### getZoomRatios() - -`getZoomRatios()` returns a List of Integer values, this values are the zoom ratios in 1/100 increments (e.g. a zoom of 3.2x is returned as 320). - -### setZoom(int) - -The int parameter from `setZoom(int zoom)` is the index of zoom ratios that returns `getZoomRatios()`. - -### Zoom Behavior on Camera Switch - -During a camera switch (e.g. from back to front) the zoom remains unaffected. - -### Implementation Example - -```java -public class MainActivity extends Activity { - private ScaleGestureDetector scaleGestureDetector; - private List mZoomRatios = null; - - private nanoStream streamLib = null; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - nanoStreamSettings nss = new nanoStreamSettings(); - // configure nanoStreamSettings - - streamLib = new nanoStream(nss); - - if(streamLib.hasZoom()) { - mZoomRatios = streamLib.getZoomRatio(); - } - - if(null == scaleGestureDetector) { - scaleGestureDetector = new ScaleGestureDetector(this, new ScaleGestureListener()); - } - } - - @Override - public boolean onTouchEvent(MotionEvent event) - { - if (scaleGestureDetector != null) - { - scaleGestureDetector.onTouchEvent(event); - } - return true; - } - - private class ScaleGestureListener extends ScaleGestureDetector.SimpleOnScaleGestureListener { - @Override - public boolean onScale(ScaleGestureDetector detector) { - if(null != streamLib) { - if (streamLib.hasZoom()) { - pinch2Zoom(detector.getScaleFactor()); - } - } - return true; - } - } - - public void pinch2Zoom(float scaleFactor) { - if (streamLib.hasZoom() && null != mZoomRatios) { - int zoomFactor = streamLib.getZoom(); - float zoomRatio = mZoomRatios.get(zoomFactor) / 100f; - zoomRatio *= scaleFactor; - if (zoomRatio > 1.0f) { - if (scaleFactor > 1.0f) { - for (int i = zoomFactor; i < mZoomRatios.size(); i++) { - Double zoom = mZoomRatios.get(i) / 100.0; - if (zoom >= zoomRatio) { - streamLib.setZoom(i); - break; - } - } - } else { - for (int i = zoomFactor; i > 0; i--) { - Double zoom = mZoomRatios.get(i) / 100.0; - if (zoom <= zoomRatio) { - streamLib.setZoom(i); - break; - } - } - } - } - } - } -} -``` - -Camera Focus ------------- - -### Description - -The nanoStream Android SDK supports camera focus and focus lock, if the internal cameras supports them. There are two non-blocking functions - -```java -setFocusArea(int focusWidth, int focusHeight, float areaMultiple, int x, - int y, int previewWidth, int previewHeight, int weigh) -setFocusLockArea(int focusWidth, int| int y, int previewWidt | through the | rem | you can attach or remove a FocusCallback listener. To check if your device supports focus call the funct | which will return t | Parameter name | meaning | -|:------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| focusWidth | the focus Area width | -| focusHeight | the focus Area height | -| areaMultiple | a Multiple for the focus area (default: 1f) | -| x | the x position on the Screen | -| y | the y position on the Screen | -| previewWidth | the width of the preview | -| previewHeight | the height of the preview | -| weight | the weight of the area must be range from 1 to 1000 | -| e area must be range from 1 to 1000 | | -| | | -| e area must be range from 1 to 1000 | | -| | | -| | | -| e area must be range from 1 to 1000 | | -| | | -| | | -| | | -| e area must be range from 1 to 1000 | | - | - -e area must be range from 1 to 1000 | - -### FocusCallback interface - -The FocusCallback interface has three abstract functions - -```java -onSuccess() -onSuccess(Rect rect, Boolean focusLock) -onFailure() -``` - -### Implementation Example - -```java -public class MainActifity extens Actifity implements FocusCallback { - private GestureDetector gestureDetector; - private nanoStream streamLib = null; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - streamLib = new nanoStream(new nanoStreamSettings()); - if(streamLib.isFocusSupported()) { - gestureDetector = new GestureDetector(this, new GestureListener()); - } - ... - } - - @Override - public boolean onTouchEvent(MotionEvent event) - { - if (gestureDetector != null) - { - gestureDetector.onTouchEvent(event); - } - return true; - } - .... - private class GestureListener implements OnGestureListener { - @Override - public boolean onSingleTapUp(MotionEvent e) - { - if (streamLib != null) - { - streamLib.setFocusArea(300, 300, 1f, (int) e.getX(), (int) e.getY(), surface.getWidth(), surface.getHeight(), 1000); - } - return true; - } - - @Override - public void onLongPress(MotionEvent e) - { - if (streamLib != null) - { - streamLib.setFocusLockArea(300, 300, 1f, (int) e.getX(), (int) e.getY(), surface.getWidth(), surface.getHeight(), 1000); - } - } - } - - @Override - public void onSuccess(Rect rect, Boolean aBoolean) { - Log.i(TAG, "focus success"); - } - - @Override - public void onFailure() { - Log.i(TAG, "focus failed"); - } -} -``` -{!docs/nanostream/android/android_snapshot.md!} - -{!docs/nanostream/android/android_server_authentication.md!} - - -DeviceProperties ----------------- - -Before Android 4.3 there was no obligation for Android hardware manufacturers to pass the video related parts of the CTS (Compatibility Test Suite). Therefore some Android 4.1 and 4.2 Devices show non standard behaviour in regard to color format definitions and representation of video frames in memory. This could lead to issues in the video stream like switched red and blue colors, dislocated color components or a green bar at the bottom of the video frame. nanoStream Android now provides the functionality to detect and compensate common issues related to this. - -### Description - -`nanoStream.getDeviceProperties()` is a static function that is running a test on the device hardware to detect non standard behaviour and returning a DeviceProperties object containing the result.`DeviceProperties.getFlags()` returns the test result as an integer value that can be stored in the application preferences, to avoid running the device test on every app start. DeviceProperties can be applied to a new nanoStream instance by calling `nanoStream.setDeviceProperties(DeviceProperties)`. We recommend to call `getDeviceProperties()` in a background thread during the first app start on a pre 4.3 device, because the call is blocking and might last up to 5 seconds on older/weaker devices. We also recommend to store the OS version in the preferences, to be able to detect OS updates and to eventually rerun the device test or stop setting the DeviceProperties if the new OS is 4.3 or higher. - -### Implementation Example - -```java -public class App extends Application { - private static DeviceProperties deviceProp = null; - - public void onCreate(){ - super.onCreate(); - - Thread chkThread = new Thread(new Runnable(){ - @Override - public void run() { - try { - SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); - int curApiVer = android.os.Build.VERSION.SDK_INT; - int curAppVer = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode; - int curEncVer = DeviceProperties.VERSION; - - int oldApiVer = prefs.getInt("Pref_Android_API", 0); - int oldAppVer = prefs.getInt("Pref_App_Version", 0); - int oldChkVer = prefs.getInt("Pref_Check_Version", 0); - int oldChkResult = prefs.getInt("Pref_Check_Result", -1); - - if (((oldApiVer * oldAppVer * oldApiVer) == 0) - || (oldApiVer < curApiVer) - || (oldAppVer < curAppVer) - || (oldChkVer < curEncVer) - || oldChkResult < 0) { - Editor edit = prefs.edit(); - edit.putInt("Pref_Android_API", curApiVer); - edit.putInt("Pref_App_Version", curAppVer); - - /* Run device check */ - try { - deviceProp = nanoStream.getDeviceProperties(); - edit.putInt("Pref_Check_Result", deviceProp.getFlags()); - edit.putInt("Pref_Check_Version", deviceProp.getVersion()); - edit.commit(); - } catch (RuntimeException e) { - Log.d("Device Check failed", e.toString()); - edit.putInt("Pref_Check_Result", -1); - edit.putInt("Pref_Check_Version", 0); - edit.commit(); - } - } else { - deviceProp = new DeviceProperties(oldChkResult); - } - Log.d("Device Properties: ", deviceProp.toString()); - } catch (Exception e) { - Log.d(this.getClass().getName(), "Device Check Runnable"); - e.printStackTrace(); - } - } - }); - if (android.os.Build.VERSION.SDK_INT < 18) { - chkThread.start(); - } - ... - } - - public static DeviceProperties getDeviceProperties() - { - return deviceProp; - } -} -``` - -```java -public class MainActivity extends Activity implements NanostreamEventListener { - ... - @Override - protected void onCreate(Bundle savedInstanceState) { - try { - nanoStreamSettings nss = new nanoStreamSettings(); - streamLib = new nanoStream(nss); - - DeviceProperties deviceProperties = App.getDeviceProperties(); - if(null != streamLib && null != deviceProperties) { - streamLib.setDeviceProperties(deviceProperties); - } - } catch(NanostreamException en) { - Toast.makeText(getApplicationContext(), en.toString(), Toast.LENGTH_LONG).show(); - } - } - ... -} - -``` - -[//]: # (Link list) -[8928e181]: https://developer.android.com/reference/android/os/Environment.html "Android Enviroment" -[4c50db80]: https://developer.android.com/reference/android/content/res/Configuration.html#ORIENTATION_LANDSCAPE "Configuration.ORIENTATION_LANDSCAPE" -[4ec624ac]: https://developer.android.com/reference/android/content/res/Configuration.html#ORIENTATION_PORTRAIT "Configuration.ORIENTATION_PORTRAIT" -[baf72420]: https://developer.android.com/reference/android/content/pm/ActivityInfo.html#SCREEN_ORIENTATION_PORTRAIT "ActivityInfo.SCREEN_ORIENTATION_PORTRAIT" -[c47724c3]: https://developer.android.com/reference/android/content/pm/ActivityInfo.html#SCREEN_ORIENTATION_LANDSCAPE "ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE" -[a59fc893]: https://developer.android.com/reference/android/content/pm/ActivityInfo.html#SCREEN_ORIENTATION_REVERSE_PORTRAIT "ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT" -[b1a7076f]: https://developer.android.com/reference/android/content/pm/ActivityInfo.html#SCREEN_ORIENTATION_REVERSE_LANDSCAPE "ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE" diff --git a/docs/nanostream/android/android_developer_manual_playback.md b/docs/nanostream/android/android_developer_manual_playback.md deleted file mode 100644 index 195701e86..000000000 --- a/docs/nanostream/android/android_developer_manual_playback.md +++ /dev/null @@ -1,5 +0,0 @@ -# nanoStream SDK Android: Playback Developer Manual - - -{!docs/nanostream/android/android_rtmp_playback.md!} -{!docs/nanostream/android/android_feedback.md!} diff --git a/docs/nanostream/android/android_developer_manual_sample.md b/docs/nanostream/android/android_developer_manual_sample.md deleted file mode 100644 index 22e21f0e6..000000000 --- a/docs/nanostream/android/android_developer_manual_sample.md +++ /dev/null @@ -1,7 +0,0 @@ -# nanoStream SDK Android: Sample Developer Manual - - -{!docs/nanostream/android/sample/android_sample_quickstart.md!} -{!docs/nanostream/android/sample/android_sample_streamer.md!} -{!docs/nanostream/android/sample/android_sample_player.md!} -{!docs/nanostream/android/android_feedback.md!} diff --git a/docs/nanostream/android/android_developer_manual_streaming.md b/docs/nanostream/android/android_developer_manual_streaming.md deleted file mode 100644 index 74f3a5a3c..000000000 --- a/docs/nanostream/android/android_developer_manual_streaming.md +++ /dev/null @@ -1,18 +0,0 @@ -# nanoStream SDK Android: Streaming Developer Manual - -{!docs/nanostream/android/android_getting_started.md!} - -{!docs/nanostream/android/streaming/android_resolution_aspect_ratio_and_orientation.md!} -{!docs/nanostream/android/streaming/android_rotationhelper_class.md!} -{!docs/nanostream/android/streaming/android_stream_type.md!} -{!docs/nanostream/android/streaming/android_server_authentication.md!} -{!docs/nanostream/android/streaming/android_mp4_recording.md!} -{!docs/nanostream/android/streaming/android_snapshot.md!} -{!docs/nanostream/android/streaming/android_bandwidth_control.md!} -{!docs/nanostream/android/streaming/android_rtmp_quality_statistics.md!} -{!docs/nanostream/android/streaming/android_camera_zoom.md!} -{!docs/nanostream/android/streaming/android_camera_focus.md!} -{!docs/nanostream/android/streaming/android_device_properties.md!} - - -{!docs/nanostream/android/android_feedback.md!} diff --git a/docs/nanostream/android/android_feedback.md b/docs/nanostream/android/android_feedback.md deleted file mode 100644 index 166aa1b21..000000000 --- a/docs/nanostream/android/android_feedback.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Further questions? - Would you like a feature not available yet? - - -We can make it work for you based on our consulting and development / implementation services. [Contact us][623e68f0] - -# Crash Logs - - -If you encounter a crash, please send us the crash log as explained in the following steps: - -- Plug in the device and open Android Studio -- In Android Studios Android Monitor - - Clear the logcat output - - Set the Log Level to `Verbose` - - Set the filter to `No Filters` -- Run the critical section -- Mark the entire logcat output -- Right click in the logcat View and `Copy as Plain Text` -- Open an editor of your choice -- Paste the logcat output into the editor and Save the logcat output as .txt file - -[//]: # (Link list) -[623e68f0]: https://www.nanocosmos.de/v6/#section_call "Contect us" diff --git a/docs/nanostream/android/nanostream-android-index.md b/docs/nanostream/android/nanostream-android-index.md deleted file mode 100644 index e42f17c80..000000000 --- a/docs/nanostream/android/nanostream-android-index.md +++ /dev/null @@ -1,14 +0,0 @@ - -### Android Documentation - -#### [nanoStream SDK for Android](nanostream-android-sdk.md) - -#### [Streaming Media](android_developer_manual_streaming.md) -This developer manual provides a quick insight in how to setup the basic streaming functionality in android apps using the nanoStream SDK. Furthermore it contains a description of some main functions and options of the sdk. - -#### [Playback](android_developer_manual_streaming.md) -This developer manual provides a quick insight in how to setup the basic playback functionality in android apps using the nanoStream SDK. Furthermore it contains a description of some main functions and options of the sdk. - -#### [Samples](android_developer_manual_sample.md) -To allow an even quicker start with the nanoStream SDK for Android we provide some basic samples. These samples are containing android studio projects with the basic app structure needed from using the nanoStream SDK. Currently, we are providing two different sample. The Streamer Sample ,containing the basic setup for streaming AV-Data from your device and the playback sample, containing the basic setup for playing rtmp-streams on your device. - diff --git a/docs/nanostream/android/nanostream-android-sdk.md b/docs/nanostream/android/nanostream-android-sdk.md deleted file mode 100644 index 00e1342f4..000000000 --- a/docs/nanostream/android/nanostream-android-sdk.md +++ /dev/null @@ -1,1028 +0,0 @@ ---- -id: nanostream-android-sdk -title: SDK for Android -sidebar_label: SDK for Android ---- - -## Introduction - - -### Purpose - - -This documentation is about the nanoStream Live Video Streaming SDK for Android and can be used by software developers to integrate nanoStream Live Video Encoding into custom apps. - -### Requirements - -- Android 4.1+ (API Level 16) - -#### Required permissions - -The nanoStream SDK for android does not request any permissions by itself. -However, it needs a few permissions to work. - -The needed permissions are : -* `android.permission.INTERNET` - This is needed since the stream should be sent over a network. -* `android.permission.RECORD_AUDIO` - In case your stream is not video-only the app needs this permission to record audio data using the microphone. -* `android.permission.RECORD_VIDEO` - In case your stream is not audio-only the app needs this permission to record image data using the camera. -* `android.permission.WRITE_EXTERNAL_STORAGE` - In case the encoded stream should be written on the phone's memory. - -How these permissions should be requested depends on the used version of android. - -On devices with android versions prior to Android 6.0 the permissions are getting requested once per app installation. They just need to be configured within the `AndroidManifest.xml` file, so that the user can give the permission while installing the app. - -On devices with android versions from 6.0 upwards the permissions should be requested at run time when needed. It can be checked whether a permission is already granted or not. Afterwards, the needed permissions can be requested. This will create a pop-up, which asks the user to grant the needed permissions. If you are working with our BinutStreamer-Sample, an example of this can be found in the CheckAppPermission-Class. - -### Getting Started - - -#### Copy the SDK libraries into your Android Studio project - -Add the `net.nanocosmos.nanoStream.jar` java component to your Android Studio project by copying `[SDK]/libs/net.nanocosmos.nanoStream.jar` to the folder `[projectpath]/app/libs/net.nanocosmos.nanoStream.jar` Add the `nanoStream.so` native components to the Android Studio project by copying the 5 folders `[SDK]/libs/[platform]/libRTMPStream.so` to [projectpath]/app/src/main/jniLibs/[platform]/libRTMPStream.so\` - -Platforms are armeabi, armeabi-v7a, arm64-v8a, x86, mips - -#### Add the nanoStream to the gradle file - -Open the `build.gradle` file (Module:app) and add - -``` -compile files('libs/net.nanocosmos.nanoStream.jar') -``` - -to the dependencies section. - -#### Check library version - -```java -String nanoStreamVersion = nanoStream.getVersion().fullVersion; -``` - -#### Initialize the library - -Implement the interface "nanoStreamEventListener" in your class: - -```java -public class StreamActivity extends Activity implements NanostreamEventListener { - // implement your class - - private class NotificationRunable implements Runnable { - private NanostreamEvent m_event; - - public NotificationRunable(NanostreamEvent event) { - m_event = event; - } - - @Override - public void run() { - Toast.makeText(getApplicationContext(), m_event.GetDescription(), Toast.LENGTH_SHORT).show(); - } - } - - @Override - public void onNanostreamEvent(NanostreamEvent event) { - if (event.GetType() != NanostreamEvent.TYPE_RTMP_QUALITY) { - this.runOnUiThread(new NotificationRunable(event)); - } - } -} -``` - -Configure the nanoStreamSettings object for the library: - -```java - private String license = "--- add your nanoStream license here ---"; - private String serverUrl = "rtmp://example.org/live"; - private String streamName = "myStream"; - private nanoStream streamLib = null; - - void initStreamLib() { - if(null == streamLib) { - nanoStreamSettings nss = new nanoStreamSettings(); - nss.setLicense(license); - nss.setLogSettings(logSettings); - nss.setStreamUrl(serverUrl); - nss.setStreamName(streamName); - nss.setEventListener(this); - - try { - streamLib = new nanoStream(nss); - } catch (NanostreamException en) { - Toast.makeText(getApplicationContext(), en.toString(), Toast.LENGTH_LONG).show(); - } - - if(null != streamLib) { - try { - streamLib.init(); - } catch (NanostreamException e) { - Toast.makeText(getApplicationContext(), e.toString(), Toast.LENGTH_LONG).show(); - } catch (IllegalArgumentException e) { - e.printStackTrace(); - } - } - } - } -``` - -Start/Stop the Stream: - -```java -public void toggleStreaming(View clicked) { - if (null == streamLib) { - Toast.makeText(getApplicationContext(), "nanoStream failed to initialize", Toast.LENGTH_LONG).show(); - return; - } - - if (!streamLib.hasState(nanoStream.EncoderState.RUNNING)) { - Toast.makeText(getApplicationContext(), "Starting...", Toast.LENGTH_SHORT).show(); - - if (streamLib.hasState(nanoStream.EncoderState.STOPPED) || streamLib.hasState(nanoStream.EncoderState.CREATED)) { - try { - Logging.log(Logging.LogLevel.DEBUG, TAG, "toggleStreaming init nanoStream"); - streamLib.init(); - } catch (NanostreamException en) { - Toast.makeText(getApplicationContext(), en.toString(), Toast.LENGTH_LONG).show(); - return; - } - } - - try { - streamLib.start(); - } catch (NanostreamException en) { - Toast.makeText(getApplicationContext(), en.toString(), Toast.LENGTH_LONG).show(); - return; - } - } else { - Toast.makeText(getApplicationContext(), "Stopping...", Toast.LENGTH_SHORT).show(); - streamLib.stop(); - } -} -``` - -[//]: # (Link list) - -## Resolution, Aspect Ratio and Orientation - -### Resolution -Resolution means the native resolution of the camera (input). In the most situations this will be the same for the output. -To set the resolution there is a function in the `VideoSettings` object called `setResolution(Resolution res)`. If you set a resolution that the -device doesn't support, nanoStream will automatically switch to the nearest resolution available on the device. A list of supported resolutions for the current video source can be obtained from `getCapabilities().listAvailableVideoResolutions()` -on the `nanoStream` object. - -### Aspect Ratio -Aspect ratio means the aspect ratio of the outgoing stream. The aspect ratio determines if the input video needs to be cropped. -The aspect ratio can be set through the `setAspectRatio(AspectRatio aspectRatio)` function on the `VideoSettings` object. - -#### Supported Aspect Ratios -| Aspect Ratio | AspectRatio value | -|--------------|------------------------------| -| Keep Input | AspectRatio.RATIO_KEEP_INPUT | -| 1:1 | AspectRatio.RATIO_1_1 | -| 4:3 | AspectRatio.RATIO_4_3 | -| 16:9 | AspectRatio.RATIO_16_9 | -| 3:4 | AspectRatio.RATIO_3_4 | -| 9:16 | AspectRatio.RATIO_9_16 | - - - -### Orientation -The default stream orientation is landscape. If you switch to portrait the resolution will swap width and height, e.g. from 640x480 to 480x640. -You can set the stream orientation on the `nanoStream` object with the `setStreamRotation` function. The stream orientation needs to be set -before starting the stream, it is not possible to switch the orientation during the stream. - -#### Supported Orientations - -| Orientation | Rotation Value | -|-----------------------|-----------------------| -| Landscape | Rotation.ROTATION_0 | -| Portrait | Rotation.ROTATION_90 | -| Landscape Upside Down | Rotation.ROTATION_180 | -| Portrait Upside Down | Rotation.ROTATION_270 | - - -### Example Combinations of Aspect Ratios and Orientations -The input resolution is set to 640x480 here. -The red rectangle marks up the active area that is included in the output stream. - -| Orientation | Aspect Ratio | Stream Area | -|--------------------------------|--------------|---------------------------------------------| -| Portrait[1](#fnAS1) | Keep Input | ![Screenshot](img/portrait_keep_input.png) | -| Portrait[1](#fnAS1) | 4:3 | ![Screenshot](img/portrait_4_3.png) | -| Portrait[1](#fnAS1) | 3:4 | ![Screenshot](img/portrait_3_4.png) | -| Portrait[1](#fnAS1) | 16:9 | ![Screenshot](img/portrait_16_9.png) | -| Portrait[1](#fnAS1) | 9:16 | ![Screenshot](img/portrait_9_16.png) | -| Landscape | Keep Input | ![Screenshot](img/landscape_keep_input.png) | -| Landscape | 4:3 | ![Screenshot](img/landscape_4_3.png) | -| Landscape | 3:4 | ![Screenshot](img/landscape_3_4.png) | -| Landscape | 16:9 | ![Screenshot](img/landscape_16_9.png) | -| Landscape | 9:16 | ![Screenshot](img/landscape_9_16.png) | - -1: In this sample APP we crop the preview so it doesn't look ugly, so the stream is actually larger then the preview. - -### Example -If you want to stream with a resolution of 640x360 but your device doesn't supports this resolution, you need to crop the resolution from 640x480 (this resolution is supported by the most devices) to 640x360. -This can be done through the aspect ratio, so you need to set the aspect ratio to 16:9 to stream with a resolution of 640x360. - -### Implementation Example - - -```java -public class MainActivity { - ... - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - nanoStreamSettings nss = new nanoStreamSettings(); - VideoSettings vs = new VideoSettings(); - ... - vs.setResolution(new Resolution(640, 480)); // default value - vs.setAspectRatio(AspectRatio.RATIO_16_9); // default value is AspectRatio.KEEP_INPUT - ... - streamLib = new nanoStream(nss); - streaLib.init(); - - streamLib.setStreamRotation(Rotation.ROTATION_0); // default value - ... - } - ... -} -``` - -## Stream Type - -The SDK supports differnet streaming modes: - -- Video and Audio -- Video only -- Audio only - -You can en/disable Video/Audio in the `nanoStreamSettings`.object - -### Implementation Example - -```java -nanoStreamSettings nss = new nanoStreamSettings(); -nss.setHaveVideo(true); // false -nss.setHaveAudio(true); // false -``` - -## Server Authentication - - -In case authentication is required, the credentials can be set on the `nanoStreamSettings` object. - -### Implementation Example - -```java -nanoStreamSettings nss = new nanoStreamSettings(); -nss.setAuthUser("user"); -nss.setAuthPassword("password"); -``` -## Local Recording - -### Description - -The nanoStream Android SDK supports local file recording on the device in MP4 format. This document describes how to enable and configure nanoStream for local recording. - -### Steps to configure MP4 recording - -MP4 recording can be configured with two function calls on a nanoStreamSettings object. - -- Enabling MP4 recording: setRecordMp4(boolean) -- Setting up the file path: setMp4Path(String) - -### setRecordMp4(boolean) - -The setRecordMp4 function takes a boolean as parameter to enable/disable the recording function. - -### setMp4Path(String) - -The setMp4Path function takes a String as parameter. This string needs to be a valid file path (e.g. /sdcard/test.mp4). -It is recommended to use the getExternalStorageDirectory or getExternalStoragePublicDirectory functions from the -[Android Enviroment][8928e181] API, and add a file name to the returned path. Please find the code snippet below as an example. - -### Android Permission - -To be able to write to an external file path your Android app needs the following permissions to be added to the app manifest (AndroidMainfest.xml). - -```xml - - -``` - -#### Android 6.0 - -Due to the new permission handling in Android 6 (M) writing to external directories (DCIM) requires a permission by user. Writing to the applications own data directory (/Android/data/com.companyname.appname/) is not restricted. - -### Implementation Example - -```java -File externalFilePath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM); -File filePath = new File(externalFilePath, "myMp4File.mp4"); -String mp4FilePath = filePath.getAbsolutePath(); - -nanoStreamSettings nss = new nanoStreamSettings(); -nss.setRecordMp4(true); -nss.setMp4Path(mp4FilePath); -``` - -## Adaptive Bitrate Streaming - -By using the Adaptive Bitrate Control (ABC) the stream will automatically adjust to changes of the bandwidth. There are four modes available: - -- DISABLED: The Adaptive Bitrate Control is disabled. -- QUALITY_DEGRADE: The video quality will be changed if the bandwidth changes. For instance, if not enough bandwidth is available, the video bitrate will be decreased, which in turn degrades the video quality. -- FRAME_DROP: Low bandwidth is compensated by decreasing the framerate (FPS), but maintaining the video qualtiy. -- QUALITY_DEGRADE_AND_FRAME_DROP: The video quality and the framerate (FPS) decreased if the not enough bandwidth is available. - -Make sure to set the ABC settings before a stream is started. - -### Implementation Example - -```java -private AdaptiveBitrateControlSettings.AdaptiveBitrateControlMode abcMode = AdaptiveBitrateControlSettings.AdaptiveBitrateControlMode.QUALITY_DEGRADE_AND_FRAME_DROP; -private int videoBitrate = 500000; - -private void initStreamLib() { - AdaptiveBitrateControlSettings abcSettings = new AdaptiveBitrateControlSettings(abcMode); - abcSettings.SetMaximumBitrate((int)(videoBitrate * 1.5)); - - nanoStreamSettings nss = new nanoStreamSettings(); - nss.setAbcSettings(abcSettings); -} -``` - -### Measuring the available bandwidth - - -For measuring the available bandwidth you can use the method `runBandwidthCheck`. After the check finished, the result can be used to set the bitrate for the nanoStream object. -The check measures the bandwidth by running a test stream to the server. -The BandwidthCheck Class has three public functions: - -* runBandwidthCheck(BandwidthCheckSettings settings, BandwidthCheckResultCallback callback() -* forceStop() -* abort() - -There is a BandwidthCheckSettings Class, the constructor creates a standard object of BandwidthCheckSettings, with the following settings: - -| property | default values | meaning| -|:------------------------------------------------|:----------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| prerollSeconds | 1 (in sec.) | this is the pre roll time to connect to the server | -| runTime | 5 (in sec.) | the run time of the bandwidth check | -| maxBitrate | 3000000 (bit/s = 3 MBit/s) | the maximum bit rate for the bandwidth check | -| rtmpUrl | empty | the rtmp url for the bandwidth check | -| streamId | empty | the stream id for the bandwidth check | - -With this settings you can call the runBandwidthCheck methode, the second parameter is the callback for the results. This callback class has a finished method that will be called after bandwidth check is done. -The finished method has one parameter from type BandwidthCheckResult, this object has 6 getter methods: - - - getAverageBitrate() // the average measured bandwidth - - getMedianBitrate() // the median measured bandwidth - - getMaxBitrate() // the maximum measured bandwidth - - getMinBitrate() // the minimum measured bandwidth - - getRunTimeMS() // the run time in ms - - getErrorCode() // the error code if all is ok this is nanoResults.N_OK (all error codes can be found in the nanoStream API Reference documentation for nanoResults) - -The forceStop call stops the bandwidth check and will return the results that where measured until then. The abort call stops the bandwidth check but don't return any results. - -The bandwidth check, sends a special type of metadata that will not be recorded on the Streaming Server. - -#### Implementation Example - -```java -private BandwidthCheck bwCheck = null; - -private class CustomBandwidthCheckResultCallback implements BandwidthCheckResultCallback { - @Override - public void finished(final BandwidthCheckResult bandwidthCheckResult) { - Log.d(TAG, "BandwidthCheck results: " + - "\n\tAverage Bitrate (kBit/s): " + bandwidthCheckResult.getAverageBitrate() / 1000 + - "\n\tMedian Bitrate (kBit/s): " + bandwidthCheckResult.getMedianBitrate() / 1000 + - "\n\tMax Bitrate (kBit/s): " + bandwidthCheckResult.getMaxBitrate() / 1000 + - "\n\tMin Bitrate (kBit/s): " + bandwidthCheckResult.getMinBitrate() / 1000 + - "\n\tRun Time (ms) : " + bandwidthCheckResult.getRunTimeMS()); - } -} - -private void initBandwidthCheck() { - if(null == bwCheck) { - BandwidthCheckSettings settings = new BandwidthCheckSettings(); - settings.setRtmpUrl(serverUrl); - settings.setStreamId(streamName); - bwCheck = new BandwidthCheck(); - bwCheck.runBandwidthCheck(settings, new CustomBandwidthCheckResultCallback()); - } -} -``` -##Snapshot - -To get a snapshot (image) of the current preview/stream, the method `takeSnapshot` can be used. This is a non blocking function, for the result you need to implement the SnapshotCallback interface. The snapshot returns as a base64 encoded JPEG - -### Implementation Example - -```java -private class CustomSnapshotCallback implements SnapshotCallback { - @Override - void onSuccess(String arg0){ - // do something with the base64 encoded JPEG. - } - - @Override - void onFailure(){ - Log.d(TAG, "takeSnapshot() failed!") - } -} -private void shapshot() { - streamLib.takeSnapshot(new CustomSnapshotCallback()); -} -``` - -## Camera Zoom - -### Description - -The nanoStream Android SDK supports camera zoom, if the internal camera supports it. Therefor there are a few functions, the most important are: - -| Function | Return Type | returns | -|:----------------|:--------------|:----------------------------------------------------------------------| -| hasZoom() | boolean | true if zoom is supported by the video source/ device | -| getZoomRatios() | List | list with of ale zoom ratios | -| getZoom() | int | the index of the List that returned from getZoomRatios() | -| setZoom(int) | int | the new index of the List that returned from getZoomRatios() | - -It is recommended to use pinch to zoom, therefor you need to implement a ScaleGestureDetector.SimpleOnScaleGestureListener, and a pinch2zoom function, that takes the scalefactor from the SimpleOnScaleGestureListener as a int parameter, take a loaok at the [Implementation Example][ef1c8421]. -#### getZoomRatios() -getZoomRatios() returns a List of Integer values, this values are the zoom ratios in 1/100 increments (e.g. a zoom of 3.2x is returned as 320). -#### setZoom(int) -The int parameter from setZoom(int zoom) is the index of zoom ratios that returns getZoomRatios(). -#### Zoom Behavior on Camera Switch -During a camera switch (e.g. from back to front) the zoom remains unaffected. - -#### Implementation Example - -```java -public class MainActivity extends Activity { - private ScaleGestureDetector scaleGestureDetector; - private List mZoomRatios = null; - - private nanoStream streamLib = null; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - nanoStreamSettings nss = new nanoStreamSettings(); - // configure nanoStreamSettings - - streamLib = new nanoStream(nss); - - if(streamLib.hasZoom()) { - mZoomRatios = streamLib.getZoomRatio(); - } - - if(null == scaleGestureDetector) { - scaleGestureDetector = new ScaleGestureDetector(this, new ScaleGestureListener()); - } - } - - @Override - public boolean onTouchEvent(MotionEvent event) - { - if (scaleGestureDetector != null) - { - scaleGestureDetector.onTouchEvent(event); - } - return true; - } - - private class ScaleGestureListener extends ScaleGestureDetector.SimpleOnScaleGestureListener { - @Override - public boolean onScale(ScaleGestureDetector detector) { - if(null != streamLib) { - if (streamLib.hasZoom()) { - pinch2Zoom(detector.getScaleFactor()); - } - } - return true; - } - } - - public void pinch2Zoom(float scaleFactor) { - if (streamLib.hasZoom() && null != mZoomRatios) { - int zoomFactor = streamLib.getZoom(); - float zoomRatio = mZoomRatios.get(zoomFactor) / 100f; - zoomRatio *= scaleFactor; - if (zoomRatio > 1.0f) { - if (scaleFactor > 1.0f) { - for (int i = zoomFactor; i < mZoomRatios.size(); i++) { - Double zoom = mZoomRatios.get(i) / 100.0; - if (zoom >= zoomRatio) { - streamLib.setZoom(i); - break; - } - } - } else { - for (int i = zoomFactor; i > 0; i--) { - Double zoom = mZoomRatios.get(i) / 100.0; - if (zoom <= zoomRatio) { - streamLib.setZoom(i); - break; - } - } - } - } - } - } -} -``` - - [ef1c8421]: #nanostream_android_camera_zoom_impl_example "Implementation Example" - -## Camera Focus - -### Description - -The nanoStream Android SDK supports camera focus and focus lock, if the internal cameras supports them. -There are two non-blocking functions -```java -setFocusArea(int focusWidth, int focusHeight, float areaMultiple, int x, int y, int previewWidth, int previewHeight, int weigh) -setFocusLockArea(int focusWidth, int focusHeight, float areaMultiple, int x, int y, int previewWidth, int previewHeight, int weigh) -``` -through the -```java -addFocusCalback(FocusCallback callback) -removeFocusCalback(FocusCallback callback) -``` -you can attach or remove a FocusCallback listener. -To check if your device supports focus call the function -```java -isFocusSupported() -``` -which will return true or false. - -### Parameter List - -| **Parameter name** | **meaning** | -|----------------|-----------------------------------------------------| -| focusWidth | the focus Area width | -| focusHeight | the focus Area height | -| areaMultiple | a Multiple for the focus area (default: 1f) | -| x | the x position on the Screen | -| y | the y position on the Screen | -| previewWidth | the width of the preview | -| previewHeight | the height of the preview | -| weight | the weight of the area must be range from 1 to 1000 | - -### FocusCallback interface - -The FocusCallback interface has three abstract functions -```java -onSuccess() -onSuccess(Rect rect, Boolean focusLock) -onFailure() -``` - -### Implementation Example - -```java -public class MainActifity extens Actifity implements FocusCallback { - private GestureDetector gestureDetector; - private nanoStream streamLib = null; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - streamLib = new nanoStream(new nanoStreamSettings()); - if(streamLib.isFocusSupported()) { - gestureDetector = new GestureDetector(this, new GestureListener()); - } - ... - } - - @Override - public boolean onTouchEvent(MotionEvent event) - { - if (gestureDetector != null) - { - gestureDetector.onTouchEvent(event); - } - return true; - } - .... - private class GestureListener implements OnGestureListener { - - @Override - public boolean onSingleTapUp(MotionEvent e) - { - if (streamLib != null) - { - streamLib.setFocusArea(300, 300, 1f, (int) e.getX(), (int) e.getY(), surface.getWidth(), surface.getHeight(), 1000); - } - return true; - } - - @Override - public void onLongPress(MotionEvent e) - { - if (streamLib != null) - { - streamLib.setFocusLockArea(300, 300, 1f, (int) e.getX(), (int) e.getY(), surface.getWidth(), surface.getHeight(), 1000); - } - } - } - - @Override - public void onSuccess(Rect rect, Boolean aBoolean) { - Log.i(TAG, "focus success"); - } - - @Override - public void onFailure() { - Log.i(TAG, "focus failed"); - } -} -``` - -## DeviceProperties -Before Android 4.3 there was no obligation for Android hardware manufacturers to pass the video related parts of the CTS (Compatibility Test Suite). -Therefore some Android 4.1 and 4.2 Devices show non standard behaviour in regard to color format definitions and representation of video frames in memory. This could lead to issues in the video stream like switched red and blue colors, dislocated color components or a green bar at the bottom of the video frame. nanoStream Android now provides the functionality to detect and compensate common issues related to this. - -### Description -`nanoStream.getDeviceProperties()` is a static function that is running a test on the device hardware to detect non standard behaviour and returning a DeviceProperties object containing the result. -`DeviceProperties.getFlags()` returns the test result as an integer value that can be stored in the application preferences, to avoid running the device test on every app start. -DeviceProperties can be applied to a new nanoStream instance by calling `nanoStream.setDeviceProperties(DeviceProperties)`. -We recommend to call `getDeviceProperties()` in a background thread during the first app start on a pre 4.3 device, because the call is blocking and might last up to 5 seconds on older/weaker devices. -We also recommend to store the OS version in the preferences, to be able to detect OS updates and to eventually rerun the device test or stop setting the DeviceProperties if the new OS is 4.3 or higher. - -### Implementation Example -```java -public class App extends Application -{ - private static DeviceProperties deviceProp = null; - - public void onCreate() - { - super.onCreate(); - - Thread chkThread = new Thread(new Runnable() - { - @Override - public void run() - { - try - { - SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); - int curApiVer = android.os.Build.VERSION.SDK_INT; - int curAppVer = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode; - int curEncVer = DeviceProperties.VERSION; - - int oldApiVer = prefs.getInt("Pref_Android_API", 0); - int oldAppVer = prefs.getInt("Pref_App_Version", 0); - int oldChkVer = prefs.getInt("Pref_Check_Version", 0); - int oldChkResult = prefs.getInt("Pref_Check_Result", -1); - - if (((oldApiVer * oldAppVer * oldApiVer) == 0) - || (oldApiVer < curApiVer) - || (oldAppVer < curAppVer) - || (oldChkVer < curEncVer) - || oldChkResult < 0) - { - - Editor edit = prefs.edit(); - edit.putInt("Pref_Android_API", curApiVer); - edit.putInt("Pref_App_Version", curAppVer); - - /* Run device check */ - try - { - deviceProp = nanoStream.getDeviceProperties(); - - edit.putInt("Pref_Check_Result", deviceProp.getFlags()); - edit.putInt("Pref_Check_Version", deviceProp.getVersion()); - edit.commit(); - } - catch (RuntimeException e) - { - Log.d("Device Check failed", e.toString()); - edit.putInt("Pref_Check_Result", -1); - edit.putInt("Pref_Check_Version", 0); - edit.commit(); - } - - } - else - { - deviceProp = new DeviceProperties(oldChkResult); - } - - Log.d("Device Properties: ", deviceProp.toString()); - } - catch (Exception e) - { - Log.d(this.getClass().getName(), "Device Check Runnable"); - e.printStackTrace(); - } - } - }); - - if (android.os.Build.VERSION.SDK_INT < 18) - { - chkThread.start(); - } - - ... - } - - public static DeviceProperties getDeviceProperties() - { - return deviceProp; - } -} -``` - -```java -public class MainActivity extends Activity implements NanostreamEventListener -{ - ... - @Override - protected void onCreate(Bundle savedInstanceState) - { - try - { - nanoStreamSettings nss = new nanoStreamSettings(); - - streamLib = new nanoStream(nss); - - DeviceProperties deviceProperties = App.getDeviceProperties(); - - if(null != streamLib && null != deviceProperties) - { - streamLib.setDeviceProperties(deviceProperties); - } - } - catch(NanostreamException en) - { - Toast.makeText(getApplicationContext(), en.toString(), Toast.LENGTH_LONG).show(); - } - } - ... -} -} -``` - -## RTMP Playback -### Description and Features -RTMP Playback Component enables application developers to add playback of RTMP live and on demand streams to their apps. - -Supported codecs are H.264 Video, AAC and MP3 Audio. - -Video streams are decoded and rendered on a Surface that is hold by the application, usually connected to a `SurfaceView`. - -Audio streams are decoded and rendered to system audio using the Android AudioSession/AudioTrack API. - -The interface and usage are similar to the Android MediaPlayer. The Android MediaPlayerControl interface is implemented to enable control through an `android.widget.MediaController` instance. - -### License - -The playback component requires a special feature flag to be enabled in your nanoStream license key. It not necessarily included in nanoStream Android SDK licenses. - -### Interface -#### Package name -`net.nanocosmos.nanoStream.streamer` -#### Declaration -`public abstract class NanostreamPlayer implements MediaPlayercontrol, Surfaceholder.Callback` -#### Function Life Cycle - -| Instance Handling | Initialization | Capabilities | Queries | Playback Control | Supported by RTMP Player | -|------------------------|------------------------|-----------------|--------------------|------------------|--------------------------| -| createNanostreamPlayer | | | | | | -| | setSettings | | | | yes | -| | setPlayerEventListener | | | | yes | -| | | canPrepare | | | yes | -| | | canPrepareAsync | | | yes | -| | | canPause | | | yes | -| | | canSeekBackward | | | yes | -| | | canSeekForward | | | yes | -| | | | getState | | yes | -| | | | isPlaying | | yes | -| | | | getCurrentPosition | | no | -| | | | getDuration | | no | -| | | | | prepare | no | -| | | | | prepareAsync | no | -| | | | | start | yes | -| | | | | pause | yes | -| | | | | seekTo | yes | -| | | | | stop | yes | -| | | | | start | yes | -| | | | | stop | yes | -| | close | | | | no | -| | release | | | | yes | - -### Creating an Instance -`NanostreamPlayer` instances can be created through the static factory function `createNanostreamPlayer` at the top level `nanoStream class`. NanostreamPlayer is designed to support multiple player instances. The number of parallel instances can be limited by system resources such as codec,surfaces,memory, network connections and bandwidth. -### Configuration and Settings -Initial player settings are wrapped by the `NanostreamPlayer.PlayerSettings` class. The settings can be applied by calling `NanostreamPlayer.setSettings`. - -### PlayerSettings: - -| Setting | Functions | Description | Type | Default Values | -|---------------------|---------------------------------------------------------------------|------------------------------------------------------------------------------|-------------------|------------------------| -| License | getLicense/setLicense | nanoStream license key | String | empty | -| Url | getUrl/setUrl | RTMP url | String | empty | -| Stream Name | getStreamname/setStreamname | RTMP stream name | String | empty | -| User Name | getUsername/setUsername | User name if RTMP authentication is required | String | empty | -| Password | getPassword/setPassword Password if RTMP authentication is required | String | empty | | -| Buffer Time | getBufferTimeMs/setBufferTimeMs | Length of the stream buffer in milliseconds | Integer | 2000ms/2s | -| Frame Dropping Mode | getFrameDroppingMode/setFrameDroppingMode | Configuration of the dropping mode regarding different droppable frame types | FrameDroppingMode | DROP_NO_FRAMES | -| Stream Playback | getVideoPlayback/getAudioPlayback/setStreamPlayback | Enable stream types to be decoded and played | boolean | video:true, audio:true | -| TrackTimout | getTrackTimeout/setTrackTimeout | Timeout to waiting for Track info | long | 10000 | -| EndlessMode | getEndlessMode/setEndlessMode | Reopen the stream until stop call | boolean | false | - -### Player State -The player stat can be queried through the `getState()` function -```java -/** -* -* The different states of the player instance. -* -*/ -public enum PlayerState -{ - IDLE, INITIALIZED, PREPARED, STARTED, PAUSED, SEEKING, BUFFERING, RECONNECTING, PLAYBACKCOMPLETED, STOPPING, STOPPED; -} -``` - -| State | Description | Supported by RTMP Player | -|-------------------------------|------------------------------------------------------------------------|--------------------------| -| PlayerState.IDLE | Initial state. Player has not yet been initialized or has been closed. | yes | -| PlayerState.INITIALIZED | Player has been initialized with license and settings. | yes | -| PlayerState.PREPARED | Player has been prepared and is ready to start. | no | -| PlayerState.STARTED | Playback has been started. | yes | -| PlayerState.PAUSED | Playback has been paused. | yes | -| PlayerState.SEEKING | Player is Seeking | yes | -| PlayerState.BUFFERING | Player is buffering stream data. | yes | -| PlayerState.RECONNECTING | Player is performing a reconnect | no | -| PlayerState.PLAYBACKCOMPLETED | Playback has ended due to end of stream. | yes | -| PlayerState.STOPPING | Player is stopping | yes | -| PlayerState.STOPPED | Player is stopped | yes | - -### Event Notification -Event notifications can be received through the `NanostreamPlayer.PlayerEventListener` interface. Derive your listener from this interface and add it to the player by calling `setPlayerEventListener()`. - -### Status Events -Event Type : `TYPE_RTMP_STATUS` - -| Event Code | Description | Corresponding State | -|----------------------------------------------------|--------------------------------------------------|-------------------------------| -| NanostreamEvent.CODE_STREAM_STARTED | Playback has been started. | PlayerState.STARTED | -| NanostreamEvent.CODE_STREAM_STOPPING | Playback will stop. | PlayerState.STOPPING | -| NanostreamEvent.CODE_STREAM_STOPPED | Playback has been stopped. | PlayerState.STOPPED | -| NanostreamEvent.CODE_STREAM_ERROR_CONNECT | The connect to the stream url failed. | PlayerState.STOPPED | -| NanostreamEvent.CODE_STREAM_BUFFERING | Player is buffering stream data | PlayerState.BUFFERING | -| NanostreamEvent.CODE_STREAM_PLAYBACKCOMPLETED | Playback has ended due to end of stream. | PlayerState.PLAYBACKCOMPLETED | -| NanostreamEvent.CODE_STREAM_NOT_FOUND | The specified stream could not be found. | PlayerState.STOPPED | -| NanostreamEvent.CODE_STREAM_SEEKING | The Stream is seeking. | PlayerState.SEEKING | -| NanostreamEvent.CODE_STREAM_PAUSED | The Stream is paused | PlayerState.PAUSED | -| NanostreamEvent.CODE_STREAM_VIDEO_FORMAT_AVAILABLE | The Stream has a MediaFormat for the Video Track | | -| NanostreamEvent.CODE_STREAM_AUDIO_FORMAT_AVAILABLE | The Stream has a MediaFormat for the Audio Track | | - - -### Results and Error Events -Event Type : `TYPENANORESULTS` Event Codes : Values of type nanoResults - -| Event Code | Description | Corresponding State | -|-------------------------------------------------|-------------------------------------------------------------------|---------------------| -| nanoResults.N_NOT_INITIALIZED | The RTMP library has not been initialized properly. | PlayerState.STOPPED | -| nanoResults.N_ALLOCATEDATA_FAILED_RTMP_SRC | Memory allocation failed. | PlayerState.STOPPED | -| nanoResults.N_LICENSE_INVALID | License check failed - License invalid. | PlayerState.STOPPED | -| nanoResults.N_LICENSE_INVALID_RTMP_SRC | License check failed - RTMP playback is not included. | PlayerState.STOPPED | -| nanoResults.N_LICENSE_EXPIRED | License check failed - The license period has ended. | PlayerState.STOPPED | -| nanoResults.N_TCP_CONNECT_FAILED | TCP connect failed. | PlayerState.STOPPED | -| nanoResults.N_RTMP_HANDSHAKE_FAILED | RTMP handshake failed. | PlayerState.STOPPED | -| nanoResults.N_RTMP_CONNECT_FAILED | RTMP connect failed. | PlayerState.STOPPED | -| nanoResults.N_RTMP_AUTH_FAILED | RTMP authentication is required and failed. | PlayerState.STOPPED | -| nanoResults.N_RTMP_APP_INVALID | The application part of the url is invalid and has been rejected. | PlayerState.STOPPED | -| nanoResults.N_RTMP_STATUS_PLAY_STREAM_NOT_FOUND | The stream name could not be found. | PlayerState.STOPPED | -| nanoResults.N_RTMP_STATUS_PLAY_STREAM_SEEK | The player is seeking. | PlayerState.SEEKING | -| nanoResults.N_RTMP_SEEK_NOT_AVAILABLE | The stream can not seek. | | -| nanoResults.N_RTMP_SEEK_FAILED | The stream can not seek. | | - -### Audio / Video Format -After the `NanostreamEvent.CODE_STREAM_AUDIO/VIDEO_FORMAT_AVAILABLE` event, you can get the MediaFormat Object with the `getAudio/VideoFormat()`[^(2)] function call. -We added two custom Fields for the Video MediaFormat: -    `NanostreamPlayer.KEY_ASPECT_RATIO_WIDTH` -    `NanostreamPlayer.KEY_ASPECT_RATIO_HEIGHT` -With these custom fields you can get the aspect ratio width and height. - -```java -MediaFormat videoFormat = mPlayer.getVideoFormat(); - -int aspectRatioWidth = videoFormat.getInteger(NanostreamPlayer.KEY_ASPECT_RATIO_WIDTH); -int aspectRatioHeight = videoFormat.getInteger(NanostreamPlayer.KEY_ASPECT_RATIO_HEIGHT); -``` - -### Implementation Example - -```java -public class PlayerActivity extends Activity implements PlayerEventListener, SurfaceHolder.Callback { - ... - private NanostreamPlayer mPlayer = null; - private String license = "YOUR LICENSE CODE"; - - private String strStreamUrl = "rtmp://192.168.1.100/vod"; - private String strStreamname = "mp4:file.mp4"; - - private LinearLayout root; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - root = new LinearLayout(this); - root.setOrientation(LinearLayout.VERTICAL); - root.setLayoutParams(containerParams); - root.setBackgroundColor(Color.BLACK); - - ... - - mPlayer = nanoStream.createNanostreamPlayer(); - - PlayerSettings settings = mPlayer.new PlayerSettings(); - - settings.setLicense(license); - settings.setUrl(strStreamUrl); - settings.setStreamname(strStreamname); - settings.setAuthUsername(""); - settings.setAuthPassword(""); - settings.setBufferTimeMs(2000); - - mPlayer.setSettings(settings); - mPlayer.setPlayerEventListener(this); - - ... - // we need a surface Callback for the application - LinearLayout.LayoutParams surfaceParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT, 0.5F); - surfaceParams.gravity = Gravity.CENTER; - surfaceParams.weight = 0.5f; - - SurfaceView surfaceView = new SurfaceView(this); - surfaceView.setLayoutParams(surfaceParams); - surfaceView.getHolder.addCallback(this); - - root.addView(surfaceView); - setContentView(root); - } - - ... - - @Override - public void onPlayerEvent(NanostreamEvent event, NanostreamPlayer instance) { - final String msg = event.GetDescription(); - Log.d(this.getClass().getName(), event.GetDescription()); - } - - @Override - public void surfaceCreated(SurfaceHolder holder) { - mPlayer.surfaceCreated(holder); - - try { - if (!mPlayer.getState().equals(PlayerState.STARTED)) { - mPlayer.start(); - } - } catch (IllegalStateException e) { - e.printStackTrace(); - } - } - - @Override - public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { - mPlayer.surfaceChanged(holder, format, width, height); - } - - @Override - public void surfaceDestroyed(SurfaceHolder holder) { - mPlayer.surfaceDestroyed(holder); - } -} -``` - - -## Logging / Debugging - -If you encounter an issue, our support team is able to help. -Please send us the log file as explained in the following steps: - -- Plug in the device and open Android Studio -- In Android Studios Android Monitor - 1. Clear the logcat output - 2. Set the Log Level to `Verbose` - 3. Set the filter to `No Filters` -- Run the critical section -- Mark the entire logcat output -- Right click in the logcat View and `Copy as Plain Text` -- Open an editor of your choice -- Paste the logcat output into the editor and Save the logcat output as .txt file - -## Further questions? Would you like a feature not available yet? -We can make it work for you based on our consulting and development / implementation services. [Contact us](http://www.nanocosmos.de/v4/en/contact-form.html) - -[53119650]: https://developer.android.com/reference/android/os/Environment.html "Android Enviroment" diff --git a/docs/nanostream/android/android_rtmp_playback.md b/docs/nanostream/android/nanostream_android_developer_manual_playback_new.md similarity index 62% rename from docs/nanostream/android/android_rtmp_playback.md rename to docs/nanostream/android/nanostream_android_developer_manual_playback_new.md index 82c7940c7..641741328 100644 --- a/docs/nanostream/android/android_rtmp_playback.md +++ b/docs/nanostream/android/nanostream_android_developer_manual_playback_new.md @@ -1,12 +1,14 @@ -## Introduction +--- +id: nanostream_android_developer_manual_playback_new +title: Playback +sidebar_label: Playback +--- +## RTMP Playback +### Description and Features +`RTMP` Playback Component enables application developers to add playback of RTMP live and on demand streams to their apps. -### Description - - -RTMP Playback Component enables application developers to add playback of RTMP live and on demand streams to their apps. - -Supported codecs are H.264 Video, AAC and MP3 Audio. +Supported codecs are `H.264` Video, `AAC` and `MP3` Audio. Video streams are decoded and rendered on a Surface that is hold by the application, usually connected to a `SurfaceView`. @@ -14,39 +16,28 @@ Audio streams are decoded and rendered to system audio using the Android AudioSe The interface and usage are similar to the Android MediaPlayer. The Android MediaPlayerControl interface is implemented to enable control through an `android.widget.MediaController` instance. -### Requirements - - -Related nanoStream SDK Version: 4.1 - -Minimum supported Android OS/API: 4.1/API 16 - -Required application permissions: -- `android.permission.INTERNET` -- `android.permission.RECORD_AUDIO` -- `android.permission.RECORD_VIDEO` -- `android.permission.MODIFY_AUDIO_SETTINGS` ### License - The playback component requires a special feature flag to be enabled in your nanoStream license key. It not necessarily included in nanoStream Android SDK licenses. -##Interface -### Package name +### Interface + +#### Package name `net.nanocosmos.nanoStream.streamer` -### Declaration -`public abstract class NanostreamPlayer implements MediaPlayercontrol, Surfaceholder.Callback` -### Function Life Cycle +#### Declaration -| __Instance Handling__ | __Init__ | __Capabilities__ | __Queries__ | __Playback__ | __Supported by RTMP Player__ | -|------------------------|------------------------|-----------------|--------------------|------------------|--------------------------| +`public abstract class NanostreamPlayer implements MediaPlayercontrol, Surfaceholder.Callback` +#### Function Life Cycle + +| Instance Handling | Initialization | Capabilities | Queries | Playback Control | Supported by RTMP Player | +| ---------------------- | ---------------------- | --------------- | ------------------ | ---------------- | ------------------------ | | createNanostreamPlayer | | | | | | | | setSettings | | | | yes | | | setPlayerEventListener | | | | yes | @@ -62,45 +53,39 @@ The playback component requires a special feature flag to be enabled in your nan | | | | | prepare | no | | | | | | prepareAsync | no | | | | | | start | yes | -| | | | | pause | yes [2](#fnAV2) | -| | | | | seekTo | yes [1](#fnAV1) | +| | | | | pause | yes | +| | | | | seekTo | yes | | | | | | stop | yes | | | | | | start | yes | | | | | | stop | yes | | | close | | | | no | | | release | | | | yes | -## Creating an Instance - - +### Creating an Instance `NanostreamPlayer` instances can be created through the static factory function `createNanostreamPlayer` at the top level `nanoStream class`. NanostreamPlayer is designed to support multiple player instances. The number of parallel instances can be limited by system resources such as codec,surfaces,memory, network connections and bandwidth. - -## Configuration and Settings - - +### Configuration and Settings Initial player settings are wrapped by the `NanostreamPlayer.PlayerSettings` class. The settings can be applied by calling `NanostreamPlayer.setSettings`. -PlayerSettings: ---------------- +### PlayerSettings: -| Setting | Functions | Description | Type | Default Values | -|---------------------|---------------------------------------------------------------------|------------------------------------------------------------------------------|-------------------|------------------------| -| License | getLicense/setLicense | nanoStream license key | String | empty | -| Url | getUrl/setUrl | RTMP url | String | empty | -| Stream Name | getStreamname/setStreamname | RTMP stream name | String | empty | -| User Name | getUsername/setUsername | User name if RTMP authentication is required | String | empty | -| Password | getPassword/setPassword Password if RTMP authentication is required | String | empty | | -| Buffer Time | getBufferTimeMs/setBufferTimeMs | Length of the stream buffer in milliseconds | Integer | 2000ms/2s | -| Frame Dropping Mode | getFrameDroppingMode/setFrameDroppingMode | Configuration of the dropping mode regarding different droppable frame types | FrameDroppingMode | DROP_NO_FRAMES | -| Stream Playback | getVideoPlayback/getAudioPlayback/setStreamPlayback | Enable stream types to be decoded and played | boolean | video:true, audio:true | -| TrackTimout | getTrackTimeout/setTrackTimeout | Timeout to waiting for Track info | long | 10000 | -| EndlessMode | getEndlessMode/setEndlessMode | Reopen the stream until stop call | boolean | false | +| Setting | Functions | Description | Type | Default Values | +| ------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ----------------- | ---------------------- | +| License | getLicense/setLicense | nanoStream license key | String | empty | +| Url | getUrl/setUrl | RTMP url | String | empty | +| Stream Name | getStreamname/setStreamname | RTMP stream name | String | empty | +| User Name | getUsername/setUsername | User name if RTMP authentication is required | String | empty | +| Password | getPassword/setPassword Password if RTMP authentication is required | String | empty | | +| Buffer Time | getBufferTimeMs/setBufferTimeMs | Length of the stream buffer in milliseconds | Integer | 2000ms/2s | +| Frame Dropping Mode | getFrameDroppingMode/setFrameDroppingMode | Configuration of the dropping mode regarding different droppable frame types | FrameDroppingMode | DROP_NO_FRAMES | +| Stream Playback | getVideoPlayback/getAudioPlayback/setStreamPlayback | Enable stream types to be decoded and played | boolean | video:true, audio:true | +| TrackTimout | getTrackTimeout/setTrackTimeout | Timeout to waiting for Track info | long | 10000 | +| EndlessMode | getEndlessMode/setEndlessMode | Reopen the stream until stop call | boolean | false | -## Player State -The player stat can be queried through the `getState()` function +### Player State +The player stat can be queried through the `getState()` function ```java /** * @@ -113,32 +98,34 @@ public enum PlayerState } ``` -| State | Description | Supported by RTMP Player | -|-------------------------------|------------------------------------------------------------------------|--------------------------| +| State | Description | Supported by RTMP Player | +| ----------------------------- | ------------------------------------------------------------ | ------------------------ | | PlayerState.IDLE | Initial state. Player has not yet been initialized or has been closed. | yes | -| PlayerState.INITIALIZED | Player has been initialized with license and settings. | yes | -| PlayerState.PREPARED | Player has been prepared and is ready to start. | no | -| PlayerState.STARTED | Playback has been started. | yes | -| PlayerState.PAUSED | Playback has been paused. | yes [2](#fnAV2) | -| PlayerState.SEEKING | Player is Seeking | yes [1](#fnAV1) | -| PlayerState.BUFFERING | Player is buffering stream data. | yes | -| PlayerState.RECONNECTING | Player is performing a reconnect | no | -| PlayerState.PLAYBACKCOMPLETED | Playback has ended due to end of stream. | yes | -| PlayerState.STOPPING | Player is stopping | yes | -| PlayerState.STOPPED | Player is stopped | yes | +| PlayerState.INITIALIZED | Player has been initialized with license and settings. | yes | +| PlayerState.PREPARED | Player has been prepared and is ready to start. | no | +| PlayerState.STARTED | Playback has been started. | yes | +| PlayerState.PAUSED | Playback has been paused. | yes | +| PlayerState.SEEKING | Player is Seeking | yes | +| PlayerState.BUFFERING | Player is buffering stream data. | yes | +| PlayerState.RECONNECTING | Player is performing a reconnect | no | +| PlayerState.PLAYBACKCOMPLETED | Playback has ended due to end of stream. | yes | +| PlayerState.STOPPING | Player is stopping | yes | +| PlayerState.STOPPED | Player is stopped | yes | + -## Event Notification +### Event Notification Event notifications can be received through the `NanostreamPlayer.PlayerEventListener` interface. Derive your listener from this interface and add it to the player by calling `setPlayerEventListener()`. -## Status Events +### Status Events + Event Type : `TYPE_RTMP_STATUS` | Event Code | Description | Corresponding State | -|----------------------------------------------------|--------------------------------------------------|-------------------------------| +| -------------------------------------------------- | ------------------------------------------------ | ----------------------------- | | NanostreamEvent.CODE_STREAM_STARTED | Playback has been started. | PlayerState.STARTED | | NanostreamEvent.CODE_STREAM_STOPPING | Playback will stop. | PlayerState.STOPPING | | NanostreamEvent.CODE_STREAM_STOPPED | Playback has been stopped. | PlayerState.STOPPED | @@ -146,42 +133,42 @@ Event Type : `TYPE_RTMP_STATUS` | NanostreamEvent.CODE_STREAM_BUFFERING | Player is buffering stream data | PlayerState.BUFFERING | | NanostreamEvent.CODE_STREAM_PLAYBACKCOMPLETED | Playback has ended due to end of stream. | PlayerState.PLAYBACKCOMPLETED | | NanostreamEvent.CODE_STREAM_NOT_FOUND | The specified stream could not be found. | PlayerState.STOPPED | -| NanostreamEvent.CODE_STREAM_SEEKING [1](#fnAV1) | The Stream is seeking. | PlayerState.SEEKING | -| NanostreamEvent.CODE_STREAM_PAUSED [2](#fnAV2) | The Stream is paused | PlayerState.PAUSED | -| NanostreamEvent.CODE_STREAM_VIDEO_FORMAT_AVAILABLE [1](#fnAV1) | The Stream has a MediaFormat for the Video Track | | -| NanostreamEvent.CODE_STREAM_AUDIO_FORMAT_AVAILABLE [1](#fnAV1) | The Stream has a MediaFormat for the Audio Track | | +| NanostreamEvent.CODE_STREAM_SEEKING | The Stream is seeking. | PlayerState.SEEKING | +| NanostreamEvent.CODE_STREAM_PAUSED | The Stream is paused | PlayerState.PAUSED | +| NanostreamEvent.CODE_STREAM_VIDEO_FORMAT_AVAILABLE | The Stream has a MediaFormat for the Video Track | | +| NanostreamEvent.CODE_STREAM_AUDIO_FORMAT_AVAILABLE | The Stream has a MediaFormat for the Audio Track | | -## Results and Error Events +### Results and Error Events + Event Type : `TYPENANORESULTS` Event Codes : Values of type nanoResults -| Event Code | Description | Corresponding State | -|-------------------------------------------------|-------------------------------------------------------------------|---------------------| -| nanoResults.N_NOT_INITIALIZED | The RTMP library has not been initialized properly. | PlayerState.STOPPED | -| nanoResults.N_ALLOCATEDATA_FAILED_RTMP_SRC | Memory allocation failed. | PlayerState.STOPPED | -| nanoResults.N_LICENSE_INVALID | License check failed - License invalid. | PlayerState.STOPPED | -| nanoResults.N_LICENSE_INVALID_RTMP_SRC | License check failed - RTMP playback is not included. | PlayerState.STOPPED | -| nanoResults.N_LICENSE_EXPIRED | License check failed - The license period has ended. | PlayerState.STOPPED | -| nanoResults.N_TCP_CONNECT_FAILED | TCP connect failed. | PlayerState.STOPPED | -| nanoResults.N_RTMP_HANDSHAKE_FAILED | RTMP handshake failed. | PlayerState.STOPPED | -| nanoResults.N_RTMP_CONNECT_FAILED | RTMP connect failed. | PlayerState.STOPPED | -| nanoResults.N_RTMP_AUTH_FAILED | RTMP authentication is required and failed. | PlayerState.STOPPED | +| Event Code | Description | Corresponding State | +| ----------------------------------------------- | ------------------------------------------------------------ | ------------------- | +| nanoResults.N_NOT_INITIALIZED | The RTMP library has not been initialized properly. | PlayerState.STOPPED | +| nanoResults.N_ALLOCATEDATA_FAILED_RTMP_SRC | Memory allocation failed. | PlayerState.STOPPED | +| nanoResults.N_LICENSE_INVALID | License check failed - License invalid. | PlayerState.STOPPED | +| nanoResults.N_LICENSE_INVALID_RTMP_SRC | License check failed - RTMP playback is not included. | PlayerState.STOPPED | +| nanoResults.N_LICENSE_EXPIRED | License check failed - The license period has ended. | PlayerState.STOPPED | +| nanoResults.N_TCP_CONNECT_FAILED | TCP connect failed. | PlayerState.STOPPED | +| nanoResults.N_RTMP_HANDSHAKE_FAILED | RTMP handshake failed. | PlayerState.STOPPED | +| nanoResults.N_RTMP_CONNECT_FAILED | RTMP connect failed. | PlayerState.STOPPED | +| nanoResults.N_RTMP_AUTH_FAILED | RTMP authentication is required and failed. | PlayerState.STOPPED | | nanoResults.N_RTMP_APP_INVALID | The application part of the url is invalid and has been rejected. | PlayerState.STOPPED | -| nanoResults.N_RTMP_STATUS_PLAY_STREAM_NOT_FOUND | The stream name could not be found. | PlayerState.STOPPED | -| nanoResults.N_RTMP_STATUS_PLAY_STREAM_SEEK [1](#fnAV1) | The player is seeking. | PlayerState.SEEKING | -| nanoResults.N_RTMP_SEEK_NOT_AVAILABLE [1](#fnAV1) | The stream can not seek. | | -| nanoResults.N_RTMP_SEEK_FAILED [1](#fnAV1) | The stream can not seek. | | - -## Audio / Video Format +| nanoResults.N_RTMP_STATUS_PLAY_STREAM_NOT_FOUND | The stream name could not be found. | PlayerState.STOPPED | +| nanoResults.N_RTMP_STATUS_PLAY_STREAM_SEEK | The player is seeking. | PlayerState.SEEKING | +| nanoResults.N_RTMP_SEEK_NOT_AVAILABLE | The stream can not seek. | | +| nanoResults.N_RTMP_SEEK_FAILED | The stream can not seek. | | -After the `NanostreamEvent.CODE_STREAM_AUDIO/VIDEO_FORMAT_AVAILABLE` event, you can get the MediaFormat Object with the `getAudio/VideoFormat()`[1](#fnAV1) function call. -We added two custom Fields for the Video MediaFormat: -- `NanostreamPlayer.KEY_ASPECT_RATIO_WIDTH` -- `NanostreamPlayer.KEY_ASPECT_RATIO_HEIGHT` +### Audio / Video Format +After the `NanostreamEvent.CODE_STREAM_AUDIO/VIDEO_FORMAT_AVAILABLE` event, you can get the MediaFormat Object with the `getAudio/VideoFormat()`[^(2)] function call. +We added two custom Fields for the Video MediaFormat: +    `NanostreamPlayer.KEY_ASPECT_RATIO_WIDTH` +    `NanostreamPlayer.KEY_ASPECT_RATIO_HEIGHT` With these custom fields you can get the aspect ratio width and height. ```java @@ -191,9 +178,10 @@ int aspectRatioWidth = videoFormat.getInteger(NanostreamPlayer.KEY_ASPECT_RATIO_ int aspectRatioHeight = videoFormat.getInteger(NanostreamPlayer.KEY_ASPECT_RATIO_HEIGHT); ``` -## Implementation Example +### Implementation Example + ```java public class PlayerActivity extends Activity implements PlayerEventListener, SurfaceHolder.Callback { ... @@ -274,7 +262,4 @@ public class PlayerActivity extends Activity implements PlayerEventListener, Sur mPlayer.surfaceDestroyed(holder); } } -``` - -1: since nanoStream Android SDK 3.2 -2: since nanoStream Android SDK 3.3 +``` \ No newline at end of file diff --git a/docs/nanostream/android/nanostream_android_developer_manual_sample_new.md b/docs/nanostream/android/nanostream_android_developer_manual_sample_new.md new file mode 100644 index 000000000..78b514054 --- /dev/null +++ b/docs/nanostream/android/nanostream_android_developer_manual_sample_new.md @@ -0,0 +1,158 @@ +--- +id: nanostream_android_developer_manual_sample_new +title: Sample +sidebar_label: Sample +--- + +## Quickstart + +The **nanoStream SDK** contains libraries for developing streaming apps for Android devices or for incorporating streaming capabilities in your existing Android applications. + +Three samples are included to show the basic usage of the nanoStream SDK (Android-BasicStreamer, Android-StreamerSample and Android-Player).  You will need to download and install the latest version of Android Studio. Visit the [Download Page](http://www.nanocosmos.de/v4/order/demo.php) of Nanocosmos to download a trial version of the nanoStream SDK (version 4.3.0 supports  Android API-Level from 16 up to 23). Contact Nanocosmos for obtaining a licence longer than the trial period. + + + +*Android-BasicStreamer*: this sample contains a single java file that starts and stops a stream. How-to start running the sample. + +*Android-StreamerSample*: this sample contains a single java file that starts and stops a stream and includes options for adjusting the quality of the stream. + +*Android-Player*: this sample contains a single java file that starts and stops playing a stream from a remote source. + + + +## Player Sample + +### Description + +This sample shows the basic usage of the nanoStream Android SDK for player apps. + +### Usage + +**Step 1: Unzip the sample project to the desired project path** + + + +**Step 2: Copy the SDK libraries into the Android Studio project** + +Before runnig the sample, six libraries have to copied from the SDK library folder: +Add the ``net.nanocosmos.nanoStream.jar`` java component to the Android Studio project by copying ``[SDK]/libs/net.nanocosmos.nanoStream.jar`` to the folder `[projectpath]/app/libs/net.nanocosmos.nanoStream.jar` + +Add the nanoStream.so native components to the Android Studio project by copying the 5 folders `[SDK]/libs/[platform]/libRTMPStream.so` to +`[projectpath]/app/src/main/jniLibs/[platform]/libRTMPStream.so` + +Platforms are `armeabi`, `armeabi-v7a`, `arm64-v8a`, `x86`, `mips` + + + +**Step 3: Open the PlayerActivity.java in the Android Studio Code Editor** +The PlayerActivity contains the main application code. The location is: +`[projectpath]/app/src/main/java/net/nanocosmos/nanoStream/demo/player` + +Your window should look like this: + +![Git-Android-Player](img/android_sample_player_studio.png) + + + +**Step 4: Enter your license in the PlayerActivity** + +Just replace the placeholder with your license key. +```java +// TODO: REPLACE WITH YOUR LICENSE +private String license = "--- ADD YOUR LICENSE HERE ---"; +``` + + + +**Step 5: Enter your stream configuration in the MainActivity** + +Replace the server url and the stream name with yours. +The server url usually has this pattern : `[Protocol]://[Adresse]/[Application]`. +With the stream name your streaming server identifies each stream. + +```java +// TODO: REPLACE THE RTMP URL AND STREAM NAME +private static final String strStreamUrl = "--- INSERT THE STREAMING SERVER URL ---"; +private static final String strStreamname = "--- INSERT THE STREAM NAME OR FILE NAME ---"; +``` + + + +**Step 6: Connect an Android device, build and run the application** + + + +### About + +**Version** : nanoStream SDK 4.3.0 + +**Compatible with** : Android API-Level from 16 up to 23 + + + +## Streamer Sample + +### Description + +This sample shows the basic usage of the nanoStream Android SDK for streaming apps. + +### Usage + +**Step 1: Unzip the sample project to the desired project path** + + + +**Step 2: Copy the SDK libraries into the Android Studio project** + +Before runnig the sample, six libraries have to copied from the SDK library folder: +Add the ``net.nanocosmos.nanoStream.jar`` java component to the Android Studio project by copying ``[SDK]/libs/net.nanocosmos.nanoStream.jar`` to the folder``[projectpath]/app/libs/net.nanocosmos.nanoStream.jar`` + +Add the nanoStream.so native components to the Android Studio project by copying the 5 folders ``[SDK]/libs/[platform]/libRTMPStream.so`` to +``[projectpath]/app/src/main/jniLibs/[platform]/libRTMPStream.so`` + +Platforms are armeabi, armeabi-v7a, arm64-v8a, x86, mips + + + +**Step 3: Open the MainActivity.java in the Android Studio Code Editor** +The MainActivity contains the main application code. The location is: +[projectpath]/app/src/main/java/net/nanocosmos/nanoStream/demo/basicstreamer + +Your window should look like this: + +![Git-Android-Streamer](img/android_sample_streamer_studio.png) + + + +**Step 4: Enter your license in the MainActivity** + +Just replace the placeholder with your license key. +```java +// TODO: REPLACE WITH YOUR LICENSE +private String license = "--- ADD YOUR LICENSE HERE ---"; +``` + + + +**Step 5: Enter your stream configuration in the MainActivity** + +Replace the server url and the stream name with yours. +The server url usually has this pattern : `[Protocol]://[Adresse]/[Application]`. +With the stream name your streaming server identifies each stream. +```java +// TODO: REPLACE THE RTMP URL AND STREAM NAME +private static final String strStreamUrl = "--- INSERT THE STREAMING SERVER URL ---"; +private static final String strStreamname = "--- INSERT THE STREAM NAME OR FILE NAME ---"; +``` + + + +**Step 6: Connect an Android device, build and run the application** + + + +### About + +**Version** : nanoStream SDK 4.3.0 + +**Compatible with** : Android API-Level from 16 up to 23 \ No newline at end of file diff --git a/docs/nanostream/android/nanostream_android_developer_manual_streaming_new.md b/docs/nanostream/android/nanostream_android_developer_manual_streaming_new.md new file mode 100644 index 000000000..acbb9b678 --- /dev/null +++ b/docs/nanostream/android/nanostream_android_developer_manual_streaming_new.md @@ -0,0 +1,686 @@ +--- +id: nanostream_android_developer_manual_streaming_new +title: Streaming Media +sidebar_label: Streaming Media +--- +## Resolution, Aspect Ratio and Orientation + +### Resolution +Resolution means the native resolution of the camera (input). In the most situations this will be the same for the output. +To set the resolution there is a function in the `VideoSettings` object called `setResolution(Resolution res)`. If you set a resolution that the +device doesn't support, nanoStream will automatically switch to the nearest resolution available on the device. A list of supported resolutions for the current video source can be obtained from `getCapabilities().listAvailableVideoResolutions()` +on the `nanoStream` object. + + + +### Aspect Ratio + +Aspect ratio means the aspect ratio of the outgoing stream. The aspect ratio determines if the input video needs to be cropped. +The aspect ratio can be set through the `setAspectRatio(AspectRatio aspectRatio)` function on the `VideoSettings` object. + + + +#### Supported Aspect Ratios + +| Aspect Ratio | AspectRatio value | +| ---------------- | ------------------------------ | +| **`Keep Input`** | `AspectRatio.RATIO_KEEP_INPUT` | +| **`1:1`** | `AspectRatio.RATIO_1_1` | +| **`4:3`** | `AspectRatio.RATIO_4_3` | +| **`16:9`** | `AspectRatio.RATIO_16_9` | +| **`3:4`** | `AspectRatio.RATIO_3_4` | +| **`9:16`** | `AspectRatio.RATIO_9_16` | + + + +### Orientation +The default stream orientation is landscape. If you switch to portrait the resolution will swap width and height, e.g. from `640x480` to `480x640`. +You can set the stream orientation on the `nanoStream` object with the `setStreamRotation` function. The stream orientation needs to be set +before starting the stream, it is not possible to switch the orientation during the stream. + + + +#### Supported Orientations + +| Orientation | Rotation Value | +| --------------------------- | ----------------------- | +| **`Landscape`** | `Rotation.ROTATION_0` | +| **`Portrait`** | `Rotation.ROTATION_90` | +| **`Landscape Upside Down`** | `Rotation.ROTATION_180` | +| **`Portrait Upside Down`** | `Rotation.ROTATION_270` | + + + +### Example Combinations of Aspect Ratios and Orientations + +The input resolution is set to `640x480` here. +The red rectangle marks up the active area that is included in the output stream. + +| Orientation | Aspect Ratio | Stream Area | +| ------------------------------ | ------------ | ------------------------------------------- | +| Portrait[1](#fnAS1) | Keep Input | ![Screenshot](img/portrait_keep_input.png) | +| Portrait[1](#fnAS1) | 4:3 | ![Screenshot](img/portrait_4_3.png) | +| Portrait[1](#fnAS1) | 3:4 | ![Screenshot](img/portrait_3_4.png) | +| Portrait[1](#fnAS1) | 16:9 | ![Screenshot](img/portrait_16_9.png) | +| Portrait[1](#fnAS1) | 9:16 | ![Screenshot](img/portrait_9_16.png) | +| Landscape | Keep Input | ![Screenshot](img/landscape_keep_input.png) | +| Landscape | 4:3 | ![Screenshot](img/landscape_4_3.png) | +| Landscape | 3:4 | ![Screenshot](img/landscape_3_4.png) | +| Landscape | 16:9 | ![Screenshot](img/landscape_16_9.png) | +| Landscape | 9:16 | ![Screenshot](img/landscape_9_16.png) | + +1: In this sample APP we crop the preview so it doesn't look ugly, so the stream is actually larger then the preview. + + + +### Example + +If you want to stream with a resolution of `640x360` but your device doesn't supports this resolution, you need to crop the resolution from `640x480` (this resolution is supported by the most devices) to `640x360`. +This can be done through the aspect ratio, so you need to set the aspect ratio to `16:9` to stream with a resolution of `640x360`. + + + +### Implementation Example + + +```java +public class MainActivity { + ... + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + nanoStreamSettings nss = new nanoStreamSettings(); + VideoSettings vs = new VideoSettings(); + ... + vs.setResolution(new Resolution(640, 480)); // default value + vs.setAspectRatio(AspectRatio.RATIO_16_9); // default value is AspectRatio.KEEP_INPUT + ... + streamLib = new nanoStream(nss); + streaLib.init(); + + streamLib.setStreamRotation(Rotation.ROTATION_0); // default value + ... + } + ... +} +``` + + + +## Stream Type + +The SDK supports differnet streaming modes: + +- Video and Audio +- Video only +- Audio only + +You can en/disable Video/Audio in the `nanoStreamSettings.object` + + + +### Implementation Example + +```java +nanoStreamSettings nss = new nanoStreamSettings(); +nss.setHaveVideo(true); // false +nss.setHaveAudio(true); // false +``` + + + +## Server Authentication + + +In case authentication is required, the credentials can be set on the `nanoStreamSettings` object. + +### Implementation Example + +```java +nanoStreamSettings nss = new nanoStreamSettings(); +nss.setAuthUser("user"); +nss.setAuthPassword("password"); +``` + + + +## Local Recording + +### Description + +The nanoStream Android SDK supports local file recording on the device in MP4 format. This document describes how to enable and configure nanoStream for local recording. + + + +### Steps to configure MP4 recording + +MP4 recording can be configured with two function calls on a nanoStreamSettings object. + +- Enabling MP4 recording: `setRecordMp4(boolean)` +- Setting up the file path: `setMp4Path(String)` + + + +### setRecordMp4(boolean) + +The `setRecordMp4` function takes a boolean as parameter to enable/disable the recording function. + + + +### setMp4Path(String) + +The `setMp4Path` function takes a String as parameter. This string needs to be a valid file path (e.g. `/sdcard/test.mp4`). It is recommended to use the `getExternalStorageDirectory` or `getExternalStoragePublicDirectory` functions from the [Android Enviroment][8928e181] API, and add a file name to the returned path. Please find the code snippet below as an example. + + + +### Android Permission + +To be able to write to an external file path your Android app needs the following permissions to be added to the app manifest (`AndroidMainfest.xml`). + +```xml + + +``` + +#### Android 6.0 + +Due to the new permission handling in Android 6 (M) writing to external directories (DCIM) requires a permission by user. Writing to the applications own data directory (/Android/data/com.companyname.appname/) is not restricted. + + + +### Implementation Example + +```java +File externalFilePath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM); +File filePath = new File(externalFilePath, "myMp4File.mp4"); +String mp4FilePath = filePath.getAbsolutePath(); + +nanoStreamSettings nss = new nanoStreamSettings(); +nss.setRecordMp4(true); +nss.setMp4Path(mp4FilePath); +``` + + + +## Adaptive Bitrate Streaming + +By using the Adaptive Bitrate Control (ABC) the stream will automatically adjust to changes of the bandwidth. There are four modes available: + +- `DISABLED`: The Adaptive Bitrate Control is disabled. +- `QUALITY_DEGRADE`: The video quality will be changed if the bandwidth changes. For instance, if not enough bandwidth is available, the video bitrate will be decreased, which in turn degrades the video quality. +- `FRAME_DROP`: Low bandwidth is compensated by decreasing the framerate (FPS), but maintaining the video qualtiy. +- `QUALITY_DEGRADE_AND_FRAME_DROP`: The video quality and the framerate (FPS) decreased if the not enough bandwidth is available. + +Make sure to set the ABC settings before a stream is started. + + + +### Implementation Example + +```java +private AdaptiveBitrateControlSettings.AdaptiveBitrateControlMode abcMode = AdaptiveBitrateControlSettings.AdaptiveBitrateControlMode.QUALITY_DEGRADE_AND_FRAME_DROP; +private int videoBitrate = 500000; + +private void initStreamLib() { + AdaptiveBitrateControlSettings abcSettings = new AdaptiveBitrateControlSettings(abcMode); + abcSettings.SetMaximumBitrate((int)(videoBitrate * 1.5)); + + nanoStreamSettings nss = new nanoStreamSettings(); + nss.setAbcSettings(abcSettings); +} +``` + + + +### Measuring the available bandwidth + + +For measuring the available bandwidth you can use the method `runBandwidthCheck`. After the check finished, the result can be used to set the bitrate for the nanoStream object. +The check measures the bandwidth by running a test stream to the server. +The BandwidthCheck Class has three public functions: + +* `runBandwidthCheck(BandwidthCheckSettings settings, BandwidthCheckResultCallback callback())` +* `forceStop()` +* `abort()` + +There is a BandwidthCheckSettings Class, the constructor creates a standard object of BandwidthCheckSettings, with the following settings: + +| property | default values | meaning | +| :--------------- | :------------------------- | :------------------------------------------------- | +| `prerollSeconds` | 1 (in sec.) | this is the pre roll time to connect to the server | +| `runTime` | 5 (in sec.) | the run time of the bandwidth check | +| `maxBitrate` | 3000000 (bit/s = 3 MBit/s) | the maximum bit rate for the bandwidth check | +| `rtmpUrl` | empty | the rtmp url for the bandwidth check | +| `streamId` | empty | the stream id for the bandwidth check | + +With this settings you can call the runBandwidthCheck methode, the second parameter is the callback for the results. This callback class has a finished method that will be called after bandwidth check is done. +The finished method has one parameter from type BandwidthCheckResult, this object has 6 getter methods: + + - `getAverageBitrate()` // the average measured bandwidth + - `getMedianBitrate()` // the median measured bandwidth + - `getMaxBitrate()` // the maximum measured bandwidth + - `getMinBitrate()` // the minimum measured bandwidth + - `getRunTimeMS()` // the run time in ms + - `getErrorCode()` // the error code if all is ok this is nanoResults.N_OK (all error codes can be found in the nanoStream API Reference documentation for nanoResults) + +The forceStop call stops the bandwidth check and will return the results that where measured until then. The abort call stops the bandwidth check but don't return any results. + +The bandwidth check, sends a special type of metadata that will not be recorded on the Streaming Server. + + + +#### Implementation Example + +```java +private BandwidthCheck bwCheck = null; + +private class CustomBandwidthCheckResultCallback implements BandwidthCheckResultCallback { + @Override + public void finished(final BandwidthCheckResult bandwidthCheckResult) { + Log.d(TAG, "BandwidthCheck results: " + + "\n\tAverage Bitrate (kBit/s): " + bandwidthCheckResult.getAverageBitrate() / 1000 + + "\n\tMedian Bitrate (kBit/s): " + bandwidthCheckResult.getMedianBitrate() / 1000 + + "\n\tMax Bitrate (kBit/s): " + bandwidthCheckResult.getMaxBitrate() / 1000 + + "\n\tMin Bitrate (kBit/s): " + bandwidthCheckResult.getMinBitrate() / 1000 + + "\n\tRun Time (ms) : " + bandwidthCheckResult.getRunTimeMS()); + } +} + +private void initBandwidthCheck() { + if(null == bwCheck) { + BandwidthCheckSettings settings = new BandwidthCheckSettings(); + settings.setRtmpUrl(serverUrl); + settings.setStreamId(streamName); + bwCheck = new BandwidthCheck(); + bwCheck.runBandwidthCheck(settings, new CustomBandwidthCheckResultCallback()); + } +} +``` + + +##Snapshot + +To get a snapshot (image) of the current preview/stream, the method `takeSnapshot` can be used. This is a non blocking function, for the result you need to implement the `SnapshotCallback` interface. The snapshot returns as a `base64` encoded `JPEG` + +### Implementation Example + +```java +private class CustomSnapshotCallback implements SnapshotCallback { + @Override + void onSuccess(String arg0){ + // do something with the base64 encoded JPEG. + } + + @Override + void onFailure(){ + Log.d(TAG, "takeSnapshot() failed!") + } +} +private void shapshot() { + streamLib.takeSnapshot(new CustomSnapshotCallback()); +} +``` + + + +## Camera Zoom + +### Description + +The nanoStream Android SDK supports camera zoom, if the internal camera supports it. Therefor there are a few functions, the most important are: + +| Function | Return Type | returns | +| :---------------- | :-------------- | :----------------------------------------------------------- | +| `hasZoom()` | `boolean` | true if zoom is supported by the video source/ device | +| `getZoomRatios()` | `List` | list with of ale zoom ratios | +| `getZoom()` | `int` | the index of the `List` that returned from `getZoomRatios()` | +| `setZoom(int)` | `int` | the new index of the `List` that returned from `getZoomRatios()` | + +It is recommended to use pinch to zoom, therefor you need to implement a `ScaleGestureDetector.SimpleOnScaleGestureListener`, and a `pinch2zoom` function, that takes the `scalefactor` from the `SimpleOnScaleGestureListener` as a int parameter, take a look at the [Implementation Example][ef1c8421]. + + + +#### getZoomRatios() + +`getZoomRatios()` returns a List of Integer values, this values are the zoom ratios in `1/100` increments (e.g. a zoom of `3.2x` is returned as `320`). + + + +#### setZoom(int) + +The int parameter from `setZoom(int zoom)` is the index of zoom ratios that returns `getZoomRatios()`. + + + +#### Zoom Behavior on Camera Switch + +During a camera switch (e.g. from back to front) the zoom remains unaffected. + + + +#### Implementation Example + +```java +public class MainActivity extends Activity { + private ScaleGestureDetector scaleGestureDetector; + private List mZoomRatios = null; + + private nanoStream streamLib = null; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + nanoStreamSettings nss = new nanoStreamSettings(); + // configure nanoStreamSettings + + streamLib = new nanoStream(nss); + + if(streamLib.hasZoom()) { + mZoomRatios = streamLib.getZoomRatio(); + } + + if(null == scaleGestureDetector) { + scaleGestureDetector = new ScaleGestureDetector(this, new ScaleGestureListener()); + } + } + + @Override + public boolean onTouchEvent(MotionEvent event) + { + if (scaleGestureDetector != null) + { + scaleGestureDetector.onTouchEvent(event); + } + return true; + } + + private class ScaleGestureListener extends ScaleGestureDetector.SimpleOnScaleGestureListener { + @Override + public boolean onScale(ScaleGestureDetector detector) { + if(null != streamLib) { + if (streamLib.hasZoom()) { + pinch2Zoom(detector.getScaleFactor()); + } + } + return true; + } + } + + public void pinch2Zoom(float scaleFactor) { + if (streamLib.hasZoom() && null != mZoomRatios) { + int zoomFactor = streamLib.getZoom(); + float zoomRatio = mZoomRatios.get(zoomFactor) / 100f; + zoomRatio *= scaleFactor; + if (zoomRatio > 1.0f) { + if (scaleFactor > 1.0f) { + for (int i = zoomFactor; i < mZoomRatios.size(); i++) { + Double zoom = mZoomRatios.get(i) / 100.0; + if (zoom >= zoomRatio) { + streamLib.setZoom(i); + break; + } + } + } else { + for (int i = zoomFactor; i > 0; i--) { + Double zoom = mZoomRatios.get(i) / 100.0; + if (zoom <= zoomRatio) { + streamLib.setZoom(i); + break; + } + } + } + } + } + } +} +``` + + + +## Camera Focus + +### Description + +The nanoStream Android SDK supports camera focus and focus lock, if the internal cameras supports them. There are two non-blocking functions +```java +setFocusArea(int focusWidth, int focusHeight, float areaMultiple, int x, int y, int previewWidth, int previewHeight, int weigh) +setFocusLockArea(int focusWidth, int focusHeight, float areaMultiple, int x, int y, int previewWidth, int previewHeight, int weigh) +``` +through the +```java +addFocusCalback(FocusCallback callback) +removeFocusCalback(FocusCallback callback) +``` +you can attach or remove a `FocusCallback` listener. +To check if your device supports focus call the function + +```java +isFocusSupported() +``` +which will return `true` or `false`. + + + +### Parameter List + +| **Parameter name** | **meaning** | +| ------------------ | --------------------------------------------------- | +| `focusWidth` | the focus Area width | +| `focusHeight` | the focus Area height | +| `areaMultiple` | a Multiple for the focus area (default: 1f) | +| `x` | the x position on the Screen | +| `y` | the y position on the Screen | +| `previewWidth` | the width of the preview | +| `previewHeight` | the height of the preview | +| `weight` | the weight of the area must be range from 1 to 1000 | + + + +### FocusCallback interface + +The `FocusCallback` interface has three abstract functions +```java +onSuccess() +onSuccess(Rect rect, Boolean focusLock) +onFailure() +``` + + + +### Implementation Example + +```java +public class MainActifity extens Actifity implements FocusCallback { + private GestureDetector gestureDetector; + private nanoStream streamLib = null; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + streamLib = new nanoStream(new nanoStreamSettings()); + if(streamLib.isFocusSupported()) { + gestureDetector = new GestureDetector(this, new GestureListener()); + } + ... + } + + @Override + public boolean onTouchEvent(MotionEvent event) + { + if (gestureDetector != null) + { + gestureDetector.onTouchEvent(event); + } + return true; + } + .... + private class GestureListener implements OnGestureListener { + + @Override + public boolean onSingleTapUp(MotionEvent e) + { + if (streamLib != null) + { + streamLib.setFocusArea(300, 300, 1f, (int) e.getX(), (int) e.getY(), surface.getWidth(), surface.getHeight(), 1000); + } + return true; + } + + @Override + public void onLongPress(MotionEvent e) + { + if (streamLib != null) + { + streamLib.setFocusLockArea(300, 300, 1f, (int) e.getX(), (int) e.getY(), surface.getWidth(), surface.getHeight(), 1000); + } + } + } + + @Override + public void onSuccess(Rect rect, Boolean aBoolean) { + Log.i(TAG, "focus success"); + } + + @Override + public void onFailure() { + Log.i(TAG, "focus failed"); + } +} +``` + + + +## DeviceProperties + +Before Android 4.3 there was no obligation for Android hardware manufacturers to pass the video related parts of the CTS (Compatibility Test Suite). +Therefore some Android 4.1 and 4.2 Devices show non standard behaviour in regard to color format definitions and representation of video frames in memory. This could lead to issues in the video stream like switched red and blue colors, dislocated color components or a green bar at the bottom of the video frame. nanoStream Android now provides the functionality to detect and compensate common issues related to this. + + + +### Description + +`nanoStream.getDeviceProperties()` is a static function that is running a test on the device hardware to detect non standard behaviour and returning a DeviceProperties object containing the result. +`DeviceProperties.getFlags()` returns the test result as an integer value that can be stored in the application preferences, to avoid running the device test on every app start. +DeviceProperties can be applied to a new nanoStream instance by calling `nanoStream.setDeviceProperties(DeviceProperties)`. +We recommend to call `getDeviceProperties()` in a background thread during the first app start on a pre 4.3 device, because the call is blocking and might last up to 5 seconds on older/weaker devices. +We also recommend to store the OS version in the preferences, to be able to detect OS updates and to eventually rerun the device test or stop setting the DeviceProperties if the new OS is 4.3 or higher. + + + +### Implementation Example + +```java +public class App extends Application +{ + private static DeviceProperties deviceProp = null; + + public void onCreate() + { + super.onCreate(); + + Thread chkThread = new Thread(new Runnable() + { + @Override + public void run() + { + try + { + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + int curApiVer = android.os.Build.VERSION.SDK_INT; + int curAppVer = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode; + int curEncVer = DeviceProperties.VERSION; + + int oldApiVer = prefs.getInt("Pref_Android_API", 0); + int oldAppVer = prefs.getInt("Pref_App_Version", 0); + int oldChkVer = prefs.getInt("Pref_Check_Version", 0); + int oldChkResult = prefs.getInt("Pref_Check_Result", -1); + + if (((oldApiVer * oldAppVer * oldApiVer) == 0) + || (oldApiVer < curApiVer) + || (oldAppVer < curAppVer) + || (oldChkVer < curEncVer) + || oldChkResult < 0) + { + + Editor edit = prefs.edit(); + edit.putInt("Pref_Android_API", curApiVer); + edit.putInt("Pref_App_Version", curAppVer); + + /* Run device check */ + try + { + deviceProp = nanoStream.getDeviceProperties(); + + edit.putInt("Pref_Check_Result", deviceProp.getFlags()); + edit.putInt("Pref_Check_Version", deviceProp.getVersion()); + edit.commit(); + } + catch (RuntimeException e) + { + Log.d("Device Check failed", e.toString()); + edit.putInt("Pref_Check_Result", -1); + edit.putInt("Pref_Check_Version", 0); + edit.commit(); + } + + } + else + { + deviceProp = new DeviceProperties(oldChkResult); + } + + Log.d("Device Properties: ", deviceProp.toString()); + } + catch (Exception e) + { + Log.d(this.getClass().getName(), "Device Check Runnable"); + e.printStackTrace(); + } + } + }); + + if (android.os.Build.VERSION.SDK_INT < 18) + { + chkThread.start(); + } + + ... + } + + public static DeviceProperties getDeviceProperties() + { + return deviceProp; + } +} +``` + +```java +public class MainActivity extends Activity implements NanostreamEventListener +{ + ... + @Override + protected void onCreate(Bundle savedInstanceState) + { + try + { + nanoStreamSettings nss = new nanoStreamSettings(); + + streamLib = new nanoStream(nss); + + DeviceProperties deviceProperties = App.getDeviceProperties(); + + if(null != streamLib && null != deviceProperties) + { + streamLib.setDeviceProperties(deviceProperties); + } + } + catch(NanostreamException en) + { + Toast.makeText(getApplicationContext(), en.toString(), Toast.LENGTH_LONG).show(); + } + } + ... +} +} +``` \ No newline at end of file diff --git a/docs/nanostream/android/android_getting_started.md b/docs/nanostream/android/nanostream_android_getting_started.md similarity index 78% rename from docs/nanostream/android/android_getting_started.md rename to docs/nanostream/android/nanostream_android_getting_started.md index 4d9e29ecb..71d50e411 100644 --- a/docs/nanostream/android/android_getting_started.md +++ b/docs/nanostream/android/nanostream_android_getting_started.md @@ -1,45 +1,55 @@ -## Introduction +--- +id: nanostream_android_getting_started +title: Getting started +sidebar_label: Getting started +--- +## Purpose -### Purpose +This documentation is about the nanoStream Live Video Streaming SDK for Android and can be used by software developers to integrate nanoStream Live Video Encoding into custom apps. -This documentation is about the nanoStream Live Video Streaming SDK for Android and can be used by software developers to integrate nanoStream Live Video Encoding into custom apps. -### Requirements +## Requirements - Android 4.1+ (API Level 16) -#### Required permissions: + + +### Required permissions: The nanoStream SDK for android does not request any permissions by itself. However, it needs a few permissions to work. The needed permissions are : -* android.permission.INTERNET - This is needed since the stream should be sent over a network. -* android.permission.RECORD_AUDIO - In case your stream is not video-only the app needs this permission to record audio data using the microphone. -* android.permission.RECORD_VIDEO - In case your stream is not audio-only the app needs this permission to record image data using the camera. -* android.permission.WRITE_EXTERNAL_STORAGE - In case the encoded stream should be written on the phone's memory. +* `android.permission.INTERNET` - This is needed since the stream should be sent over a network. +* `android.permission.RECORD_AUDIO` - In case your stream is not video-only the app needs this permission to record audio data using the microphone. +* `android.permission.RECORD_VIDEO` - In case your stream is not audio-only the app needs this permission to record image data using the camera. +* `android.permission.WRITE_EXTERNAL_STORAGE` - In case the encoded stream should be written on the phone's memory. How these permissions should be requested depends on the used version of android. -On devices with android versions prior to Android 6.0 the permissions are getting requested once per app installation. They just need to be configured within the AndroidManifest.xml file, so that the user can give the permission while installing the app. +On devices with android versions prior to Android 6.0 the permissions are getting requested once per app installation. They just need to be configured within the `AndroidManifest.xml` file, so that the user can give the permission while installing the app. -On devices with android versions from 6.0 upwards the permissions should be requested at run time when needed. It can be checked whether a permission is already granted or not. Afterwards, the needed permissions can be requested. This will create a pop-up, which asks the user to grant the needed permissions. If you are working with our BinutStreamer-Sample, an example of this can be found in the CheckAppPermission-Class. +On devices with android versions from 6.0 upwards the permissions should be requested at run time when needed. It can be checked whether a permission is already granted or not. Afterwards, the needed permissions can be requested. This will create a pop-up, which asks the user to grant the needed permissions. If you are working with our BinutStreamer-Sample, an example of this can be found in the `CheckAppPermission-Class`. -### Getting Started -#### Copy the SDK libraries into your Android Studio project +## Getting Started + + +### Copy the SDK libraries into your Android Studio project Add the `net.nanocosmos.nanoStream.jar` java component to your Android Studio project by copying `[SDK]/libs/net.nanocosmos.nanoStream.jar` to the folder `[projectpath]/app/libs/net.nanocosmos.nanoStream.jar` Add the `nanoStream.so` native components to the Android Studio project by copying the 5 folders `[SDK]/libs/[platform]/libRTMPStream.so` to [projectpath]/app/src/main/jniLibs/[platform]/libRTMPStream.so\` Platforms are armeabi, armeabi-v7a, arm64-v8a, x86, mips -#### Add the nanoStream to the gradle file -Open the build.gradle file (Module:app) and add + +### Add the nanoStream to the gradle file + +Open the `build.gradle` file (Module:app) and add ``` compile files('libs/net.nanocosmos.nanoStream.jar') @@ -47,15 +57,19 @@ compile files('libs/net.nanocosmos.nanoStream.jar') to the dependencies section. -#### Check library version + + +### Check library version ```java String nanoStreamVersion = nanoStream.getVersion().fullVersion; ``` -#### Initialize the library -Implement the interface "nanoStreamEventListener" in your class: + +### Initialize the library + +Implement the interface `nanoStreamEventListener` in your class: ```java public class StreamActivity extends Activity implements NanostreamEventListener { @@ -83,7 +97,7 @@ public class StreamActivity extends Activity implements NanostreamEventListener } ``` -Configure the nanoStreamSettings object for the library: +Configure the `nanoStreamSettings object` for the library: ```java private String license = "--- add your nanoStream license here ---"; @@ -152,6 +166,4 @@ public void toggleStreaming(View clicked) { streamLib.stop(); } } -``` - -[//]: # (Link list) +``` \ No newline at end of file diff --git a/docs/nanostream/directshow/directshow_avc_h264.md b/docs/nanostream/directshow/directshow_avc_h264.md deleted file mode 100644 index b8e2c0532..000000000 --- a/docs/nanostream/directshow/directshow_avc_h264.md +++ /dev/null @@ -1,72 +0,0 @@ -## AVC/H.264 Video Codec / SDK - -### High Quality and High Performance Video Coding - -nanocosmos AVC/H.264 video codec is a high performance video codec for the latest generation `MPEG-AVC / H.264` video coding standards. It may be licensed by Professional and OEM customers for integration into custom applications. - -#### Major Features - - * Most advanced video coding standard `H.264 (MPEG-AVC)` - * Highly optimized software coding with support for latest CPU generations (Multicore / Core i7) - * Wide range of applications from Mobile Phones (3GP), Portable Devices (iPod etc.) up to HDTV - * Full HD `1080i` and `1080p `support - * X-HD support for Custom Applications (Dome Cinema, Projections), up to `2k/4k` (4096 x 4096) - * Support for realtime Full HD 1080 encoding and decoding of `dual channel video` (stereo video / 3d) - * Baseline Profile, Main Profile and HDTV modes supported - * Compatible to `ISO Mp4` and `Flash Media Streaming Server` and `Wowza` - - -#### Architecture and Availability - -The Codec is available for Windows platforms based on DirectShow filters. For MacOS and Linux, custom based solutions are available. - - - -#### Components - - * AVC/H.264 Video Encoder and Decoder, MP4 splitter and multiplexer - * MPEG audio and AAC audio codecs. - * MP4, 3GP and optionally Quicktime and AVI file format writers - - -#### Licensing model - -We offer several licensing models, dependent on customer requirements. - - * Developer License (SDK): With the Developer License, you will get a documented SDK including shared library objects (DLLs), interface specifications, header files and source code samples to develop video coding applications. - * Redistribution License (Royalties): For redistributing video coding modules with your application, a per-item additional royalty license is needed. You may also get flat fees for high sales volumes. Please contact us for further information. - * Customization and flat fees are possible - -#### H.264 / AVC Video Encoder - -The Video Encoder produces compatible streams according to `ITU H.264 / ISO MPEG/AVC Reference `Model JM9.2`, as well as MP4 file format output. - -Dual channel encoding for stereo video is supported. - -The encoder accepts the following parameters: - * GOP Structure (I-frame distance / P-frame distance) - * Bit rate - * Profile/Level (baseline, main, extended, high) - * Field Structure (Interlaced/Progressive) - * Frame rate (15, 24, 25, 30, 50, 60) - * chroma_format / aux_format (monochrome, 4:2:0) - * misc. rate controls (fixed quantization, vbr, cbr) - * Motion Estimation method - * full pel, half pel and quarter pel motion vectors - * SVC chroma deblocking filter mode - * transform_8x8_mode - * Frame Size from Mobile to HDTV (64x64 to 4096x2048) - -#### H.264/AVC Video Decoder - -The decoder supports decoding of files created by `JM9.2` compliant encoders or later, as well as MP4 file format input. The decoder supports baseline, main, extended and high profiles features, including HD, e.g. 1080i. - -#### Audio, Multiplexer and File Formats - - * Elementary Files, MP4 file format, 3GP file format, Quicktime - * RTMP streaming for Flash compatible streaming servers - * MPEG audio and AAC formats are available. - -#### Other codec types - -Ask for special configurations and custom codec development, e.g. for `IMX`, `DVCPRO-HD XDCAM`. diff --git a/docs/nanostream/directshow/directshow_code_statistics.md b/docs/nanostream/directshow/directshow_code_statistics.md deleted file mode 100644 index a7ee6ed71..000000000 --- a/docs/nanostream/directshow/directshow_code_statistics.md +++ /dev/null @@ -1,65 +0,0 @@ -## Codec Statistics DirectShow Events - - -The option to send Codec Statistics to the DirectShow event queue -is currently implemented by H.264 Encoder and MPEG-2 Encoder filters. - -Codec Statistics are disabled by default and can be enabled and -configured through the INanoCodecStatistics COM interface -declared in INanoCodecStatistics.h . - -### Configuration COM Interface - -```cpp -// {60D60E3B-9A3D-4201-9851-82667041D307} -DEFINE_GUID(IID_INanoCodecStatistics, -0x60d60e3b, 0x9a3d, 0x4201, 0x98, 0x51, 0x82, 0x66, 0x70, 0x41, 0xd3, 0x7); - - -interface __declspec (uuid("60D60E3B-9A3D-4201-9851-82667041D307")) -INanoCodecStatistics : public IUnknown -{ - // Get/Set statistics events - // Mode - 0: disable (default), 1: enable - // Interval - Notification interval in seconds - disabled if <= 0 - STDMETHOD(GetStatisticsMode( int* pmode, int* pinterval)) = 0; - STDMETHOD(SetStatisticsMode( int mode, int interval)) = 0; -}; -``` - - -### Codec Statistics Event Code - -```cpp -// Codec Statistics Event Code -// EC_USER is defined in Windows SDK\include\evcode.h -// EC_USER 0x8000 -#define EC_NANO_CODEC_STATS EC_USER+201 // 0x80C9 -``` - - -### Codec Statistics Event Parameters - -```cpp -// Codec Statistics Event Parameters -// EventCode: (long)EC_NANO_CODEC_STATS -// EventParam1: (LONG_PTR)NanoCodecStatistics* statistics -// EventParam2: (LONG_PTR)IBaseFilter* instance or NULL -// The parameter pointer MUST NOT be deleted or released -``` - -### Codec Statistics Data Structure - -```cpp -struct NanoCodecStatistics -{ - uint64_t timeInterval; // Overall duration of statistics event in ms - uint64_t timeIdle; // Idle time waiting for input in ms - uint64_t timeProcess; // Processing, Encoding, Decoding time in ms - uint64_t timeDeliver; // Delivery to downstream filter time in ms - uint64_t numInput; // Input frames or samples - uint64_t numOutput; // Output frames or samples - uint64_t numDropped; // Dropped frames or samples - uint64_t numFailed; // Failed frames or samples -}; -``` diff --git a/docs/nanostream/directshow/directshow_h264_video_decoder.md b/docs/nanostream/directshow/directshow_h264_video_decoder.md deleted file mode 100644 index e09d2f48e..000000000 --- a/docs/nanostream/directshow/directshow_h264_video_decoder.md +++ /dev/null @@ -1,185 +0,0 @@ -## nanocosmos H.264 Video Decoder Filter - -### Module / Version - -nanocosmos H.264/AVC Direct Show Video Decoder Filter\\ -`nh264dec.ax Version 2.5.2.4` - -The nanocosmos H.264/AVC Video Decoder support streams in baseline, main and high profile. It is highly optimized for use on hyper-threading and multi core systems. - -### Connectivity - -The input is accepting connections to splitter filters or combined source/splitter filters matching the following media types: - -Major types: - * MEDIATYPE_Video - -Subtypes: - * FourCCs: - * H264, h264, - * AVC1, avc1, - * X264, x264, - * VSSH, vssh, - * MEDIASUBTYPE_H264: {8D2D71CB-243F-45E3-B2D8-5FD7967EC09B} - -Formats: - * FORMAT_VideoInfo, - * FORMAT_VideoInfo2, - * FORMAT_MPEG2_VIDEO - -The output supports these media types: - -Major types: - * MEDIATYPE_Video - -Subtypes: - * MEDIASUBTYPE_YV12, - * MEDIASUBTYPE_I420, - * MEDIASUBTYPE_IYUV, - * MEDIASUBTYPE_YUY2, - * MEDIASUBTYPE_RGB24, - * MEDIASUBTYPE_RGB32, - * MEDIASUBTYPE_ARGB32, - * MEDIASUBTYPE_RGB565, - -Formats: - * FORMAT_VideoInfo - * FORMAT_VideoInfo2 - -### Filter GUIDs - - -```cpp -//%% Filter GUID -//%% {264DA7DD-CE74-472d-A2FD-796A1F0A379C} -DEFINE_GUID(CLSID_NANO_H264_DECODER, 0x264DA7DD, 0xCE74, 0x472d, 0xA2, 0xFD, 0x79, 0x6A, 0x1F, 0x0A, 0x37, 0x9C); - -//%% Configuration interface ICodecProp -//%% {0F817204-82C8-4c12-884A-F45FB2F33A6E} -DEFINE_GUID(IID_ICodecProp, 0xf817204, 0x82c8, 0x4c12, 0x88, 0x4a, 0xf4, 0x5f, 0xb2, 0xf3, 0x3a, 0x6e); - -//%% ICodecProp: IID_nanoPeg_LicenseString -//%% type: BSTR / Unicode string -//%% Set license string to unlock filter -//%% {1788F0B0-5985-4a19-B7FE-8AAC1BFC14B3} -DEFINE_GUID(IID_nanoPeg_LicenseString, 0x1788f0b0, 0x5985, 0x4a19, 0xb7, 0xfe, 0x8a, 0xac, 0x1b, 0xfc, 0x14, 0xb3); - -``` - -### Setting the license to unlock filter - -The filter can be unlocked either through a license key entry in the windows registry or -by setting the license key through COM interface ICodecProp::SetProperty with the -property **IID_nanoPeg_LicenseString** as first parameter. - -> The second license parameter has to be a wide/unicode string! - -### Decoder Configuration Registry Settings - -The decoder is able to perform an adaptive frame dropping and deblocking depending on the quality / delay messages received from the downstream renderer filter. - -Key: -``` -HKEY_CURRENT_USER\Software\nanocosmos\nh264dec -``` - -#### Frame dropping / skipping mode - -Determines the behaviour in the case of timing / performance problems. - * Value name: `DroppingMode` - * Value type: `REG_DWORD` - * Valid values: - * `0` - no frames are skipped - * `1` - skip non reference frames only (B-frames) - * `2` - skip non intra frames only (P- and B-frames), __default value__ - -#### Deblocking mode - -Determines the deblocking behaviour. - * Value name: `DeblockingMode` - * Value type: `REG_DWORD` - * Valid values: - * `0` - disable deblocking - * `1` - auto, decoder will reduce deblocking temporarily in the case of performance problems, __default value__ - * `2` - always perform full deblocking - * `3` - always perform deblocking on reference frames only - -#### Output color space selection - -Forces the filter to use a desired output color format. If no or no valid value is set, the output color format will be negotiated with the downstream renderer filter (usually YV12). - * Value name: `ForceOutputFourCC` - * Value type: `REG_SZ / String` - * Valid values: - * `YV12`, - * `I420`, - * `IYUV`, - * `YUY2`, - * `RGB32`, - * `RGB24`, - * `RGB565`, - * `ARGB32` - -#### Deinterlacing Mode - -Determines the deinterlacing behaviour. - * Value name: `DeinterlacingMode` - * Value type: `REG_DWORD` - * Valid values: - * `0` - disabled - * `1` - duplicate, __default value__ - * `2` - blend - * `3` - median - * `4` - edge detection - * `5` - median threshold - * `6` - content adaptive vertical temporal - -#### DirectShow Editing Services (DES) Return Mode - -Receive returns HRESULT error values if Deliver fails. Needs to be enabled for DES. - * Value name: `DESReturnMode` - * Value type: `REG_DWORD` - * Valid values: - * `0` - disabled, __default value__ - * `1` - enabled - -#### Threading Mode - -Determines the threading behaviour. Auto detection or number of decoding threads. - * Value name: `DESReturnMode` - * Value type: `REG_DWORD` - * Valid values: - * `0` - auto detect number of `cpus`, `__default value__` - * `1-8` - set number of decoding threads - -#### Output resolution alignment - -Determines the alignment of the output resolution, -to adjust it to multiples of this value. - * Value name: OutputAlignment - * Value type: `REG_DWORD` - * Valid values: - * `1-16`, `__default value:__ 4` - -### Debug-Log Configuration Registry Settings - -Key: -``` -HKEY_CURRENT_USER\Software\DebugNano\nh264dec.ax -``` - -#### File name - -Sets the output file name. The folder must already exist. - * Value name: `LogToFile` - * Value type: `REG_SZ` / `String` - * Valid values: a valid output file name to enable file logging or an empty string - -#### Logging level - -A higher value increases the amount of logging messages sent, and messages get more detailed. - * Value name: `TRACE` - * Value type: `REG_DWORD` - * Valid values: - * `0` - minimal logging - * … - * `9` - maximal logging diff --git a/docs/nanostream/directshow/directshow_h264_video_encoder.md b/docs/nanostream/directshow/directshow_h264_video_encoder.md deleted file mode 100644 index 4b4c6b85e..000000000 --- a/docs/nanostream/directshow/directshow_h264_video_encoder.md +++ /dev/null @@ -1,76 +0,0 @@ -## nanocosmos MPEG-2 Broadcast DirectShow SDK - -### Introduction - -Nanocosmos MPEG-2 Broadcast DirectShow SDK enables you to perform high quality and high performance video coding for the latest generation video and audio coding standards. It is intended to develop video encoding / transcoding applications based on Microsoft DirectShow technology.\\ - -### Major Features - - * Encoding of MPEG-2 video streams in Main and High profile - * Highly optimized software coding with support for latest CPU technology by Intel and AMD (SSE2/SSE3/SSE4 and Dual-Core/Core-Duo, AMD Athlon64 - * Real-time Encoding from Capture cards is supported - * File Reader for MOV and MXF - * File Writer for MOV and MXF - -### Documentation - -The SDK\doc folder contains further documentation for the following filters: - - * MPEG-2 Video Decoder - * MPEG-2 Video Encoder - * QuickTime Source - * QuickTime Writer - * MXF Reader - * MXF Writer - -> Contact us for additional modules for MPEG Audio Encoding and Multiplexing - -### Filter components - - * nanocosmos MPEG-2 Video Decoder - * Module: nmpeg2dec.ax - * CLSID: {223784F1-4D9F-45A5-8281-8F9AFCABD904} - - - * nanocosmos MPEG-2 Video Encoder - * Module: nmpeg2enc.ax - * CLSID: {2327A344-BECC-4F4F-89C6-DABDC5143832} - - - * nanocosmos QuickTime Source Filter - * Module: nqtsource.ax - * CLSID: {53718C99-F067-4609-8184-A8A92A241A5A} - - - * nanocosmos Quicktime Writer (MPEG2/Broadcast) - * Module: nmp4mux.ax - * CLSID: {C2FB362B-CE6C-4797-BC16-F81976DFEF61} - - - * nanocosmos MXF Reader - * Module: nh264dec.ax - * CLSID: {A3462D0F-3BD0-48A2-BD91-A1366CFC35BB} - - - * nanocosmos MXF Writer - * Module: nh264dec.ax - * CLSID: {C1C2C181-EBDA-421F-895F-638A4C5F132B} - - - * nanocosmos MPEG PS/TS Stream Splitter - * Module: nmpegsplitter.ax - * CLSID: {0994D1E8-B697-47DE-B1E3-36D26937D5B4} - - - * nanocosmos File Dump Filter - * Module: nanodump.ax - * CLSID: {DA67A541-8FEA-11D4-A908-00105A6758CF} - -### Registering and unregistering components in the DirectShow framework - -In order to use them, filters must be registered in the DirectShow framework. After -installation all filters are registered. To re-register or unregister components, execute the `RegisterFilters.bat` or `UnregisterFilters.bat` batch files from the SDK/bin folder. - -### Filter activation - -Filters can be activated by installing a license key to windows registry or programmatically by setting a license key through the software interface of a filter instance. How to set license keys to unlock filters is described in the module's documents. diff --git a/docs/nanostream/directshow/directshow_license_api.md b/docs/nanostream/directshow/directshow_license_api.md deleted file mode 100644 index 2ad6d609e..000000000 --- a/docs/nanostream/directshow/directshow_license_api.md +++ /dev/null @@ -1,21 +0,0 @@ -## nanocosmos License API for DirectShow -For unlocking a DirectShow Filter, the following API should be used.// Configuration Interface ICodecProp -```cpp -// {0F817204-82C8-4c12-884A-F45FB2F33A6E} -DEFINE_GUID(IID_ICodecProp, 0xf817204, 0x82c8, 0x4c12, 0x88, 0x4a, 0xf4, 0x5f, 0xb2, 0xf3, 0x3a, 0x6e); - -// ICodecProp: IID_nanoPeg_LicenseString -// type: BSTR / Unicode string -// Set license string to unlock filter -// {1788F0B0-5985-4a19-B7FE-8AAC1BFC14B3} -DEFINE_GUID(IID_nanoPeg_LicenseString, 0x1788f0b0, 0x5985, 0x4a19, 0xb7, 0xfe, 0x8a, 0xac, 0x1b, 0xfc, 0x14, 0xb3); - - -CComQIPtr nanoProp = filter; -if(nanoProp) -{ - nanoProp->SetProperty(&IID_nanoPeg_LicenseString,_T("nlic:...")); -} else { -... -} -``` diff --git a/docs/nanostream/directshow/directshow_mpeg2_broadcast_sdk.md b/docs/nanostream/directshow/directshow_mpeg2_broadcast_sdk.md deleted file mode 100644 index aeeb23fef..000000000 --- a/docs/nanostream/directshow/directshow_mpeg2_broadcast_sdk.md +++ /dev/null @@ -1,69 +0,0 @@ -## nanocosmos MPEG-2 Broadcast DirectShow SDK - -### Introduction - -Nanocosmos MPEG-2 Broadcast DirectShow SDK enables you to perform high quality and high performance video coding for the latest generation video and audio coding standards. It is intended to develop video encoding / transcoding applications based on Microsoft DirectShow technology. - -### Major Features - - * Encoding of MPEG-2 video streams in Main and High profile - * Highly optimized software coding with support for latest CPU technology by Intel and AMD (SSE2/SSE3/SSE4 and Dual-Core/Core-Duo, AMD Athlon64 - * Real-time Encoding from Capture cards is supported - * File Reader for MOV and MXF - * File Writer for MOV and MXF - -### Documentation - -The SDK\doc folder contains further documentation for the following filters: - - * MPEG-2 Video Decoder - * MPEG-2 Video Encoder - * QuickTime Source - * QuickTime Writer - * MXF Reader - * MXF Writer - -> Contact us for additional modules for MPEG Audio Encoding and Multiplexing - -### Filter components - - * nanocosmos MPEG-2 Video Decoder - * Module: nmpeg2dec.ax - * CLSID: {223784F1-4D9F-45A5-8281-8F9AFCABD904} - - * nanocosmos MPEG-2 Video Encoder - * Module: nmpeg2enc.ax - * CLSID: {2327A344-BECC-4F4F-89C6-DABDC5143832} - - * nanocosmos QuickTime Source Filter - * Module: nqtsource.ax - * CLSID: {53718C99-F067-4609-8184-A8A92A241A5A} - - * nanocosmos Quicktime Writer (MPEG2/Broadcast) - * Module: nmp4mux.ax - * CLSID: {C2FB362B-CE6C-4797-BC16-F81976DFEF61} - - * nanocosmos MXF Reader - * Module: nh264dec.ax - * CLSID: {A3462D0F-3BD0-48A2-BD91-A1366CFC35BB} - - * nanocosmos MXF Writer - * Module: nh264dec.ax - * CLSID: {C1C2C181-EBDA-421F-895F-638A4C5F132B} - - * nanocosmos MPEG PS/TS Stream Splitter - * Module: nmpegsplitter.ax - * CLSID: {0994D1E8-B697-47DE-B1E3-36D26937D5B4} - - * nanocosmos File Dump Filter - * Module: nanodump.ax - * CLSID: {DA67A541-8FEA-11D4-A908-00105A6758CF} - -### Registering and unregistering components in the DirectShow framework - -In order to use them, filters must be registered in the DirectShow framework. After -installation all filters are registered. To re-register or unregister components, execute the `RegisterFilters.bat` or `UnregisterFilters.bat` batch files from the SDK/bin folder. - -### Filter activation - -Filters can be activated by installing a license key to windows registry or programmatically by setting a license key through the software interface of a filter instance. How to set license keys to unlock filters is described in the module's documents. diff --git a/docs/nanostream/directshow/directshow_mpeg2_video_decoder.md b/docs/nanostream/directshow/directshow_mpeg2_video_decoder.md deleted file mode 100644 index 4bbd1bebc..000000000 --- a/docs/nanostream/directshow/directshow_mpeg2_video_decoder.md +++ /dev/null @@ -1,164 +0,0 @@ -## nanocosmos MPEG-2 HD/SD Video Decoder Filter - -### DirectShow Filter / Module - -nanocosmos MPEG-2 HD/SD Video Decoder\\ -Module Name: `nmpeg2dec.ax` - -### Connectivity - -The input is accepting connections to splitter filters or combined source/splitter filters matching the following media types: - -Major types: - * MEDIATYPE_Video - -Subtypes: - * MEDIASUBTYPE_MPEG2 - -Formats: - * FORMAT_VideoInfo, - * FORMAT_VideoInfo2, - * FORMAT_MPEG2_VIDEO - -The output supports these media types: - -Major types: - * MEDIATYPE_Video - -Subtypes: - * MEDIASUBTYPE_YV12, - * MEDIASUBTYPE_I420, - * MEDIASUBTYPE_IYUV, - * MEDIASUBTYPE_YUY2, - * MEDIASUBTYPE_RGB24, - * MEDIASUBTYPE_RGB32, - * MEDIASUBTYPE_ARGB32, - * MEDIASUBTYPE_RGB565, - -Formats: - * FORMAT_VideoInfo - * FORMAT_VideoInfo2 - -### Filter GUIDs - - -```cpp -// Filter GUID -// {223784F1-4D9F-45a5-8281-8F9AFCABD904} -DEFINE_GUID(CLSID_NANO_MPEG2_DECODER, 0x223784f1, 0x4d9f, 0x45a5, 0x82, 0x81, 0x8f, 0x9a, 0xfc, 0xab, 0xd9, 0x4); - -// Configuration interface ICodecProp -// {0F817204-82C8-4c12-884A-F45FB2F33A6E} -DEFINE_GUID(IID_ICodecProp, 0xf817204, 0x82c8, 0x4c12, 0x88, 0x4a, 0xf4, 0x5f, 0xb2, 0xf3, 0x3a, 0x6e); - -// ICodecProp: IID_nanoPeg_LicenseString -// type: BSTR / Unicode string -// Set license string to unlock filter -// {1788F0B0-5985-4a19-B7FE-8AAC1BFC14B3} -DEFINE_GUID(IID_nanoPeg_LicenseString, 0x1788f0b0, 0x5985, 0x4a19, 0xb7, 0xfe, 0x8a, 0xac, 0x1b, 0xfc, 0x14, 0xb3); -``` - - -### Setting the license to unlock filter - -The filter can be unlocked either through a license key entry in the windows registry or -by setting the license key through COM interface ICodecProp::SetProperty with the -property **IID_nanoPeg_LicenseString** as first parameter. The second license parameter -has to be a wide/unicode string! - -### Decoder Configuration Registry Settings - -Key: -``` -HKEY_CURRENT_USER\Software\nanocosmos\nmpeg2dec -``` - -#### Frame dropping / skipping mode - -Determines the behaviour in the case of timing / performance problems. - * Value name: DroppingMode - * Value type: REG_DWORD - * Valid values: - * `0` - `disabled` - * `1` - `enabled`, `__default value__` - -#### Output color space selection - -Forces the filter to use a desired output color format. If no or no valid value is set, the output color format will be negotiated with the downstream renderer filter (usually YV12). - * Value name: ForceOutputFourCC - * Value type: `REG_SZ / String` - * Valid values: - * `YV12`, - * `I420`, - * `IYUV`, - * `YUY2`, - * `RGB32`, - * `RGB24`, - * `RGB565`, - * `ARGB32` - -#### Deinterlacing Mode - -Determines the deinterlacing behaviour. - * Value name: DeinterlacingMode - * Value type: REG_DWORD - * Valid values: - * `0` - disabled - * `1` - duplicate, __default value__ - * `2` - blend - * `3` - median - * `4` - edge detection - * `5` - median threshold - * `6` - content adaptive vertical temporal - -#### DirectShow Editing Services (DES) Return Mode - -Receive returns HRESULT error values if Deliver fails. -Needs to be enabled for DES. - * Value name: `DESReturnMode` - * Value type: `REG_DWORD` - * Valid values: - * `0` - disabled, __default value__ - * `1` - enabled - -#### Threading Mode - -Determines the threading behaviour. -Auto detection or number of decoding threads. - * Value name: `DESReturnMode` - * Value type: `REG_DWORD` - * Valid values: - * `0` - auto detect number of cpus, __default value__ - * `1-8` - set number of decoding threads - -#### Output resolution alignment - -Determines the alignment of the output resolution, -to adjust it to multiples of this value. - * Value name: `OutputAlignment` - * Value type: `REG_DWORD` - * Valid values: - * `1-16`, __default value:__ 4 - -### Debug-Log Configuration Registry Settings - -Key: -``` -HKEY_CURRENT_USER\Software\DebugNano\nmpeg2dec.ax -``` - -#### File name -Sets the output file name. The folder must already exist. - * Value name: `LogToFile` - * Value type: `REG_SZ` / `String` - * Valid values: a valid output file name to enable file logging or an empty string - -### Logging level - -A higher value increases the amount of logging messages sent, and messages get more detailed. - * Value name: `TRACE` - * Value type: `REG_DWORD` - * Valid values: - * `0` - minimal logging - * … - * `9` - maximal logging diff --git a/docs/nanostream/directshow/directshow_mpeg2_video_encoder.md b/docs/nanostream/directshow/directshow_mpeg2_video_encoder.md deleted file mode 100644 index ceb12cde1..000000000 --- a/docs/nanostream/directshow/directshow_mpeg2_video_encoder.md +++ /dev/null @@ -1,157 +0,0 @@ -## nanocosmos MPEG-2 Video Encoder Filter - -### DirectShow Filter / Module - -nanocosmos MPEG-2 Video Encoder\\ -Module Name: nmpeg2enc.ax - -### DirectShow Connectivity - -The input is accepting connections to video source, capture and decoder filters matching the following media types: - -Major types: - * MEDIATYPE_Video - -Subtypes: - * MEDIASUBTYPE_YV12, - * MEDIASUBTYPE_I420, - * MEDIASUBTYPE_YUY2, - * MEDIASUBTYPE_UYVY, - * MEDIASUBTYPE_HDYC, - * MEDIASUBTYPE_RGB24, - * MEDIASUBTYPE_RGB32, - * MEDIASUBTYPE_ARGB32, - * MEDIASUBTYPE_RGB565, - -Formats: - * FORMAT_VideoInfo - * FORMAT_VideoInfo2 - -The output supports these media types: - -Major types: - * MEDIATYPE_Video - -Subtypes: - * MEDIASUBTYPE_MPEG2_VIDEO, - * MEDIASUBTYPE_mpgv - -Formats: - * FORMAT_MPEG2_VIDEO, - * FORMAT_NONE - -### Configuration - -The encoding configuration may be set by using either the property page or the COM Interface INanoCodecOpts as declared in header file INanoCodecOpts.h . - -```cpp -// Filter GUID -// {2327A344-BECC-4f4f-89C6-DABDC5143832} -DEFINE_GUID(CLSID_NANO_MPEG2_ENCODER, 0x2327a344, 0xbecc, 0x4f4f, 0x89, 0xc6, 0xda, 0xbd, 0xc5, 0x14, 0x38, 0x32); - -// Property Page GUID -// {8A84396A-277A-4835-9EB5-719863194DC9} -DEFINE_GUID(CLSID_NANO_MPEG2_ENCODER_PROPPAGE, 0x8a84396a, 0x277a, 0x4835, 0x9e, 0xb5, 0x71, 0x98, 0x63, 0x19, 0x4d, 0xc9); - -// Configuration Interface GUID -// {698E0F57-B828-4c40-8867-095FF49F77D6} -DEFINE_GUID(IID_INanoCodecOpts, 0x698e0f57, 0xb828, 0x4c40, 0x88, 0x67, 0x9, 0x5f, 0xf4, 0x9f, 0x77, 0xd6); - -// Configuration interface ICodecProp -// {0F817204-82C8-4c12-884A-F45FB2F33A6E} -DEFINE_GUID(IID_ICodecProp, 0xf817204, 0x82c8, 0x4c12, 0x88, 0x4a, 0xf4, 0x5f, 0xb2, 0xf3, 0x3a, 0x6e); - -// ICodecProp: IID_nanoPeg_LicenseString -// type: BSTR / Unicode string -// Set license string to unlock filter -// {1788F0B0-5985-4a19-B7FE-8AAC1BFC14B3} -DEFINE_GUID(IID_nanoPeg_LicenseString, 0x1788f0b0, 0x5985, 0x4a19, 0xb7, 0xfe, 0x8a, 0xac, 0x1b, 0xfc, 0x14, 0xb3); -``` - - -### Setting the license to unlock filter - -The filter can be unlocked either through a license key entry in the windows registry or -by setting the license key through COM interface ICodecProp::SetProperty with the -property **IID_nanoPeg_LicenseString** as first parameter. The second license parameter -has to be a wide/unicode string! - -### Common Encoder Settings - -| Parameter | Default values | Description | -|------------------------------|-----------------------------|---------------------------------| -| profile, level | Main Profile, Main Level | MPEG-2 Profile and Level | -| base_video.bitrate_kb | Profile and Level dependend | Video Bitrate in kBits/second | -| base_video.resolution.width | 0 - use input width | Picture Coding Width | -| base_video.resolution.height | 0 - use input height | Picture Coding Height | -| chroma_format_idc | 0 - I420, 1 - I422 | [0,1] Chroma Format | -| rate_method | 0 - CBR, 1 - VBR | [0,1] Rate Control Mode | -| distance_i | 12 | Intra Frame Distance / GOP len. | -| distance_p | 3 | P Frame Distance | - -### Configuration through INanoCodecOpts interface - - - Version check by calling //GetCodecOptsVersion//// //(optional) - - Instanciating a parameter structure of type //MPDX4_MPEG2EncoderParams// - - Initializing the parameter struct by calling //InitCodecOptions// will set all parameters to default values for the selected profile and level - - Setting custom values for resolution and bitrate - - Applying settings by calling //SetCodecOptions// - -Here a code snippet without error handling to show configuration for IMX 50 format: -```cpp -#include "mpeg2_enc_params.h" - -HRESULT hr = S_OK; - -// Query INanoCodecOpts interface from IBaseFilter interface -// of MPEG-2 Encoder filter -CComQIPtr pNanoCodecOpts = pBaseFilter; - -MPDX4_MPEG2EncoderParams mpeg2EncParams; -memset(&mpeg2EncParams, 0, sizeof(MPDX4_MPEG2EncoderParams)); - -// Set desired profile and level values -mpeg2EncParams.profile = MPDX4_MPEG2_PROFILE_422IMX; -mpeg2EncParams.level = MPDX4_MPEG2_LEVEL_MAIN; - -// Intialize the parameter struct according to profile and level set -hr = pNanoCodecOpts->InitCodecOptions((MPDX4_BaseCodecOpts*) &mpeg2EncParams, INANOCODECOPTS_VERSION); - -// Set custom parameter values -// Bitrate -mpeg2EncParams.base_video.bitrate_kb = 50000; // IMX 50 -// If resize is needed -mpeg2EncParams.base_video.resolution.width = 720; -mpeg2EncParams.base_video.resolution.height = 608; - -// Apply settings and finish configuration -hr = pNanoCodecOpts->SetCodecOptions((MPDX4_BaseCodecOpts*) &mpeg2EncParams, INANOCODECOPTS_VERSION); -``` - - -### Configuration through DirectShow filter property page - -The filter's property page offers a subset of encoding parameters, containing the most important options. - -![MPEG-2 Video Encoder Properties](img/directshow_mpeg2_video_enc_prop.png) - -### Debug-Log Configuration Registry Settings - -Key: HKEY_CURRENT_USER\Software\DebugNano\nmpeg2enc.ax - -#### File name - -Sets the output file name. The folder must already exist. - * Value name: LogToFile - * Value type: REG_SZ / String - * Valid values: a valid output file name to enable file logging or an empty string - -#### Logging level - -A higher value increases the amount of logging messages sent, and messages get more detailed. - * Value name: TRACE - * Value type: REG_DWORD - * Valid values: - * 0 - minimal logging - * … - * 9 - maximal logging diff --git a/docs/nanostream/directshow/directshow_mpeg_audio_encoder.md b/docs/nanostream/directshow/directshow_mpeg_audio_encoder.md deleted file mode 100644 index 663966894..000000000 --- a/docs/nanostream/directshow/directshow_mpeg_audio_encoder.md +++ /dev/null @@ -1,14 +0,0 @@ -## Configure encoder settings - -Here is a pseudo sample code, showing how to set the bitrate for the encoder - m_pEncMpegA is the instance of the mpeg audio encoder: -```cpp -ICodecAPI* encoderInt; -m_pEncMpegA->QueryInterface(IID_ICodecAPI, (void **) &encoderInt); -VARIANT v; -v.vt = VT_INT; -v.intVal = 128000; // 128 kb -encoderInt->SetValue(&PROPID_nanoMPAEBitrate, &vt); -... -encoderInt->Release(); - -``` diff --git a/docs/nanostream/directshow/directshow_nanoAVC_decoding_sdk.md b/docs/nanostream/directshow/directshow_nanoAVC_decoding_sdk.md deleted file mode 100644 index f7bc309f0..000000000 --- a/docs/nanostream/directshow/directshow_nanoAVC_decoding_sdk.md +++ /dev/null @@ -1,49 +0,0 @@ -## nanoAVC/H.264 DirectShow Decoding SDK - -### Introduction - -nanoAVC/H.264 Direct Show Decoding SDK enables you to decode/play back -AVC/H.264 video and AAC audio from MP4/3GP or transport stream (TS) sources -within Windows Media Player and custom applications based on Microsoft DirectShow Framework. - -The nanocosmos H.264/AVC Video Decoder supports streams in baseline, main and high profile. It is highly optimized for use on hyper-threading and multi core systems. - -### Filter components - - * nanocosmos AVC/H.264 Video Decoder - * Module: nh264dec.ax - * CLSID: {264DA7DD-CE74-472D-A2FD-796A1F0A379C} - - - * nanocosmos AAC Audio Decoder - * Module: naacdec.ax - * CLSID: {AEED2B3D-6DA1-4C84-A85D-83547FA90486} - - - * nanocosmos MP4 Stream Splitter - * Module: nmp4splitter.ax - * CLSID: {22F493C4-B51B-4767-BE55-ADFA34D6A205} - - - * nanocosmos MPEG PS/TS Stream Splitter - * Module: nmpegsplitter.ax - * CLSID: {0994D1E8-B697-47DE-B1E3-36D26937D5B4} - - - -![Example playback filtergraph](img/directshow_h264_decoding_filtergraph.png) - -Figure 1. Example playback filtergraph - -### Registering and unregistering components in the DirectShow framework - -In order to use them, filters must be registered in the DirectShow framework. After installation all filters are registered. To re-register or unregister components, execute the RegisterFilters.bat or UnregisterFilters.bat batch files from the SDK/bin folder. - -### Evaluation mode and filter activation - -Filters can be activated by installing a license key to windows registry or programmatically by setting a license key through the software interface of a filter instance. How to set license keys to unlock filters is described in the module's documents.\\ -If filters run in evaluation mode, an overlay logo will be shown on video. - -### Embedding / Customizing nanocosmos technology - -Nanocosmos also offers special OEM and customization service. Dependent on your needs, we may offer different models of licensing or application development. diff --git a/docs/nanostream/directshow/directshow_nanoAVC_encoding_sdk.md b/docs/nanostream/directshow/directshow_nanoAVC_encoding_sdk.md deleted file mode 100644 index b0c02935a..000000000 --- a/docs/nanostream/directshow/directshow_nanoAVC_encoding_sdk.md +++ /dev/null @@ -1,101 +0,0 @@ -## nanoAVC/H.264 DirectShow Encoding SDK - -### Introduction - -nanoAVC/H.264 Direct Show Encoding SDK enables you to perform high quality and high performance video coding for the latest generation video and audio coding standards. It is intended to develop video encoding / transcoding applications based on Microsoft(R) DirectX/DirectShow(R) technology. - -### Major Features - - * ISO 14496 Part 10 (MPEG-AVC) / ITU H.264 compliance for many profiles and levels - * Encoding of H.264 video streams in Baseline, Main, Extended and High profile - * Encoding of AAC-LC/LTP/MAIN/HE(aacPlus) audio streams with up to 6 channels - * Encoding of AMR-NB audio streams - * Highly optimized software coding with support for latest CPU technology by Intel and AMD (SSE2/SSE3/SSE4 and Dual-Core/Core-Duo, AMD Athlon64 - * Real-time Encoding from Capture cards is supported - * Wide range of applications from Mobile Phones (3GP), Portable Devices (iPod, iPhone, Sony PSP etc) up to Professional HDTV - * Multiplexer for MP4, MOV and 3GP - - -### Documentation - -The SDK\doc folder contains the following further documents: - - * H.264/AVC Video Decoder - * H.264/AVC Video Encoder - * AAC Audio Encoder - * AMR-NB Audio Encoder - * MP4/3GP Multiplexer - -### Filter components - - * nanocosmos AVC/H.264 Video Encoder - * Module: nh264enc.ax - * CLSID: {A88889A8-3C2A-4A32-8EAA-755D491D02A0} - - - * nanocosmos AAC Audio Encoder - * Module: naacenc.ax - * CLSID: {0296CC21-B78D-416D-846C-45E26CA46A4A} - - - * nanocosmos AMR-NB Audio Encoder - * Module: namrnbenc.ax - * CLSID: {10CAB930-E019-41DF-83B7-60D723706B8F} - - - * nanocosmos MP4 Multiplexer - * Module: nmp4mux.ax - * CLSID: {78D670BF-49B5-4A3B-BB8C-E2A36E688FCF} - - - * nanocosmos File Dump Filter - * Module: nanodump.ax - * CLSID: {DA67A541-8FEA-11D4-A908-00105A6758CF} - - - * nanocosmos AVC/H.264 Video Decoder - * Module: nh264dec.ax - * CLSID: {264DA7DD-CE74-472D-A2FD-796A1F0A379C} - - - * nanocosmos AAC Audio Decoder - * Module: naacdec.ax - * CLSID: {AEED2B3D-6DA1-4C84-A85D-83547FA90486} - - - * nanocosmos MP4 Stream Splitter - * Module: nmp4splitter.ax - * CLSID: {22F493C4-B51B-4767-BE55-ADFA34D6A205} - - - * nanocosmos MPEG PS/TS Stream Splitter - * Module: nmpegsplitter.ax - * CLSID: {0994D1E8-B697-47DE-B1E3-36D26937D5B4} - - - * nanocosmos Color Space Converter - * Module: ncolconv.ax - * CLSID: {E855821E-C055-4C85-B04F-19F65D5D50FD} - - - * nanocosmos MPEG TS Writer - * Module: nanoTsWriter.ax - * CLSID: {2C6E92AB-523E-4C90-8A01-394FC0FC273C} - - -![Example filtergraph](img/directshow_h264_encoding_filtergraph.png) - -Figure 1. Example filtergraph - -### Registering and unregistering components in the DirectShow framework - -In order to use them, filters must be registered in the DirectShow framework. After installation all filters are registered. To re-register or unregister components, execute the RegisterFilters.bat or UnregisterFilters.bat batch files from the SDK/bin folder. - -### Evaluation mode and filter activation - -Filters can be activated by installing a license key to windows registry or programmatically by setting a license key through the software interface of a filter instance. How to set license keys to unlock filters is described in the module's documents.\\ -If filters run in evaluation mode, an overlay logo will be shown on video. - -### Embedding / Customizing nanoPEG technology - -Nanocosmos also offers special OEM and customization service. Dependent on your needs, we may offer different models of licensing or application development. diff --git a/docs/nanostream/directshow/directshow_quicktime_imx.md b/docs/nanostream/directshow/directshow_quicktime_imx.md deleted file mode 100644 index c87a51650..000000000 --- a/docs/nanostream/directshow/directshow_quicktime_imx.md +++ /dev/null @@ -1,80 +0,0 @@ -## QuickTime IMX Video Playback Components - -**For QuickTime und DirectShow** - -The QuickTime IMX Playback components allow easy playback of QuickTime IMX video files with Windows or MacOS systems.\\ -IMX is also known as SMPTE D-10 and is based on the MPEG compression technology. - -The Codec Packet contains the following components: - * QuickTime IMX Source Direct Show Package - * QuickTime IMX Codec for Quicktime Player - -### QuickTime IMX Source Direct Show Package - -The QuickTime IMX Source DirectShow Package allows playback of QuickTime IMX video files with all WindowsMediaPlayer-/DirectShow based applications. Installation of the Quicktime System is not required.\\ -Direct Show Filters included: - -#### File Reader for QuickTime IMX Video Files - -Output Media Types: - - * Majortype: - * Video, - * Sub Type: - * MPEG2_Video - - * Majortype: - * Audio: - * Sub Type: - * PCMAudio - -#### IMX Video Decoder Filter - -Formats: - * MPEG-2 IMX 30 (FourCC: mx3p) - * MPEG-2 IMX 40 (FourCC: mx4p) - * MPEG-2 IMX 50 (FourCC: mx5p) - - - -![Direct Show Example](img/directshow_qt_example.png) - -Direct Show Example - - -### QuickTime IMX Decoder for Quicktime Player - -QuickTime IMX Codec Package can be used in all Quicktime based applications, for example QuickTime Player. - -#### Supported input Formats: - - * QuickTime Movie File - * IMX Compression (MPEG-2 IMX 30 (FourCC: mx3p) - * MPEG-2 IMX 40 (FourCC: mx4p) - * MPEG-2 IMX 50 (FourCC: mx5p)) - -#### Supported Decoding Parameters: - - * Bitrates from up to 100 mbps - * Frame Rates: 23.976, 24, 25, 29.97, and 30 frames/sec up to 60 fields/sec. - - -The Codec is a QuickTime Decoder Component developed by nanocosmos. - -![Quicktime IMX Example](img/directshow_imx_example.png) - -Quicktime IMX Example - - - -#### Supported input Formats: - - * QuickTime Movie File - * IMX Compression (MPEG-2 IMX 30 (FourCC: mx3p) - * MPEG-2 IMX 40 (FourCC: 'mx4p') - * MPEG-2 IMX 50 (FourCC: mx5p)) - -#### Supported Decoding Parameters: - - * Bitrates from up to 100 mbps - * Frame Rates: 23.976, 24, 25, 29.97, and 30 frames/sec up to 60 fields/sec. diff --git a/docs/nanostream/directshow/directshow_rtmp_source.md b/docs/nanostream/directshow/directshow_rtmp_source.md deleted file mode 100644 index 6c0e50d6e..000000000 --- a/docs/nanostream/directshow/directshow_rtmp_source.md +++ /dev/null @@ -1,232 +0,0 @@ -## nanocosmos RTMP Source Filter - -### Introduction - * DirectShow filter for RTMP Downstreaming / Playback - * Supported Architectures: Microsoft DirectShow, Windows XP, Vista, 7, Server - * Supported Formats: H.264 + AAC + MP3 - -### Module Name / Version - -Module: nRTMPSource.ax \\ -Version: 1.3.1.1 - -### DirectShow Connectivity - -The output pins are accepting connections matching the following media types: - - * Major types: - * MEDIATYPE_Video - * Subtypes: - * FourCCs: H264, h264 - * Formats: - * FORMAT_MPEG2_VIDEO, - * FORMAT_NONE - * Major types: - * AAC: MEDIATYPE_Audio - * MP3: MEDIATYPE_Audio - * SPEEX: MEDIATYPE Ogg Stream - * Subtypes: - * AAC: MEDIASUBTYPE_AAC, FourCC: 0x000000FF, - * MP3: MEDIASUBTYPE_MP3, FourCC: 0x00000055 - * SPEEX: MEDIASUBTYPE_None - * Formats: - * AAC, MP3: FORMAT_WaveFormatEx, - * SPEEX: FORMAT_Speex - -### Filter GUIDs - -```cpp -// Filter GUID -// {440E11F2-FB35-4699-809B-157C390E9238} -DEFINE_GUID(CLSID_NANO_RTMP_SOURCE, 0x440e11f2, 0xfb35, 0x4699, 0x80, 0x9b, 0x15, 0x7c, 0x39, 0xe, 0x92, 0x38); - -// Property Page GUID -// {7A05E2F3-9258-4952-920A-54F6AE6A0D66} -DEFINE_GUID(CLSID_NANO_RTMP_SOURCE_PROPPAGE, 0x7a05e2f3, 0x9258, 0x4952, 0x92, 0xa, 0x54, 0xf6, 0xae, 0x6a, 0xd, 0x66); -``` - -### Configuration through COM Interface - -The streaming url can be set by using standard DirectShow interface IFileSourceFilter . - -#### URL format - -rtmp:%%//%% [ IP:port ]/[ application name]/[ stream name]\\ -If no port is specified, standard rtmp port 1935 will be used. - -Example:\\ -rtmp:%%//%%127.0.0.1:1935/live/myStream - -Following options can be set by using standard DirectShow interface ICodecAPI. -See DirectShow documentation for usage of ICodecAPI interface. - -#### Connect to nanocosmos decoder filters only - -Value Type: Integer, Variant::intVal, VT_INT\\ -Valid values: yes: 1, no: 0 \\ -GUID: - -```cpp -// {FB5005A0-3231-4171-A218-A3A3431D7790} -DEFINE_GUID(PROPID_nanoSourceConnectToNanoDecodersOnly, 0xfb5005a0, 0x3231, 0x4171, 0xa2, 0x18, 0xa3, 0xa3, 0x43, 0x1d, 0x77, 0x90); -``` - - -#### Buffering delay in milliseconds - -Under low bandwidth conditions a higher value leads to smoother playback. - -Value Type: Integer, Variant::intVal, VT_INT\\ -Valid values: 0...INT32_MAX\\ -GUID: - -```cpp -// {3641DC07-82CD-40b0-9293-DCBE25E0C274} -DEFINE_GUID(PROPID_nanoSourceBufferingDelay, 0x3641dc07, 0x82cd, 0x40b0, 0x92, 0x93, 0xdc, 0xbe, 0x25, 0xe0, 0xc2, 0x74); -``` - -#### Buffering mode - -Use this GUID to configure the buffering mode\\ -Value Type: VT_I4 / VARIANT::intVal, get/set \\ -Valid values: 0 - Fill buffer once on start, 1 - Refill buffer always if empty\\ -Default value: 1\\ - -```cpp -// {AB91A1D9-6701-4133-8733-6EB3A20E9583} -DEFINE_GUID(PROPID_nanoSourceBufferingMode, 0xab91a1d9, 0x6701, 0x4133, 0x87, 0x33, 0x6e, 0xb3, 0xa2, 0xe, 0x95, 0x83); -``` - -#### Receive timeout in milliseconds - -A stream is stopped if no data is present for this amount of time Overrides registry value ReceiveTimeout -Value Type: Integer, Variant::intVal, VT_I4\\ -Valid values: 1000...INT (1-30 seconds), default: 5000 (5 seconds)\\ -GUID: - -```cpp -// {767B756C-A55B-4fd9-88F8-159B338207ED} -DEFINE_GUID(PROPID_nanoRTMPReceiveTimeoutMs, 0x767b756c, 0xa55b, 0x4fd9, 0x88, 0xf8, 0x15, 0x9b, 0x33, 0x82, 0x7, 0xed); -``` - -#### Stream format detection timeout in milliseconds - -The detection is stopped after this amount of time, even if less than 2 streams found Overrides registry value DetectStreamFormatTimeout -Value Type: Integer, Variant::intVal, VT_I4\\ -Valid values: 1000...INT32_MAX, default: 10000 (10 seconds)\\ -GUID: -```cpp -// {7400166F-8140-4b81-8B3E-C97CB7D972DF} -DEFINE_GUID(PROPID_nanoRTMPDetectStreamFormatTimeoutMs, 0x7400166f, 0x8140, 0x4b81, 0x8b, 0x3e, 0xc9, 0x7c, 0xb7, 0xd9, 0x72, 0xdf); -``` - - -#### Configuration through DirectShow filter property page - -![RTMP Source Properties](img/directshow_rtmp_source_properties.png) - - -#### Configuration Registry Settings - -Key: HKEY_CURRENT_USER\Software\nanocosmos\nRTMPSource - -#### Receive timeout - -A stream is stopped if no data is present for this this amount of time\\ -Value name: DetectStreamFormatTimeout\\ -Value type: REG_DWORD\\ -Valid values: 1 second - 30 seconds, default: 5 seconds - -#### Stream format detection mode - -Determines if stream format settings are detected from the RTMP network stream or from registry preset values below.\\ -Value name: DetectStreamFormatMode\\ -Value type: REG_DWORD\\ -Valid values: 0: Detect from stream (default), 1: Use registry preset\\ - -#### Stream format detection timeout - -Timeout for format detection in seconds\\ -Value name: DetectStreamFormatTimeout\\ -Value type: REG_DWORD\\ -Valid values: 1 second - 30 seconds, default: 10 seconds - -#### Audio Codec - -Sets the audio codec if DetectStreamFormatMode = 1.\\ -Value name: AudioCodec\\ -Value type: REG_DWORD\\ -Valid values: 0: Auto/Default(AAC), 1: AAC, 2: MP3, 3: SPEEX - -#### Audio Channels - -Sets the number of audio channels if DetectStreamFormatMode = 1.\\ -Value name: AudioChannels\\ -Value type: REG_DWORD\\ -Valid values: 0: Auto/Default(Stereo), 1: Mono, 2: Stereo - -#### Audio Bitlength - -Sets the number of bits per audio sample if DetectStreamFormatMode = 1.\\ -Value name: AudioBitlength\\ -Value type: REG_DWORD\\ -Valid values: 0: Auto/Default(16 Bit), 1: 8 Bit, 2: 16 Bit - -#### Audio Samplerate - -Sets the audio samplerate if DetectStreamFormatMode = 1.\\ -Codecs support different sampling rates and have different default values!!!\\ -Value name: AudioRate\\ -Value type: REG_DWORD\\ - -##### Valid values AAC: - * 0: Auto/Default(44100), - * 1: 8000 , - * 2: 11025, - * 3: 12000, - * 4: 16000, - * 5: 22050, - * 6: 24000 - * 7: 32000, - * 8: 44100, - * 9: 48000, - * 10: 64000, - * 11: 88200, - * 12: 96000 - -##### Valid values MP3: - * 0: Auto/Default(44100), - * 1: 5500 , - * 2: 11025, - * 3: 22050, - * 4: 44100 - -##### Valid values SPEEX: - * 0: Auto/Default(16000), - * 1: 8000 , - * 2: 16000, - * 3: 32000, - * 4: 44100 -SPEEX internal sampling is usually 16000 (wideband). -It differs from flash's Microphone::rate value! - - -### Debug-Log Configuration Registry Settings - -Key: HKEY_CURRENT_USER\Software\DebugNano\nRTMPSource.ax - -#### File name -Sets the output file name. The folder must already exist.\\ -Value name: LogToFile\\ -Value type: REG_SZ / String\\ -Valid values: a valid output file name to enable file logging or an empty string - -#### Logging level - -A higher value increases the amount of logging messages sent, and messages get more detailed. \\ -Value name: TRACE\\ -Value type: REG_DWORD\\ -Valid values: - * 0 - minimal logging - * … - * 9 - maximal logging diff --git a/docs/nanostream/directshow/directshow_rtmp_status_statistics.md b/docs/nanostream/directshow/directshow_rtmp_status_statistics.md deleted file mode 100644 index 0858fad25..000000000 --- a/docs/nanostream/directshow/directshow_rtmp_status_statistics.md +++ /dev/null @@ -1,76 +0,0 @@ -## RTMP DirectShow Events - -RTMP Writer filter provides statistics and information about the current streaming status as DirectShow events. - -All types are declared in RTMPWriterOptions.h. -### RTMP Event Codes -```cpp -// EC_USER is defined in Windows SDK\include\evcode.h -// EC_USER 0x8000 - -// RTMP Statistics Event Code -#define EC_NANO_RTMP_WRITER_STATS EC_USER+179 - -// RTMP Status Event Code -#define EC_NANO_RTMP_WRITER_STATUS EC_USER+181 -``` - - -### RTMP Statistics Event Parameters - -```cpp -// RTMP Statistics Event Parameters -// EventCode: (long)EC_NANO_RTMP_WRITER_STATS -// EventParam1: (LONG_PTR)rtmp_writer_stats_t* pStatistics -// EventParam2: (LONG_PTR)(char**)ppRTMPUrl or NULL -// The parameter pointers MUST NOT be deleted or released -``` - -### RTMP Status Event Parameters - -```cpp -// RTMP Status Event Parameters -// EventCode: (long)EC_NANO_RTMP_WRITER_STATUS -// EventParam1: (LONG_PTR)(int*)pRtmpWriterStatus -// EventParam2: (LONG_PTR))(char**)ppRTMPUrl or NULL -// The parameter pointers MUST NOT be deleted or released -``` - -### RTMP Status Values - -```cpp -enum RtmpWriterStatus -{ - RTMPWriterConnected = 0, // RTMP Writer is connected - RTMPWriterDisconnected = 1, // RTMP Writer is disconnected - RTMPWriterReconnecting = 2 // RTMP Writer is trying to reconnect -}; -``` - - -### RTMP Statistics Data Structure - -```cpp -struct rtmp_writer_stats_t -{ - int output_buffer_size; // Available buffer size in bytes - int output_buffer_fillness; // Current buffer fillness in bytes - - __int64 output_bitrate; // Data rate sent through network in bits/s - __int64 output_bitrate2; // Deprecated - works only with Windows XP - __int64 output_bitrate3; // Deprecated - works only with Windows XP - - DWORD packetsRtt; // Deprecated - works only with Windows XP - unsigned int clientBytesReceived; // Experimental - Bytes received / - // acknowledged by client - - size_t audio_packets_buffered; // Number of audio packets/frames buffered - size_t video_packets_buffered; // Number of video packets/frames buffered - - int audio_bitrate; // Input audio bitrate in bits/s - int video_bitrate; // Input video bitrate in bits/s - - int audio_packets_sent; // Number of audio packets/frames sent - int video_packets_sent; // Number of video packets/frames sent -}; -``` diff --git a/docs/nanostream/directshow/directshow_rtmp_writer.md b/docs/nanostream/directshow/directshow_rtmp_writer.md deleted file mode 100644 index 07ba49b49..000000000 --- a/docs/nanostream/directshow/directshow_rtmp_writer.md +++ /dev/null @@ -1,175 +0,0 @@ -## RTMP Network Renderer & Writer - -### Purpose - -Writing RTMP compatible video/audio streams over a network connection - -DirectShow filter for streaming to Wowza and Flash Media Servers - - * Supported Architectures: Microsoft DirectShow, Windows XP, Vista, 7, Server - * Supported Formats: H.264 + AAC - -### Module / Version - -nanocosmos RTMP Network Writer \\ -nRtmpRenderer.ax Version 3.0.3.1 - -### DirectShow Connectivity - -The RTMP Writer is implemented as a "Renderer Filter", which means it only has 2 input pins for compressed video and audio and no output pin.\\ -The input is accepting connections matching the following media types: - - * Pin 1 Media Types: - * MEDIATYPE_Video - * Pin 1 Media Subtypes: - * FourCCs: H264, h264 - * Pin 1 Formats: - * FORMAT_MPEG2_VIDEO, - * FORMAT_NONE - * Pin 2 Major Media Types: - * MEDIATYPE_Audio - * Pin 2 Media Subtypes: - * MEDIASUBTYPE_AAC, FourCC: 0x000000FF - * Pin 2 Formats: - * FORMAT_WaveFormatEx, - * FORMAT_NONE - -### Configuration - -The configuration may be set by using either the property page or the COM-Interface IRTMPOptions as declared in header file RTMPWriterOptions.h. - -```c -// Filter Guids -// {B4FB59C5-983B-4d96-9204-F8B0E46704EE} -DEFINE_GUID(CLSID_NANO_RTMP_WRITER, 0xb4fb59c5, 0x983b, 0x4d96, 0x92, 0x4, 0xf8, 0xb0, 0xe4, 0x67, 0x4, 0xee); - -// Property Page GUID -// {EFC673DE-E20E-4699-8331-9522C5DF7A6D} -DEFINE_GUID(CLSID_NANO_RTMP_WRITER_PROPPAGE, 0xefc673de, 0xe20e, 0x4699, 0x83, 0x31, 0x95, 0x22, 0xc5, 0xdf, 0x7a, 0x6d); - -// Configuration Interface GUID -// IID_IRTMPOptions interface -// {B8AF4593-BE31-449c-8485-3E6D65CBC1FE} -DEFINE_GUID(IID_IRTMPOptions, 0xb8af4593, 0xbe31, 0x449c, 0x84, 0x85, 0x3e, 0x6d, 0x65, 0xcb, 0xc1, 0xfe) -``` - -The streaming url can be set by using standard DirectShow interface IFileSinkFilter . - -### Configuration with DirectShow filter property page - -![RTMP Writer Properties](img/directshow_rtmp_writer_properties.png) - -The filter's property page offers a subset of encoding parameters, containing the most important options. - -URL formatting:\\ -rtmp:// [hostname / IP address]/[application]+[stream name] - -for example:\\ -rtmp://127.0.0.1/live+myStream - -with:\\ -IP address: 127.0.0.1\\ -Application name: live, Stream name: myStream - -### Connection Test - -Connect/Disconnect buttons. Allows to connect before starting the graph and disconnect during the streaming (this stops the running graph). - -### RTMP Authentication -RTMP Authentication expects a user name and a password for unlocking access to the Media Server. -This has been verified with Flash Media Server (3.x and 4) and Wowza Media Server (2.x). -CDNs are supported on a case-by-case basis. -Special tuning as been made for some CDN access -(e.g. Limelight). - -### Automatic Reconnection: - -Attempts to restore network connection after n seconds to the server in case of network interrupts. During the reconnect attempts the graph still playing. 0 means no attempts to reconnect to server. - -### Advanced Configuration Options - -The advanced options should be handled carefully. They can severely affect network and streaming performance. Contact support if you want to fine tune any settings. - -//**Buffering:**// - -Data Flow: RTMP multiplexed data -> application buffer -> socket buffer -> network. - -There are 2 buffer types: - * Socket level buffer -Size of the network socket buffer, much dependent on the underlying network architecture - - * Application level buffer (Output Buffer Size, Output packet size), 0=no buffer -Affects bandwidth utilization, prevents bitrate changes and puts the sending process to a separate thread. - -#### Advanced Settings: - * Live Mode: - * Turns on/off blocking of input pins. (should be off by default) - * TCP No Delay: - * Activates the TCP_NODELAY option for TCP transmission ("Nagle Algorithm") - * Timecode Options: - * Sends Time Code in RTMP Meta Data - * Allow B Frames: - * should be on - * Reduces the buffer/delay in H.264 Main Profile without B Frames. No effect in Baseline Mode. - * Timecode Options: - * send Time Code in RTMP Meta Data - -#### Connection Status Notification - -There are two possibilities to get the status of the connection to the server: - - * Event messages are sent via IMediaEventSink with the event code EC_NANO_RTMP_WRITER_STATUS declared in RTMPWriterOptions.h (#define EC_NANO_RTMP_WRITER_STATUS EC_USER+181). A message is sent when the connection state changes. The different states are represented by (also declared in RTMPWriterOptions.h): - * RTMPWriterConnected=0 - * RTMPWriterDisconnected=1 - * RTMPWriterReconnecting=2 - * Using a callback function, which is called when the connection state changes: - * Query for the interface IRTMPStatusNotify - * Set the callback function via SetStatusNotifyHandler() - -##### Rtmp Writer Filter crashes when using SetStatusNotifyHandler() - -This problem is probably caused by calling a function declared with one calling convention with a function pointer declared with a different calling convention. Here is pretty good explanation of the problem: - * [http://stackoverflow.com/questions/301655/c-visual-studio-runtime-error][59d1de83] - * [http://stackoverflow.com/questions/10079625/c-run-time-check-failure-0-the-value-of-esp-was-not-properly-saved-across-a][31ed7150] - - - -Conclusion: Make sure you use __stdcall in your declaration. - -### Log / Debug Configuration Registry Settings - -Key: HKEY_CURRENT_USER\Software\DebugNano\ nRtmpRenderer.ax - -#### File name - * Sets the output file name. The folder must exist. - * Value name: LogToFile - * Value type: REG_SZ / String - * Valid values: a valid output file name to enable file logging or an empty string - -#### Logging level - * A higher value increases the amount of logging messages sent, and messages get more detailed. - * Value name: TRACE - * Value type: REG_DWORD - * Valid values: - * 0 - minimal logging - * … - * 9 - maximal logging - -#### Contact -//Please contact us for further information, extended services are available upon request.// - - -[http://www.nanocosmos.de][8da7b4b5] - - - -[info@nanocosmos.de][6b2aae43] - - - -(c) 2009-2012, nanocosmos gmbh - -[59d1de83]: http://stackoverflow.com/questions/301655/c-visual-studio-runtime-error "Stackoverflow C visual studio runtime error" -[31ed7150]: http://stackoverflow.com/questions/10079625/c-run-time-check-failure-0-the-value-of-esp-was-not-properly-saved-across-a "Stackoverflow c run time check failure" -[6b2aae43]: mailto:info@nanocosmos.de "Mail to : info@nanocosmos.de" -[8da7b4b5]: http://www.nanocosmos.de "http://www.nanocosmos.de" diff --git a/docs/nanostream/directshow/directshow_rtsp_sink.md b/docs/nanostream/directshow/directshow_rtsp_sink.md deleted file mode 100644 index addd961ae..000000000 --- a/docs/nanostream/directshow/directshow_rtsp_sink.md +++ /dev/null @@ -1,82 +0,0 @@ -## nanocosmos RTSP Sink Filter - -#### Module / Version - -nanocosmos RTSP Sink \\ -nRTSPSink.ax Version 1.1.1.0 - -#### nanocosmos RTSP Sink - - * DirectShow filter for RTSP Streaming - * Supported Architectures: Microsoft DirectShow, Windows XP, Vista, 7, Server - * Supported Formats: H.264 + AAC - -### DirectShow Connectivity - -The input is accepting connections matching the following media types: - * Major types: - * MEDIATYPE_Video - * Subtypes: - * FourCCs: H264, h264 - * Formats: - * FORMAT_MPEG2_VIDEO, - * FORMAT_NONE - - * Major types: - * MEDIATYPE_Audio - * Subtypes: - * MEDIASUBTYPE_AAC, FourCC: 0x000000FF - * Formats: - * FORMAT_WaveFormatEx, - * FORMAT_NONE - -### Configuration - -The filter configuration may be set by using either the property page or the COM Interface IRTSPSink and as declared in header file RTSPWriterOptions.h . The streaming url can be set by using standard DirectShow interface IFileSinkFilter . -```cpp -// Filter GUID -// {2ECDA33B-81FB-4467-96C9-BD53A9ED975F} -DEFINE_GUID(CLSID_NANO_RTSP_WRITER, 0x2ecda33b, 0x81fb, 0x4467, 0x96, 0xc9, 0xbd, 0x53, 0xa9, 0xed, 0x97, 0x5f); - -// Property Page GUID -// {F387B72B-05AA-4016-8EC8-D6DA5DB36D23} -DEFINE_GUID(CLSID_NANO_RTSP_WRITER_PROPPAGE, 0xf387b72b, 0x5aa, 0x4016, 0x8e, 0xc8, 0xd6, 0xda, 0x5d, 0xb3, 0x6d, 0x23); - -// Configuration Interface GUID -// IRTSPSink -// {F79C7B6E-E89E-415e-B3C7-A8E8BFA0278D} -DEFINE_GUID(IID_IRTSPSink, 0xf79c7b6e, 0xe89e, 0x415e, 0xb3, 0xc7, 0xa8, 0xe8, 0xbf, 0xa0, 0x27, 0x8d); -``` - -#### Configuration through DirectShow filter property page - -The filter's property page offers a subset of parameters, containing the most important options. - - - -![RTSP Network Writer Properties](img/directshow_rtsp_writer_properties.png) - -URL format:\\ -rtsp:%%//%%127.0.0.1:8554/streaming\\ -rtsp:%%//%%[ IP:port ]/[ stream name]\\ - -#### Debug-Log Configuration Registry Settings - -Key: HKEY_CURRENT_USER\Software\DebugNano\nRTSPSink.ax - -##### File name - -Sets the output file name. The folder must already exist.\\ -Value name: LogToFile\\ -Value type: REG_SZ / String\\ -Valid values: a valid output file name to enable file logging or an empty string - -##### Logging level - -A higher value increases the amount of logging messages sent, and messages get more detailed. \\ -Value name: TRACE\\ -Value type: REG_DWORD\\ -Valid values: - * 0 - minimal logging - * … - * 9 - maximal logging diff --git a/docs/nanostream/directshow/directshow_rtsp_source.md b/docs/nanostream/directshow/directshow_rtsp_source.md deleted file mode 100644 index 50d3aeb27..000000000 --- a/docs/nanostream/directshow/directshow_rtsp_source.md +++ /dev/null @@ -1,99 +0,0 @@ -## nanocosmos RTSP Source Filter - -#### Module / Version - -nanocosmos RTSP Source \\ -nRTSPSource.ax Version 1.2.1.0 - -#### nanocosmos RTSP Source - -DirectShow filter for RTSP Streaming - * Supported Architectures: Microsoft DirectShow, Windows XP, Vista, 7, Server - * Supported Formats: H.264 + AAC - -#### DirectShow Connectivity - -The output is accepting connections matching the following media types: - - * Major types: - * MEDIATYPE_Video - * Subtypes: - * FourCCs: H264, h264 - * Formats: - * FORMAT_MPEG2_VIDEO, - * FORMAT_NONE - - * Major types: - * MEDIATYPE_Audio - * Subtypes: - * MEDIASUBTYPE_AAC, FourCC: 0x000000FF - * Formats: - * FORMAT_WaveFormatEx, - * FORMAT_NONE - -### Configuration - -The filter configuration may be set by using either the property page or the COM Interface IRTSPSource and as declared in header file RTSPSourceOptions.h . The streaming url can be set by using standard DirectShow interface IFileSourceFilter . - -```cpp -// Filter GUID -// {99709313-5825-42ab-82ED-A7AD88ACBF4A} -DEFINE_GUID(CLSID_NANO_RTSP_SOURCE, 0x99709313, 0x5825, 0x42ab, 0x82, 0xed, 0xa7, 0xad, 0x88, 0xac, 0xbf, 0x4a); - -// Property Page GUID -// {D3BE0AA6-A8E2-45a8-9414-385FFD94B816} -DEFINE_GUID(CLSID_NANO_RTSP_SOURCE_PROPPAGE, 0xd3be0aa6, 0xa8e2, 0x45a8, 0x94, 0x14, 0x38, 0x5f, 0xfd, 0x94, 0xb8, 0x16); - -// Configuration Interface GUID -// IRTSPSource interface -// {C39F308A-D27B-4c17-B01E-469F00248981} -DEFINE_GUID(IID_IRTSPSource, 0xc39f308a, 0xd27b, 0x4c17, 0xb0, 0x1e, 0x46, 0x9f, 0x0, 0x24, 0x89, 0x81); -``` - -#### Buffer statistics can be retrieved using IRTSPSourceBufferStats interface. - -```cpp -// IRTSPSourceBufferStats interface -// {655D499B-C9E0-4134-9DC4-6431FEEB5EB0} -DEFINE_GUID(IID_IRTSPSourceBufferStats, 0x655d499b, 0xc9e0, 0x4134, 0x9d, 0xc4, 0x64, 0x31, 0xfe, 0xeb, 0x5e, 0xb0); -``` - -#### Use standard DirectShow interface ICodecAPI to get/set these parameters: - -```cpp -// ICodecAPI GUID -// get/set receive timeout in seconds -// VARIANT_TYPE: VT_I4, VARIANT::intVal -// default value: 2 -// {33759D2A-3B7D-45ac-A8BF-C2477915C03B} -DEFINE_GUID(PROPID_nanoRTSPSourceConnectionTimeout, 0x33759d2a, 0x3b7d, 0x45ac, 0xa8, 0xbf, 0xc2, 0x47, 0x79, 0x15, 0xc0, 0x3b); -``` - -#### Configuration through DirectShow filter property page - -The filter's property page offers a subset of parameters, containing the most important options. -{{ :nanortsp_netsrcprop.png?nolink |}} -URL format:\\ -rtsp:%%//%%127.0.0.1:8554/streaming\\ -rtsp:%%//%% [ IP:port ]/[ stream name] - -#### Debug-Log Configuration Registry Settings - -Key: HKEY_CURRENT_USER\Software\DebugNano\ nRTSPSource.ax - -##### File name - -Sets the output file name. The folder must already exist.\\ -Value name: LogToFile\\ -Value type: REG_SZ / String\\ -Valid values: a valid output file name to enable file logging or an empty string - -##### Logging level - -A higher value increases the amount of logging messages sent, and messages get more detailed. \\ -Value name: TRACE\\ -Value type: REG_DWORD\\ -Valid values: - * 0 - minimal logging - * … - * 9 - maximal logging diff --git a/docs/nanostream/directshow/directshow_screen_capture_filter.md b/docs/nanostream/directshow/directshow_screen_capture_filter.md deleted file mode 100644 index 9c93f01d6..000000000 --- a/docs/nanostream/directshow/directshow_screen_capture_filter.md +++ /dev/null @@ -1,27 +0,0 @@ -## How to use the Screen Capture DirectShow filter - -### Capture Modes - * Mouse Follow - * Region - * Screen - * Window Handle - -### Screen Capture - Single Window - -It is possible to capture a single window instead of the entire screen. The content of the window is captured even if the window is partially or completely in the background. You need to enter the Window handle or Window class name into the field. - -At the moment there are two modes for capturing a single window: - * Auto Size: adjusts the output size depending on the size of the window to capture, before the directshow graph is started - - ![Auto Size](img/directshow_screen_capture_single_autosize.jpg) - * Fullscreen: the output size is equivalent to the screen size, the window size is not scaled, the window can be resized while the graph is running and one can see the whole window at all times - - ![Fullscreen](img/directshow_screen_capture_single_fullscreen.jpg) - - * Scaling example: if you need to downscale a full screen capture, use the additional "Resize/Scale" functionality in the encoder or add a resizer/scaler filter to the DirectShow filter graph - -### Region Capture - -If the output of the region area seems to be different from the specified region, check if Windows display zoom is enabled: - -![Zoom](img/directshow_screen_capture_region.jpg) diff --git a/docs/nanostream/directshow/directshow_video_mixer.md b/docs/nanostream/directshow/directshow_video_mixer.md deleted file mode 100644 index 8783f1ff8..000000000 --- a/docs/nanostream/directshow/directshow_video_mixer.md +++ /dev/null @@ -1,38 +0,0 @@ -## Video Mixer / Picture-in-Picture - -This document describes the DirectShow filter configuration for the nanocosmos Video Mixer 2. - -See also the [[live_video_encoder_-_overlay_mixing|nanoStream API for the VideoMixer]] -#### Requirements: - - * DirectShow architecture / C++ - * Nanocosmos Video Mixer 2 Filter - -### Picture-in-picture mode for 2 video inputs - -This short C++ example code shows how to configure the Video Mixer to show video 2 in the right top corner of video 1. - -```cpp -// {0ED06AB0-B2F3-421b-BA63-2E591C932802} -static const GUID CLSID_nanoVideoMixer2 = { 0xed06ab0, 0xb2f3, 0x421b, { 0xba, 0x63, 0x2e, 0x59, 0x1c, 0x93, 0x28, 0x2 } }; - -// {2140722A-9F1E-4ac7-8A81-CF77CA6DD683} -static const GUID IID_IVideoPlacement = { 0x2140722a, 0x9f1e, 0x4ac7, { 0x8a, 0x81, 0xcf, 0x77, 0xca, 0x6d, 0xd6, 0x83 } }; - -CComPtr m_pVideoMixer; -m_pVideoMixer.CoCreateInstance(CLSID_nanoVideoMixer2); - -// target area picture-in-picture: right top corner of picture 1 -RECT rcTarget = {m_VideoWidth * 7/10, m_VideoHeight*1/20, -m_VideoWidth * 9/20, m_VideoHeight * 3/10}; - -CComQIPtr api = m_pVideoMixer; -if (api){ - api->SetVideoFrameDuration( (REFERENCE_TIME)(10000000LL / m_VideoFrameRate) ); - api->SetOutputSize(m_VideoWidth, m_VideoHeight); - RECT rc = {0,0, m_VideoWidth, m_VideoHeight}; - api->SetVideoPosition(0, &rc); - api->SetVideoPosition(1, &rcTarget); - return 0; -} -``` diff --git a/docs/nanostream/directshow/directshow_audio_volume.md b/docs/nanostream/directshow/nanostream_directshow_audio_volume.md similarity index 61% rename from docs/nanostream/directshow/directshow_audio_volume.md rename to docs/nanostream/directshow/nanostream_directshow_audio_volume.md index 2c720d813..115cae922 100644 --- a/docs/nanostream/directshow/directshow_audio_volume.md +++ b/docs/nanostream/directshow/nanostream_directshow_audio_volume.md @@ -1,3 +1,9 @@ +--- +id: nanostream_directshow_audio_volume +title: Audio Volume +sidebar_label: Audio Volume +--- + ## Mix to mono The filter is able to mix all channels to a mono channel. @@ -14,4 +20,7 @@ if(pAudioVolMix) ... ``` -> **Note: ** that the option `MixToMono` has to be set before the output pin of the Audio Volume filter is connected to another filter. \ No newline at end of file +> **Note:** +> +> The option `MixToMono` has to be set before the output pin of the Audio Volume filter is connected to another filter. + diff --git a/docs/nanostream/directshow/nanostream_directshow_h264.md b/docs/nanostream/directshow/nanostream_directshow_h264.md new file mode 100644 index 000000000..b60980c66 --- /dev/null +++ b/docs/nanostream/directshow/nanostream_directshow_h264.md @@ -0,0 +1,426 @@ +--- +id: nanostream_directshow_h264 +title: H264 +sidebar_label: H264 +--- + +## AVC/H.264 Video Codec / SDK + +### High Quality and High Performance Video Coding + +nanocosmos AVC/H.264 video codec is a high performance video codec for the latest generation `MPEG-AVC / H.264` video coding standards. It may be licensed by Professional and OEM customers for integration into custom applications. + +### Major Features + + * Most advanced video coding standard `H.264 (MPEG-AVC)` + * Highly optimized software coding with support for latest CPU generations (Multicore / Core i7) + * Wide range of applications from Mobile Phones (3GP), Portable Devices (iPod etc.) up to HDTV + * Full HD `1080i` and `1080p `support + * X-HD support for Custom Applications (Dome Cinema, Projections), up to `2k/4k` (4096 x 4096) + * Support for realtime Full HD 1080 encoding and decoding of `dual channel video` (stereo video / 3d) + * Baseline Profile, Main Profile and HDTV modes supported + * Compatible to `ISO Mp4` and `Flash Media Streaming Server` and `Wowza` + + +### Architecture and Availability + +The Codec is available for Windows platforms based on DirectShow filters. For MacOS and Linux, custom based solutions are available. + + + +### Components + + * AVC/H.264 Video Encoder and Decoder, MP4 splitter and multiplexer + * MPEG audio and AAC audio codecs. + * MP4, 3GP and optionally Quicktime and AVI file format writers + + +### Licensing model + +We offer several licensing models, dependent on customer requirements. + + * Developer License (SDK): With the Developer License, you will get a documented SDK including shared library objects (DLLs), interface specifications, header files and source code samples to develop video coding applications. + * Redistribution License (Royalties): For redistributing video coding modules with your application, a per-item additional royalty license is needed. You may also get flat fees for high sales volumes. Please contact us for further information. + * Customization and flat fees are possible + +### H.264 / AVC Video Encoder + +The Video Encoder produces compatible streams according to `ITU H.264 / ISO MPEG/AVC Reference Model JM9.2`, as well as MP4 file format output. + +Dual channel encoding for stereo video is supported. + +The encoder accepts the following parameters: + * GOP Structure (I-frame distance / P-frame distance) + * Bit rate + * Profile/Level (baseline, main, extended, high) + * Field Structure (Interlaced/Progressive) + * Frame rate (`15`, `24`, `25`, `30`, `50`, `60`) + * chroma_format / aux_format `(monochrome`, `4:2:0`) + * misc. rate controls (fixed quantization, vbr, cbr) + * Motion Estimation method + * full pel, half pel and quarter pel motion vectors + * SVC chroma deblocking filter mode + * transform_8x8_mode + * Frame Size from Mobile to HDTV (`64x64` to `4096x2048`) + +### H.264/AVC Video Decoder + +The decoder supports decoding of files created by `JM9.2` compliant encoders or later, as well as MP4 file format input. The decoder supports baseline, main, extended and high profiles features, including HD, e.g. 1080i. + +### Audio, Multiplexer and File Formats + + * Elementary Files, MP4 file format, 3GP file format, Quicktime + * RTMP streaming for Flash compatible streaming servers + * MPEG audio and AAC formats are available. + +### Other codec types + +Ask for special configurations and custom codec development, e.g. for `IMX`, `DVCPRO-HD XDCAM`. + +----- + + +## nanoAVC/H.264 DirectShow Decoding SDK + +### Introduction + +nanoAVC/H.264 Direct Show Decoding SDK enables you to decode/play back +AVC/H.264 video and AAC audio from MP4/3GP or transport stream (TS) sources +within Windows Media Player and custom applications based on Microsoft DirectShow Framework. + +The nanocosmos H.264/AVC Video Decoder supports streams in baseline, main and high profile. It is highly optimized for use on hyper-threading and multi core systems. + +### Filter components + + * nanocosmos AVC/H.264 Video Decoder + * Module: nh264dec.ax + * CLSID: {264DA7DD-CE74-472D-A2FD-796A1F0A379C} + + + * nanocosmos AAC Audio Decoder + * Module: naacdec.ax + * CLSID: {AEED2B3D-6DA1-4C84-A85D-83547FA90486} + + + * nanocosmos MP4 Stream Splitter + * Module: nmp4splitter.ax + * CLSID: {22F493C4-B51B-4767-BE55-ADFA34D6A205} + + + * nanocosmos MPEG PS/TS Stream Splitter + * Module: nmpegsplitter.ax + * CLSID: {0994D1E8-B697-47DE-B1E3-36D26937D5B4} + + + +![Example playback filtergraph](img/directshow_h264_decoding_filtergraph.png) + +Figure 1. Example playback filtergraph + +### Registering and unregistering components in the DirectShow framework + +In order to use them, filters must be registered in the DirectShow framework. After installation all filters are registered. To re-register or unregister components, execute the RegisterFilters.bat or UnregisterFilters.bat batch files from the SDK/bin folder. + +### Evaluation mode and filter activation + +Filters can be activated by installing a license key to windows registry or programmatically by setting a license key through the software interface of a filter instance. How to set license keys to unlock filters is described in the module's documents. +If filters run in evaluation mode, an overlay logo will be shown on video. + +### Embedding / Customizing nanocosmos technology + +Nanocosmos also offers special OEM and customization service. Dependent on your needs, we may offer different models of licensing or application development. + +----- + + +## nanoAVC/H.264 DirectShow Encoding SDK + +### Introduction + +nanoAVC/H.264 Direct Show Encoding SDK enables you to perform high quality and high performance video coding for the latest generation video and audio coding standards. It is intended to develop video encoding / transcoding applications based on Microsoft(R) DirectX/DirectShow(R) technology. + +### Major Features + + * ISO 14496 Part 10 (MPEG-AVC) / ITU H.264 compliance for many profiles and levels + * Encoding of H.264 video streams in Baseline, Main, Extended and High profile + * Encoding of AAC-LC/LTP/MAIN/HE(aacPlus) audio streams with up to 6 channels + * Encoding of AMR-NB audio streams + * Highly optimized software coding with support for latest CPU technology by Intel and AMD (SSE2/SSE3/SSE4 and Dual-Core/Core-Duo, AMD Athlon64 + * Real-time Encoding from Capture cards is supported + * Wide range of applications from Mobile Phones (3GP), Portable Devices (iPod, iPhone, Sony PSP etc) up to Professional HDTV + * Multiplexer for MP4, MOV and 3GP + + +### Documentation + +The SDK\doc folder contains the following further documents: + + * H.264/AVC Video Decoder + * H.264/AVC Video Encoder + * AAC Audio Encoder + * AMR-NB Audio Encoder + * MP4/3GP Multiplexer + +### Filter components + + * nanocosmos AVC/H.264 Video Encoder + * Module: nh264enc.ax + * CLSID: {A88889A8-3C2A-4A32-8EAA-755D491D02A0} + + + * nanocosmos AAC Audio Encoder + * Module: naacenc.ax + * CLSID: {0296CC21-B78D-416D-846C-45E26CA46A4A} + + + * nanocosmos AMR-NB Audio Encoder + * Module: namrnbenc.ax + * CLSID: {10CAB930-E019-41DF-83B7-60D723706B8F} + + + * nanocosmos MP4 Multiplexer + * Module: nmp4mux.ax + * CLSID: {78D670BF-49B5-4A3B-BB8C-E2A36E688FCF} + + + * nanocosmos File Dump Filter + * Module: nanodump.ax + * CLSID: {DA67A541-8FEA-11D4-A908-00105A6758CF} + + + * nanocosmos AVC/H.264 Video Decoder + * Module: nh264dec.ax + * CLSID: {264DA7DD-CE74-472D-A2FD-796A1F0A379C} + + + * nanocosmos AAC Audio Decoder + * Module: naacdec.ax + * CLSID: {AEED2B3D-6DA1-4C84-A85D-83547FA90486} + + + * nanocosmos MP4 Stream Splitter + * Module: nmp4splitter.ax + * CLSID: {22F493C4-B51B-4767-BE55-ADFA34D6A205} + + + * nanocosmos MPEG PS/TS Stream Splitter + * Module: nmpegsplitter.ax + * CLSID: {0994D1E8-B697-47DE-B1E3-36D26937D5B4} + + + * nanocosmos Color Space Converter + * Module: ncolconv.ax + * CLSID: {E855821E-C055-4C85-B04F-19F65D5D50FD} + + + * nanocosmos MPEG TS Writer + * Module: nanoTsWriter.ax + * CLSID: {2C6E92AB-523E-4C90-8A01-394FC0FC273C} + + +![Example filtergraph](img/directshow_h264_encoding_filtergraph.png) + +Figure 1. Example filtergraph + +### Registering and unregistering components in the DirectShow framework + +In order to use them, filters must be registered in the DirectShow framework. After installation all filters are registered. To re-register or unregister components, execute the `RegisterFilters.bat` or `UnregisterFilters.bat` batch files from the SDK/bin folder. + +### Evaluation mode and filter activation + +Filters can be activated by installing a license key to windows registry or programmatically by setting a license key through the software interface of a filter instance. How to set license keys to unlock filters is described in the module's documents. +If filters run in evaluation mode, an overlay logo will be shown on video. + +### Embedding / Customizing nanoPEG technology + +Nanocosmos also offers special OEM and customization service. Dependent on your needs, we may offer different models of licensing or application development. + +----- + + +## nanocosmos H.264 Video Decoder Filter + +### Module / Version + +nanocosmos H.264/AVC Direct Show Video Decoder Filter\\ +`nh264dec.ax Version 2.5.2.4` + +The nanocosmos H.264/AVC Video Decoder support streams in baseline, main and high profile. It is highly optimized for use on hyper-threading and multi core systems. + +### Connectivity + +The input is accepting connections to splitter filters or combined source/splitter filters matching the following media types: + +Major types: + * MEDIATYPE_Video + +Subtypes: + * FourCCs: + * H264, h264, + * AVC1, avc1, + * X264, x264, + * VSSH, vssh, + * MEDIASUBTYPE_H264: {8D2D71CB-243F-45E3-B2D8-5FD7967EC09B} + +Formats: + * FORMAT_VideoInfo, + * FORMAT_VideoInfo2, + * FORMAT_MPEG2_VIDEO + +The output supports these media types: + +Major types: + * MEDIATYPE_Video + +Subtypes: + * MEDIASUBTYPE_YV12, + * MEDIASUBTYPE_I420, + * MEDIASUBTYPE_IYUV, + * MEDIASUBTYPE_YUY2, + * MEDIASUBTYPE_RGB24, + * MEDIASUBTYPE_RGB32, + * MEDIASUBTYPE_ARGB32, + * MEDIASUBTYPE_RGB565, + +Formats: + * FORMAT_VideoInfo + * FORMAT_VideoInfo2 + +### Filter GUIDs + + +```cpp +//%% Filter GUID +//%% {264DA7DD-CE74-472d-A2FD-796A1F0A379C} +DEFINE_GUID(CLSID_NANO_H264_DECODER, 0x264DA7DD, 0xCE74, 0x472d, 0xA2, 0xFD, 0x79, 0x6A, 0x1F, 0x0A, 0x37, 0x9C); + +//%% Configuration interface ICodecProp +//%% {0F817204-82C8-4c12-884A-F45FB2F33A6E} +DEFINE_GUID(IID_ICodecProp, 0xf817204, 0x82c8, 0x4c12, 0x88, 0x4a, 0xf4, 0x5f, 0xb2, 0xf3, 0x3a, 0x6e); + +//%% ICodecProp: IID_nanoPeg_LicenseString +//%% type: BSTR / Unicode string +//%% Set license string to unlock filter +//%% {1788F0B0-5985-4a19-B7FE-8AAC1BFC14B3} +DEFINE_GUID(IID_nanoPeg_LicenseString, 0x1788f0b0, 0x5985, 0x4a19, 0xb7, 0xfe, 0x8a, 0xac, 0x1b, 0xfc, 0x14, 0xb3); + +``` + +### Setting the license to unlock filter + +The filter can be unlocked either through a license key entry in the windows registry or +by setting the license key through COM interface ICodecProp::SetProperty with the +property **IID_nanoPeg_LicenseString** as first parameter. + +> The second license parameter has to be a wide/unicode string! + +### Decoder Configuration Registry Settings + +The decoder is able to perform an adaptive frame dropping and deblocking depending on the quality / delay messages received from the downstream renderer filter. + +Key: +``` +HKEY_CURRENT_USER\Software\nanocosmos\nh264dec +``` + +#### Frame dropping / skipping mode + +Determines the behaviour in the case of timing / performance problems. + * Value name: `DroppingMode` + * Value type: `REG_DWORD` + * Valid values: + * `0` - no frames are skipped + * `1` - skip non reference frames only (B-frames) + * `2` - skip non intra frames only (P- and B-frames), __default value__ + +#### Deblocking mode + +Determines the deblocking behaviour. + * Value name: `DeblockingMode` + * Value type: `REG_DWORD` + * Valid values: + * `0` - disable deblocking + * `1` - auto, decoder will reduce deblocking temporarily in the case of performance problems, __default value__ + * `2` - always perform full deblocking + * `3` - always perform deblocking on reference frames only + +#### Output color space selection + +Forces the filter to use a desired output color format. If no or no valid value is set, the output color format will be negotiated with the downstream renderer filter (usually YV12). + * Value name: `ForceOutputFourCC` + * Value type: `REG_SZ / String` + * Valid values: + * `YV12`, + * `I420`, + * `IYUV`, + * `YUY2`, + * `RGB32`, + * `RGB24`, + * `RGB565`, + * `ARGB32` + +#### Deinterlacing Mode + +Determines the deinterlacing behaviour. + * Value name: `DeinterlacingMode` + * Value type: `REG_DWORD` + * Valid values: + * `0` - disabled + * `1` - duplicate, __default value__ + * `2` - blend + * `3` - median + * `4` - edge detection + * `5` - median threshold + * `6` - content adaptive vertical temporal + +#### DirectShow Editing Services (DES) Return Mode + +Receive returns HRESULT error values if Deliver fails. Needs to be enabled for DES. + * Value name: `DESReturnMode` + * Value type: `REG_DWORD` + * Valid values: + * `0` - disabled, __default value__ + * `1` - enabled + +#### Threading Mode + +Determines the threading behaviour. Auto detection or number of decoding threads. + * Value name: `DESReturnMode` + * Value type: `REG_DWORD` + * Valid values: + * `0` - auto detect number of `cpus`, `__default value__` + * `1-8` - set number of decoding threads + +#### Output resolution alignment + +Determines the alignment of the output resolution, +to adjust it to multiples of this value. + * Value name: OutputAlignment + * Value type: `REG_DWORD` + * Valid values: + * `1-16`, `__default value:__ 4` + +### Debug-Log Configuration Registry Settings + +Key: +``` +HKEY_CURRENT_USER\Software\DebugNano\nh264dec.ax +``` + +#### File name + +Sets the output file name. The folder must already exist. + * Value name: `LogToFile` + * Value type: `REG_SZ` / `String` + * Valid values: a valid output file name to enable file logging or an empty string + +#### Logging level + +A higher value increases the amount of logging messages sent, and messages get more detailed. + * Value name: `TRACE` + * Value type: `REG_DWORD` + * Valid values: + * `0` - minimal logging + * … + * `9` - maximal logging + diff --git a/docs/nanostream/directshow/nanostream_directshow_mpeg.md b/docs/nanostream/directshow/nanostream_directshow_mpeg.md new file mode 100644 index 000000000..830c48550 --- /dev/null +++ b/docs/nanostream/directshow/nanostream_directshow_mpeg.md @@ -0,0 +1,422 @@ +--- +id: nanostream_directshow_mpeg +title: MPEG +sidebar_label: MPEG +--- + +## nanocosmos MPEG-2 Broadcast DirectShow SDK + +### Introduction + +Nanocosmos MPEG-2 Broadcast DirectShow SDK enables you to perform high quality and high performance video coding for the latest generation video and audio coding standards. It is intended to develop video encoding / transcoding applications based on Microsoft DirectShow technology. + +### Major Features + + * Encoding of MPEG-2 video streams in Main and High profile + * Highly optimized software coding with support for latest CPU technology by Intel and AMD (SSE2/SSE3/SSE4 and Dual-Core/Core-Duo, AMD Athlon64 + * Real-time Encoding from Capture cards is supported + * File Reader for MOV and MXF + * File Writer for MOV and MXF + +### Documentation + +The SDK\doc folder contains further documentation for the following filters: + + * MPEG-2 Video Decoder + * MPEG-2 Video Encoder + * QuickTime Source + * QuickTime Writer + * MXF Reader + * MXF Writer + +> Contact us for additional modules for MPEG Audio Encoding and Multiplexing + +### Filter components + + * nanocosmos MPEG-2 Video Decoder + * Module: nmpeg2dec.ax + * CLSID: {223784F1-4D9F-45A5-8281-8F9AFCABD904} + + * nanocosmos MPEG-2 Video Encoder + * Module: nmpeg2enc.ax + * CLSID: {2327A344-BECC-4F4F-89C6-DABDC5143832} + + * nanocosmos QuickTime Source Filter + * Module: nqtsource.ax + * CLSID: {53718C99-F067-4609-8184-A8A92A241A5A} + + * nanocosmos Quicktime Writer (MPEG2/Broadcast) + * Module: nmp4mux.ax + * CLSID: {C2FB362B-CE6C-4797-BC16-F81976DFEF61} + + * nanocosmos MXF Reader + * Module: nh264dec.ax + * CLSID: {A3462D0F-3BD0-48A2-BD91-A1366CFC35BB} + + * nanocosmos MXF Writer + * Module: nh264dec.ax + * CLSID: {C1C2C181-EBDA-421F-895F-638A4C5F132B} + + * nanocosmos MPEG PS/TS Stream Splitter + * Module: nmpegsplitter.ax + * CLSID: {0994D1E8-B697-47DE-B1E3-36D26937D5B4} + + * nanocosmos File Dump Filter + * Module: nanodump.ax + * CLSID: {DA67A541-8FEA-11D4-A908-00105A6758CF} + +### Registering and unregistering components in the DirectShow framework + +In order to use them, filters must be registered in the DirectShow framework. After +installation all filters are registered. To re-register or unregister components, execute the `RegisterFilters.bat` or `UnregisterFilters.bat` batch files from the SDK/bin folder. + +### Filter activation + +Filters can be activated by installing a license key to windows registry or programmatically by setting a license key through the software interface of a filter instance. How to set license keys to unlock filters is described in the module's documents. + +----- + + +## nanocosmos MPEG-2 HD/SD Video Decoder Filter + +### DirectShow Filter / Module + +nanocosmos MPEG-2 HD/SD Video Decoder\\ +Module Name: `nmpeg2dec.ax` + +### Connectivity + +The input is accepting connections to splitter filters or combined source/splitter filters matching the following media types: + +Major types: + * MEDIATYPE_Video + +Subtypes: + * MEDIASUBTYPE_MPEG2 + +Formats: + * FORMAT_VideoInfo, + * FORMAT_VideoInfo2, + * FORMAT_MPEG2_VIDEO + +The output supports these media types: + +Major types: + * MEDIATYPE_Video + +Subtypes: + * MEDIASUBTYPE_YV12, + * MEDIASUBTYPE_I420, + * MEDIASUBTYPE_IYUV, + * MEDIASUBTYPE_YUY2, + * MEDIASUBTYPE_RGB24, + * MEDIASUBTYPE_RGB32, + * MEDIASUBTYPE_ARGB32, + * MEDIASUBTYPE_RGB565, + +Formats: + * FORMAT_VideoInfo + * FORMAT_VideoInfo2 + +### Filter GUIDs + + +```cpp +// Filter GUID +// {223784F1-4D9F-45a5-8281-8F9AFCABD904} +DEFINE_GUID(CLSID_NANO_MPEG2_DECODER, 0x223784f1, 0x4d9f, 0x45a5, 0x82, 0x81, 0x8f, 0x9a, 0xfc, 0xab, 0xd9, 0x4); + +// Configuration interface ICodecProp +// {0F817204-82C8-4c12-884A-F45FB2F33A6E} +DEFINE_GUID(IID_ICodecProp, 0xf817204, 0x82c8, 0x4c12, 0x88, 0x4a, 0xf4, 0x5f, 0xb2, 0xf3, 0x3a, 0x6e); + +// ICodecProp: IID_nanoPeg_LicenseString +// type: BSTR / Unicode string +// Set license string to unlock filter +// {1788F0B0-5985-4a19-B7FE-8AAC1BFC14B3} +DEFINE_GUID(IID_nanoPeg_LicenseString, 0x1788f0b0, 0x5985, 0x4a19, 0xb7, 0xfe, 0x8a, 0xac, 0x1b, 0xfc, 0x14, 0xb3); +``` + + +### Setting the license to unlock filter + +The filter can be unlocked either through a license key entry in the windows registry or +by setting the license key through COM interface ICodecProp::SetProperty with the +property **IID_nanoPeg_LicenseString** as first parameter. The second license parameter +has to be a wide/unicode string! + +### Decoder Configuration Registry Settings + +Key: +``` +HKEY_CURRENT_USER\Software\nanocosmos\nmpeg2dec +``` + +### Frame dropping / skipping mode + +Determines the behaviour in the case of timing / performance problems. + * Value name: DroppingMode + * Value type: REG_DWORD + * Valid values: + * `0` - `disabled` + * `1` - `enabled`, `__default value__` + +### Output color space selection + +Forces the filter to use a desired output color format. If no or no valid value is set, the output color format will be negotiated with the downstream renderer filter (usually YV12). + * Value name: ForceOutputFourCC + * Value type: `REG_SZ / String` + * Valid values: + * `YV12`, + * `I420`, + * `IYUV`, + * `YUY2`, + * `RGB32`, + * `RGB24`, + * `RGB565`, + * `ARGB32` + +### Deinterlacing Mode + +Determines the deinterlacing behaviour. + * Value name: DeinterlacingMode + * Value type: REG_DWORD + * Valid values: + * `0` - disabled + * `1` - duplicate, __default value__ + * `2` - blend + * `3` - median + * `4` - edge detection + * `5` - median threshold + * `6` - content adaptive vertical temporal + +### DirectShow Editing Services (DES) Return Mode + +Receive returns HRESULT error values if Deliver fails. +Needs to be enabled for DES. + * Value name: `DESReturnMode` + * Value type: `REG_DWORD` + * Valid values: + * `0` - disabled, __default value__ + * `1` - enabled + +### Threading Mode + +Determines the threading behaviour. +Auto detection or number of decoding threads. + * Value name: `DESReturnMode` + * Value type: `REG_DWORD` + * Valid values: + * `0` - auto detect number of cpus, __default value__ + * `1-8` - set number of decoding threads + +### Output resolution alignment + +Determines the alignment of the output resolution, +to adjust it to multiples of this value. + * Value name: `OutputAlignment` + * Value type: `REG_DWORD` + * Valid values: + * `1-16`, __default value:__ 4 + +### Debug-Log Configuration Registry Settings + +Key: +``` +HKEY_CURRENT_USER\Software\DebugNano\nmpeg2dec.ax +``` + +### File name +Sets the output file name. The folder must already exist. + * Value name: `LogToFile` + * Value type: `REG_SZ` / `String` + * Valid values: a valid output file name to enable file logging or an empty string + +### Logging level + +A higher value increases the amount of logging messages sent, and messages get more detailed. + * Value name: `TRACE` + * Value type: `REG_DWORD` + * Valid values: + * `0` - minimal logging + * … + * `9` - maximal logging + +----- + + +## nanocosmos MPEG-2 Video Encoder Filter + +### DirectShow Filter / Module + +nanocosmos MPEG-2 Video Encoder\\ +Module Name: nmpeg2enc.ax + +### DirectShow Connectivity + +The input is accepting connections to video source, capture and decoder filters matching the following media types: + +Major types: + * MEDIATYPE_Video + +Subtypes: + * MEDIASUBTYPE_YV12, + * MEDIASUBTYPE_I420, + * MEDIASUBTYPE_YUY2, + * MEDIASUBTYPE_UYVY, + * MEDIASUBTYPE_HDYC, + * MEDIASUBTYPE_RGB24, + * MEDIASUBTYPE_RGB32, + * MEDIASUBTYPE_ARGB32, + * MEDIASUBTYPE_RGB565, + +Formats: + * FORMAT_VideoInfo + * FORMAT_VideoInfo2 + +The output supports these media types: + +Major types: + * MEDIATYPE_Video + +Subtypes: + * MEDIASUBTYPE_MPEG2_VIDEO, + * MEDIASUBTYPE_mpgv + +Formats: + * FORMAT_MPEG2_VIDEO, + * FORMAT_NONE + +### Configuration + +The encoding configuration may be set by using either the property page or the COM Interface INanoCodecOpts as declared in header file INanoCodecOpts.h . + +```cpp +// Filter GUID +// {2327A344-BECC-4f4f-89C6-DABDC5143832} +DEFINE_GUID(CLSID_NANO_MPEG2_ENCODER, 0x2327a344, 0xbecc, 0x4f4f, 0x89, 0xc6, 0xda, 0xbd, 0xc5, 0x14, 0x38, 0x32); + +// Property Page GUID +// {8A84396A-277A-4835-9EB5-719863194DC9} +DEFINE_GUID(CLSID_NANO_MPEG2_ENCODER_PROPPAGE, 0x8a84396a, 0x277a, 0x4835, 0x9e, 0xb5, 0x71, 0x98, 0x63, 0x19, 0x4d, 0xc9); + +// Configuration Interface GUID +// {698E0F57-B828-4c40-8867-095FF49F77D6} +DEFINE_GUID(IID_INanoCodecOpts, 0x698e0f57, 0xb828, 0x4c40, 0x88, 0x67, 0x9, 0x5f, 0xf4, 0x9f, 0x77, 0xd6); + +// Configuration interface ICodecProp +// {0F817204-82C8-4c12-884A-F45FB2F33A6E} +DEFINE_GUID(IID_ICodecProp, 0xf817204, 0x82c8, 0x4c12, 0x88, 0x4a, 0xf4, 0x5f, 0xb2, 0xf3, 0x3a, 0x6e); + +// ICodecProp: IID_nanoPeg_LicenseString +// type: BSTR / Unicode string +// Set license string to unlock filter +// {1788F0B0-5985-4a19-B7FE-8AAC1BFC14B3} +DEFINE_GUID(IID_nanoPeg_LicenseString, 0x1788f0b0, 0x5985, 0x4a19, 0xb7, 0xfe, 0x8a, 0xac, 0x1b, 0xfc, 0x14, 0xb3); +``` + + +### Setting the license to unlock filter + +The filter can be unlocked either through a license key entry in the windows registry or +by setting the license key through COM interface ICodecProp::SetProperty with the +property **IID_nanoPeg_LicenseString** as first parameter. The second license parameter +has to be a wide/unicode string! + +### Common Encoder Settings + +| Parameter | Default values | Description | +|------------------------------|-----------------------------|---------------------------------| +| profile, level | Main Profile, Main Level | MPEG-2 Profile and Level | +| base_video.bitrate_kb | Profile and Level dependend | Video Bitrate in kBits/second | +| base_video.resolution.width | 0 - use input width | Picture Coding Width | +| base_video.resolution.height | 0 - use input height | Picture Coding Height | +| chroma_format_idc | 0 - I420, 1 - I422 | [0,1] Chroma Format | +| rate_method | 0 - CBR, 1 - VBR | [0,1] Rate Control Mode | +| distance_i | 12 | Intra Frame Distance / GOP len. | +| distance_p | 3 | P Frame Distance | + +### Configuration through INanoCodecOpts interface + + - Version check by calling //GetCodecOptsVersion//// //(optional) + - Instanciating a parameter structure of type //MPDX4_MPEG2EncoderParams// + - Initializing the parameter struct by calling //InitCodecOptions// will set all parameters to default values for the selected profile and level + - Setting custom values for resolution and bitrate + - Applying settings by calling //SetCodecOptions// + +Here a code snippet without error handling to show configuration for IMX 50 format: +```cpp +#include "mpeg2_enc_params.h" + +HRESULT hr = S_OK; + +// Query INanoCodecOpts interface from IBaseFilter interface +// of MPEG-2 Encoder filter +CComQIPtr pNanoCodecOpts = pBaseFilter; + +MPDX4_MPEG2EncoderParams mpeg2EncParams; +memset(&mpeg2EncParams, 0, sizeof(MPDX4_MPEG2EncoderParams)); + +// Set desired profile and level values +mpeg2EncParams.profile = MPDX4_MPEG2_PROFILE_422IMX; +mpeg2EncParams.level = MPDX4_MPEG2_LEVEL_MAIN; + +// Intialize the parameter struct according to profile and level set +hr = pNanoCodecOpts->InitCodecOptions((MPDX4_BaseCodecOpts*) &mpeg2EncParams, INANOCODECOPTS_VERSION); + +// Set custom parameter values +// Bitrate +mpeg2EncParams.base_video.bitrate_kb = 50000; // IMX 50 +// If resize is needed +mpeg2EncParams.base_video.resolution.width = 720; +mpeg2EncParams.base_video.resolution.height = 608; + +// Apply settings and finish configuration +hr = pNanoCodecOpts->SetCodecOptions((MPDX4_BaseCodecOpts*) &mpeg2EncParams, INANOCODECOPTS_VERSION); +``` + +### Configuration through DirectShow filter property page + +The filter's property page offers a subset of encoding parameters, containing the most important options. + +![MPEG-2 Video Encoder Properties](img/directshow_mpeg2_video_enc_prop.png) + +### Debug-Log Configuration Registry Settings + +Key: HKEY_CURRENT_USER\Software\DebugNano\nmpeg2enc.ax + +### File name + +Sets the output file name. The folder must already exist. + * Value name: LogToFile + * Value type: REG_SZ / String + * Valid values: a valid output file name to enable file logging or an empty string + +### Logging level + +A higher value increases the amount of logging messages sent, and messages get more detailed. + * Value name: TRACE + * Value type: REG_DWORD + * Valid values: + * 0 - minimal logging + * … + * 9 - maximal logging + +----- + + +## Configure encoder settings + +Here is a pseudo sample code, showing how to set the bitrate for the encoder -` m_pEncMpegA` is the instance of the mpeg audio encoder: +```cpp +ICodecAPI* encoderInt; +m_pEncMpegA->QueryInterface(IID_ICodecAPI, (void **) &encoderInt); +VARIANT v; +v.vt = VT_INT; +v.intVal = 128000; // 128 kb +encoderInt->SetValue(&PROPID_nanoMPAEBitrate, &vt); +... +encoderInt->Release(); + +``` + diff --git a/docs/nanostream/directshow/nanostream_directshow_quicktime.md b/docs/nanostream/directshow/nanostream_directshow_quicktime.md new file mode 100644 index 000000000..3e28d5510 --- /dev/null +++ b/docs/nanostream/directshow/nanostream_directshow_quicktime.md @@ -0,0 +1,84 @@ +--- +id: nanostream_directshow_quicktime +title: Quicktime IMX Playback +sidebar_label: Quicktime IMX Playback +--- + +## QuickTime IMX Video Playback Components + +**For QuickTime und DirectShow** + +The QuickTime IMX Playback components allow easy playback of QuickTime IMX video files with Windows or MacOS systems. +IMX is also known as `SMPTE D-10` and is based on the MPEG compression technology. + +The Codec Packet contains the following components: + +- QuickTime IMX Source Direct Show Package +- QuickTime IMX Codec for Quicktime Player + +### QuickTime IMX Source Direct Show Package + +The QuickTime IMX Source DirectShow Package allows playback of QuickTime IMX video files with all WindowsMediaPlayer-/DirectShow based applications. Installation of the Quicktime System is not required. +Direct Show Filters include: + +#### File Reader for QuickTime IMX Video Files + +Output Media Types: + +- Majortype: + - Video, +- Sub Type: + - MPEG2_Video +- Majortype: + - Audio: +- Sub Type: + - PCMAudio + +#### IMX Video Decoder Filter + +Formats: + +- MPEG-2 IMX 30 (FourCC: mx3p) +- MPEG-2 IMX 40 (FourCC: mx4p) +- MPEG-2 IMX 50 (FourCC: mx5p) + + + +![Direct Show Example](img/directshow_qt_example.png) + +Direct Show Example + +### QuickTime IMX Decoder for Quicktime Player + +QuickTime IMX Codec Package can be used in all Quicktime based applications, for example QuickTime Player. + +#### Supported input Formats: + +- QuickTime Movie File +- IMX Compression (MPEG-2 IMX 30 (FourCC: mx3p) +- MPEG-2 IMX 40 (FourCC: mx4p) +- MPEG-2 IMX 50 (FourCC: mx5p)) + +#### Supported Decoding Parameters: + +- Bitrates from up to `100 mbps` +- Frame Rates: `23.976`, `24`, `25`, `29.97`, and `30` frames/sec up to `60` fields/sec. + +The Codec is a QuickTime Decoder Component developed by nanocosmos. + +![Quicktime IMX Example](img/directshow_imx_example.png) + +Quicktime IMX Example + + +#### Supported input Formats: + +- QuickTime Movie File + - IMX Compression (MPEG-2 IMX 30 (FourCC: mx3p) + - MPEG-2 IMX 40 (FourCC: 'mx4p') + - MPEG-2 IMX 50 (FourCC: mx5p)) + +#### Supported Decoding Parameters: + +- Bitrates from up to 100 mbps +- Frame Rates: 23.976, 24, 25, 29.97, and 30 frames/sec up to 60 fields/sec. \ No newline at end of file diff --git a/docs/nanostream/directshow/nanostream_directshow_rtmp.md b/docs/nanostream/directshow/nanostream_directshow_rtmp.md new file mode 100644 index 000000000..db5bea851 --- /dev/null +++ b/docs/nanostream/directshow/nanostream_directshow_rtmp.md @@ -0,0 +1,500 @@ +--- +id: nanostream_directshow_rtmp +title: RTMP +sidebar_label: RTMP +--- + +## nanocosmos RTMP Source Filter + +### Introduction + * DirectShow filter for RTMP Downstreaming / Playback + * Supported Architectures: Microsoft DirectShow, Windows XP, Vista, 7, Server + * Supported Formats: H.264 + AAC + MP3 + +### Module Name / Version + +Module: `nRTMPSource.ax` +Version: `1.3.1.1` + +### DirectShow Connectivity + +The output pins are accepting connections matching the following media types: + + * Major types: + * MEDIATYPE_Video + * Subtypes: + * FourCCs: H264, h264 + * Formats: + * FORMAT_MPEG2_VIDEO, + * FORMAT_NONE + * Major types: + * AAC: MEDIATYPE_Audio + * MP3: MEDIATYPE_Audio + * SPEEX: MEDIATYPE Ogg Stream + * Subtypes: + * AAC: MEDIASUBTYPE_AAC, FourCC: 0x000000FF, + * MP3: MEDIASUBTYPE_MP3, FourCC: 0x00000055 + * SPEEX: MEDIASUBTYPE_None + * Formats: + * AAC, MP3: FORMAT_WaveFormatEx, + * SPEEX: FORMAT_Speex + +### Filter GUIDs + +```cpp +// Filter GUID +// {440E11F2-FB35-4699-809B-157C390E9238} +DEFINE_GUID(CLSID_NANO_RTMP_SOURCE, 0x440e11f2, 0xfb35, 0x4699, 0x80, 0x9b, 0x15, 0x7c, 0x39, 0xe, 0x92, 0x38); + +// Property Page GUID +// {7A05E2F3-9258-4952-920A-54F6AE6A0D66} +DEFINE_GUID(CLSID_NANO_RTMP_SOURCE_PROPPAGE, 0x7a05e2f3, 0x9258, 0x4952, 0x92, 0xa, 0x54, 0xf6, 0xae, 0x6a, 0xd, 0x66); +``` + +### Configuration through COM Interface + +The streaming url can be set by using standard DirectShow interface IFileSourceFilter . + +#### URL format + +``` +rtmp:%%//%% [ IP:port ]/[ application name]/[ stream name]/ +``` +> If no port is specified, standard rtmp port `1935` will be used. + +Example: +``` +rtmp:%%//%%127.0.0.1:1935/live/myStream +``` + +Following options can be set by using standard DirectShow interface ICodecAPI. +See DirectShow documentation for usage of ICodecAPI interface. + +#### Connect to nanocosmos decoder filters only + +Value Type: Integer, Variant::intVal, VT_INT\\ +Valid values: yes: 1, no: 0 \\ +GUID: + +```cpp +// {FB5005A0-3231-4171-A218-A3A3431D7790} +DEFINE_GUID(PROPID_nanoSourceConnectToNanoDecodersOnly, 0xfb5005a0, 0x3231, 0x4171, 0xa2, 0x18, 0xa3, 0xa3, 0x43, 0x1d, 0x77, 0x90); +``` + + +#### Buffering delay in milliseconds + +Under low bandwidth conditions a higher value leads to smoother playback. + +Value Type: Integer, Variant::intVal, VT_INT\\ +Valid values: 0...INT32_MAX\\ +GUID: + +```cpp +// {3641DC07-82CD-40b0-9293-DCBE25E0C274} +DEFINE_GUID(PROPID_nanoSourceBufferingDelay, 0x3641dc07, 0x82cd, 0x40b0, 0x92, 0x93, 0xdc, 0xbe, 0x25, 0xe0, 0xc2, 0x74); +``` + +#### Buffering mode + +Use this GUID to configure the buffering mode\\ +Value Type: VT_I4 / VARIANT::intVal, get/set \\ +Valid values: 0 - Fill buffer once on start, 1 - Refill buffer always if empty\\ +Default value: 1\\ + +```cpp +// {AB91A1D9-6701-4133-8733-6EB3A20E9583} +DEFINE_GUID(PROPID_nanoSourceBufferingMode, 0xab91a1d9, 0x6701, 0x4133, 0x87, 0x33, 0x6e, 0xb3, 0xa2, 0xe, 0x95, 0x83); +``` + +#### Receive timeout in milliseconds + +A stream is stopped if no data is present for this amount of time Overrides registry value ReceiveTimeout +Value Type: Integer, Variant::intVal, VT_I4\\ +Valid values: 1000...INT (1-30 seconds), default: 5000 (5 seconds)\\ +GUID: + +```cpp +// {767B756C-A55B-4fd9-88F8-159B338207ED} +DEFINE_GUID(PROPID_nanoRTMPReceiveTimeoutMs, 0x767b756c, 0xa55b, 0x4fd9, 0x88, 0xf8, 0x15, 0x9b, 0x33, 0x82, 0x7, 0xed); +``` + +#### Stream format detection timeout in milliseconds + +The detection is stopped after this amount of time, even if less than 2 streams found Overrides registry value DetectStreamFormatTimeout +Value Type: Integer, Variant::intVal, VT_I4\\ +Valid values: 1000...INT32_MAX, default: 10000 (10 seconds)\\ +GUID: +```cpp +// {7400166F-8140-4b81-8B3E-C97CB7D972DF} +DEFINE_GUID(PROPID_nanoRTMPDetectStreamFormatTimeoutMs, 0x7400166f, 0x8140, 0x4b81, 0x8b, 0x3e, 0xc9, 0x7c, 0xb7, 0xd9, 0x72, 0xdf); +``` + + +#### Configuration through DirectShow filter property page + +![RTMP Source Properties](img/directshow_rtmp_source_properties.png) + + +#### Configuration Registry Settings + +Key: +``` +HKEY_CURRENT_USER\Software\nanocosmos\nRTMPSource +``` + +#### Receive timeout + +A stream is stopped if no data is present for this this amount of time\\ +Value name: DetectStreamFormatTimeout\\ +Value type: REG_DWORD\\ +Valid values: 1 second - 30 seconds, default: 5 seconds + +#### Stream format detection mode + +Determines if stream format settings are detected from the RTMP network stream or from registry preset values below.\\ +Value name: DetectStreamFormatMode\\ +Value type: REG_DWORD\\ +Valid values: 0: Detect from stream (default), 1: Use registry preset\\ + +#### Stream format detection timeout + +Timeout for format detection in seconds\\ +Value name: DetectStreamFormatTimeout\\ +Value type: REG_DWORD\\ +Valid values: 1 second - 30 seconds, default: 10 seconds + +#### Audio Codec + +Sets the audio codec if DetectStreamFormatMode = 1.\\ +Value name: AudioCodec\\ +Value type: REG_DWORD\\ +Valid values: 0: Auto/Default(AAC), 1: AAC, 2: MP3, 3: SPEEX + +#### Audio Channels + +Sets the number of audio channels if DetectStreamFormatMode = 1.\\ +Value name: AudioChannels\\ +Value type: REG_DWORD\\ +Valid values: 0: Auto/Default(Stereo), 1: Mono, 2: Stereo + +#### Audio Bitlength + +Sets the number of bits per audio sample if DetectStreamFormatMode = 1.\\ +Value name: AudioBitlength\\ +Value type: REG_DWORD\\ +Valid values: 0: Auto/Default(16 Bit), 1: 8 Bit, 2: 16 Bit + +#### Audio Samplerate + +Sets the audio samplerate if DetectStreamFormatMode = 1.\\ +Codecs support different sampling rates and have different default values!!!\\ +Value name: AudioRate\\ +Value type: REG_DWORD\\ + +##### Valid values AAC: + * 0: Auto/Default(44100), + * 1: 8000 , + * 2: 11025, + * 3: 12000, + * 4: 16000, + * 5: 22050, + * 6: 24000 + * 7: 32000, + * 8: 44100, + * 9: 48000, + * 10: 64000, + * 11: 88200, + * 12: 96000 + +##### Valid values MP3: + * 0: Auto/Default(44100), + * 1: 5500 , + * 2: 11025, + * 3: 22050, + * 4: 44100 + +##### Valid values SPEEX: + * 0: Auto/Default(16000), + * 1: 8000 , + * 2: 16000, + * 3: 32000, + * 4: 44100 +SPEEX internal sampling is usually 16000 (wideband). +It differs from flash's Microphone::rate value! + + +### Debug-Log Configuration Registry Settings + +Key: +``` +HKEY_CURRENT_USER\Software\DebugNano\nRTMPSource.ax +``` + +#### File name +Sets the output file name. The folder must already exist.\\ +Value name: LogToFile\\ +Value type: REG_SZ / String\\ +Valid values: a valid output file name to enable file logging or an empty string + +#### Logging level + +A higher value increases the amount of logging messages sent, and messages get more detailed. \\ +Value name: TRACE\\ +Value type: REG_DWORD\\ +Valid values: + * 0 - minimal logging + * … + * 9 - maximal logging + +----- + + +## RTMP Network Renderer & Writer + +### Purpose + +Writing RTMP compatible video/audio streams over a network connection + +DirectShow filter for streaming to Wowza and Flash Media Servers + + * Supported Architectures: Microsoft DirectShow, Windows XP, Vista, 7, Server + * Supported Formats: H.264 + AAC + +### Module / Version + +nanocosmos RTMP Network Writer +nRtmpRenderer.ax Version 3.0.3.1 + +### DirectShow Connectivity + +The RTMP Writer is implemented as a "Renderer Filter", which means it only has 2 input pins for compressed video and audio and no output pin.\\ +The input is accepting connections matching the following media types: + + * Pin 1 Media Types: + * MEDIATYPE_Video + * Pin 1 Media Subtypes: + * FourCCs: H264, h264 + * Pin 1 Formats: + * FORMAT_MPEG2_VIDEO, + * FORMAT_NONE + * Pin 2 Major Media Types: + * MEDIATYPE_Audio + * Pin 2 Media Subtypes: + * MEDIASUBTYPE_AAC, FourCC: 0x000000FF + * Pin 2 Formats: + * FORMAT_WaveFormatEx, + * FORMAT_NONE + +### Configuration + +The configuration may be set by using either the property page or the COM-Interface IRTMPOptions as declared in header file RTMPWriterOptions.h. + +```c +// Filter Guids +// {B4FB59C5-983B-4d96-9204-F8B0E46704EE} +DEFINE_GUID(CLSID_NANO_RTMP_WRITER, 0xb4fb59c5, 0x983b, 0x4d96, 0x92, 0x4, 0xf8, 0xb0, 0xe4, 0x67, 0x4, 0xee); + +// Property Page GUID +// {EFC673DE-E20E-4699-8331-9522C5DF7A6D} +DEFINE_GUID(CLSID_NANO_RTMP_WRITER_PROPPAGE, 0xefc673de, 0xe20e, 0x4699, 0x83, 0x31, 0x95, 0x22, 0xc5, 0xdf, 0x7a, 0x6d); + +// Configuration Interface GUID +// IID_IRTMPOptions interface +// {B8AF4593-BE31-449c-8485-3E6D65CBC1FE} +DEFINE_GUID(IID_IRTMPOptions, 0xb8af4593, 0xbe31, 0x449c, 0x84, 0x85, 0x3e, 0x6d, 0x65, 0xcb, 0xc1, 0xfe) +``` + +The streaming url can be set by using standard DirectShow interface IFileSinkFilter . + +### Configuration with DirectShow filter property page + +![RTMP Writer Properties](img/directshow_rtmp_writer_properties.png) + +The filter's property page offers a subset of encoding parameters, containing the most important options. + +URL formatting: + +`rtmp:// [hostname / IP address]/[application]+[stream name]` + +for example: +`rtmp://127.0.0.1/live+myStream` + +with: +IP address: 127.0.0.1 +Application name: live, Stream name: myStream + +### Connection Test + +Connect/Disconnect buttons. Allows to connect before starting the graph and disconnect during the streaming (this stops the running graph). + +### RTMP Authentication +RTMP Authentication expects a user name and a password for unlocking access to the Media Server. +This has been verified with Flash Media Server (3.x and 4) and Wowza Media Server (2.x). +CDNs are supported on a case-by-case basis. +Special tuning as been made for some CDN access +(e.g. Limelight). + +### Automatic Reconnection: + +Attempts to restore network connection after n seconds to the server in case of network interrupts. During the reconnect attempts the graph still playing. 0 means no attempts to reconnect to server. + +### Advanced Configuration Options + +The advanced options should be handled carefully. They can severely affect network and streaming performance. Contact support if you want to fine tune any settings. + +**Buffering:** + +Data Flow: `RTMP multiplexed data` -> `application buffer` -> `socket buffer` -> `network`. + +There are 2 buffer types: + * Socket level buffer +Size of the network socket buffer, much dependent on the underlying network architecture + + * Application level buffer (Output Buffer Size, Output packet size), 0=no buffer +Affects bandwidth utilization, prevents bitrate changes and puts the sending process to a separate thread. + +#### Advanced Settings: + * Live Mode: + * Turns on/off blocking of input pins. (should be off by default) + * TCP No Delay: + * Activates the TCP_NODELAY option for TCP transmission ("Nagle Algorithm") + * Timecode Options: + * Sends Time Code in RTMP Meta Data + * Allow B Frames: + * should be on + * Reduces the buffer/delay in H.264 Main Profile without B Frames. No effect in Baseline Mode. + * Timecode Options: + * send Time Code in RTMP Meta Data + +#### Connection Status Notification + +There are two possibilities to get the status of the connection to the server: + + * Event messages are sent via IMediaEventSink with the event code `EC_NANO_RTMP_WRITER_STATUS` declared in `RTMPWriterOptions.h (#define EC_NANO_RTMP_WRITER_STATUS EC_USER+181)`. A message is sent when the connection state changes. The different states are represented by (also declared in RTMPWriterOptions.h): + * RTMPWriterConnected=0 + * RTMPWriterDisconnected=1 + * RTMPWriterReconnecting=2 + * Using a callback function, which is called when the connection state changes: + * Query for the interface `IRTMPStatusNotify` + * Set the callback function via `SetStatusNotifyHandler()` + +##### Rtmp Writer Filter crashes when using SetStatusNotifyHandler() + +This problem is probably caused by calling a function declared with one calling convention with a function pointer declared with a different calling convention. Here is pretty good explanation of the problem: + * [http://stackoverflow.com/questions/301655/c-visual-studio-runtime-error][59d1de83] + * [http://stackoverflow.com/questions/10079625/c-run-time-check-failure-0-the-value-of-esp-was-not-properly-saved-across-a][31ed7150] + + + +Conclusion: Make sure you use `__stdcall` in your declaration. + +### Log / Debug Configuration Registry Settings + +Key: HKEY_CURRENT_USER\Software\DebugNano\ nRtmpRenderer.ax + +#### File name + * Sets the output file name. The folder must exist. + * Value name: LogToFile + * Value type: REG_SZ / String + * Valid values: a valid output file name to enable file logging or an empty string + +#### Logging level + * A higher value increases the amount of logging messages sent, and messages get more detailed. + * Value name: TRACE + * Value type: REG_DWORD + * Valid values: + * 0 - minimal logging + * … + * 9 - maximal logging + + +http://stackoverflow.com/questions/301655/c-visual-studio-runtime-error "Stackoverflow C visual studio runtime error" +http://stackoverflow.com/questions/10079625/c-run-time-check-failure-0-the-value-of-esp-was-not-properly-saved-across-a "Stackoverflow c run time check failure" + +----- + + +## RTMP DirectShow Events + +RTMP Writer filter provides statistics and information about the current streaming status as DirectShow events. + +All types are declared in `RTMPWriterOptions.h`. +### RTMP Event Codes +```cpp +// EC_USER is defined in Windows SDK\include\evcode.h +// EC_USER 0x8000 + +// RTMP Statistics Event Code +#define EC_NANO_RTMP_WRITER_STATS EC_USER+179 + +// RTMP Status Event Code +#define EC_NANO_RTMP_WRITER_STATUS EC_USER+181 +``` + + +### RTMP Statistics Event Parameters + +```cpp +// RTMP Statistics Event Parameters +// EventCode: (long)EC_NANO_RTMP_WRITER_STATS +// EventParam1: (LONG_PTR)rtmp_writer_stats_t* pStatistics +// EventParam2: (LONG_PTR)(char**)ppRTMPUrl or NULL +// The parameter pointers MUST NOT be deleted or released +``` + +### RTMP Status Event Parameters + +```cpp +// RTMP Status Event Parameters +// EventCode: (long)EC_NANO_RTMP_WRITER_STATUS +// EventParam1: (LONG_PTR)(int*)pRtmpWriterStatus +// EventParam2: (LONG_PTR))(char**)ppRTMPUrl or NULL +// The parameter pointers MUST NOT be deleted or released +``` + +### RTMP Status Values + +```cpp +enum RtmpWriterStatus +{ + RTMPWriterConnected = 0, // RTMP Writer is connected + RTMPWriterDisconnected = 1, // RTMP Writer is disconnected + RTMPWriterReconnecting = 2 // RTMP Writer is trying to reconnect +}; +``` + + +### RTMP Statistics Data Structure + +```cpp +struct rtmp_writer_stats_t +{ + int output_buffer_size; // Available buffer size in bytes + int output_buffer_fillness; // Current buffer fillness in bytes + + __int64 output_bitrate; // Data rate sent through network in bits/s + __int64 output_bitrate2; // Deprecated - works only with Windows XP + __int64 output_bitrate3; // Deprecated - works only with Windows XP + + DWORD packetsRtt; // Deprecated - works only with Windows XP + unsigned int clientBytesReceived; // Experimental - Bytes received / + // acknowledged by client + + size_t audio_packets_buffered; // Number of audio packets/frames buffered + size_t video_packets_buffered; // Number of video packets/frames buffered + + int audio_bitrate; // Input audio bitrate in bits/s + int video_bitrate; // Input video bitrate in bits/s + + int audio_packets_sent; // Number of audio packets/frames sent + int video_packets_sent; // Number of video packets/frames sent +}; +``` + + +#### Contact +Please contact us [here](mailto:info@nanocosmos.de) for further information, extended services are available upon request. + + +(c) 2009-2012, nanocosmos gmbh \ No newline at end of file diff --git a/docs/nanostream/directshow/nanostream_directshow_rtsp.md b/docs/nanostream/directshow/nanostream_directshow_rtsp.md new file mode 100644 index 000000000..4220af785 --- /dev/null +++ b/docs/nanostream/directshow/nanostream_directshow_rtsp.md @@ -0,0 +1,207 @@ +--- +id: nanostream_directshow_rtsp +title: RTSP +sidebar_label: RTSP +--- + +## nanocosmos RTSP Sink Filter + +#### Module / Version + +nanocosmos RTSP Sink +nRTSPSink.ax Version 1.1.1.0 + +#### nanocosmos RTSP Sink + + * DirectShow filter for RTSP Streaming + * Supported Architectures: Microsoft DirectShow, Windows XP, Vista, 7, Server + * Supported Formats: H.264 + AAC + +### DirectShow Connectivity + +The input is accepting connections matching the following media types: + * Major types: + * MEDIATYPE_Video + * Subtypes: + * FourCCs: H264, h264 + * Formats: + * FORMAT_MPEG2_VIDEO, + * FORMAT_NONE + + * Major types: + * MEDIATYPE_Audio + * Subtypes: + * MEDIASUBTYPE_AAC, FourCC: 0x000000FF + * Formats: + * FORMAT_WaveFormatEx, + * FORMAT_NONE + +### Configuration + +The filter configuration may be set by using either the property page or the COM Interface IRTSPSink and as declared in header file RTSPWriterOptions.h . The streaming url can be set by using standard DirectShow interface IFileSinkFilter . +```cpp +// Filter GUID +// {2ECDA33B-81FB-4467-96C9-BD53A9ED975F} +DEFINE_GUID(CLSID_NANO_RTSP_WRITER, 0x2ecda33b, 0x81fb, 0x4467, 0x96, 0xc9, 0xbd, 0x53, 0xa9, 0xed, 0x97, 0x5f); + +// Property Page GUID +// {F387B72B-05AA-4016-8EC8-D6DA5DB36D23} +DEFINE_GUID(CLSID_NANO_RTSP_WRITER_PROPPAGE, 0xf387b72b, 0x5aa, 0x4016, 0x8e, 0xc8, 0xd6, 0xda, 0x5d, 0xb3, 0x6d, 0x23); + +// Configuration Interface GUID +// IRTSPSink +// {F79C7B6E-E89E-415e-B3C7-A8E8BFA0278D} +DEFINE_GUID(IID_IRTSPSink, 0xf79c7b6e, 0xe89e, 0x415e, 0xb3, 0xc7, 0xa8, 0xe8, 0xbf, 0xa0, 0x27, 0x8d); +``` + +#### Configuration through DirectShow filter property page + +The filter's property page offers a subset of parameters, containing the most important options. + + + +![RTSP Network Writer Properties](img/directshow_rtsp_writer_properties.png) + +URL format: +``` +rtsp:%%//%%127.0.0.1:8554/streaming +``` +``` +rtsp:%%//%%[ IP:port ]/[ stream name] +``` + +#### Debug-Log Configuration Registry Settings + +Key: +``` +HKEY_CURRENT_USER\Software\DebugNano\nRTSPSink.ax +``` + +##### File name + +Sets the output file name. The folder must already exist. +Value name: LogToFile +Value type: REG_SZ / String +Valid values: a valid output file name to enable file logging or an empty string + +##### Logging level + +A higher value increases the amount of logging messages sent, and messages get more detailed. +Value name: TRACE +Value type: REG_DWORD +Valid values: + + * 0 - minimal logging + * … + * 9 - maximal logging + +----- + + +## nanocosmos RTSP Source Filter + +#### Module / Version + +nanocosmos RTSP Source +nRTSPSource.ax Version 1.2.1.0 + +#### nanocosmos RTSP Source + +DirectShow filter for RTSP Streaming + * Supported Architectures: Microsoft DirectShow, Windows XP, Vista, 7, Server + * Supported Formats: H.264 + AAC + +#### DirectShow Connectivity + +The output is accepting connections matching the following media types: + + * Major types: + * MEDIATYPE_Video + * Subtypes: + * FourCCs: H264, h264 + * Formats: + * FORMAT_MPEG2_VIDEO, + * FORMAT_NONE + + * Major types: + * MEDIATYPE_Audio + * Subtypes: + * MEDIASUBTYPE_AAC, FourCC: 0x000000FF + * Formats: + * FORMAT_WaveFormatEx, + * FORMAT_NONE + +### Configuration + +The filter configuration may be set by using either the property page or the COM Interface IRTSPSource and as declared in header file RTSPSourceOptions.h . The streaming url can be set by using standard DirectShow interface IFileSourceFilter . + +```cpp +// Filter GUID +// {99709313-5825-42ab-82ED-A7AD88ACBF4A} +DEFINE_GUID(CLSID_NANO_RTSP_SOURCE, 0x99709313, 0x5825, 0x42ab, 0x82, 0xed, 0xa7, 0xad, 0x88, 0xac, 0xbf, 0x4a); + +// Property Page GUID +// {D3BE0AA6-A8E2-45a8-9414-385FFD94B816} +DEFINE_GUID(CLSID_NANO_RTSP_SOURCE_PROPPAGE, 0xd3be0aa6, 0xa8e2, 0x45a8, 0x94, 0x14, 0x38, 0x5f, 0xfd, 0x94, 0xb8, 0x16); + +// Configuration Interface GUID +// IRTSPSource interface +// {C39F308A-D27B-4c17-B01E-469F00248981} +DEFINE_GUID(IID_IRTSPSource, 0xc39f308a, 0xd27b, 0x4c17, 0xb0, 0x1e, 0x46, 0x9f, 0x0, 0x24, 0x89, 0x81); +``` + +#### Buffer statistics can be retrieved using IRTSPSourceBufferStats interface. + +```cpp +// IRTSPSourceBufferStats interface +// {655D499B-C9E0-4134-9DC4-6431FEEB5EB0} +DEFINE_GUID(IID_IRTSPSourceBufferStats, 0x655d499b, 0xc9e0, 0x4134, 0x9d, 0xc4, 0x64, 0x31, 0xfe, 0xeb, 0x5e, 0xb0); +``` + +#### Use standard DirectShow interface ICodecAPI to get/set these parameters: + +```cpp +// ICodecAPI GUID +// get/set receive timeout in seconds +// VARIANT_TYPE: VT_I4, VARIANT::intVal +// default value: 2 +// {33759D2A-3B7D-45ac-A8BF-C2477915C03B} +DEFINE_GUID(PROPID_nanoRTSPSourceConnectionTimeout, 0x33759d2a, 0x3b7d, 0x45ac, 0xa8, 0xbf, 0xc2, 0x47, 0x79, 0x15, 0xc0, 0x3b); +``` + +#### Configuration through DirectShow filter property page + +The filter's property page offers a subset of parameters, containing the most important options. +{{ :nanortsp_netsrcprop.png?nolink |}} +URL format: +``` +rtsp:%%//%%127.0.0.1:8554/streaming +``` +``` +rtsp:%%//%% [ IP:port ]/[ stream name] +``` + +#### Debug-Log Configuration Registry Settings + +Key: +``` +HKEY_CURRENT_USER\Software\DebugNano\ nRTSPSource.ax +``` + +##### File name + +Sets the output file name. The folder must already exist. +Value name: LogToFile +Value type: REG_SZ / String +Valid values: a valid output file name to enable file logging or an empty string + +##### Logging level + +A higher value increases the amount of logging messages sent, and messages get more detailed. +Value name: TRACE +Value type: REG_DWORD +Valid values: + + * 0 - minimal logging + * … + * 9 - maximal logging \ No newline at end of file diff --git a/docs/nanostream/directshow/directshow_udp_ts_streaming.md b/docs/nanostream/directshow/nanostream_directshow_udp_streaming.md similarity index 74% rename from docs/nanostream/directshow/directshow_udp_ts_streaming.md rename to docs/nanostream/directshow/nanostream_directshow_udp_streaming.md index 73be06098..08ec9708b 100644 --- a/docs/nanostream/directshow/directshow_udp_ts_streaming.md +++ b/docs/nanostream/directshow/nanostream_directshow_udp_streaming.md @@ -1,6 +1,12 @@ +--- +id: nanostream_directshow_udp_streaming +title: UDP/TS Streaming +sidebar_label: UDP/TS Streaming +--- + ## nanocosmos UDP/TS Network Writer and Reader Filter -#### Introduction +### Introduction DirectShow filters for UDP/TS Streaming * Supported Architectures: Microsoft DirectShow, Vista, 7, 8, 10, Server * Supported Protocols: UDP Unicast and Multicast @@ -9,31 +15,31 @@ DirectShow filters for UDP/TS Streaming * Supported Payload: MPEG Transport Stream (A/V Interleaved) or Video Elementary Stream (Video only) -#### Modules +### Modules -UDP Network Source Filter: nanoNetSource.ax \\ -UDP Network Writer Filter: nanoNetSink.ax \\ +UDP Network Source Filter: `nanoNetSource.ax` +UDP Network Writer Filter: `nanoNetSink.ax` -#### DirectShow Connectivity +### DirectShow Connectivity The DirectShow pins are accepting connections matching the following media types: - Video Major Types: - MEDIATYPE_Video - Subtypes: - H.264: MEDIASUBTYPE_H264, FourCC: 0x34363248 - H.264: MEDIASUBTYPE_h264, FourCC: 0x34363268 - MPEG-2: MEDIASUBTYPE_MPEG2_VIDEO - Formats: - FORMAT_MPEG2_VIDEO + Video Major Types: + MEDIATYPE_Video + Subtypes: + H.264: MEDIASUBTYPE_H264, FourCC: 0x34363248 + H.264: MEDIASUBTYPE_h264, FourCC: 0x34363268 + MPEG-2: MEDIASUBTYPE_MPEG2_VIDEO + Formats: + FORMAT_MPEG2_VIDEO FORMAT_NONE - Audio Major Types: - MEDIATYPE_Audio - Subtypes: - AAC: MEDIASUBTYPE_AAC, FourCC: 0x000000FF - MPEG-1 Audio: MEDIASUBTYPE_MPEG1AudioPayload - MPEG-2 Audio: MEDIASUBTYPE_MPEG2_AUDIO + Audio Major Types: + MEDIATYPE_Audio + Subtypes: + AAC: MEDIASUBTYPE_AAC, FourCC: 0x000000FF + MPEG-1 Audio: MEDIASUBTYPE_MPEG1AudioPayload + MPEG-2 Audio: MEDIASUBTYPE_MPEG2_AUDIO Formats: AAC, MPEG Audio: FORMAT_WaveFormatEx @@ -45,7 +51,7 @@ The DirectShow pins are accepting connections matching the following media types **Interface**: Desired network interface or Any -**Address**: Local IP address or 0.0.0.0 +**Address**: Local IP address or `0.0.0.0` **Port**: Network port number @@ -111,24 +117,24 @@ Network Writer Filter: ##### Setting up the stream URL -The streaming url can be set by using standard DirectShow interfaces //**IFileSourceFilter**// (Reader) and //**IFileSinkFilter**// (Writer) -or the custom interfaces //**INetSource**// (Reader) and //**INetSink**// (Writer). +The streaming url can be set by using standard DirectShow interfaces **IFileSourceFilter** (Reader) and **IFileSinkFilter** (Writer) +or the custom interfaces **INetSource** (Reader) and **INetSink** (Writer). -URL Format: udp:%%//%% [ hostnameorIP:port ]\\ +URL Format: `udp:%%//%% [ hostnameorIP:port ]` Examples: -Given two machines with different IP addresses, the sender 192.168.1.51 and the receiver 192.168.1.52. +Given two machines with different IP addresses, the sender `192.168.1.51` and the receiver `192.168.1.52` For a **UDP unicast** stream the Network Writer needs to be set up -to the destination IP address of the receiver, udp:%%//%%192.168.1.52:1234. +to the destination IP address of the receiver, `udp:%%//%%192.168.1.52:1234`. On the receiver side the Network Source is set up to the local IP address, -udp:%%//%%192.168.1.52:1234 or udp:%%//%%0.0.0.0:1234. +`udp:%%//%%192.168.1.52:1234` or `udp:%%//%%0.0.0.0:1234`. -For a **UDP multicast** stream the sender and receiver are set up to the same multicast address, e.g. udp:%%//%%225.0.0.40:1234. +For a **UDP multicast** stream the sender and receiver are set up to the same multicast address, e.g. `udp:%%//%%225.0.0.40:1234`. ##### Setting the license to unlock the filter -The filter can be unlocked either through a license key entry in the windows registry or by setting the license key through COM interface ICodecProp::SetProperty with the property IID_nanoPeg_LicenseString as first parameter. The second license parameter has to be a wide/unicode string! +The filter can be unlocked either through a license key entry in the windows registry or by setting the license key through COM interface `ICodecProp::SetProperty` with the property `IID_nanoPeg_LicenseString` as first parameter. The second license parameter has to be a wide/unicode string! ```cpp #include "ICodecProp.h" // ICodecProp interface @@ -152,7 +158,7 @@ else ##### INetSource and INetSink Interfaces -The INetSource and INetSink interfaces provide additional functions for getting and setting configuration properties like network interface, hostname, port, operational mode (Transport Stream or Elementary Stream) and the current streaming state. +The `INetSource` and `INetSink` interfaces provide additional functions for getting and setting configuration properties like network interface, hostname, port, operational mode (Transport Stream or Elementary Stream) and the current streaming state. ```cpp // Interface declared in NetSourceOptions.h @@ -199,8 +205,8 @@ interface INetSink : public IUnknown Timeout settings can be configured through the standard DirectShow COM interface ICodecAPI or in the Windows Registry. -1. **Load Timeout** in ms -The load timeout leads to loading being aborted after the configured timespan if no stream input was received during IFileSourceFilter::Load. +1. **Load Timeout** in ms + The load timeout leads to loading being aborted after the configured timespan if no stream input was received during `IFileSourceFilter::Load`. ```cpp Registry Key: HKCU\SOFTWARE\nanocosmos\nNetSource @@ -217,7 +223,7 @@ DEFINE_GUID(PROPID_nanoNSTimeoutLoad, 0xcdc0c5af, 0x1666, 0x4b46, 0x8c, 0x7a, 0x48, 0xef, 0xf1, 0xc7, 0xe9, 0x65); ``` -2. **Input Timeout** in ms +2. **Input Timeout** in ms The input timeout leads to the filtergraph being stopped if no stream input was received for the configured time, e.g. because the stream was stopped at the sender. ```cpp @@ -235,7 +241,7 @@ DEFINE_GUID(PROPID_nanoNSTimeoutInput, 0x454b2e50, 0xc50f, 0x41f6, 0xbf, 0x96, 0xbf, 0x84, 0x1, 0x67, 0x80, 0xc6); ``` -3. **Output Timeout** in ms +3. **Output Timeout** in ms The output timeout leads to the filtergraph being stopped if no MediaSamples were delivered for the configured time. @@ -257,14 +263,14 @@ DEFINE_GUID(PROPID_nanoNSTimeoutOutput, #### Network Source Filter File Dump Settings -The file dump allows to record the udp input stream to a file. -It is intended to be used for diagnosis purposes only. -It is supported for a single Network Source Filter instance only. -Settings can be configured through the Windows Registry. -Registry settings are loaded at creation time of an instance. +The file dump allows to record the udp input stream to a file. +It is intended to be used for diagnosis purposes only. +It is supported for a single Network Source Filter instance only. +Settings can be configured through the Windows Registry. +Registry settings are loaded at creation time of an instance. The file dump is started and stopped when the filtergraph is started and stopped. -1. **Enable File Dump** +1. **Enable File Dump** Enable/disable dump file writing ```cpp @@ -275,8 +281,8 @@ Valid Values: 0 - disable, 1 - enable Default Value: 0 - disable ``` -2. **Dump File Name** -Full file path to the output file. +2. **Dump File Name** +Full file path to the output file. The destination folder must already exist. ```cpp @@ -290,22 +296,27 @@ Valid Values: A valid output file name ##### Keys: - HKEY_CURRENT_USER\Software\DebugNano\nanoNetSource.ax - HKEY_CURRENT_USER\Software\DebugNano\nanoNetSink.ax +``` +HKEY_CURRENT_USER\Software\DebugNano\nanoNetSource.ax +``` +``` +HKEY_CURRENT_USER\Software\DebugNano\nanoNetSink.ax +``` ##### File name -Sets the output file name. The folder must already exist.\\ -Value name: LogToFile\\ -Value type: REG_SZ / String\\ +Sets the output file name. The folder must already exist. +Value name: LogToFile +Value type: REG_SZ / String Valid values: a valid output file name to enable file logging or an empty string ##### Logging level -A higher value increases the amount of logging messages sent, and messages get more detailed. \\ -Value name: TRACE\\ -Value type: REG_DWORD\\ +A higher value increases the amount of logging messages sent, and messages get more detailed. +Value name: TRACE +Value type: REG_DWORD Valid values: + * 0 - minimal logging * … - * 9 - maximal logging + * 9 - maximal logging \ No newline at end of file diff --git a/docs/nanostream/directshow/directshow_overlay_mixing.md b/docs/nanostream/directshow/nanostream_directshow_video_filter.md similarity index 66% rename from docs/nanostream/directshow/directshow_overlay_mixing.md rename to docs/nanostream/directshow/nanostream_directshow_video_filter.md index 32b69183f..ee1ac0019 100644 --- a/docs/nanostream/directshow/directshow_overlay_mixing.md +++ b/docs/nanostream/directshow/nanostream_directshow_video_filter.md @@ -1,3 +1,82 @@ +--- +id: nanostream_directshow_video_filter +title: Video Filter +sidebar_label: Video Filter +--- + +## How to use the Screen Capture DirectShow filter + +### Capture Modes + * Mouse Follow + * Region + * Screen + * Window Handle + +### Screen Capture - Single Window + +It is possible to capture a single window instead of the entire screen. The content of the window is captured even if the window is partially or completely in the background. You need to enter the Window handle or Window class name into the field. + +At the moment there are two modes for capturing a single window: + * Auto Size: adjusts the output size depending on the size of the window to capture, before the directshow graph is started + + ![Auto Size](img/directshow_screen_capture_single_autosize.jpg) + * Fullscreen: the output size is equivalent to the screen size, the window size is not scaled, the window can be resized while the graph is running and one can see the whole window at all times + + ![Fullscreen](img/directshow_screen_capture_single_fullscreen.jpg) + + * Scaling example: if you need to downscale a full screen capture, use the additional `Resize/Scale` functionality in the encoder or add a resizer/scaler filter to the DirectShow filter graph + +### Region Capture + +If the output of the region area seems to be different from the specified region, check if Windows display zoom is enabled: + +![Zoom](img/directshow_screen_capture_region.jpg) + +----- + + +## Video Mixer / Picture-in-Picture + +This document describes the DirectShow filter configuration for the nanocosmos Video Mixer 2. + +See also the nanoStream API for the VideoMixer. +#### Requirements: + + * DirectShow architecture / C++ + * Nanocosmos Video Mixer 2 Filter + +### Picture-in-picture mode for 2 video inputs + +This short C++ example code shows how to configure the Video Mixer to show video 2 in the right top corner of video 1. + +```cpp +// {0ED06AB0-B2F3-421b-BA63-2E591C932802} +static const GUID CLSID_nanoVideoMixer2 = { 0xed06ab0, 0xb2f3, 0x421b, { 0xba, 0x63, 0x2e, 0x59, 0x1c, 0x93, 0x28, 0x2 } }; + +// {2140722A-9F1E-4ac7-8A81-CF77CA6DD683} +static const GUID IID_IVideoPlacement = { 0x2140722a, 0x9f1e, 0x4ac7, { 0x8a, 0x81, 0xcf, 0x77, 0xca, 0x6d, 0xd6, 0x83 } }; + +CComPtr m_pVideoMixer; +m_pVideoMixer.CoCreateInstance(CLSID_nanoVideoMixer2); + +// target area picture-in-picture: right top corner of picture 1 +RECT rcTarget = {m_VideoWidth * 7/10, m_VideoHeight*1/20, +m_VideoWidth * 9/20, m_VideoHeight * 3/10}; + +CComQIPtr api = m_pVideoMixer; +if (api){ + api->SetVideoFrameDuration( (REFERENCE_TIME)(10000000LL / m_VideoFrameRate) ); + api->SetOutputSize(m_VideoWidth, m_VideoHeight); + RECT rc = {0,0, m_VideoWidth, m_VideoHeight}; + api->SetVideoPosition(0, &rc); + api->SetVideoPosition(1, &rcTarget); + return 0; +} +``` + +----- + + ## nanocosmos Video Mixer / Overlay ### General Information @@ -141,5 +220,4 @@ if(m_pPicOverlay) { } ``` - -If the alpha values of a png picture should be used **item.use_image_alpha** has to be set to true. +> If the alpha values of a png picture should be used **item.use_image_alpha** has to be set to true. \ No newline at end of file diff --git a/docs/nanostream/ios/ios-quick-start.md b/docs/nanostream/ios/nanostream_ios_quick_start.md similarity index 70% rename from docs/nanostream/ios/ios-quick-start.md rename to docs/nanostream/ios/nanostream_ios_quick_start.md index e28c92b7f..bc563949b 100644 --- a/docs/nanostream/ios/ios-quick-start.md +++ b/docs/nanostream/ios/nanostream_ios_quick_start.md @@ -1,16 +1,23 @@ -Copied from : [https://www.nanocosmos.de/wiki/nanostream-sdk-for-ios-developer-quickstart/][8ffbac7a] +--- +id: nanostream_ios_quick_start +title: Developer Quickstart +sidebar_label: Developer Quickstart +--- + +## Purpose +This documentation is about the [nanoStream Live Video Streaming](http://www.nanocosmos.de/v4/en/products/live_video_streaming.html) SDK for iOS and can be used by software developers to integrate nanoStream Live Video Encoding into custom apps. -# NANOSTREAM SDK FOR IOS – DEVELOPER QUICKSTART -(c) 2017-2018 nanocosmos gmbh, http://www.nanocosmos.de -## Purpose -This documentation is about the [nanoStream Live Video Streaming][870448de] SDK for iOS and can be used by software developers to integrate nanoStream Live Video Encoding into custom apps. ## Requirements -* Apple Mac with MacOS 10.9 or higher with XCode 6 or higher + +* Apple Mac with MacOS 10.9 or higher with `XCode` 6 or higher * Apple iPhone with iOS 7 or later (min. iOS 8.1 recommended) + + ## Check library version + ```objc int version = [nanostreamAVC getVersion]; if(version!=NANOSTREAM_AVC_VERSION) @@ -38,7 +45,10 @@ nanostreamAVCSettings *nAVCSettings = [[nanostreamAVCSettings alloc] init]; [nAVCSettings setAudioMonoStereo: Stereo]; [nAVCSettings setAudioSamplerate: 44100.0f]; ``` + + ## Initialize the nanoStream module + ```objc // nAVC and previewView are properties of the controller class in this example self.nAVC = [[nanostreamAVC alloc] initWithSettings: nAVCSettings @@ -48,10 +58,11 @@ self.nAVC = [[nanostreamAVC alloc] initWithSettings: nAVCSettings // set the license key (required for streaming) [self.nanostream setLicense: @"nlic:1.2:LiveEnc:1.1:LvApp=1.....288"]; ``` + + ## Start a stream + ```objc // Start broadcast asynchronously with completion handler [self.nAVC start:^(bool success) -``` -[870448de]: http://www.nanocosmos.de/v4/en/products/live_video_streaming.html "nanoStream Live Video Streaming" -[8ffbac7a]: https://www.nanocosmos.de/wiki/nanostream-sdk-for-ios-developer-quickstart/ "https://www.nanocosmos.de/wiki/nanostream-sdk-for-ios-developer-quickstart/" +``` \ No newline at end of file diff --git a/docs/nanostream/ios/nanostream-ios-sdk.md b/docs/nanostream/ios/nanostream_ios_sdk.md similarity index 66% rename from docs/nanostream/ios/nanostream-ios-sdk.md rename to docs/nanostream/ios/nanostream_ios_sdk.md index bc5c58ab6..20ca6c760 100644 --- a/docs/nanostream/ios/nanostream-ios-sdk.md +++ b/docs/nanostream/ios/nanostream_ios_sdk.md @@ -1,5 +1,5 @@ --- -id: nanostream-ios-sdk +id: nanostream_ios_sdk title: SDK for iOS sidebar_label: SDK for iOS --- @@ -8,73 +8,37 @@ sidebar_label: SDK for iOS This documentation is about the nanoStream Live Video Streaming SDK for iOS and can be used by software developers to integrate nanoStream Live Video Encoding into custom apps. -## Contents - -- [nanoStream SDK for iOS - Developer Manual](#nanostream-sdk-for-ios---developer-manual) - * [Purpose](#purpose) - * [Requirements](#requirements) - * [Getting Started](#getting-started) - + [Preparation](#preparation) - + [Check library version](#check-library-version) - + [Initialize the library](#initialize-the-library) - + [Start a stream](#start-a-stream) - + [Stop a running stream](#stop-a-running-stream) - * [Live Playback](#live-playback) - + [Initialize the library for playback](#initialize-the-library-for-playback) - + [Start playback](#start-playback) - * [Advanced Settings/Usage](#advanced-settings-usage) - + [Switch Camera](#switch-camera) - + [Orientation](#orientation) - + [Stream Type](#stream-type) - + [Server Authentication](#server-authentication) - + [Cropping](#cropping) - + [Local Recording](#local-recording) - + [Adaptive Bitrate](#adaptive-bitrate) - + [Statistics during streaming](#statistics-during-streaming) - + [Measuring the available bandwidth](#measuring-the-available-bandwidth) - + [Snaphot from the current stream](#snaphot-from-the-current-stream) - + [Overlay/Watermark](#overlay-watermark) - + [initWithSession](#initwithsession) - * [Specific use cases](#specific-use-cases) - + [Stream from a GoPro](#stream-from-a-gopro) - + [Stream from a Drone](#stream-from-a-drone) - * [Possible Issues](#possible-issues) - + [General](#general) - + [Compiler/Linker](#compiler-linker) - - [libstdc++](#libstdc--) - - [Undefined Symbols for Parrot & DJI](#undefined-symbols-for-parrot---dji) - - [Duplicate Symbols](#duplicate-symbols) - + [Breakpoints](#breakpoints) - + [Crashes](#crashes) - - [CALayerGetDelegate / CALayerGetSuperlayer / Other CALayer](#calayergetdelegate---calayergetsuperlayer---other-calayer) - * [Logging Information](#logging-information) - * [Crash Logs](#crash-logs) - + + ## Requirements - Apple Mac with MacOS 10.9 with XCode 6 or higher - Apple iPhone with iOS 7 or later (min. iOS 8.1 recommended) + + ## Getting Started ### Preparation -Add the library "libnanostreamAVC.a" as dependency (Link Binary With Libraries) to your project. +Add the library **`libnanostreamAVC.a`** as dependency (Link Binary With Libraries) to your project. Further required dependencies: -* libc++.dylib -* libstdc++.dylib -* AVFoundation.framework -* Accelerate.framework -* CoreGraphics.framework -* CoreMedia.framework -* CoreVideo.framework -* Foundation.framework -* SystemConfiguration.framework -* VideoToolbox.framework (link as Optional, not as Required) -* AudioToolbox.framework +* `libc++.dylib` +* `libstdc++.dylib` +* `AVFoundation.framework` +* `Accelerate.framework` +* `CoreGraphics.framework` +* `CoreMedia.framework` +* `CoreVideo.framework` +* `Foundation.framework` +* `SystemConfiguration.framework` +* `VideoToolbox.framework` (link as Optional, not as Required) +* `AudioToolbox.framework` + +Include the header `libnanostreamAVC.h` in your source code. + -Include the header "libnanostreamAVC.h" in your source code. ### Check library version @@ -87,6 +51,8 @@ if(version!=NANOSTREAM_AVC_VERSION) ``` + + ### Initialize the library Implement the interface ```nanostreamEventListener``` in your class: @@ -164,6 +130,7 @@ self.nAVC = [[nanostreamAVC alloc] initWithSettings: nAVCSettings ``` + ### Start a stream ```objc @@ -188,10 +155,11 @@ self.nAVC = [[nanostreamAVC alloc] initWithSettings: nAVCSettings ``` + ### Stop a running stream -If the parameter "blocking" of the stop method is set to YES, all the remaining data (to this moment) will be sent before stopping the stream. -If set to NO, the stream will stop immediately, discarding the remaining data. +If the parameter `blocking` of the stop method is set to `YES`, all the remaining data (to this moment) will be sent before stopping the stream. +If set to `NO`, the stream will stop immediately, discarding the remaining data. ```objc // Stop broadcast asynchronously with completion handler @@ -206,13 +174,16 @@ If set to NO, the stream will stop immediately, discarding the remaining data. ``` + ## Live Playback -nanoStream supports live playback from RTMP sources. +nanoStream supports live playback from `RTMP` sources. For a complete running sample, see our SDK package including broadcasting and playback samples. + + ### Initialize the library for playback - + ```objc self.session = [[RtmpSourceCaptureSession alloc] initWithPreview:self.playerView andStatusListener:self andLogLevel:LogLevelMinimal]; @@ -221,54 +192,65 @@ For a complete running sample, see our SDK package including broadcasting and pl [self.session setUrl:self.rtmpServerURL]; [self.session setStreamId:self.rtmpStreamName]; ``` - + + + ### Start playback ```objc - [self.session start]; +[self.session start]; ``` - + + + ## Advanced Settings/Usage -### Meaning of Events and Errors (nanostreamEvent) +### Meaning of Events and Errors (nanostreamEvent) -Events: +| Event | Meaning | +| --------------------------------- | ------------------------------------------------------------ | +| **`StreamStarted/StreamStopped`** | notification that a stream was successfully started/stopped | +| **`StreamConnectionStatus`** | indicates the connection status: connected, disconnected or reconnecting | -- StreamStarted/StreamStopped: notification that a stream was successfully started/stopped -- StreamConnectionStatus: indicates the connection status: connected, disconnected or reconnecting +
+ +| Error | Meaning | +| --------------------------------------- | ------------------------------------------------------------ | +| **`StreamSettingCropModeNotSupported`** | a larger input resolution is required for the crop mode | +| **`StreamErrorConnect`** | the connection to the server could not be established, server might no be reachable or there are network problems | +| **`StreamErrorConnectSSL`** | the connection process failed when trying to setup SSL, maybe the server certificates could not be verified | +| **`StreamError`** | an error occurred while initializing the stream, or during the stream, used license might be invalid or expired | +| **`GeneralError`** | a general error | -Errors: -- StreamSettingCropModeNotSupported: a larger input resolution is required for the crop mode -- StreamError: -- StreamErrorConnect: the connection to the server could not be established, server might no be reachable or there are network problems -- StreamErrorConnectSSL: the connection process failed when trying to setup SSL, maybe the server certificates could not be verified -- StreamError: an error occurred while initializing the stream, or during the stream, used license might be invalid or expired -- GeneralError: a general error ### Switch Camera The camera (front/back) can be switched during preview and broadcast, with the method -```objc - -(bool) useFrontCamera: (bool) value; // returns true if switch was successful -``` +`(bool) useFrontCamera: (bool) value; // returns true if switch was successful` It is also possible to select the desired camera directly, when initializing the library, by using the property ```objc - @property (assign) BOOL frontCamera; +@property (assign) BOOL frontCamera; ``` of the ```nanostreamAVCSettings``` object. + + ### Orientation The orientation of the stream can be set to portrait or landscape with the property ```orientation``` of the settings object. -As of version 4.4.0.6 the orientation can also be changed after the initialization with the property ```orientation``` of the nanostreamAVC object itself. +As of version 4.4.0.6 the orientation can also be changed after the initialization with the property ```orientation``` of the `nanostreamAVC` object itself. + +> **Important:** +> +> The orientation change will only affect the stream, but not the preview. The orientation for the preview has to be managed on the application level. This can be achieved by using e.g. [```CGAffineTransformMakeRotation``` ](https://developer.apple.com/documentation/coregraphics/cgaffinetransform). + -**Important:** The orientation change will only affect the stream, but not the preview. The orientation for the preview has to be managed on the application level. This can be achieved by using e.g. ```CGAffineTransformMakeRotation``` ([https://developer.apple.com/library/mac/documentation/GraphicsImaging/Reference/CGAffineTransform/](https///developer.apple.com/library/mac/documentation/GraphicsImaging/Reference/CGAffineTransform/)). ### Stream Type @@ -280,13 +262,14 @@ The SDK supports different streaming modes: You can configure the mode with the property ```streamType``` of the settings object. + + ### Zoom Following Methods are available for zooming: ```objc /** - * maxZoomFactor * * Returns the maximum zoom factor that can be set on the current device. @@ -299,7 +282,6 @@ Following Methods are available for zooming: ```objc /** - * Newer devices can use an almost-optical zoom, using the bigger sensor sizes. * Setting the zoom factor to a value smaller than this value uses a lossless * zoom. @@ -311,7 +293,6 @@ Following Methods are available for zooming: ```objc /** - * Sets the zoom factor for the camera. Available from iOS 7.1 onwards. * * @param factor Double between 1.0 and maxZoomFactor. Will be set for the @@ -325,11 +306,16 @@ Following Methods are available for zooming: -(BOOL)setZoomFactor:(CGFloat)factor; ``` -Zooming is also demonstrated in the sample project "BintuStream", included in the SDK packet. +Zooming is also demonstrated in the sample project `BintuStream`, included in the SDK packet. + + ### Server Authentication -In case authentication is required, the credentials can be set with the method `-(void) setAuthentication: (NSString*) user withPassword: (NSString*) password;`{objc} +In case authentication is required, the credentials can be set with the method +```objc +-(void) setAuthentication: (NSString*) user withPassword: (NSString*) password; +``` The method has to be invoked before a stream is started. @@ -344,20 +330,23 @@ For example: ``` + ### Cropping The stream can be transformed to a different format than the input from the camera. -The following example shows how to crop the format to 16:9. +The following example shows how to crop the format to `16:9`. ```objc - [nAVCSettings setCropMode: CropTo16By9]; +[nAVCSettings setCropMode: CropTo16By9]; ``` + + ### Local Recording It is possible to make a local copy of the stream, on the iOS device. -This is an extra feature and needs to be unlocked by the license - the license should contain the string "MP4=2". +This is an extra feature and needs to be unlocked by the license - the license should contain the string `MP4=2`. ```objc NSString *homeDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]; @@ -372,22 +361,25 @@ NSString *locStr = [homeDirectory stringByAppendingPathComponent: [[dateFormatte There are three modes available: -- AVCRecordingModeStartBitrate: uses the video bitrate set with nanostreamAVCSettings -- AVCRecordingModeDoubleAtLeastOneMbit: uses double the video bitrate, but at least 1Mbps -- AVCRecordingMode720p2Mbit: independent of the set video bitrate, always uses 2Mbps and a resolution of 1280x720 +- **`AVCRecordingModeStartBitrate`**: uses the video bitrate set with `nanostreamAVCSettings` +- **`AVCRecordingModeDoubleAtLeastOneMbit`**: uses double the video bitrate, but at least `1Mbps` +- **`AVCRecordingMode720p2Mbit`**: independent of the set video bitrate, always uses `2Mbps` and a resolution of `1280x720` The bitrate for the recording remains constant during a stream. The adaptive bitrate mechanism only influences the bitrate for the stream, but not the bitrate for the recording. The bitrate for the recording also depends on the video material. If there is a lot of movement in the video the bitrate will be higher than for recordings with little to no movement. + + ### Adaptive Bitrate -By using the Adaptive Bitrate Control (ABC) the stream will automatically adjust to changes of the bandwidth. +By using the Adaptive Bitrate Control (*ABC*) the stream will automatically adjust to changes of the bandwidth. + There are two modes available: -* AdaptiveBitrateControlModeQualityDegrade: The video quality will be changed if the bandwidth changes. For instance, if not enough bandwidth is available, the video bitrate will be decreased, which in turn degrades the video quality. +* **`AdaptiveBitrateControlModeQualityDegrade`**: The video quality will be changed if the bandwidth changes. For instance, if not enough bandwidth is available, the video bitrate will be decreased, which in turn degrades the video quality. -* AdaptiveBitrateControlModeFrameDrop: Low bandwidth is compensated by decreasing the framerate (FPS), but maintaining the video qualtiy. +* **`AdaptiveBitrateControlModeFrameDrop`**: Low bandwidth is compensated by decreasing the framerate (FPS), but maintaining the video qualtiy. Make sure to set the ABC settings before a stream is started. @@ -404,13 +396,14 @@ Make sure to set the ABC settings before a stream is started. Possible properties: -| property | default values | range of values | optional | -| ----------------------- | -------------- |------------------- |--------- | -| minimumBitrate | 5000 (50 kb) | 50000 - 10 000 000 | YES | -| minimumFramerate | 15 (fps) | 5 - 60 | YES | -| maxPercentBitrateChange | 50 (%) | 0 - 100 | YES | +| property | default values | range of values | optional | +| ----------------------------- | -------------- | ------------------ | -------- | +| **`minimumBitrate`** | 5000 (50 kb) | 50000 - 10 000 000 | YES | +| **`minimumFramerate`** | 15 (fps) | 5 - 60 | YES | +| **`maxPercentBitrateChange`** | 50 (%) | 0 - 100 | YES | + + -For more information look here http://www.nanocosmos.de/v4/documentation/live_video_encoder_-_adaptive_bitrate#abc_modes ### Statistics during streaming @@ -428,55 +421,58 @@ This method will be invoked every second. Meaning of the parameters: -- oBitrate: the measured outgoing bitrate for the stream - this is an estimation and probably not 100% accurate -- fillness: the fillness, in percent, of the buffer used for outgoing packages -- vBitrate: the currently used bitrate for video -- vFramerate: the currently used framerate for video +- **`oBitrate`**: the measured outgoing bitrate for the stream - this is an estimation and probably not 100% accurate +- **`fillness`**: the fillness, in percent, of the buffer used for outgoing packages +- **`vBitrate`**: the currently used bitrate for video +- **`vFramerate`**: the currently used framerate for video + +| property | default values | range of values | optional | +| :---------------------------- | :------------- | :----------------- | :------- | +| **`minimumBitrate`** | 5000 (50 kb) | 50000 - 10 000 000 | YES | +| **`minimumFramerate`** | 15 (fps) | 5 - 60 | YES | +| **`maxPercentBitrateChange`** | 50 (%) | 0 - 100 | YES | + -| property | default values | range of values | optional | -|:------------------------|:---------------|:-------------------|:---------| -| minimumBitrate | 5000 (50 kb) | 50000 - 10 000 000 | YES | -| minimumFramerate | 15 (fps) | 5 - 60 | YES | -| maxPercentBitrateChange | 50 (%) | 0 - 100 | YES | -For more information look here : http://www.nanocosmos.de/v4/documentation/live_video_encoder_-_adaptive_bitrate#abc_modes ### Measuring the available bandwidth -For measuring the available bandwidth you can use the method "runBandwidthCheck". After the check finished, the result can be used to set the bitrate for the nanostreamAVC object. +For measuring the available bandwidth you can use the method `runBandwidthCheck`. After the check finished, the result can be used to set the bitrate for the `nanostreamAVC` object. The check measures the bandwidth by running a test stream to the server. ```objc - NSXBandwidthCheckSettings *bwSettings = [[NSXBandwidthCheckSettings alloc] init]; - // the URL settings are identical to the URL settings for the nanostreamAVCSettings - // for testing the bandwidth it is advised to use the same server you want to stream to - // you might want to use a stream id different from the stream id for the actual stream, to distinguish between a bandwidth check and a real stream - bwSettings.url = @"rtmp://localhost/live"; - bwSettings.streamId = @"bwcheck"; - // the maxium bitrate that should be tested - if this value is lower than the actual bandwidth, the result will be similar to the maximum bitrate - bwSettings.maxBitrate = 5000000; // 5Mb +NSXBandwidthCheckSettings *bwSettings = [[NSXBandwidthCheckSettings alloc] init]; +// the URL settings are identical to the URL settings for the nanostreamAVCSettings +// for testing the bandwidth it is advised to use the same server you want to stream to +// you might want to use a stream id different from the stream id for the actual stream, to distinguish between a bandwidth check and a real stream +bwSettings.url = @"rtmp://localhost/live"; +bwSettings.streamId = @"bwcheck"; + +// the maxium bitrate that should be tested - if this value is lower than the actual bandwidth, the result will be similar to the maximum bitrate +bwSettings.maxBitrate = 5000000; // 5Mb - [self.nAVC runBandwidthCheck: bwSettings withCompletionBlock:^(NSXBandwidthCheckResult* measuredBandwidth){ - NSLog(@"measuredBandwidth: avg=%i, median=%i, min=%i, max=%i, runTimeMs=%i", (int)measuredBandwidth.avgBitrate, (int)measuredBandwidth.medianBitrate, (int)measuredBandwidth.minBitrate, (int)measuredBandwidth.maxBitrate, (int)measuredBandwidth.runTimeMs); - }]; +[self.nAVC runBandwidthCheck: bwSettings withCompletionBlock:^(NSXBandwidthCheckResult* measuredBandwidth){ + NSLog(@"measuredBandwidth: avg=%i, median=%i, min=%i, max=%i, runTimeMs=%i", (int)measuredBandwidth.avgBitrate, (int)measuredBandwidth.medianBitrate, (int)measuredBandwidth.minBitrate, (int)measuredBandwidth.maxBitrate, (int)measuredBandwidth.runTimeMs); +}]; ``` - -The default run time is 10 seconds. The run time can be changed with the property "runTime". -If the bandwidth check should be stopped before it finished on itself, the method "stopBandwidthCheck" can be used. This will force the bandwidth check to stop and return the result based on the collected information up to this point. +The default run time is 10 seconds. The run time can be changed with the property `runTime`. +If the bandwidth check should be stopped before it finished on itself, the method `stopBandwidthCheck` can be used. This will force the bandwidth check to stop and return the result based on the collected information up to this point. ```objc - [self.nAVC stopBandwidthCheck]; // stop bw check if still running +[self.nAVC stopBandwidthCheck]; // stop bw check if still running ``` The result of the bandwidth check can be used as bitrate setting for library object. At the moment it is not possible to change the video bitrate after the initialization of the library object, thus the object need to be re-initialized. (This will change in future releases.) + + ### Snaphot from the current stream -To get a snaphot (image) of the current preview/stream, the method "grabStillImageWithCompletionBlock" can be used. +To get a snaphot (image) of the current preview/stream, the method `grabStillImageWithCompletionBlock` can be used. ```objc [self.nAVC grabStillImageWithCompletionBlock:^(UIImage *image, NSError *error) { @@ -485,12 +481,13 @@ To get a snaphot (image) of the current preview/stream, the method "grabStillIma ``` + ### Overlay/Watermark It is possible to use an overlay (image, text, or both) for a stream. Notice that the CPU usage will be increased slightly when an overlay is used. -This is an extra feature and needs to be unlocked by the license - the license should contain the string "OVL=1". +This is an extra feature and needs to be unlocked by the license - the license should contain the string `OVL=1`. -The easiest way to use an overlay is to use the class "AVCFullImageOverlay": +The easiest way to use an overlay is to use the class `AVCFullImageOverlay`: ```objc UIImage *overlayImg = [UIImage imageNamed:@"button"]; // uses an image from the bundle resources, named "button" @@ -617,7 +614,7 @@ In this case it is better to implement your own overlay class, which is shown in ``` -If you want to use a dynamic overlay, e.g. a scoreboard, you can modify the above class (NSXWatermark) like so: +If you want to use a dynamic overlay, e.g. a scoreboard, you can modify the above class (`NSXWatermark`) like so: ```objc ... @@ -690,13 +687,15 @@ If you want to use a dynamic overlay, e.g. a scoreboard, you can modify the abov ... ``` + + ### initWithSession Instead of letting the SDK manage the video and audio input, you can also do that yourself. This is helpful to supply video and audio samples which are not coming from the standard input devices. Or to modify video and/or audio samples before they are used for the stream. The SDK provides a separate init method ```initWithSession```. -An example for a custom capture session, which supplies CVPixelBufferRef's to the SDK: +An example for a custom capture session, which supplies `CVPixelBufferRef`'s to the SDK: ```objc @interface CustomCaptureSession : AVCaptureSession @@ -829,25 +828,33 @@ self.stream = [[nanostreamAVC alloc] initWithSession: self.session ``` + ### Stream from a Drone Get in touch with us to learn how to send a live stream from a Drone (Parrot Bebop or DJI) + + ## Possible Issues ### General -For older versions of the sdk, without support for arm64, architecture in Xcode has to be set to armv7 and/or armv7s. This works also for newer iOS-Devcies like iPhone 5s. -This is not required for newer sdk versions, which also support arm64. +For older versions of the sdk, without support for `arm64`, architecture in `Xcode` has to be set to `armv7` and/or `armv7s`. This works also for newer iOS-Devcies like iPhone 5s. + +**This is not required for newer sdk versions**, which also support `arm64`. + + ### Compiler/Linker #### libstdc++ -If there are linker errors with "std::": "symbol(s) not found for architecture", make sure that you added the libraries "libstdc++.dylib" and "libc++.dylib" to your project. +If there are linker errors with `std::: "symbol(s) not found for architecture"`, make sure that you added the libraries `libstdc++.dylib` and `libc++.dylib` to your project. Due to a bug in Xcode, depending on the selected Base SDK and deployment target, there might be still linker errors regarding "std". In this case you need to add a specific version of the libstdc++ to your project, e.g.: libstdc++-6.0.9.dylib instead of libstdc++.dylib + + #### Undefined Symbols for Parrot & DJI **The following part is only relevant for SDK versions from 3.3.x to 4.1.x.** @@ -855,25 +862,31 @@ As of version 4.2.x the drone dependencies are removed from the standard SDK pac It might be possible that there are linker errors for the classes -* ParrotBebopCaptureSession or +* `ParrotBebopCaptureSession` or + +* `DJIPhantom2CaptureSession` + +Generally, if the Parrot & DJI extensions are not used, the symbols should be stripped automatically by `Xcode` and you do not need to link the frameworks. +However this is not the case when the linker flag -`ObjC` is used in the app project. This causes the linker to load all symbols included in all linked object files (including the Parrot & DJI symbols). This prevents the automatic stripping. -* DJIPhantom2CaptureSession +To use our library without Parrot & DJI, either remove the -`ObjC` linker flag from the project or replace the -`ObjC` linker flag with the `-force_load` flag for each library that you want to use. Do not use `-force_load` with `libnanostreamAVC.a`. + +For examples [see](http://stackoverflow.com/questions/11254269/using-the-force-load-linker-flag-with-restkit-ios) -Generally, if the Parrot & DJI extensions are not used, the symbols should be stripped automatically by Xcode and you do not need to link the frameworks. -However this is not the case when the linker flag "-ObjC" is used in the app project. This causes the linker to load all symbols included in all linked object files (including the Parrot & DJI symbols). This prevents the automatic stripping. -To use our library without Parrot & DJI, either remove the "-ObjC" linker flag from the project or replace the "-ObjC" linker flag with the "-force\_load" flag for each library that you want to use. Do not use "-force\_load" with libnanostreamAVC.a. -For examples see http://stackoverflow.com/questions/11254269/using-the-force-load-linker-flag-with-restkit-ios #### Duplicate Symbols If there are duplicate symbol errors, check the "Other Linker Flags" setting. Select a target, go to "Build Settings" and type into the search field "Other Linker Flags". -Check if the linker flag "-all\_load" is used. Either remove the flag or if you have to use it, consider using the flag "-force\_load" or "-ObjC" instead. +Check if the linker flag `-all_load` is used. Either remove the flag or if you have to use it, consider using the flag `-force_load` or `-ObjC` instead. + +[See also here for more information on the "-force\_load" flag](http://stackoverflow.com/questions/3354864/xcode-project-target-settings-syntax-for-linker-flag-force-load-on-iphone) + +[Check also this information if you have a "selector not recognized" runtime exception](https://developer.apple.com/library/mac/qa/qa1490/_index.html) + -See also here for more information on the "-force\_load" flag: http://stackoverflow.com/questions/3354864/xcode-project-target-settings-syntax-for-linker-flag-force-load-on-iphone -Check also this information if you have a "selector not recognized" runtime exception: https://developer.apple.com/library/mac/qa/qa1490/_index.html ### Breakpoints If you debug your application, it is possible that breakpoints are being hit due to internal exceptions. Exceptions on the SDK level are handled in the SDK and do not affect the workflow of your application. @@ -882,18 +895,20 @@ You can prevent the breakpoint from pausing the workflow of your application, if The default setting is most likely that every exception causes a break. To change that, use the settings from the following screenshot: -![Screenshot](docs/nanostream/ios/img/screenshot_exception_breakpoint.png) +![Screenshot](../img/screenshot_exception_breakpoint.png) + +This way only `Objective-C exceptions` will be catched and `C++ exceptions` will be ignored. + -This way only Objective-C exceptions will be catched and C++ exceptions will be ignored. ### Crashes #### CALayerGetDelegate / CALayerGetSuperlayer / Other CALayer -If there are crashes occurring in your app that include above symbols in the stack trace and are otherwise not obvious, check to see if you added a subviews to the preview view. The UIView instance that is passed to +If there are crashes occurring in your app that include above symbols in the stack trace and are otherwise not obvious, check to see if you added a subviews to the preview view. The `UIView` instance that is passed to ```objc - -[RtmpSourceCaptureSession initWithPreview:andStatusListener:andLogLevel:] +-[RtmpSourceCaptureSession initWithPreview:andStatusListener:andLogLevel:] ``` @@ -905,37 +920,50 @@ and cannot contain any subviews (UIButtons or otherwise). + + ## Logging Information -If you encounter a problem with the nanostreamAVC library and you want to report the problem, log files will help us to comprehend the problem. +If you encounter a problem with the `nanostreamAVC` library and you want to report the problem, log files will help us to comprehend the problem. + + Please use the following steps to create the log files: -* **for the encoder (nanostreamAVC)**: enable logging for the library with the method "SetLogLevel", use LogLevelCustomSupport (if not available use LogLevelVerbose): ```[self.nAVC SetLogLevel: LogLevelCustomSupport]; // set the log level before the method "start" is invoked``` +* **for the encoder (nanostreamAVC)**: enable logging for the library with the method "SetLogLevel", use LogLevelCustomSupport (if not available use LogLevelVerbose): + +```objc +[self.nAVC SetLogLevel: LogLevelCustomSupport]; // set the log level before the method "start" is invoked +``` + +* **for the player (RtmpSourceCaptureSession)**: the log level has to be set in the constructor: +```objc +self.session = [[RtmpSourceCaptureSession alloc] initWithPreview:self.playerView andStatusListener:self andLogLevel:LogLevelCustomSupport]; +``` + +* try to reproduce the problem -* **for the player (RtmpSourceCaptureSession)**: the log level has to be set in the constructor: ```self.session = [[RtmpSourceCaptureSession alloc] initWithPreview:self.playerView andStatusListener:self andLogLevel:LogLevelCustomSupport];``` +* download the app container (for your app) from the iOS device with `Xcode`, as explained [here](http://help.apple.com/xcode/mac/8.0/#/dev816c242e1) -* try to reproduce the problem +* in Finder right click on the downloaded container and select `Show Package Contents` -* download the app container (for your app) from the iOS device with Xcode, as explained here: [http://help.apple.com/xcode/mac/8.0/#/dev816c242e1](http://help.apple.com/xcode/mac/8.0/#/dev816c242e1) +* send us **all** log files located (in the container) in the folder `/AppData/Library/Caches/Logs/` -* in Finder right click on the downloaded container and select "Show Package Contents" -* send us **all** log files located (in the container) in the folder "/AppData/Library/Caches/Logs/" ## Crash Logs If you encounter a crash, please send us the crash log as explained in the following steps: -- Plug in the device and open Xcode -- Choose Window -> Devices from the menu bar +- Plug in the device and open `Xcode` +- Choose `Window --> Devices` from the menu bar - Under the DEVICES section in the left column, choose the device - To see the device console, click the up-triangle at the bottom left of the right hand panel - Click the down arrow on the bottom right to save the console as a file - To see crash logs, select the View Device Logs button under the Device Information section on the right hand panel - **Wait until the Scanning Process is complete**, this can take a while (there should be a text at the top of the Window, something like "Scanning '...crash'...") -- Use the column "Date/Time" to order the crashes after dates. +- Use the column `Date/Time` to order the crashes after dates. - Find your app in the Process column and select the Crash log to see the contents. -- To save a crash log, right click the entry on the left column and choose "Export Log" +- To save a crash log, right click the entry on the left column and choose `Export Log` -(Taken from https://developer.apple.com/library/ios/qa/qa1747/_index.html) +Taken from [here](https://developer.apple.com/library/ios/qa/qa1747/_index.html) diff --git a/docs/nanostream/macos/nanostream-macos-sdk.md b/docs/nanostream/macos/nanostream_macos_sdk.md similarity index 75% rename from docs/nanostream/macos/nanostream-macos-sdk.md rename to docs/nanostream/macos/nanostream_macos_sdk.md index 658653fb3..852e03313 100644 --- a/docs/nanostream/macos/nanostream-macos-sdk.md +++ b/docs/nanostream/macos/nanostream_macos_sdk.md @@ -1,4 +1,8 @@ -# nanoStream MacOS API +--- +id: nanostream_macos_sdk +title: MacOSX API +sidebar_label: MacOSX API +--- ## Intro @@ -8,11 +12,17 @@ The nanoStream MacOS dylib API supports internet broadcast streaming and local r It works perfectly together with internet streaming servers like Wowza Media Server and Flash Media Server, streaming to Mobile devices like iPhone, Silverlight and other playback clients is possible. -* Note: this is preliminary documentation, please contact us for further information or help. +> **Note**: +> +> This is preliminary documentation, please contact us for further information or help. + + ## Setup: -The best way to start is using the C++ sample code included in the SDK. +The best way to start is using the `C++` sample code included in the SDK. + + ## System Requirements: @@ -28,66 +38,66 @@ Recommended for HD capture: Intel Core i7 or Xeon | Method Name | Description | libnanoStream.dylib Support | Mac Plugin Support | Mac Framework Support | ANE Support | |------------------------------|---------------------------------------------------------------------------|-------------------------------|--------------------------|-------------------------|--------------| -| InitPlugin | Initialization of the Plugin | nanoStream | initEncoder | init | ✔ | -| SetXml | deprecated - no functionality | ✘ | ✘ | ✘ | ✔ | -| GetVersion | Get version number of the SDK | ✔ | | | | -| SetLicense | Set license for nano SDK | ✔ | ✔ | ✔ | ✔ | -| GetLicense | Get the current license of the SDK | ✔ | | | | -| SetConfig | Set property over Identifier. | ✔ | ✔ | ✔ | ✔ | -| UpdatePreviewDimensions | Update preview dimensions of the bmp | ✘ | ✘ | ✘ | ✔ | -| GetPreviewDimensions | Get the current preview dimensions | ✔ | | | | -| GetPreviewImage | Get the preview image | ✔ | | | | -| GetPreviewFrame | Get current preview Frame | ✘ | ✘ | ✘ | ✔ | -| StartPreview | Start the preview. | ✔ | ✔ | ✘ | ✔ | -| StopPreview | Stop the preview. | ✔ | ✔ | ✘ | ✔ | -| StartBroadcast | Start broadcasting. | ✔ | ✔ | startStream | ✔ | -| StopBroadcast | Stop broadcasting. | ✔ | ✔ | stopStream | ✔ | -| GetNumberOfVideoSources | Count video sources with current settings | ✔ | ✔ | ✔ | ✔ | -| GetNumberOfAudioSources | Count audio sources with current settings | ✔ | ✔ | ✔ | ✔ | -| GetVideoSource | Get name of the video source as string. | ✔ | ✔ | ✘ | ✔ | -| GetAudioSource | Get name of the audio source as string. | ✔ | ✔ | ✘ | ✔ | -| SetVideoSource | Set video source for preview or broadcasting | ✔ | VideoSource | ✘ | ✔ | -| SetVideoSourceFromURL | URL to an mp4 file source or ramp source | ✘ | ✘ | ✘ | ✔ | -| SetAudioSource | Set audio source for preview or broadcasting | ✔ | AudioSource | ✘ | ✔ | -| SetVideoWidth | Set width of video in pixels | ✔ | VideoWidth | ✔ | ✔ | -| GetVideoWidth | Get width of video in pixels | ✔ | VideoWidth | | | -| SetVideoHeight | Set height of video in pixels | ✔ | VideoHeight | ✔ | ✔ | -| GetVideoHeight | Get height of video in pixels | ✔ | VideoHeight | | | -| SetVideoResizeWidth | Resize width of video in pixels | ✘ | ✔ | ✘ | ✔ | -| SetVideoResizeHeight | Resize height of video in pixels | ✘ | ✔ | ✘ | ✔ | -| SetVideoFramerate | Set frame rate of video in frames per second | SetFramerate | VideoFrameRate | setFrameRate | ✔ | -| SetNumberOfChannels | set channel number | ✔ | | | | -| SetVideoBitrate | Set bitrate of video in kbits per second | ✔ | ✔ | ✔ | ✔ | -| GetVideoBitrate | Get the current video bitrate | ✔ | | | | -| SetAudioBitrate | Set bitrate of audio in kbits per second | ✔ | ✔ | ✔ | ✔ | -| GetAudioBitrate | Get the current audio bitrate | ✔ | | | | -| SetAudioSamplerate | Set the samplerate of the audio in Hertz | ✔ | ✘ | setSampleRate | ✔ | -| GetAudioLevel | Get the audio level of a channel | ✔ | ✔ | ✔ | ✔ | -| SetAudioVolume | Set audio volume | ✔ | AudioVolume | ✘ | ✔ | -| SetAudioPreviewVolume | Set audio volume of preview | ✔ | AudioPreviewVolume | ✘ | ✔ | -| SetColorSpace | Set the color space of an input source | ✔ | ✔ | ✘ | ✔ | -| GetNumberOfColorspaces | Get the count of color spaces | ✔ | ✔ | ✘ | ✔ | -| GetColorspace | Get color space name as string | ✔ | ✔ | ✔ | ✔ | -| GetNumberOfResolutions | Get count of available resolutions | ✔ | ✔ | ✘ | ✔ | -| GetResolution | Get count of resolutions | ✔ | ✔ | ✘ | ✔ | -| GetNumberOfFramerates | Count of available frame rates as integer value | GetNumberOfFrameRates | ✔ | ✘ | ✔ | -| GetFramerate | Get the frame rate of a video source | ✔ | ✔ | getFrameRate | ✔ | -| SetDeinterlacing | Set deinterlacing mode and method | ✘ | ✘ | ✘ | ✔ | -| GetNumberOfOutputs | Get count of output sources | ✘ | ✔ | ✘ | ✔ | -| AddOutput | Add new output source with url | ✘ | ✔ | ✘ | ✔ | -| SetOutputUrl | Set output source with url. Local or rtmp | ✔ | ✔ | setOutputUrl | ✔ | -| GetOutputUrl | | ✔ | | | | -| GetNumberOfOutputUrls | | ✔ | | | | -| AcceptDataInSampleBuffer | ✔ | | | | | -| AddSampleBuffer | | ✔ | | | | -| SetFilesourceFilename | Set the filename of a local source | ✘ | ✘ | ✘ | ✔ | -| ClearOutputs | Reset all output sources | ✘ | ✔ | ✘ | ✔ | -| SetVideoEffect | Add a video effect. | ✘ | ✔ | ✘ | ✔ | -| SetOverlay | Add a overlay to the video | ✘ | ✘ | ✘ | ✔ | -| ShowPropertyPage | Show property page | ✘ | ✔ | ✘ | ✔ | -| SetLog | Set log file path and log level. | ✔ | ✔ | ✔ | ✔ | -| SetXmlProfile | | ✔ | | | | -| dispose():void | Reset buffer | ✘ | ✘ | ✘ | ✔ | +| `InitPlugin` | Initialization of the Plugin | nanoStream | initEncoder | init | ✔ | +| `SetXml` | deprecated - no functionality | ✘ | ✘ | ✘ | ✔ | +| `GetVersion` | Get version number of the SDK | ✔ | | | | +| `SetLicense` | Set license for nano SDK | `✔` | ✔ | ✔ | ✔ | +| `GetLicense` | Get the current license of the SDK | ✔ | | | | +| `SetConfig` | Set property over Identifier. | ✔ | ✔ | ✔ | ✔ | +| `UpdatePreviewDimensions` | Update preview dimensions of the bmp | ✘ | ✘ | ✘ | ✔ | +| `GetPreviewDimensions` | Get the current preview dimensions | ✔ | | | | +| `GetPreviewImage` | Get the preview image | ✔ | | | | +| `GetPreviewFrame` | Get current preview Frame | ✘ | ✘ | ✘ | ✔ | +| `StartPreview` | Start the preview. | ✔ | ✔ | ✘ | ✔ | +| `StopPreview` | Stop the preview. | ✔ | ✔ | ✘ | ✔ | +| `StartBroadcast` | Start broadcasting. | ✔ | ✔ | startStream | ✔ | +| `StopBroadcast` | Stop broadcasting. | ✔ | ✔ | stopStream | ✔ | +| `GetNumberOfVideoSources` | Count video sources with current settings | ✔ | ✔ | ✔ | ✔ | +| `GetNumberOfAudioSources` | Count audio sources with current settings | ✔ | ✔ | ✔ | ✔ | +| `GetVideoSource` | Get name of the video source as string. | ✔ | ✔ | ✘ | ✔ | +| `GetAudioSource` | Get name of the audio source as string. | ✔ | ✔ | ✘ | ✔ | +| `SetVideoSource` | Set video source for preview or broadcasting | ✔ | VideoSource | ✘ | ✔ | +| `SetVideoSourceFromURL` | URL to an mp4 file source or ramp source | ✘ | ✘ | ✘ | ✔ | +| `SetAudioSource` | Set audio source for preview or broadcasting | ✔ | AudioSource | ✘ | ✔ | +| `SetVideoWidth` | Set width of video in pixels | ✔ | VideoWidth | ✔ | ✔ | +| `GetVideoWidth` | Get width of video in pixels | ✔ | VideoWidth | | | +| `SetVideoHeight` | Set height of video in pixels | ✔ | VideoHeight | ✔ | ✔ | +| `GetVideoHeight` | Get height of video in pixels | ✔ | VideoHeight | | | +| `SetVideoResizeWidth` | Resize width of video in pixels | ✘ | ✔ | ✘ | ✔ | +| `SetVideoResizeHeight` | Resize height of video in pixels | ✘ | ✔ | ✘ | ✔ | +| `SetVideoFramerate` | Set frame rate of video in frames per second | SetFramerate | VideoFrameRate | setFrameRate | ✔ | +| `SetNumberOfChannels` | set channel number | ✔ | | | | +| `SetVideoBitrate` | Set bitrate of video in kbits per second | ✔ | ✔ | ✔ | ✔ | +| `GetVideoBitrate` | Get the current video bitrate | ✔ | | | | +| `SetAudioBitrate` | Set bitrate of audio in kbits per second | ✔ | ✔ | ✔ | ✔ | +| `GetAudioBitrate` | Get the current audio bitrate | ✔ | | | | +| `SetAudioSamplerate` | Set the samplerate of the audio in Hertz | ✔ | ✘ | setSampleRate | ✔ | +| `GetAudioLevel` | Get the audio level of a channel | ✔ | ✔ | ✔ | ✔ | +| `SetAudioVolume` | Set audio volume | ✔ | AudioVolume | ✘ | ✔ | +| `SetAudioPreviewVolume` | Set audio volume of preview | ✔ | AudioPreviewVolume | ✘ | ✔ | +| `SetColorSpace` | Set the color space of an input source | ✔ | ✔ | ✘ | ✔ | +| `GetNumberOfColorspaces` | Get the count of color spaces | ✔ | ✔ | ✘ | ✔ | +| `GetColorspace` | Get color space name as string | ✔ | ✔ | ✔ | ✔ | +| `GetNumberOfResolutions` | Get count of available resolutions | ✔ | ✔ | ✘ | ✔ | +| `GetResolution` | Get count of resolutions | ✔ | ✔ | ✘ | ✔ | +| `GetNumberOfFramerates` | Count of available frame rates as integer value | GetNumberOfFrameRates | ✔ | ✘ | ✔ | +| `GetFramerate` | Get the frame rate of a video source | ✔ | ✔ | getFrameRate | ✔ | +| `SetDeinterlacing` | Set deinterlacing mode and method | ✘ | ✘ | ✘ | ✔ | +| `GetNumberOfOutputs` | Get count of output sources | ✘ | ✔ | ✘ | ✔ | +| `AddOutput` | Add new output source with url | ✘ | ✔ | ✘ | ✔ | +| `SetOutputUrl` | Set output source with url. Local or rtmp | ✔ | ✔ | setOutputUrl | ✔ | +| `GetOutputUrl` | | ✔ | | | | +| `GetNumberOfOutputUrls` | | ✔ | | | | +| `AcceptDataInSampleBuffer` | ✔ | | | | | +| `AddSampleBuffer` | | ✔ | | | | +| `SetFilesourceFilename` | Set the filename of a local source | ✘ | ✘ | ✘ | ✔ | +| `ClearOutputs` | Reset all output sources | ✘ | ✔ | ✘ | ✔ | +| `SetVideoEffect` | Add a video effect. | ✘ | ✔ | ✘ | ✔ | +| `SetOverlay` | Add a overlay to the video | ✘ | ✘ | ✘ | ✔ | +| `ShowPropertyPage` | Show property page | ✘ | ✔ | ✘ | ✔ | +| `SetLog` | Set log file path and log level. | ✔ | ✔ | ✔ | ✔ | +| `SetXmlProfile` | | ✔ | | | | +| `dispose():void` | Reset buffer | ✘ | ✘ | ✘ | ✔ | @@ -101,14 +111,15 @@ Recommended for HD capture: Intel Core i7 or Xeon #### Declaration -```cpp +```c++ InitPlugin(xmlPath:String):int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | xmlPath|String | Path to the xml file with configuration information, can be local or a url. 1| 1 **— deprecated - no functionality**| @@ -131,14 +142,14 @@ Initialization of the plugin. On Windows and Mac OSX - +----- ### GetVersion #### Declaration -```cpp +```c++ GetVersion() ``` @@ -153,16 +164,20 @@ Return the version number of the SDK as int value #### Availability On Mac OSX + +----- + ### SetLicense #### Declaration -```cpp +```c++ SetLicense(licenseStr:String):int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | licenseStr|String | License String getting from nano. | #### Return Value @@ -177,12 +192,14 @@ Set license for nano SDK On Windows and Mac OSX +----- + ### GetLicense #### Declaration -```cpp +```c++ GetLicense() ``` @@ -198,17 +215,20 @@ Get license for nano SDK On Mac OSX +----- + ### SetConfig #### Declaration -```cpp +```c++ SetConfig(property:String, value:String):int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | property|String | Property identifier as string. See property list for configuration on page 32. | | value|String | Value for property as string representation. | @@ -224,6 +244,8 @@ Set property over Identifier. On Windows and Mac OSX + + ## Preview @@ -241,19 +263,22 @@ Updates the preview with the current width and height. On Windows and Mac OSX +----- + ### GetPreviewDimensions #### Declaration -```cpp +```c++ GetPreviewDimensions(long *width, long *height, long *size) ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | width|long | Pointer to return the video width | | height|long | Pointer to return the video height | | size|long | Pointer to return the video size | @@ -266,18 +291,21 @@ GetPreviewDimensions(long *width, long *height, long *size) Get the current preview dimensions. +----- + ### GetPreviewImage #### Declaration -```cpp +```c++ GetPreviewImage(char *pixelBuffer, int size) ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | pixelBuffer|char | pixel buffer| | size|int | size | @@ -289,18 +317,21 @@ GetPreviewImage(char *pixelBuffer, int size) Get the preview image. +----- + ### GetPreviewFrame #### Declaration -```cpp +```c++ GetPreviewFrame(options:int = GET\_FRAME\_BITMAP):Boolean ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | options|int | option as integer. Default is GET\_FRAME\_BITMAP = 2. A\\ Also possible: \\ GET\_FRAME\_RAW\_BYTES:int = 4,\\ GET\_POWER\_OF\_2\_FRAME\_BGRA\_BYTES:int = 8 | #### Return Value @@ -311,12 +342,14 @@ True if new frame was received otherwise false Get current preview Frame. +----- + ### StartPreview #### Declaration -```cpp +```c++ StartPreview():int ``` @@ -332,12 +365,14 @@ Start the preview. On Windows and Mac OSX +----- + ### StopPreview #### Declaration -```cpp +```c++ StopPreview():int ``` @@ -353,13 +388,15 @@ Stop the preview. On Windows and Mac OSX + + ## Broadcast ### StartBroadcast #### Declaration -```cpp +```c++ StartBroadcast():int ``` @@ -379,12 +416,14 @@ Start broadcasting. On Windows and Mac OSX +----- + ### StopBroadcast #### Declaration -```cpp +```c++ StopBroadcast():int ``` @@ -400,6 +439,8 @@ Stop broadcasting. On Windows and Mac OSX + + ## Video Source & Audio Source handling ### GetNumberOfVideoSources @@ -407,7 +448,7 @@ On Windows and Mac OSX #### Declaration -```cpp +```c++ GetNumberOfVideoSources():int ``` @@ -423,12 +464,14 @@ Count of all available video sources with current settings On Windows and Mac OSX +----- + ### GetNumberOfAudioSources #### Declaration -```cpp +```c++ GetNumberOfAudioSources():int ``` @@ -444,17 +487,20 @@ Count of all available audio sources with current settings On Windows and Mac OSX +----- + ### GetVideoSource #### Declaration -```cpp +```c++ GetVideoSource(index:int):String ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | index|int | Index of the video source. The index of the video source, from **0 - GetNumberOfVideoSources -1** | #### Return Value @@ -469,17 +515,20 @@ Get name of the video source as string. Call **GetNumberOfVideoSources** first. On Windows and Mac OSX +----- + ### GetAudioSource #### Declaration -```cpp +```c++ GetAudioSource(index:int):String ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | index|int | Index of the audio source. The index of the audio source, from **0 - GetNumberOfAudioSources -1** | #### Return Value @@ -494,17 +543,20 @@ Get name of the audio source as string. Call **GetNumberOfAudioSources** first. On Windows and Mac OSX +----- + ### SetVideoSource #### Declaration -```cpp +```c++ SetVideoSource(index:int, mixSource:int, mixMode:int):int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | index |int | Index of the video source. The index of the video source goes from **0 - GetNumberOfVideoSources -1** | | mixSource|int | set **0** to to set only the first video source. **1** to set a second video source. 1 | | mixMode|int | when mixSource **1** is set, the mix mode to combine two video sources can be chosen here. See available mix modes on page 33. 2 | @@ -526,17 +578,20 @@ Set video source for preview or broadcasting over index. Call **GetNumberOfVideo On Mac OSX only one video source can use. On Microsoft Windows up to two video sources can be used and be combined in different ways. +----- + ### SetVideoSourceFromURL #### Declaration -```cpp +```c++ SetVideoSourceFromURL(url:String):int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | url|String | URL to use an mp4 file as video source. | #### Return Value @@ -551,17 +606,20 @@ URL to an mp4 file source to stream this file. Only Supported under Microsoft Windows +----- + ### SetAudioSource #### Declaration -```cpp +```c++ SetAudioSource(index:int):int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | index|int | Index of the audio source. The index of the audio source, from **0 - GetNumberOfAudioSources -1** | #### Return Value @@ -577,6 +635,8 @@ Set audio source for preview or broadcasting over index. Call **GetNumberOfAudio Under Windows and Mac OSX + + ## Video Properties ### SetVideoWidth @@ -584,13 +644,14 @@ Under Windows and Mac OSX #### Declaration -```cpp +```c++ SetVideoWidth(width:int, mixSource:int):int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | width|int | Width of the video in pixels as integer value | | mixSource|int | set **0** to to set only the first video source. **1** to set a second video source. 1 | @@ -607,17 +668,20 @@ Set width of video in pixels. With mixSource the height for two video sources ca Set Width is supported under Mac OS X and Microsoft Windows. The second mix source is only available under Microsoft Windows. +----- + ### SetVideoHeight #### Declaration -```cpp +```c++ SetVideoHeight(height:int, mixSource:int):int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | height|int | Height of the video in pixels as integer value | | mixSource|int | set **0** to to set only the first video source. **1** to set a second video source 1 | @@ -635,17 +699,20 @@ Set height of video in pixels. With mixSource the height for two video sources c Set Height is supported under Mac OS X and Microsoft Windows. The second mix source is only available under Microsoft Windows. +----- + ### SetVideoResizeWidth #### Declaration -```cpp +```c++ SetVideoResizeWidth(width:int, index:int):int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | width|int | resize width of the video in pixels as integer value | | index|int | Index of the output. The index of the output, from **0 - GetNumberOfOutputs -1** | @@ -661,17 +728,20 @@ Resize width of video in pixels. Only Supported under Microsoft Windows +----- + ### SetVideoResizeHeight #### Declaration -```cpp +```c++ SetVideoResizeHeight(height:int, index:int):int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | height|int | resize height of the video in pixels as integer value | | index|int | Index of the output. The index of the output, from **0 - GetNumberOfOutputs -1** | @@ -687,17 +757,20 @@ Resize height of video in pixels. Only supported under Microsoft Windows +----- + ### SetVideoFramerate #### Declaration -```cpp +```c++ SetVideoFramerate(framerate:Number, mixSource:int):int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | framerate|Number | Frame rate in frames per Second(FPS) as number value. | | mixSource|int | set **0** to to set only the first video source. **1** to set a second video source. 1 | @@ -715,16 +788,19 @@ Set frame rate of video in frames per second (FPS). With mixSource the frame rat Set video frame rate is supported under Mac OS X and Microsoft Windows. Mix Source is only available under Microsoft Windows. +----- + ### SetNumberOfChannels #### Declaration -```cpp +```c++ SetNumberOfChannels(int numOfChannels) ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | numOfChannels|int | Number of channels as int value | #### Description @@ -735,18 +811,21 @@ Set channel number On Mac OSX +----- + ### SetVideoBitrate #### Declaration -```cpp +```c++ SetVideoBitrate(bitrate:int, index:int):int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | bitrate|int | Video bitrate as integer value. | | index|int | index of output to set the bitrate for multiple encoders. 1| @@ -764,20 +843,21 @@ Set bitrate of video in kbits per second (kbits/s). Under Mac OS X the same bitrate is set to all outputs. Under Microsoft Windows every output can be set to another bitrate. - +----- ### GetVideoBitrate #### Declaration -```cpp +```c++ GetVideoBitrate(int source) ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | index|int | index of output to get the bitrate for multiple encoders. 1| 1 **— set different outputs is only available on Microsoft Windows. On Mac OS X the same bitrate is set to all outputs.** @@ -794,6 +874,8 @@ Get the current video bitrate. Under Mac OS X there is only one output available. Under Microsoft Windows several outputs are available over the index parameter. + + ## Audio Properties ### SetAudioBitrate @@ -801,12 +883,13 @@ Under Mac OS X there is only one output available. Under Microsoft Windows sever #### Declaration -```cpp +```c++ SetAudioBitrate(int bitrate, int index): int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | bitrate|int | Audio bitrate as integer value. | | index|int | index of output to set the bitrate for multiple encoders. 1| @@ -824,18 +907,21 @@ Set bitrate of audio in kbits per second (kbits/s). Under Mac OS X the same bitrate is set to all outputs. Under Microsoft Windows every output can be set to another bitrate. +----- + ### GetAudioBitrate #### Declaration -```cpp +```c++ GetAudioBitrate(int source): int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | index|int | index of output to get the bitrate for multiple encoders. 1| 1 **—Get different outputs is only available on Microsoft Windows. On Mac OS X there is only one source available.** | @@ -848,17 +934,20 @@ Audio bitrate as integer value. Get the current audio bitrate. +----- + ### SetAudioSamplerate #### Declaration -```cpp +```c++ SetAudioSamplerate(int samplerate): int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | samplerate|int | Samplerate of audio as integer value | #### Return Value @@ -873,17 +962,20 @@ Set the samplerate of the audio in Hertz (Hz). Under Windows and Mac OSX. +----- + ### GetAudioLevel #### Declaration -```cpp +```c++ GetAudioLevel(channel:int):int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | channel|int | channel id as integer. | #### Return Value @@ -898,17 +990,20 @@ Get the audio level of a channel. Under Windows and Mac OSX. +----- + ### SetAudioVolume #### Declaration -```cpp +```c++ SetAudioVolume(volume:int):int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | volume|int | volume as integer value | #### Return Value @@ -923,17 +1018,20 @@ Set audio volume. Under Windows and Mac OSX. +----- + ### SetAudioPreviewVolume #### Declaration -```cpp +```c++ SetAudioPreviewVolume(volume:int):int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | volume|int | volume as integer value | #### Return Value @@ -948,6 +1046,8 @@ Set audio volume of preview. Under Windows and Mac OSX. + + ## Color Management ### SetColorSpace @@ -955,12 +1055,13 @@ Under Windows and Mac OSX. #### Declaration -```cpp +```c++ SetColorSpace(index:int, mixSource:int):int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | index|int | index of the input source. | | mixSource|int | set **0** to to set only the first mixed source. **1** to set a second mixed source. 1| @@ -978,17 +1079,20 @@ Set the color space of an input source. Only the firtst source is supported unde Under Windows and Mac OSX. +----- + ### GetNumberOfColorspaces #### Declaration -```cpp +```c++ GetNumberOfColorspaces(width:int, height:int, mixSource:int):int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | width|int | width of the video source | | height|int | height of the video source | | mixSource|int | set **0** to to get the first mixed source. **1** to get the second mixed source. 1| @@ -1007,17 +1111,20 @@ Get the count of color spaces. Get the color space for the specified with and he Under Windows and Mac OSX. Under Mac OSX mix source is not supported. +----- + ### GetColorspace #### Declaration -```cpp +```c++ GetColorspace(index:int, mixSource:int):String ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | index|int | Index of the color spaces. The index of the color spaces, from **0 - GetNumberOfColorspaces -1** | | mixSource|int | set **0** to to get the first mixed source. **1** to get the second mixed source. 1| @@ -1035,6 +1142,8 @@ Get color space name as string. First call **GetNumberOfColorspaces.** Under Windows and Mac OSX. Under Mac OSX only the first mix source is supported. + + ## Resolution & Frame rate ### GetNumberOfResolutions @@ -1042,12 +1151,13 @@ Under Windows and Mac OSX. Under Mac OSX only the first mix source is supported. #### Declaration -```cpp +```c++ GetNumberOfResolutions(mixSource:int):int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | mixSource|int | set **0** to to get the first mixed source. **1** to get the second mixed source. 1| 1 **—second mixed source is only available on Microsoft Windows** @@ -1064,17 +1174,20 @@ Get count of resolutions. Under Windows and Mac OSX. Under Mac OSX only the first mix source is supported. +----- + ### GetResolution #### Declaration -```cpp +```c++ GetResolution(index:int, mixSource:int):Object ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | index|int | Index of the resolutions. The index of the resolutions, from **0 - GetNumberOfResolutions -1** | | mixSource|int | set **0** to to get the first mixed source. **1** to get the second mixed source. 1| @@ -1092,17 +1205,20 @@ Get count of resolutions. Under Windows and Mac OSX. Under Mac OSX only the first mix source is supported. +----- + ### GetNumberOfFramerates #### Declaration -```cpp +```c++ GetNumberOfFramerates(width:int, height:int, colorspace:String, mixSource:int):int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | width|int | width of the video source | | height|int | height of the video source. | | colorspace|String | name of the color space get from GetColorspace | @@ -1122,17 +1238,20 @@ Get count of available frame rates. Under Windows and Mac OSX. Under Mac OSX only the first mix source is supported. +----- + ### GetFramerate #### Declaration -```cpp +```c++ GetFramerate(index:int, mixSource:int):Number ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | index|int | Index of the frame rate. The index of the frame rate, from **0 - GetNumberOfFramerates -1** | | mixSource|int | set **0** to to get the first mixed source. **1** to get the second mixed source. 1| @@ -1150,16 +1269,19 @@ Get the frame rate of a video source. Call **GetNumberOfFramerates** first. Under Windows and Mac OSX. Under Mac OSX only the first mix source is supported. +----- + ### SetDeinterlacing #### Declaration -```cpp +```c++ SetDeinterlacing(mode:int, method:int):int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | mode|int | possible values: **0**=off, **1**=auto, **2**=on \\ no auto mode for mac | | method|int | possible values: **0**=duplicate field/bob, **1**=blend, **2**=vertical filter, **3**=edge, 4=median, **5**=median2 | @@ -1175,6 +1297,8 @@ Set deinterlacing mode and method. Under Windows and Mac OSX. + + ## Outputs ### GetNumberOfOutputs @@ -1182,7 +1306,7 @@ Under Windows and Mac OSX. #### Declaration -```cpp +```c++ GetNumberOfOutputs():int ``` @@ -1198,17 +1322,20 @@ Get count of outputs. Only Supported under Microsoft Windows. +----- + ### AddOutput #### Declaration -```cpp +```c++ AddOutput(url:String):int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | url|String | Url of outputs can be a local mp4 recording or a rtmp source. | #### Return Value @@ -1223,16 +1350,19 @@ Add new output source with url. Only Supported under Microsoft Windows. +----- + ### SetOutputUrl #### Declaration -```cpp +```c++ SetOutputUrl(url:String, index:int):int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | url|String | Url of outputs can be a local mp4 recording or a rtmp server. | | index|int | Index of the output. | @@ -1248,31 +1378,33 @@ Set output with url. A local mp4 recording or a rtmp server. Under Windows and Mac OSX. - -### GetOutputUrl - +----- +### GetOutputUrl +----- ### GetNumberOfOutputUrls - +----- ### AcceptDataInSampleBuffer +----- ### SetFilesourceFilename #### Declaration -```cpp +```c++ SetFilesourceFilename(url:String):int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | url|String | Url to the local file | #### Return Value @@ -1287,12 +1419,14 @@ Set the filename of a local source. Only Supported under Microsoft Windows. +----- + ### ClearOutputs #### Declaration -```cpp +```c++ ClearOutputs():int ``` @@ -1308,6 +1442,8 @@ Reset all outputs except the first one. Only Supported under Microsoft Windows. + + ## Video Special ### SetVideoEffect @@ -1315,12 +1451,13 @@ Only Supported under Microsoft Windows. #### Declaration -```cpp +```c++ SetVideoEffect(mode:int):int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | mode|int | Mode of video effect. See possible overlay effects on page 33 | #### Return Value @@ -1335,17 +1472,20 @@ Add a video effect. For overlay. Only Supported under Microsoft Windows. +----- + ### SetOverlay #### Declaration -```cpp +```c++ SetOverlay(url:String):int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | url|String | Url of the overlay source. Can be a locale path or server url to a png or txt file. Also can be a txt string. | #### Return Value @@ -1360,17 +1500,20 @@ Add a overlay to the video. Only Supported under Microsoft Windows. +----- + ### ShowPropertyPage #### Declaration -```cpp +```c++ ShowPropertyPage(value:int):int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | value|int | **1** or **0** are possible values | #### Return Value @@ -1385,6 +1528,8 @@ Show property page. Only used for Blackmagic devices. Only supported under Microsoft Windows. + + ## Logging ### SetLog @@ -1392,12 +1537,13 @@ Only supported under Microsoft Windows. #### Declaration -```cpp +```c++ SetLog(logFile:String, logLevel:int):int ``` #### Parameters -{!docs/nanostream/general/nanocosmos_method_parameter_header.md!} +|Name|Type|Description| +|----|----|-----------| | logFile|String | local path for logfile as string. | | logLevel|int | log level as integer. For possible loglevels 0-9. | @@ -1417,7 +1563,7 @@ Under Windows and Mac OSX. Under Windows and Mac OSX. - +----- ### SetXmlProfile @@ -1428,7 +1574,7 @@ Under Windows and Mac OSX. #### Declaration -```cpp +```c++ dispose():void ``` @@ -1440,61 +1586,63 @@ Destructor. Under Windows and Mac OSX. + + # SetConfig Properties | **Property name** | **Description** | **Values** | Mac Platform Support | |-------------------------|------------------------------------------------------------------------|-----------------------------------------------------------------------------------|---------------------| -| license | License string | | ✔ | -| XMLPath | Path to the XML file with configuration information | | ✔ | -| RemoteControlPort | Port number | | ✔ | -| LiveSource | | | ✔ | -| RemoteIP | | | ✔ | -| AVOffsetMs | | | ✔ | -| ReconnectPeriod/ReconnectInterval | | | ✔ | -| ReconnectAttempts | Auto Reconnect No. of Attempts | 5 | ✔ | -| UseInternalReconnect | Use RTMP Internal Reconnect of the RTMP Filter (do not stop encoder on network errors) | 0 / 1 | ✔ | -| UseUnlimitedReconnect | Don't stop reconnecting after a specific number of failed attempts (encoder is not stopped) | 0 / 1 | ✔ | -| Auth | Authentication for RTMP and RTSP Push streaming | “user:password” | ✔ | -| RtmpUrlDelimiter | Set delimiter for RTMP-url and streamname. | Example: ”+“ will split [](rtmp://localhost/live+myStream) so that “myStream” is the stream name. | ✔ | -| DeinterlacingMode | Deinterlacing Mode | 0=off, 1=auto (default), 2=on Note: for some capture devices you need to set this to „on“ (2). (Resolutions 480i, 576i, 1080i) | ✔ | -| DeinterlacingMethod | Deinterlacing Method | 0=duplicate field/bob, 1=blend, 2=vertical filter, 3=edge, 4=median, 5=median2 | ✔ | -| RemoteSendAudioLevelInterval | | | ✔ | -| CaptureRegion | Capture Region of the input source, example for a input resolution of 640×480: SetConfig(“CaptureRegion”, “10,630,10,470”) - discards 10 pixels on each side | left,right,top,bottom | ✔ | -| RTMPPublishMode | RTMP Publish/Live/Record on Server (VOD) | 1=record, 2=append, 0=live (default) | ✔ | -| VideoAudioInput | | | ✔ | -| PreviewNoInvert | | | ✔ | -| ScreenCapMode | Screen Capture Desktop Mode | 0=Screen, 1=FollowMouse, 2=Region relative, 3=Region absolute, 4=Window, 5=Window overlapping | ✔ | -| ScreenCapWindowIndex | | | ✔ | -| ApplyDynamicSettings | | | ✔ | -| Mp4RecordOnTheFlyChangeName | | | ✔ | -| Mp4RecordOnTheFlyControl | If Mp4RecordOnTheFly is enabled, controls start/stop recording | 0=stop, 1=start | ✔ | -| AudioPreview | Enables audio preview during preview or broadcast | 0=no preview, 1=visual preview (default, requires filter AudioVolume), 2=visual and audible preview, 3=audible preview | ✔ | -| Mp4RecordOnTheFly | Enables start/stop recording to local file while the broadcast is running | 0=off (default), 1=on | ✔ | -| H264Quality | H.264 Encoder Quality/Speed Ratio | 0=worst/fastest 1=default 6=highest/slowest | ✔ | -| H264IFrameDistance | H.264 I Frame / GOP Length in Frames (100 Frames = 4 seconds for 25 fps) | 100=default, 1 = I-Frame-Only | ✔ | -| H264PFrameDistance | H.264 P/B Frame Distance | 3 1 = IP-Only (no B-Frames) | ✔ | -| H264Profile | H.264 Encoding Profile | Baseline, Main, Extended, High Most compatible but lowest quality is Baseline, (no B-Frames, no CABAC VLC) | ✔ | -| H264Level | H.264 Level | 10=1.0, 11=1.1, 12=1.2, 13=1.3, 20=2.0, 21=2.1, 22=2.2, 30=3.0, 31=3.1, 32=3.2, 40=4.0, 41=4.1, 42=4.2, 50=5.0, 51=5.1 | ✔ | -| H264VlcMode | H.264 VLC Mode (CAVLC/CABAC) | =CAVLC, 2=CABAC (not allowed in H.264 Baseline Profile) | ✔ | -| OutputFrameRate | Video Output (Encoded) Frame Rate | 5,10,15,20,25,30, OR 23980 OR 29970 | ✔ | -| RTMPWriteTimecode | Send timecodes in RTMP streams, If enabled RTMP timecodes are sent in addition to the always sent RTMP packet timestamps | 0=off (default), 1=on | ✔ | -| UseSystemTimeAsTimecode | Send RTMP/MP4 timecodes as UTC system date time or stream time | 0=stream time (default), 1=UTC system date time | ✔ | -| TimecodeInterval | RTMP/MP4 timecode interval in milliseconds | Should be higher or equal to 1000 (1s) | ✔ | -| TcpConnectTimeout | | | ✔ | -| RTSPSinkMode | Determines if the RTSPSink is running as a server (passive/pull) or as a streamer to a RTSP push capable server (active/push) | 1=server/pull (default), 2=streamer/push | ✔ | -| RTSPSDPFileFolder | | | ✔ | -| RTSPStreamDescription | | | ✔ | -| AudioVolumePerSoftware | Control volume with the Audio Volume Filter | 0=off (default), 1=on | ✔ | -| AVFShowBlackmagicDevices | use AVFoundation for BlackMagic devices | 0=off (default), 1=on | ✔ | -| OverlayRect | Sets the dimensions for a given overlay-image. | “index,left,top,right,bottom”. index: the overlay-index, beginning with 0. left, top, right and bottom define a rectangle in screen-coordinates. | ✔ | -| OverlayAlpha | Sets the alpha-value for overlays. | Range: 0-1. 0.0 (not visable), 1 (fully visable). | ✔ | -| OverlayTextColor | Text Overlay Color | Must be a hexadecimal color-value in BGR-format, e.g.: “0000FF” (255 (0x0000FF) - red) | ✔ | -| OverlayBackgroundColor | | Must be a hexadecimal color-value in BGR-format, e.g.: “000000” (0 (0x000000) - black). | ✔ | -| OverlaySkipColor | Setting skipcolor to a specific value will result in this color to be rendered transparent in the overlays. | Example: If OverlayBackgroundColor was set to blue (“FF0000”) setting OverlaySkipColor to blue as well will result in a transparent background. Parameter must be a hexadecimal color-value in BGR-format, e.g.: “FF0000” (blue). Disable: Setting OverlaySkipColor to “FF000000” (ABGR) will disable the usage of skipcolor. | ✔ | -| AudioDelay | Streaming Audio Delay / Offset (ms) | | ✔ | -| ShowPropertyPageForDevice | Calls the propertypage for a given device. | 0 for device with index: 0 | ✔ | -| UseQuicktimeH264Encoder | | | ✔ | -| RotateDegrees | set the degrees by which video should be rotated, only works if UseRotation is set to on, set before StartPreview or StartBroadcast | 0/90/180/270 | ✔ | +| `license` | License string | | ✔ | +| `XMLPath` | Path to the XML file with configuration information | | ✔ | +| `RemoteControlPort` | Port number | | ✔ | +| `LiveSource` | | | ✔ | +| `RemoteIP` | | | ✔ | +| `AVOffsetMs` | | | ✔ | +| `ReconnectPeriod/ReconnectInterval` | | | ✔ | +| `ReconnectAttempts` | Auto Reconnect No. of Attempts | 5 | ✔ | +| `UseInternalReconnect` | Use RTMP Internal Reconnect of the RTMP Filter (do not stop encoder on network errors) | 0 / 1 | ✔ | +| `UseUnlimitedReconnect` | Don't stop reconnecting after a specific number of failed attempts (encoder is not stopped) | 0 / 1 | ✔ | +| `Auth` | Authentication for RTMP and RTSP Push streaming | “user:password” | ✔ | +| `RtmpUrlDelimiter` | Set delimiter for RTMP-url and streamname. | Example: ”+“ will split [](rtmp://localhost/live+myStream) so that “myStream” is the stream name. | ✔ | +| `DeinterlacingMode` | Deinterlacing Mode | 0=off, 1=auto (default), 2=on Note: for some capture devices you need to set this to „on“ (2). (Resolutions 480i, 576i, 1080i) | ✔ | +| `DeinterlacingMethod` | Deinterlacing Method | 0=duplicate field/bob, 1=blend, 2=vertical filter, 3=edge, 4=median, 5=median2 | ✔ | +| `RemoteSendAudioLevelInterval` | | | ✔ | +| `CaptureRegion` | `Capture` Region of the input source, example for a input resolution of 640×480: SetConfig(“CaptureRegion”, “10,630,10,470”) - discards 10 pixels on each side | left,right,top,bottom | ✔ | +| `RTMPPublishMode` | RTMP Publish/Live/Record on Server (VOD) | 1=record, 2=append, 0=live (default) | ✔ | +| `VideoAudioInput` | | | ✔ | +| `PreviewNoInvert` | | | ✔ | +| `ScreenCapMode` | Screen Capture Desktop Mode | 0=Screen, 1=FollowMouse, 2=Region relative, 3=Region absolute, 4=Window, 5=Window overlapping | ✔ | +| `ScreenCapWindowIndex` | | | ✔ | +| `ApplyDynamicSettings` | | | ✔ | +| `Mp4RecordOnTheFlyChangeName` | | | ✔ | +| `Mp4RecordOnTheFlyControl` | If Mp4RecordOnTheFly is enabled, controls start/stop recording | 0=stop, 1=start | ✔ | +| `AudioPreview` | Enables audio preview during preview or broadcast | 0=no preview, 1=visual preview (default, requires filter AudioVolume), 2=visual and audible preview, 3=audible preview | ✔ | +| `Mp4RecordOnTheFly` | Enables start/stop recording to local file while the broadcast is running | 0=off (default), 1=on | ✔ | +| `H264Quality` | H.264 Encoder Quality/Speed Ratio | 0=worst/fastest 1=default 6=highest/slowest | ✔ | +| `H264IFrameDistance` | H.264 I Frame / GOP Length in Frames (100 Frames = 4 seconds for 25 fps) | 100=default, 1 = I-Frame-Only | ✔ | +| `H264PFrameDistance` | H.264 P/B Frame Distance | 3 1 = IP-Only (no B-Frames) | ✔ | +| `H264Profile` | H.264 Encoding Profile | Baseline, Main, Extended, High Most compatible but lowest quality is Baseline, (no B-Frames, no CABAC VLC) | ✔ | +| `H264Level` | H.264 Level | 10=1.0, 11=1.1, 12=1.2, 13=1.3, 20=2.0, 21=2.1, 22=2.2, 30=3.0, 31=3.1, 32=3.2, 40=4.0, 41=4.1, 42=4.2, 50=5.0, 51=5.1 | ✔ | +| `H264VlcMode` | H.264 VLC Mode (CAVLC/CABAC) | =CAVLC, 2=CABAC (not allowed in H.264 Baseline Profile) | ✔ | +| `OutputFrameRate` | Video Output (Encoded) Frame Rate | 5,10,15,20,25,30, OR 23980 OR 29970 | ✔ | +| `RTMPWriteTimecode` | Send timecodes in RTMP streams, If enabled RTMP timecodes are sent in addition to the always sent RTMP packet timestamps | 0=off (default), 1=on | ✔ | +| `UseSystemTimeAsTimecode` | Send RTMP/MP4 timecodes as UTC system date time or stream time | 0=stream time (default), 1=UTC system date time | ✔ | +| `TimecodeInterval` | RTMP/MP4 timecode interval in milliseconds | Should be higher or equal to 1000 (1s) | ✔ | +| `TcpConnectTimeout` | | | ✔ | +| `RTSPSinkMode` | Determines if the RTSPSink is running as a server (passive/pull) or as a streamer to a RTSP push capable server (active/push) | 1=server/pull (default), 2=streamer/push | ✔ | +| `RTSPSDPFileFolder` | | | ✔ | +| `RTSPStreamDescription` | | | ✔ | +| `AudioVolumePerSoftware` | Control volume with the Audio Volume Filter | 0=off (default), 1=on | ✔ | +| `AVFShowBlackmagicDevices` | use AVFoundation for BlackMagic devices | 0=off (default), 1=on | ✔ | +| `OverlayRect` | Sets the dimensions for a given overlay-image. | “index,left,top,right,bottom”. index: the overlay-index, beginning with 0. left, top, right and bottom define a rectangle in screen-coordinates. | ✔ | +| `OverlayAlpha` | Sets the alpha-value for overlays. | Range: 0-1. 0.0 (not visable), 1 (fully visable). | ✔ | +| `OverlayTextColor` | Text Overlay Color | Must be a hexadecimal color-value in BGR-format, e.g.: “0000FF” (255 (0x0000FF) - red) | ✔ | +| `OverlayBackgroundColor` | | Must be a hexadecimal color-value in BGR-format, e.g.: “000000” (0 (0x000000) - black). | ✔ | +| `OverlaySkipColor` | Setting skipcolor to a specific value will result in this color to be rendered transparent in the overlays. | Example: If OverlayBackgroundColor was set to blue (“FF0000”) setting OverlaySkipColor to blue as well will result in a transparent background. Parameter must be a hexadecimal color-value in BGR-format, e.g.: “FF0000” (blue). Disable: Setting OverlaySkipColor to “FF000000” (ABGR) will disable the usage of skipcolor. | ✔ | +| `AudioDelay` | Streaming Audio Delay / Offset (ms) | | ✔ | +| `ShowPropertyPageForDevice` | Calls the propertypage for a given device. | 0 for device with index: 0 | ✔ | +| `UseQuicktimeH264Encoder` | | | ✔ | +| `RotateDegrees` | set the degrees by which video should be rotated, only works if UseRotation is set to on, set before StartPreview or StartBroadcast | 0/90/180/270 | ✔ | diff --git a/docs/nanostream/nanostream.md b/docs/nanostream/nanostream.md index ac445faa6..b11fd629f 100644 --- a/docs/nanostream/nanostream.md +++ b/docs/nanostream/nanostream.md @@ -13,19 +13,19 @@ Android, iOS, Windows, MacOS For Web based SDKs (WebRTC, H5Live) please check the main index. -### [nanoStream SDK for iOS Documentation](nanostream/ios/nanostream-ios-sdk.md) +### [nanoStream SDK for iOS Documentation](ios/nanostream_ios_sdk) The nanoStream iOS documentation provides a short introduction in the basic usage of the nanoStream SDK for iOS. -### [MacOS](nanostream/macos/nanostream-macos-sdk.md) +### [MacOS](macos/nanostream_macos_sdk) An introduction into the nanoStream SDK for MacOS and streaming with it. ### Windows -#### [Developer Manual](nanostream/windows/windows_developer_manual.md) & [Binary Modules](nanostream/windows/windows_binares.md) +#### [Developer Manual](windows/nanostream_windows_developer_manual) & [Binary Modules](windows/nanostream_windows_binaries) An overview over the available components for windows and directshow including the GUI-Software and the directshow filter. -#### [License help](nanostream/windows/windows_license_help.md) +#### [License help](windows/nanostream_windows_license_help) A tutorial on how to register the license in windows correctly. -#### [RTMP Network Renderer & Writer](nanostream/windows/windows_networkwriter.md) +#### [RTMP Network Renderer & Writer](windows/nanostream_windows_networkwriter) Description of the RTMP Network Renderer & Writer filter for directshow. -#### Language integration +#### [Language integration](windows/nanostream_windows_language_integration) diff --git a/docs/nanostream/web/nanostream-4.x-web-api.md b/docs/nanostream/web/nanostream_4.x_web_api.md similarity index 96% rename from docs/nanostream/web/nanostream-4.x-web-api.md rename to docs/nanostream/web/nanostream_4.x_web_api.md index f2e00aeaf..4dd4d1146 100644 --- a/docs/nanostream/web/nanostream-4.x-web-api.md +++ b/docs/nanostream/web/nanostream_4.x_web_api.md @@ -1,3 +1,9 @@ +--- +id: nanostream_4.x_web_api +title: nanoStream Web API 4.x +sidebar_label: nanoStream Web API 4.x +--- + nanoStream Live Video Encoder ============================ Webcaster / Browser based Live Encoder @@ -6,7 +12,7 @@ Compatible to NPAPI, ActiveX and Chrome Extension (c) 2015 nanocosmos gmbh -**Work in Progress** +**Note: This API is deprecated! Please use WebRTC.live and H5Live!** # NANO.NanoStream @@ -23,50 +29,12 @@ Compatible to NPAPI, ActiveX and Chrome Extension * Availability * Since nanoStream 4.0 -## NanoStream Summary - -* [API Methods (async with callbacks)](#api_methods_async_with_callbacks) - * [GetAudioDeviceConfig](#getaudiodeviceconfig) - * [GetAudioDevices](#getaudiodevices) - * [GetAudioLevels](#getaudiolevels) - * [GetConfig](#getconfig) - * [GetInputs](#getinputs) - * [GetOutputs](#getoutputs) - * [GetVideoDeviceConfig](#getvideodeviceconfig) - * [GetVideoDevices](#getvideodevices) - * [GetWindows](#getwindows) - * [SaveXmlProfile](#savexmlprofile) - * [SetAudioVolume](#setaudiovolume) - * [SetConfigs](#setconfigs) - * [SetInputs](#setinputs) - * [SetOutputs](#setoutputs) - * [SetPictureInPictureSize](#setpictureinpicturesize) - * [SetVideoMixingMode](#setvideomixingmode) - * [SetXmlProfile](#setxmlprofile) - * [StartBroadcast](#startbroadcast) - * [StartPreview](#startpreview) - * [StopBroadcast](#stopbroadcast) - * [StopPreview](#stoppreview) - * [Init](#init) - -* [Helper Methods (sync)](#helper_methods_sync) - * [DetectBrowser](#detectbrowser) - * [InstallExtensionInline](#installextensioninline) - * [InstallExtensionWebstore](#installextensionwebstore) - * [FireEvent](#fireevent) - -* [Events](#events) - * [onError](#onerror) - * [onNotifyEvent](#onnotifyevent) - * [onStopEvent](#onstopevent) - * [onSupported](#onsupported) - * [onUnsupported](#onunsupported) ## API Methods (async with callbacks) ### GetAudioDeviceConfig -[up to summary](#nanostream_summary) + _object_ NANO.NanoStream.GetAudioDeviceConfig(_integer_ index, _function_ successCallback, _function_ errorCallback) @@ -195,13 +163,13 @@ _object_ NANO.NanoStream.GetAudioDeviceConfig(_integer_ index, _function_ succes console.log("Call: " + JSON.stringify(message)); ``` -[up](#getaudiodeviceconfig) + --- ### GetAudioDevices -[up to summary](#nanostream_summary) + _object_ NANO.NanoStream.GetAudioDevices(_function_ successCallback, _function_ errorCallback) @@ -321,13 +289,13 @@ _object_ NANO.NanoStream.GetAudioDevices(_function_ successCallback, _function_ console.log("Call: " + JSON.stringify(message)); ``` -[up](#getaudiodevices) + --- ### GetAudioLevels -[up to summary](#nanostream_summary) + _object_ NANO.NanoStream.GetAudioLevels(_function_ successCallback, _function_ errorCallback) @@ -421,13 +389,13 @@ _object_ NANO.NanoStream.GetAudioLevels(_function_ successCallback, _function_ e }, null); ``` -[up](#getaudiolevels) + --- ### GetConfig -[up to summary](#nanostream_summary) + _object_ NANO.NanoStream.GetConfig(_string_ key, _function_ successCallback, _function_ errorCallback) @@ -524,7 +492,7 @@ _object_ NANO.NanoStream.GetConfig(_string_ key, _function_ successCallback, _fu console.log("Call: " + JSON.stringify(message)); ``` -[up](#getconfig) + --- @@ -534,7 +502,7 @@ _object_ NANO.NanoStream.GetConfig(_string_ key, _function_ successCallback, _fu ### GetVideoDeviceConfig -[up to summary](#nanostream_summary) + _object_ NANO.NanoStream.GetVideoDeviceConfig(_integer_ index, _function_ successCallback, _function_ errorCallback) @@ -739,13 +707,13 @@ _object_ NANO.NanoStream.GetVideoDeviceConfig(_integer_ index, _function_ succes console.log("Call: " + JSON.stringify(message)); ``` -[up](#getvideodeviceconfig) + --- ### GetVideoDevices -[up to summary](#nanostream_summary) + _object_ NANO.NanoStream.GetVideoDevices(_function_ successCallback, _function_ errorCallback) @@ -865,7 +833,7 @@ _object_ NANO.NanoStream.GetVideoDevices(_function_ successCallback, _function_ console.log("Call: " + JSON.stringify(message)); ``` -[up](#getvideodevices) + --- @@ -873,7 +841,7 @@ _object_ NANO.NanoStream.GetVideoDevices(_function_ successCallback, _function_ ### SaveXmlProfile -[up to summary](#nanostream_summary) + _object_ NANO.NanoStream.SaveXmlProfile(_string_ path, _function_ successCallback, _function_ errorCallback) @@ -966,13 +934,13 @@ _object_ NANO.NanoStream.SaveXmlProfile(_string_ path, _function_ successCallbac console.log("Call: " + JSON.stringify(message)); ``` -[up](#savexmlprofile) + --- ### SetAudioVolume -[up to summary](#nanostream_summary) + _object_ NANO.NanoStream.SetAudioVolume(_integer_ volume, _function_ successCallback, _function_ errorCallback) @@ -1067,13 +1035,13 @@ _object_ NANO.NanoStream.SetAudioVolume(_integer_ volume, _function_ successCall console.log("Call: " + JSON.stringify(message)); ``` -[up](#setaudiovolume) + --- ### SetConfigs -[up to summary](#nanostream_summary) + _object_ NANO.NanoStream.SetConfigs(_object_ [nanoConfigObject](#nano_config), _function_ successCallback, _function_ errorCallback) @@ -1178,7 +1146,7 @@ _object_ NANO.NanoStream.SetConfigs(_object_ [nanoConfigObject](#nano_config), _ console.log("Call: " + JSON.stringify(message)); ``` -[up](#setconfig) + --- @@ -1189,7 +1157,7 @@ _object_ NANO.NanoStream.SetConfigs(_object_ [nanoConfigObject](#nano_config), _ ### SetPictureInPictureSize -[up to summary](#nanostream_summary) + _object_ NANO.NanoStream.SetPictureInPictureSize(_integer_ size, _function_ successCallback, _function_ errorCallback) @@ -1284,13 +1252,13 @@ _object_ NANO.NanoStream.SetPictureInPictureSize(_integer_ size, _function_ succ console.log("Call: " + JSON.stringify(message)); ``` -[up](#setpictureinpicturesize) + --- ### SetVideoMixingMode -[up to summary](#nanostream_summary) + _object_ NANO.NanoStream.SetVideoMixingMode(_integer_ mode, _function_ successCallback, _function_ errorCallback) @@ -1385,13 +1353,13 @@ _object_ NANO.NanoStream.SetVideoMixingMode(_integer_ mode, _function_ successCa console.log("Call: " + JSON.stringify(message)); ``` -[up](#setvideomixingmode) + --- ### SetXmlProfile -[up to summary](#nanostream_summary) + _object_ NANO.NanoStream.SetXmlProfile(_string_ path, _function_ successCallback, _function_ errorCallback) @@ -1484,13 +1452,13 @@ _object_ NANO.NanoStream.SetXmlProfile(_string_ path, _function_ successCallback console.log("Call: " + JSON.stringify(message)); ``` -[up](#setxmlprofile) + --- ### StartBroadcast -[up to summary](#nanostream_summary) + _object_ NANO.NanoStream.StartBroadcast(_function_ successCallback, _function_ errorCallback) @@ -1584,13 +1552,13 @@ _object_ NANO.NanoStream.StartBroadcast(_function_ successCallback, _function_ e console.log("Call: " + JSON.stringify(message)); ``` -[up](#startbroadcast) + --- ### StartPreview -[up to summary](#nanostream_summary) + _object_ NANO.NanoStream.StartPreview(_function_ successCallback, _function_ errorCallback) @@ -1684,13 +1652,13 @@ _object_ NANO.NanoStream.StartPreview(_function_ successCallback, _function_ err console.log("Call: " + JSON.stringify(message)); ``` -[up](#startpreview) + --- ### StopBroadcast -[up to summary](#nanostream_summary) + _object_ NANO.NanoStream.StopBroadcast(_function_ successCallback, _function_ errorCallback) @@ -1780,13 +1748,13 @@ _object_ NANO.NanoStream.StopBroadcast(_function_ successCallback, _function_ er console.log("Call: " + JSON.stringify(message)); ``` -[up](#stopbroadcast) + --- ### StopPreview -[up to summary](#nanostream_summary) + _object_ NANO.NanoStream.StopPreview(_function_ successCallback, _function_ errorCallback) @@ -1876,13 +1844,13 @@ _object_ NANO.NanoStream.StopPreview(_function_ successCallback, _function_ erro console.log("Call: " + JSON.stringify(message)); ``` -[up](#stoppreview) + --- ### Init -[up to summary](#nanostream_summary) + _object_ NANO.NanoStream.Init(_string_ elementId, _string_ license, _function_ successCallback, _function_ errorCallback) @@ -2019,7 +1987,7 @@ _object_ NANO.NanoStream.Init(_string_ elementId, _string_ license, _function_ s console.log("Call: " + JSON.stringify(message)); ``` -[up](#init) + --- diff --git a/docs/nanostream/web/live_video_encoder_-_plugin_jscript.md b/docs/nanostream/web/nanostream_live_video_encoder_-_plugin_jscript.md similarity index 66% rename from docs/nanostream/web/live_video_encoder_-_plugin_jscript.md rename to docs/nanostream/web/nanostream_live_video_encoder_-_plugin_jscript.md index fd91330f9..4a6250824 100644 --- a/docs/nanostream/web/live_video_encoder_-_plugin_jscript.md +++ b/docs/nanostream/web/nanostream_live_video_encoder_-_plugin_jscript.md @@ -1,31 +1,39 @@ -## Live Video Encoder - Plugin API +--- +id: nanostream_live_video_encoder_-_plugin_jscript +title: Live Video Encoder - Plugin API +sidebar_label: Live Video Encoder - Plugin API +--- -**NOTE: This is the Plugin API for NPAPI and ActiveX. -For using Chrome Browsers, see our [nanoStream Web API 4.x][5092bc08] -** +**Note: This API is deprecated! Please use WebRTC.live and H5Live!** +> **NOTE**: +> +> This is the Plugin API for NPAPI and ActiveX. For using Chrome Browsers, see our [nanoStream Web API 4.x](./nanostream-4.x-web-api.md) -### Browser based usage with HTML and Javascript -The Live Video Encoder core components are available as plugins for several browsers:\\ -Internet Explorer (IE), based on ActiveX, and NP-Plugin based browsers (Firefox, Safari, Chrome).\\ -The same API is valid for integration into other languages, C++, .NET, Delphi, etc.\\ -See the sample web page for functionality or contact us for further help.\\ +## Browser based usage with HTML and Javascript -### How to embed the encoder plugin into HTML +The Live Video Encoder core components are available as plugins for several browsers: +Internet Explorer (IE), based on `ActiveX`, and NP-Plugin based browsers (Firefox, Safari, Chrome). The same API is valid for integration into other languages, `C++`, `.NET`, `Delphi`, etc. See the sample web page for functionality or contact us for further help. -#### Active-X Control -The Active-X Control is compatible with Microsoft Internet Explorer only. It is loaded by specifying the classid for the plugin. The plugin then may be accessed by Javascript via the ID specified, here "nanovid1". + +## How to embed the encoder plugin into HTML + +### Active-X Control + +The Active-X Control is compatible with Microsoft Internet Explorer only. It is loaded by specifying the classid for the plugin. The plugin then may be accessed by Javascript via the ID specified, here `nanovid1`. **Simple Version without auto-install:** + ```xml ``` **Advanced Version with auto-install from CAB file:** + ```xml ``` -Note: replace the codebase path and version with the cab file you received for installation. +> **Note**: replace the codebase path and version with the cab file you received for installation. -#### NPAPI Plugin +### NPAPI Plugin The NPAPI plugin is compatible with Mozilla Firefox, Apple Safari and Google Chrome. @@ -50,9 +58,11 @@ The NPAPI plugin is compatible with Mozilla Firefox, Apple Safari and Google Chr ``` -It may be used with an tag as well. +It may be used with an `` tag as well. + -#### Browser independent plugin loading + +### Browser independent plugin loading The object tags may be nested to support all browser types: @@ -67,12 +77,14 @@ The object tags may be nested to support all browser types: ``` -#### License and other custom settings -The License key is a string which needs to be placed into the nanoLicense.js file.\\ -The nanoLicense.js also contains the mime type and path to the Mozilla based plugin (XPI). The default path is "../packages/nanostream.xpi": -##### Contents of nanoLicense.js +### License and other custom settings + +The License key is a string which needs to be placed into the `nanoLicense.js` file.\\ +The `nanoLicense.js` also contains the mime type and path to the Mozilla based plugin (XPI). The default path is `../packages/nanostream.xpi`: + +#### Contents of nanoLicense.js ```javascript // nanoStream License Code and custom settings @@ -84,7 +96,8 @@ var nano_xpi_source = "../packages/nanostream.xpi"; ``` -#### Dynamic DOM Loading of the Plugin + +### Dynamic DOM Loading of the Plugin The plugin may be loaded into the HTML Document (DOM) by dynamically creating it with Javascript: @@ -100,28 +113,32 @@ function createNanoVideoObject() } ``` -### Accessing the plugin -nanoStream is then available as a DOM object with the id "nanovid1". The member functions and variables can be accessed as other Javascript objects, e.g. nanovid1.StartPreview(). -### Plugin Interface +## Accessing the plugin + +nanoStream is then available as a `DOM object` with the id `nanovid1`. The member functions and variables can be accessed as other Javascript objects, e.g. `nanovid1.StartPreview()`. + + + +## Plugin Interface The nanoStream Plugin may be controlled from almost any language which is able to load the plugin.\\ The plugin exposes methods and properties to set options, start preview and encoding. -#### List of Properties/Functions with example settings: +### List of Properties/Functions with example settings: ```javascript destination URL (Flash or Wowza Media Server, or local file) nanovid1.DestinationURL = "rtmp://localhost/live+myStream"; nanovid1.DestinationURL = "c:\temp\h264.mp4"; -nanovid1.VideoSource = 0; // Video Capture Device ID -nanovid1.AudioSource = 0; // Audio Capture Device ID -nanovid1.VideoBitrate = 400000; // Video Bitrate (bits/s) -nanovid1.AudioBitrate = 32000; // Audio Bitrate (bits/s) -nanovid1.VideoWidth = 352; // Video Pixel Width -nanovid1.VideoHeight = 288; // Video Pixel Height -nanovid1.VideoFrameRate = 15; // Video FPS +nanovid1.VideoSource = 0; // Video Capture Device ID +nanovid1.AudioSource = 0; // Audio Capture Device ID +nanovid1.VideoBitrate = 400000; // Video Bitrate (bits/s) +nanovid1.AudioBitrate = 32000; // Audio Bitrate (bits/s) +nanovid1.VideoWidth = 352; // Video Pixel Width +nanovid1.VideoHeight = 288; // Video Pixel Height +nanovid1.VideoFrameRate = 15; // Video FPS //start the preview from the current camera nanovid1.StartPreview(); @@ -130,15 +147,17 @@ nanovid1.StartPreview(); nanovid1.StartBroadcast(); ``` -#### Javascript Helper Functions -For simple usage, a set of Javascript functions is provided (nanoEncoder.js). + +### Javascript Helper Functions + +For simple usage, a set of Javascript functions is provided (`nanoEncoder.js`). ```javascript // setup a live stream to a Flash Media/Wowza server SetEncodingUrl("rtmp://myServer.com/live/myStream"); -SetVideoBitrate(400000); // sets the bitrate to 400 kbps -OnStartPreview(); // calls nanovid1.StartPreview() -OnStartBroadcast(); // calls nanovid1.StartBroadcast() +SetVideoBitrate(400000); // sets the bitrate to 400 kbps +OnStartPreview(); // calls nanovid1.StartPreview() +OnStartBroadcast(); // calls nanovid1.StartBroadcast() ``` Additional Configuration can be set with **nanoSetConfig();** @@ -148,7 +167,9 @@ Example: nanoSetConfig("H264Profile","Baseline"); ``` -#### Javascript API (nanoEncoder.js) + + +### Javascript API (`nanoEncoder.js`) ```javascript // SetEncodingUrl() @@ -201,10 +222,17 @@ function nanoSetOptions() function nanoSetLicense(license) // call this before Init ``` -### New functions for Version 1.5 -Special configuration data can be sent with the SetConfig method:\\ + +## New functions for Version 1.5 + +Special configuration data can be sent with the `SetConfig` method: + +```javascript nanovid1.SetConfig(property,value); +``` + + For some functions wrapper functions are available. @@ -219,7 +247,7 @@ nanoSetH264IFrameDistance(50); // Default=50 // special h264 settings nanoSetH264Profile(0); // 0 or "Baseline", 1 or "Main" -nanoSetH264VlcMode(1); // VLC mode: 0=auto, 1=cavlc, 2=cabac +nanoSetH264VlcMode(1); // VLC mode: 0=auto, 1=cavlc, 2=cabac // Constant/Variable Bit Rate nanoSetConfig("RateControl",0); // 0=auto, 1=cbr, 2=vbr @@ -255,26 +283,29 @@ nanoSetConfig("DeinterlacingMode", m); // 0=off, 1=auto, 2=always nanoSetConfig("DeinterlacingMethod", m); // 0=bob/weave, 1=blend, 2=filter, 3=edge ``` -### New Javascript functions for Version 2.0 -Beginning with nanoStream API 2.0, the Javascript code has been restructured with a surrounding object "nanoStream.api". -Simple example:\\ -In nanoEncoder.js: +## New Javascript functions for Version 2.0 + +Beginning with nanoStream API 2.0, the Javascript code has been restructured with a surrounding object `nanoStream.api`. + +**Simple example:** + +In `nanoEncoder.js`: ```javascript // set one global liveObj var liveObj = nanoStream.api; ``` -HTML usage:\\ + +HTML usage: Button with "StartBroadcast" event handler: -````html + +```html ``` -See nanoStream.html for an example implementation. - -For 2.0, there are a number of additional API functions available which are documented in the separate documentation //LiveVideoEncoder-Plugin-API. +See `nanoStream.html` for an example implementation. - [5092bc08]: ./nanostream-4.x-web-api.md "nanoStream Web API 4.x" +For 2.0, there are a number of additional API functions available which are documented in the separate documentation LiveVideoEncoder-Plugin-API. \ No newline at end of file diff --git a/docs/nanostream/windows/language_integration/img/Delphi_FormArea.png b/docs/nanostream/windows/img/Delphi_FormArea.png similarity index 100% rename from docs/nanostream/windows/language_integration/img/Delphi_FormArea.png rename to docs/nanostream/windows/img/Delphi_FormArea.png diff --git a/docs/nanostream/windows/language_integration/img/Delphi_button.png b/docs/nanostream/windows/img/Delphi_button.png similarity index 100% rename from docs/nanostream/windows/language_integration/img/Delphi_button.png rename to docs/nanostream/windows/img/Delphi_button.png diff --git a/docs/nanostream/windows/language_integration/img/Delphi_import_activex-264x300.png b/docs/nanostream/windows/img/Delphi_import_activex-264x300.png similarity index 100% rename from docs/nanostream/windows/language_integration/img/Delphi_import_activex-264x300.png rename to docs/nanostream/windows/img/Delphi_import_activex-264x300.png diff --git a/docs/nanostream/windows/language_integration/img/Delphi_rtmp_activex-300x86.png b/docs/nanostream/windows/img/Delphi_rtmp_activex-300x86.png similarity index 100% rename from docs/nanostream/windows/language_integration/img/Delphi_rtmp_activex-300x86.png rename to docs/nanostream/windows/img/Delphi_rtmp_activex-300x86.png diff --git a/docs/nanostream/windows/language_integration/img/c_sharp_1-300x202.png b/docs/nanostream/windows/img/c_sharp_1-300x202.png similarity index 100% rename from docs/nanostream/windows/language_integration/img/c_sharp_1-300x202.png rename to docs/nanostream/windows/img/c_sharp_1-300x202.png diff --git a/docs/nanostream/windows/language_integration/img/c_sharp_2-241x300.png b/docs/nanostream/windows/img/c_sharp_2-241x300.png similarity index 100% rename from docs/nanostream/windows/language_integration/img/c_sharp_2-241x300.png rename to docs/nanostream/windows/img/c_sharp_2-241x300.png diff --git a/docs/nanostream/windows/language_integration/img/c_sharp_3-300x206.png b/docs/nanostream/windows/img/c_sharp_3-300x206.png similarity index 100% rename from docs/nanostream/windows/language_integration/img/c_sharp_3-300x206.png rename to docs/nanostream/windows/img/c_sharp_3-300x206.png diff --git a/docs/nanostream/windows/language_integration/img/c_sharp_5-278x300.png b/docs/nanostream/windows/img/c_sharp_5-278x300.png similarity index 100% rename from docs/nanostream/windows/language_integration/img/c_sharp_5-278x300.png rename to docs/nanostream/windows/img/c_sharp_5-278x300.png diff --git a/docs/nanostream/windows/language_integration/img/c_sharp_6-300x300.png b/docs/nanostream/windows/img/c_sharp_6-300x300.png similarity index 100% rename from docs/nanostream/windows/language_integration/img/c_sharp_6-300x300.png rename to docs/nanostream/windows/img/c_sharp_6-300x300.png diff --git a/docs/nanostream/windows/language_integration/img/delphi_1-300x95.png b/docs/nanostream/windows/img/delphi_1-300x95.png similarity index 100% rename from docs/nanostream/windows/language_integration/img/delphi_1-300x95.png rename to docs/nanostream/windows/img/delphi_1-300x95.png diff --git a/docs/nanostream/windows/language_integration/img/nanostream_activex_visualcpp_mfc1.png b/docs/nanostream/windows/img/nanostream_activex_visualcpp_mfc1.png similarity index 100% rename from docs/nanostream/windows/language_integration/img/nanostream_activex_visualcpp_mfc1.png rename to docs/nanostream/windows/img/nanostream_activex_visualcpp_mfc1.png diff --git a/docs/nanostream/windows/language_integration/img/nanostream_activex_visualcpp_mfc10.png b/docs/nanostream/windows/img/nanostream_activex_visualcpp_mfc10.png similarity index 100% rename from docs/nanostream/windows/language_integration/img/nanostream_activex_visualcpp_mfc10.png rename to docs/nanostream/windows/img/nanostream_activex_visualcpp_mfc10.png diff --git a/docs/nanostream/windows/language_integration/img/nanostream_activex_visualcpp_mfc2.png b/docs/nanostream/windows/img/nanostream_activex_visualcpp_mfc2.png similarity index 100% rename from docs/nanostream/windows/language_integration/img/nanostream_activex_visualcpp_mfc2.png rename to docs/nanostream/windows/img/nanostream_activex_visualcpp_mfc2.png diff --git a/docs/nanostream/windows/language_integration/img/nanostream_activex_visualcpp_mfc3.png b/docs/nanostream/windows/img/nanostream_activex_visualcpp_mfc3.png similarity index 100% rename from docs/nanostream/windows/language_integration/img/nanostream_activex_visualcpp_mfc3.png rename to docs/nanostream/windows/img/nanostream_activex_visualcpp_mfc3.png diff --git a/docs/nanostream/windows/language_integration/img/nanostream_activex_visualcpp_mfc4.png b/docs/nanostream/windows/img/nanostream_activex_visualcpp_mfc4.png similarity index 100% rename from docs/nanostream/windows/language_integration/img/nanostream_activex_visualcpp_mfc4.png rename to docs/nanostream/windows/img/nanostream_activex_visualcpp_mfc4.png diff --git a/docs/nanostream/windows/language_integration/img/nanostream_activex_visualcpp_mfc5.png b/docs/nanostream/windows/img/nanostream_activex_visualcpp_mfc5.png similarity index 100% rename from docs/nanostream/windows/language_integration/img/nanostream_activex_visualcpp_mfc5.png rename to docs/nanostream/windows/img/nanostream_activex_visualcpp_mfc5.png diff --git a/docs/nanostream/windows/language_integration/img/nanostream_activex_visualcpp_mfc6.png b/docs/nanostream/windows/img/nanostream_activex_visualcpp_mfc6.png similarity index 100% rename from docs/nanostream/windows/language_integration/img/nanostream_activex_visualcpp_mfc6.png rename to docs/nanostream/windows/img/nanostream_activex_visualcpp_mfc6.png diff --git a/docs/nanostream/windows/language_integration/img/nanostream_activex_visualcpp_mfc7.png b/docs/nanostream/windows/img/nanostream_activex_visualcpp_mfc7.png similarity index 100% rename from docs/nanostream/windows/language_integration/img/nanostream_activex_visualcpp_mfc7.png rename to docs/nanostream/windows/img/nanostream_activex_visualcpp_mfc7.png diff --git a/docs/nanostream/windows/language_integration/img/nanostream_activex_visualcpp_mfc8.png b/docs/nanostream/windows/img/nanostream_activex_visualcpp_mfc8.png similarity index 100% rename from docs/nanostream/windows/language_integration/img/nanostream_activex_visualcpp_mfc8.png rename to docs/nanostream/windows/img/nanostream_activex_visualcpp_mfc8.png diff --git a/docs/nanostream/windows/language_integration/img/nanostream_activex_visualcpp_mfc9.png b/docs/nanostream/windows/img/nanostream_activex_visualcpp_mfc9.png similarity index 100% rename from docs/nanostream/windows/language_integration/img/nanostream_activex_visualcpp_mfc9.png rename to docs/nanostream/windows/img/nanostream_activex_visualcpp_mfc9.png diff --git a/docs/nanostream/windows/language_integration/img/visualc_1-300x215.png b/docs/nanostream/windows/img/visualc_1-300x215.png similarity index 100% rename from docs/nanostream/windows/language_integration/img/visualc_1-300x215.png rename to docs/nanostream/windows/img/visualc_1-300x215.png diff --git a/docs/nanostream/windows/language_integration/img/visualc_2-300x252.png b/docs/nanostream/windows/img/visualc_2-300x252.png similarity index 100% rename from docs/nanostream/windows/language_integration/img/visualc_2-300x252.png rename to docs/nanostream/windows/img/visualc_2-300x252.png diff --git a/docs/nanostream/windows/img/windows_developer_manual_graph_studio.png b/docs/nanostream/windows/img/windows_developer_manual_graph_studio.png deleted file mode 100644 index fc711539c..000000000 Binary files a/docs/nanostream/windows/img/windows_developer_manual_graph_studio.png and /dev/null differ diff --git a/docs/nanostream/windows/img/windows_networkwriter_properties.png b/docs/nanostream/windows/img/windows_networkwriter_properties.png deleted file mode 100644 index ab6f247e6..000000000 Binary files a/docs/nanostream/windows/img/windows_networkwriter_properties.png and /dev/null differ diff --git a/docs/nanostream/windows/language_integration/nanostream_activex_visualcpp.md b/docs/nanostream/windows/language_integration/nanostream_activex_visualcpp.md deleted file mode 100644 index e55dcb130..000000000 --- a/docs/nanostream/windows/language_integration/nanostream_activex_visualcpp.md +++ /dev/null @@ -1,13 +0,0 @@ -# nanoStream Visual C++ Integration -This tutorial shows how to create a custom Live Encoding and Streaming application with the nanoStream plugins, based on VisualStudio and C++ for a simple console application. -*This tutorial was created with VisualStudio 2008 but should work similar with VS 2010.* -Create a new Win32 Console Application Project (File/New Project) - - -![visualc_1](img/visualc_1-300x215.png) -  - -Leave all options to default and press “Finish” - - -![visualc_2](img/visualc_2-300x252.png) diff --git a/docs/nanostream/windows/language_integration/nanostream_activex_visualcpp_mfc.md b/docs/nanostream/windows/language_integration/nanostream_activex_visualcpp_mfc.md deleted file mode 100644 index 6b8222060..000000000 --- a/docs/nanostream/windows/language_integration/nanostream_activex_visualcpp_mfc.md +++ /dev/null @@ -1,98 +0,0 @@ -# nanoStream VisualC++ MFC Integration -This tutorial shows how to create a custom Live Encoding and Streaming application with the nanoStream plugins, based on VisualStudio, C++ and MFC. -This tutorial was created with VisualStudio 2008 but should work similar with VS 2010. -Create a new MFC Application Project (File/New Project) - - -![mfc_1](img/nanostream_activex_visualcpp_mfc1.png) - -  - -In the following MFC Application Wizard, select “Dialog Based Application” - -![mfc_2](img/nanostream_activex_visualcpp_mfc2.png) - -Select all default values for the rest and Finish - - -![mfc_3](img/nanostream_activex_visualcpp_mfc3.png) - -  - -A new project solution is created based on an empty dialog. - -Right-click on the dialog and select “Insert ActiveX Control…” - - -![mfc_4](img/nanostream_activex_visualcpp_mfc4.png) - -  - -Select “nanoStream RTMPActiveX Class” - - -![mfc_5](img/nanostream_activex_visualcpp_mfc5.png) - -  - -Position and resize the control window accordingly. - -The window will show a live camera preview later. - - -![mfc_6](img/nanostream_activex_visualcpp_mfc6.png) - -  - -Create a class member variable for the control for simpler access: - -![mfc_7](img/nanostream_activex_visualcpp_mfc7.png) - -![mfc_8](img/nanostream_activex_visualcpp_mfc8.png) - -Now let us create a button to create a camera preview. - -From the Toolbox, select “Button” and place the button on the dialog. - -![mfc_9](img/nanostream_activex_visualcpp_mfc9.png) - -  - -Double-Click on the button to edit the new source code event handler: - -![mfc_10](img/nanostream_activex_visualcpp_mfc10.png) - -  - -This is the complete code which shows the camera preview: - -```cpp -void CnanoStreamTestDlg::OnBnClickedButton1() -{ -//nanoStream Live Video Encoder Plugin -m_nanoStream.InitEncoder(); // Init Encoder -m_nanoStream.put_VideoSource(0); // Select Video Capture Source -m_nanoStream.StartPreview(); // Start Camera Preview in Window -} -``` -  - -Now add another button to start a real encoded stream. -Add the following code to the button: -```cpp -void CnanoStreamTestDlg::OnBnClickedButton2() -{ -// nanoStream Live Video Encoder Plugin -// Live Encoding/Streaming to RTMP Server -m_nanoStream.put_License(_T("nlic:1.0:nanoLiveEncDemo:1.1:LivePlgDemo=1,MP4=1,RTMP=1,.....")); -m_nanoStream.InitEncoder(); // Init Encoder -m_nanoStream.put_VideoSource(0); // Select Video Capture Source -m_nanoStream.put_VideoBitrate(500000); // 500 kBit/s encoded bitrate - -// URL to Flash Media Server / Wowza Media Server -// Syntax: rtmp://<server>/<app>+<stream> -m_nanoStream.put_DestinationURL(_T("rtmp://ws1.3p0.de/live+mfcStream01")); -m_nanoStream.StartBroadcast(); // Start Camera Preview in Window -} -``` -When pressing button2 / broadcast, the live encoding will be started. diff --git a/docs/nanostream/windows/language_integration/nanostream_cpp_integration.md b/docs/nanostream/windows/language_integration/nanostream_cpp_integration.md deleted file mode 100644 index 2f0b1038e..000000000 --- a/docs/nanostream/windows/language_integration/nanostream_cpp_integration.md +++ /dev/null @@ -1,150 +0,0 @@ -# nanoStream C++ Integration -The C++ plugin interface is similar to the plugin property/method interface, but has separate methods for “getting” and “setting” the properties. -**NOTE: SDK / Developer license is needed for this functionality.** -```cppMIDL_INTERFACE("65E7065E-43B5-46e4-9766-4E01ACAE530C") -IRTMPActiveXCommands : public IDispatch``` -  - -## Initialization and Configuration: -```cpp -InitEncoder( ) -get_PluginVersion( /* [retval][out] */ LONG *pVal)``` -  - -## License Key String -```cpp -get_License( /* [retval][out] */ BSTR *pVal) -put_License( /* [in] */ BSTR newVal) -get_EnablePreview(/* [retval][out] */ LONG *pVal) -put_EnablePreview( /* [in] */ LONG newVal) -``` -  - -## Destination File Name or Stream URL - -Example destination URL:"rtmp://localhost/live+myStream" -```cpp -get_DestinationURL( /* [retval][out] */ BSTR *pVal) -put_DestinationURL( /* [in] */ BSTR newVal)``` -  - -## Video and Audio Capture Devices (0 … n) -```cpp -get_NumberOfVideoSources( /* [retval][out] */ LONG *pVal) -get_NumberOfAudioSources( /* [retval][out] */ LONG *pVal) -GetVideoSource( /* [in] */ LONG num, /* [retval][out] */ BSTR *pVal) -GetAudioSource( /* [in] */ LONG num, /* [retval][out] */ BSTR *pVal) -get_VideoSource( /* [retval][out] */ LONG *pVal) -put_VideoSource( /* [in] */ LONG newVal) -get_AudioSource( /* [retval][out] */ LONG *pVal) -put_AudioSource( /* [in] */ LONG newVal) -get_VideoFormat( /* [retval][out] */ BSTR *pVal) -put_VideoFormat( /* [in] */ BSTR newVal) -get_AudioFormat( /* [retval][out] */ BSTR *pVal) -put_AudioFormat( /* [in] */ BSTR newVal) -``` -  - -## Video and Audio Encoding Bitrates (Quality in Bits/s) -```cpp -get_VideoBitrate( /* [retval][out] */ LONG *pVal) -put_VideoBitrate( /* [in] */ LONG newVal) -get_AudioBitrate( /* [retval][out] */ LONG *pVal) -put_AudioBitrate( /* [in] */ LONG newVal) -``` -  - -## Video Capture Frame Size and Frame Rate -```cpp -get_VideoWidth( /* [retval][out] */ LONG *pVal) -put_VideoWidth( /* [in] */ LONG newVal) -get_VideoHeight( /* [retval][out] */ LONG *pVal) -put_VideoHeight( /* [in] */ LONG newVal) -get_VideoFrameRate(/* [retval][out] */ DOUBLE *pVal) -put_VideoFrameRate(/* [in] */ DOUBLE newVal) -get_OutputFormat( /* [retval][out] */ LONG *pVal) -put_OutputFormat( /* [in] */ LONG newVal) -get_CaptureWidth( /* [retval][out] */ LONG *pVal) -put_CaptureWidth( /* [in] */ LONG newVal) -get_CaptureHeight( /* [retval][out] */ LONG *pVal) -put_CaptureHeight( /* [in] */ LONG newVal) -CheckVideoFormat( ) -``` -  - -## Encoder / Stream Control: -```cpp -StartPreview( ) -StartBroadcast( ) -StopPreview( ) -StopBroadcast( ) -``` -  - -## Screen Capture Area: -```cpp -get_ScreenRegionLeft( /* [retval][out] */ LONG *pVal) -put_ScreenRegionLeft( /* [in] */ LONG newVal) -get_ScreenRegionTop( /* [retval][out] */ LONG *pVal) -put_ScreenRegionTop( /* [in] */ LONG newVal) -get_ScreenRegionRight( /* [retval][out] */ LONG *pVal) -put_ScreenRegionRight( /* [in] */ LONG newVal) -get_ScreenRegionBottom(/* [retval][out] */ LONG *pVal) -put_ScreenRegionBottom(/* [in] */ LONG newVal) -``` -  - -## Resize Video -```cpp -get_EnableResize( /* [retval][out] */ LONG *pVal) -put_EnableResize( /* [in] */ LONG newVal) -get_VideoResizeWidth( /* [retval][out] */ LONG *pVal) -put_VideoResizeWidth( /* [in] */ LONG newVal) -get_VideoResizeHeight( /* [retval][out] */ LONG *pVal) -put_VideoResizeHeight( /* [in] */ LONG newVal) -``` -  - -## Video Effects, Mix, Overlay, 3D -```cpp -get_VideoMixer(/* [retval][out] */ LONG *pVal) -put_VideoMixer(/* [in] */ LONG newVal) -get_VideoSource2( /* [retval][out] */ LONG *pVal) -put_VideoSource2( /* [in] */ LONG newVal) -get_TextOverlayText(/* [retval][out] */ BSTR *pVal) -put_TextOverlayText(/* [in] */ BSTR newVal) -get_VideoEffect( /* [retval][out] */ LONG *pVal) -put_VideoEffect( /* [in] */ LONG newVal) -``` -  - -## Audio Control -```cpp -get_AudioDelay( /* [retval][out] */ DOUBLE *pVal) -put_AudioDelay( /* [in] */ DOUBLE newVal) -get_AudioVolume(/* [retval][out] */ LONG *pVal) -put_AudioVolume(/* [in] */ LONG pVal) -GetConfig( /* [in] */ BSTR prop, /* [retval][out] */ BSTR *pVal) -SetConfig( /* [in] */ BSTR prop, /* [in] */ BSTR pVal) -get_XMLProfile( /* [retval][out] */ BSTR *pVal) -put_XMLProfile( /* [in] */ BSTR pVal) -``` -  - -## Miscellaneous - -```cpp -get_ActivateKeyServer( /* [retval][out] */ LONG *pVal) -put_ActivateKeyServer( /* [in] */ LONG newVal) -get_FileSourceFilename(/* [retval][out] */ BSTR *pVal) -put_FileSourceFilename(/* [in] */ BSTR newVal) -get_FileSource2Filename(/* [retval][out] */ BSTR *pVal) -put_FileSource2Filename(/* [in] */ BSTR newVal) -get_MP4MuxMode( /* [retval][out] */ LONG *pVal) -put_MP4MuxMode( /* [in] */ LONG newVal) -get_OriginalVideoSize(/* [retval][out] */ LONG *pVal) -put_OriginalVideoSize( /* [in] */ LONG newVal) -get_ShowPropertyPage( /* [retval][out] */ LONG *pVal) -put_ShowPropertyPage( /* [in] */ LONG newVal) -``` -  diff --git a/docs/nanostream/windows/language_integration/nanostream_csharp_integration.md b/docs/nanostream/windows/language_integration/nanostream_csharp_integration.md deleted file mode 100644 index 5474f70fe..000000000 --- a/docs/nanostream/windows/language_integration/nanostream_csharp_integration.md +++ /dev/null @@ -1,38 +0,0 @@ -# nanoStream Visual C# Integration - -Add a New Visual C# Project / Windows Forms application - -![c_sharp_1](img/c_sharp_1-300x202.png) - -Move mouse to the left to the *Toolbox* list, search for *General* and right click to select *Choose Items…* - -![c_sharp_2](img/c_sharp_2-241x300.png) - -Select tab *COM Components* under *Name* nanoStream RTMPActiveX Class. - -![c_sharp_3](img/c_sharp_3-300x206.png) - -Drag the *nanoStream* Object Icon from the Toolbox onto your Form, and drag a Button onto your Form. - -![c_sharp_5](img/c_sharp_5-278x300.png) - -Double Click the “Button” to add source code: - -```csharp -private void button1_Click(object sender, EventArgs e) -{ -axRTMPActiveX1.InitEncoder(); -axRTMPActiveX1.StartPreview(); -} -``` - -Run the application and press the button. You should see a video image from your default camera. - -![c_sharp_6](img/c_sharp_6-300x300.png) -## Additional Options -Video Device -```csharp -axRTMPActiveX1.VideoSource = 0; // may be 1,2,… dependent on your devices -``` - -  diff --git a/docs/nanostream/windows/language_integration/nanostream_delphi_integration.md b/docs/nanostream/windows/language_integration/nanostream_delphi_integration.md deleted file mode 100644 index 7890e9078..000000000 --- a/docs/nanostream/windows/language_integration/nanostream_delphi_integration.md +++ /dev/null @@ -1,49 +0,0 @@ -# nanoStream Delphi Integration - -nanoStream plugins are based on ActiveX Controls, which can be used from within any development environment. -This document describes how to use the nanoStream plugins from within the Delphi Development IDE. - -In a Delphi Project, first *Import ActiveX Control* under the *Component* tab - - -![delphi_1](img/delphi_1-300x95.png) - - -Search for nanoStream Live Video Encoder. - -![Delphi_import_activex](img/Delphi_import_activex-264x300.png) - -Create a *RTMP ActiveX* Unit. - - -![Delphi_rtmp_activex](img/Delphi_rtmp_activex-300x86.png) - -On the resulting form, pull an area with the mouse. - - -![Delphi_FormArea](img/Delphi_FormArea.png) - -Then add a standard button to test nanoStream: - - -![Delphi_Button](img/Delphi_button.png) - -Double Click the button and add this code: -```delphi -procedure TForm1.Button1Click(Sender: TObject); -begin -RTMPActiveX1.InitEncoder; -RTMPActiveX1.StartPreview; -end; -``` - -Run the project. -Click on the button. -You should see nanoStream running in camera preview mode then. -Add Streaming / Broadcasting to a Media Server -```delphi -RTMPActiveX1.DestinationURL := 'rtmp://example.com/live+delphi123'; -RTMPActiveX1.VideoBitrate := 200000; -RTMPActiveX1.StartBroadcast; -``` -  diff --git a/docs/nanostream/windows/nanostream_windows_binaries.md b/docs/nanostream/windows/nanostream_windows_binaries.md new file mode 100644 index 000000000..253b95f60 --- /dev/null +++ b/docs/nanostream/windows/nanostream_windows_binaries.md @@ -0,0 +1,127 @@ +--- +id: nanostream_windows_binaries +title: Binary Modules for Windows +sidebar_label: Binary Modules for Windows +--- + +This list covers the Windows binaries. + +> **NOTES:** +> You require a distribution license agreement to use any specific module for distributing it to 3rd parties. Usually it is recommended and best practice to use our nanostream-plugins setup for redistribution. A typical distribution license does NOT include the application files (exe) +> Not all combinations of modules will work out of the box. + + + +**nanoStream Runtime Installer** +For Windows and MacOS, you usually should use the [runtime installer](http://nanocosmos.de/get/nanostream) to deploy nanoStream components. + + + +## Applications + +| Module | Description | Dependencies | +|--------|-------------|--------------| +| `LiveEnc.exe` | nanoStream Live Video Encoder (GUI) | ``nanoATLServer.dll`` | +| `LiveEncCmd.exe` | nanoStream Live Video Encoder (Command Line) | ``nanoATLServer.dll`` | +| `nanoLicenseTool.exe` | | | + + + +## Plugins + +| Module | Description | Dependencies | +|--------|-------------|--------------| +| `nanoStream.ax` | nanoStream Plugin for ActiveX and Internet Explorer | ``nanoATLServer.dll`` | +| `np_nanoStream.dll` | nanoStream Plugin for Mozilla | ``nanoATLServer.dll`` | + + + +## MPEG-2 Based DirectShow Filters + +| Module | Description | Dependencies | +|--------|-------------|--------------| +| `nmpeg2enc.ax` | nanocosmos MPEG-2 Video Encoder | ``nanoATLServer.dll`` | +| `nmpeg2dec.ax` | nanocosmos MPEG-2 Video Decoder | ``nanoATLServer.dll`` | +| `nmpaenc.ax` | nanocosmos MPEG Audio Encoder | ``nanoATLServer.dll`` | +| `nmpegsplitter.ax` | nanocosmos MPEG Splitter | ``nanoATLServer.dll`` | +| `nanotswriter.ax` | nanocosmos MPEG Multiplexer for Transport Stream | ``nanoATLServer.dll`` | + + + +## MPEG-4/H.264 Based DirectShow Filters + +| Module | Description | Dependencies | +|--------|-------------|--------------| +| `nh264enc.ax` | nanocosmos H.264 Video Encoder | `nanoATLServer.dll`, `libiomp5md.dll` | +| `nh264dec.ax` | nanocosmos H.264 Video Decoder | ``nanoATLServer.dll`` | +| `naacenc.ax` | nanocosmos AAC Audio Encoder | `nanoATLServer.dll` | +| `naacdec.ax` | nanocosmos AAC Audio Decoder | `nanoATLServer.dll` | +| `nmp4splitter.ax` | nanocosmos MP4 Splitter | `nanoATLServer.dll` | +| `nmp4mux.ax` | nanocosmos MP4 Multiplexer | `nanoATLServer.dll` | + + + +## Streaming DirectShow Filters + +| Module | Description | Dependencies | +|--------|-------------|--------------| +| `nRTMPSource.ax` | nanocosmos RTMP Source | `nanoATLServer.dll` | +| `nRTMPRenderer.ax` | nanocosmos RTMP Writer | `nanoATLServer.dll` | +| `nRTSPSource.ax` | nanocosmos RTSP Source | `nanoATLServer.dll` | +| `nRTSPSink.ax` | nanocosmos RTSP Writer | `nanoATLServer.dll` | +| `nanoNetSource.ax` | nanocosmos UDP Source | `nanoATLServer.dll` | +| `nanoNetSink.ax` | nanocosmos UDP Writer | `nanoATLServer.dll` | + + + +## Capture DirectShow Filters + +| Module | Description | Dependencies | +|--------|-------------|--------------| +| `nscreencap.ax` | nanocosmos Live Screen Capture | `nanoATLServer.dll` | +| `VoiceCaptureFilter.dll` | nanocosmos AEC Voice Capture Source | `nanoATLServer.dll` | + + + +## Image Processing DirectShow Filters + +| Module | Description | Dependencies | +|--------|-------------|--------------| +| `nVideoMixer.ax` | nanocosmos Video Mixer | `nanoATLServer.dll` | +| `nVideoMixer2.ax` | nanocosmos Video Mixer 2 | `nanoATLServer.dll` | +| `nremixer3d.ax` | nanocosmos Video Remixer 3D | `nanoATLServer.dll` | +| `nVideoOverlay.ax` | nanocosmos Video Overlay | `nanoATLServer.dll` | +| `nresizer2.ax` | nanocosmos Video Resizer 2 | `nanoATLServer.dll` | +| `ncolconv.ax` | nanocosmos Color Space Converter | `nanoATLServer.dll` | + + + +## Other DirectShow Filters + +| Module | Description | Dependencies | +|--------|-------------|--------------| +| `nanodump.ax` | nanocosmos File Dump | `nanoATLServer.dll` | +| `nAudioVolume.ax` | nanocosmos Audio Volume | | +| `nWavWriter.ax` | nanocosmos Wave Writer | `nanoATLServer.dll` | + + + +## Related Modules + +| Module | Description | Dependencies | +|--------|-------------|--------------| +| `nMediaBridge.ax` | nanocosmos Media Bridge - *add support for seemless switch / live encoding / file streaming* | | + + + +## Dependencies + +**Note:** Only the `nanoATLServer.dll` is mandatory. The Intel and MS files may be optional, dependent on your OS. + +| Module | Description | Dependencies | +|--------|-------------|--------------| +| `nanoATLServer.dll` | nanocosmos License Server | | +| `libiomp5md.dll` | Intel OpenMP Library | | +| `vcomp90.dll` | MS OpenMP Library | | + +[a6957aa7]: http://nanocosmos.de/get/nanostream "http://nanocosmos.de/get/nanostream" diff --git a/docs/nanostream/windows/nanostream_windows_developer_manual.md b/docs/nanostream/windows/nanostream_windows_developer_manual.md new file mode 100644 index 000000000..97d2f76cd --- /dev/null +++ b/docs/nanostream/windows/nanostream_windows_developer_manual.md @@ -0,0 +1,58 @@ +--- +id: nanostream_windows_developer_manual +title: Developer Manual +sidebar_label: Developer Manual +--- + +> **Note**: +> +> Not all modules are contained in all configurations. Please ask for availability and prices. + +## Live Video Capture Active-X Control (`npvidcap.ax`) +Active-X-Control compatible with Internet Explorer and other `ActiveX` technologies +API compatible to `Javascript`, `C/C++`, `NET/C#`, `VisualBasic`, `Delphi`, and others + +## Live Video Capture NP Plugin (`np_vidcap.dll`) +Plugin for Mozilla/Netscape based browsers, `Javascript` interface (Firefox, Safari) + +## nanocosmos H.264 video encoder (Filename: `nh264enc.ax`) +`DirectShow` video encoder filter for encoding live video to `H.264` + +## nanocosmos AAC audio encoder (Filename: `naacenc.ax`) +`DirectShow` audio encoder filter for encoding live audio to `AAC` + +## nanocosmos MP4 File Writer +`DirectShow` filter for creating `MP4` files with `H.264` support + +## nanocosmos RTMP Network Writer (Filename: `nRtmpRenderer.ax`) +`DirectShow` filter for streaming to Wowza and Flash Media Servers +Example URL: `rtmp://localhost/live+myStream` + +## HD / UDP Streaming Filters +`DirectShow` Streaming components for HD video streaming in Local Area Networks: +Point-to-Point, Broadcast, Multicast support +Example URL: `udp://localhost:1234` + +## WindowsMedia Encoding and Streaming +Streaming component compatible to Microsoft WindowsMedia Video Formats: + +## Additional Extensions: +- nanocosmos Stereoscopic 3D-Video Mixer supporting Side-by-side/Interlaced/Color Anaglyph +modes +- Video Resizer for resizing and deinterlacing video +- Overlay Filter for blending of, Texts, Bitmaps, Tickers, etc. +- Desktop Capture / Screen Grabber Filter for Application Streaming e.g. Games (upon request) +- Remote Control Function for Keyboard Feedback +- Player/Clients for DirectShow/Applications or Browser-Plugin or Flash based +- Live Video Encoder Application +Reference Application to show functionality in a simple end user program + +# DirectShow Filter usage with GraphEdit / GraphStudioNext +All Live Video Encoder components are available as `DirectShow` filters and may be used within DirectShow applications. + +We recommend using [GraphStudio](https://code.google.com/p/graph-studio-next/ ) as a replacement for GraphEdit, as `RTMP` URLs may be set easily with this software. + + +![live_encoding_graph](img/windows_developer_manual_graph_studio.png) +## Setting DirectShow properties from C++ +The `H.264` parameters may be set by calling the `InanoCodecOpts` interface. The `RTMP` output path may be set by calling the `SetFileName()` method of the default DirectShow `FileSinkFilter` interface. diff --git a/docs/nanostream/windows/nanostream_windows_language_integration.md b/docs/nanostream/windows/nanostream_windows_language_integration.md new file mode 100644 index 000000000..7678226f5 --- /dev/null +++ b/docs/nanostream/windows/nanostream_windows_language_integration.md @@ -0,0 +1,387 @@ +--- +id: nanostream_windows_language_integration +title: Language Integration +sidebar_label: Language Integration +--- + +## VisualC++ Integration + +This tutorial shows how to create a custom Live Encoding and Streaming application with the nanoStream plugins, based on VisualStudio and C++ for a simple console application. +*This tutorial was created with VisualStudio 2008 but should work similar with VS 2010.* +Create a new Win32 Console Application Project (File/New Project) + +![visualc_1](img/visualc_1-300x215.png) + +Leave all options to default and press “Finish” + +![visualc_2](img/visualc_2-300x252.png) + + + +## VisualC++ MFC Integration + +This tutorial shows how to create a custom Live Encoding and Streaming application with the nanoStream plugins, based on VisualStudio, C++ and MFC. +This tutorial was created with VisualStudio 2008 but should work similar with VS 2010. +Create a new MFC Application Project (File/New Project) + +![mfc_1](img/nanostream_activex_visualcpp_mfc1.png) + +In the following MFC Application Wizard, select “Dialog Based Application” + +![mfc_2](img/nanostream_activex_visualcpp_mfc2.png) + +Select all default values for the rest and Finish + +![mfc_3](img/nanostream_activex_visualcpp_mfc3.png) + +A new project solution is created based on an empty dialog. + +Right-click on the dialog and select “Insert ActiveX Control…” + +![mfc_4](img/nanostream_activex_visualcpp_mfc4.png) + +Select “nanoStream RTMPActiveX Class” + +![mfc_5](img/nanostream_activex_visualcpp_mfc5.png) + +Position and resize the control window accordingly. + +The window will show a live camera preview later. + +![mfc_6](img/nanostream_activex_visualcpp_mfc6.png) + +Create a class member variable for the control for simpler access: + +![mfc_7](img/nanostream_activex_visualcpp_mfc7.png) + +![mfc_8](img/nanostream_activex_visualcpp_mfc8.png) + +Now let us create a button to create a camera preview. + +From the Toolbox, select “Button” and place the button on the dialog. + +![mfc_9](img/nanostream_activex_visualcpp_mfc9.png) + + + +Double-Click on the button to edit the new source code event handler: + +![mfc_10](img/nanostream_activex_visualcpp_mfc10.png) + + + +This is the complete code which shows the camera preview: + +```cpp +void CnanoStreamTestDlg::OnBnClickedButton1() +{ +//nanoStream Live Video Encoder Plugin +m_nanoStream.InitEncoder(); // Init Encoder +m_nanoStream.put_VideoSource(0); // Select Video Capture Source +m_nanoStream.StartPreview(); // Start Camera Preview in Window +} +``` + +  + +Now add another button to start a real encoded stream. +Add the following code to the button: + +```cpp +void CnanoStreamTestDlg::OnBnClickedButton2() +{ +// nanoStream Live Video Encoder Plugin +// Live Encoding/Streaming to RTMP Server +m_nanoStream.put_License(_T("nlic:1.0:nanoLiveEncDemo:1.1:LivePlgDemo=1,MP4=1,RTMP=1,.....")); +m_nanoStream.InitEncoder(); // Init Encoder +m_nanoStream.put_VideoSource(0); // Select Video Capture Source +m_nanoStream.put_VideoBitrate(500000); // 500 kBit/s encoded bitrate + +// URL to Flash Media Server / Wowza Media Server +// Syntax: rtmp://<server>/<app>+<stream> +m_nanoStream.put_DestinationURL(_T("rtmp://ws1.3p0.de/live+mfcStream01")); +m_nanoStream.StartBroadcast(); // Start Camera Preview in Window +} +``` + +When pressing button2 / broadcast, the live encoding will be started. + + + +## C++ Integration + +The C++ plugin interface is similar to the plugin property/method interface, but has separate methods for “getting” and “setting” the properties. + + + +> **NOTE:** +> +> A SDK / Developer license is needed for this functionality. + + + +```c++ +MIDL_INTERFACE("65E7065E-43B5-46e4-9766-4E01ACAE530C") +IRTMPActiveXCommands : public IDispatch +``` + + + +### Initialization and Configuration: + +```c++ +InitEncoder( ) +get_PluginVersion( /* [retval][out] */ LONG *pVal) +``` + + + +### License Key String + +```c++ +get_License( /* [retval][out] */ BSTR *pVal) +put_License( /* [in] */ BSTR newVal) +get_EnablePreview(/* [retval][out] */ LONG *pVal) +put_EnablePreview( /* [in] */ LONG newVal) +``` + + + +### Destination File Name or Stream URL + +Example destination URL: `rtmp://localhost/live+myStream` + +```c++ +get_DestinationURL( /* [retval][out] */ BSTR *pVal) +put_DestinationURL( /* [in] */ BSTR newVal) +``` + + + +### Video and Audio Capture Devices (0 … n) + +```c++ +get_NumberOfVideoSources( /* [retval][out] */ LONG *pVal) +get_NumberOfAudioSources( /* [retval][out] */ LONG *pVal) +GetVideoSource( /* [in] */ LONG num, /* [retval][out] */ BSTR *pVal) +GetAudioSource( /* [in] */ LONG num, /* [retval][out] */ BSTR *pVal) +get_VideoSource( /* [retval][out] */ LONG *pVal) +put_VideoSource( /* [in] */ LONG newVal) +get_AudioSource( /* [retval][out] */ LONG *pVal) +put_AudioSource( /* [in] */ LONG newVal) +get_VideoFormat( /* [retval][out] */ BSTR *pVal) +put_VideoFormat( /* [in] */ BSTR newVal) +get_AudioFormat( /* [retval][out] */ BSTR *pVal) +put_AudioFormat( /* [in] */ BSTR newVal) +``` + + + +### Video and Audio Encoding Bitrates (Quality in Bits/s) + +```c++ +get_VideoBitrate( /* [retval][out] */ LONG *pVal) +put_VideoBitrate( /* [in] */ LONG newVal) +get_AudioBitrate( /* [retval][out] */ LONG *pVal) +put_AudioBitrate( /* [in] */ LONG newVal) +``` + + + +### Video Capture Frame Size and Frame Rate + +```c++ +get_VideoWidth( /* [retval][out] */ LONG *pVal) +put_VideoWidth( /* [in] */ LONG newVal) +get_VideoHeight( /* [retval][out] */ LONG *pVal) +put_VideoHeight( /* [in] */ LONG newVal) +get_VideoFrameRate(/* [retval][out] */ DOUBLE *pVal) +put_VideoFrameRate(/* [in] */ DOUBLE newVal) +get_OutputFormat( /* [retval][out] */ LONG *pVal) +put_OutputFormat( /* [in] */ LONG newVal) +get_CaptureWidth( /* [retval][out] */ LONG *pVal) +put_CaptureWidth( /* [in] */ LONG newVal) +get_CaptureHeight( /* [retval][out] */ LONG *pVal) +put_CaptureHeight( /* [in] */ LONG newVal) +CheckVideoFormat( ) +``` + + + +### Encoder / Stream Control: + +```c++ +StartPreview( ) +StartBroadcast( ) +StopPreview( ) +StopBroadcast( ) +``` + + + +### Screen Capture Area: + +```c++ +get_ScreenRegionLeft( /* [retval][out] */ LONG *pVal) +put_ScreenRegionLeft( /* [in] */ LONG newVal) +get_ScreenRegionTop( /* [retval][out] */ LONG *pVal) +put_ScreenRegionTop( /* [in] */ LONG newVal) +get_ScreenRegionRight( /* [retval][out] */ LONG *pVal) +put_ScreenRegionRight( /* [in] */ LONG newVal) +get_ScreenRegionBottom(/* [retval][out] */ LONG *pVal) +put_ScreenRegionBottom(/* [in] */ LONG newVal) +``` + + + +### Resize Video + +```c++ +get_EnableResize( /* [retval][out] */ LONG *pVal) +put_EnableResize( /* [in] */ LONG newVal) +get_VideoResizeWidth( /* [retval][out] */ LONG *pVal) +put_VideoResizeWidth( /* [in] */ LONG newVal) +get_VideoResizeHeight( /* [retval][out] */ LONG *pVal) +put_VideoResizeHeight( /* [in] */ LONG newVal) +``` + + + +### Video Effects, Mix, Overlay, 3D + +```c++ +get_VideoMixer(/* [retval][out] */ LONG *pVal) +put_VideoMixer(/* [in] */ LONG newVal) +get_VideoSource2( /* [retval][out] */ LONG *pVal) +put_VideoSource2( /* [in] */ LONG newVal) +get_TextOverlayText(/* [retval][out] */ BSTR *pVal) +put_TextOverlayText(/* [in] */ BSTR newVal) +get_VideoEffect( /* [retval][out] */ LONG *pVal) +put_VideoEffect( /* [in] */ LONG newVal) +``` + + + +### Audio Control + +```c++ +get_AudioDelay( /* [retval][out] */ DOUBLE *pVal) +put_AudioDelay( /* [in] */ DOUBLE newVal) +get_AudioVolume(/* [retval][out] */ LONG *pVal) +put_AudioVolume(/* [in] */ LONG pVal) +GetConfig( /* [in] */ BSTR prop, /* [retval][out] */ BSTR *pVal) +SetConfig( /* [in] */ BSTR prop, /* [in] */ BSTR pVal) +get_XMLProfile( /* [retval][out] */ BSTR *pVal) +put_XMLProfile( /* [in] */ BSTR pVal) +``` + + + +### Miscellaneous + +```c++ +get_ActivateKeyServer( /* [retval][out] */ LONG *pVal) +put_ActivateKeyServer( /* [in] */ LONG newVal) +get_FileSourceFilename(/* [retval][out] */ BSTR *pVal) +put_FileSourceFilename(/* [in] */ BSTR newVal) +get_FileSource2Filename(/* [retval][out] */ BSTR *pVal) +put_FileSource2Filename(/* [in] */ BSTR newVal) +get_MP4MuxMode( /* [retval][out] */ LONG *pVal) +put_MP4MuxMode( /* [in] */ LONG newVal) +get_OriginalVideoSize(/* [retval][out] */ LONG *pVal) +put_OriginalVideoSize( /* [in] */ LONG newVal) +get_ShowPropertyPage( /* [retval][out] */ LONG *pVal) +put_ShowPropertyPage( /* [in] */ LONG newVal) +``` + + + +## C# Integration + +Add a New Visual C# Project / Windows Forms application + +![c_sharp_1](img/c_sharp_1-300x202.png) + +Move mouse to the left to the *Toolbox* list, search for *General* and right click to select *Choose Items…* + +![c_sharp_2](img/c_sharp_2-241x300.png) + +Select tab *COM Components* under *Name* nanoStream RTMPActiveX Class. + +![c_sharp_3](img/c_sharp_3-300x206.png) + +Drag the *nanoStream* Object Icon from the Toolbox onto your Form, and drag a Button onto your Form. + +![c_sharp_5](img/c_sharp_5-278x300.png) + +Double Click the “Button” to add source code: + +```csharp +private void button1_Click(object sender, EventArgs e) +{ +axRTMPActiveX1.InitEncoder(); +axRTMPActiveX1.StartPreview(); +} +``` + +Run the application and press the button. You should see a video image from your default camera. + +![c_sharp_6](img/c_sharp_6-300x300.png) + + + +### Additional Options + +Video Device + +```csharp +axRTMPActiveX1.VideoSource = 0; // may be 1,2,… dependent on your devices +``` + + + +## Delphi Integration + +nanoStream plugins are based on `ActiveX` Controls, which can be used from within any development environment. +This document describes how to use the nanoStream plugins from within the Delphi Development IDE. + +In a Delphi Project, first *Import ActiveX Control* under the *Component* tab + +![delphi_1](img/delphi_1-300x95.png) + +Search for nanoStream Live Video Encoder. + +![Delphi_import_activex](img/Delphi_import_activex-264x300.png) + +Create a *RTMP ActiveX* Unit. + +![Delphi_rtmp_activex](img/Delphi_rtmp_activex-300x86.png) + +On the resulting form, pull an area with the mouse. + +![Delphi_FormArea](img/Delphi_FormArea.png) + +Then add a standard button to test nanoStream: + +![Delphi_Button](img/Delphi_button.png) + +Double Click the button and add this code: + +```delphi +procedure TForm1.Button1Click(Sender: TObject); +begin +RTMPActiveX1.InitEncoder; +RTMPActiveX1.StartPreview; +end; +``` + +Run the project. +Click on the button. +You should see nanoStream running in camera preview mode then. +Add Streaming / Broadcasting to a Media Server + +```delphi +RTMPActiveX1.DestinationURL := 'rtmp://example.com/live+delphi123'; +RTMPActiveX1.VideoBitrate := 200000; +RTMPActiveX1.StartBroadcast; +``` \ No newline at end of file diff --git a/docs/nanostream/windows/windows_license_help.md b/docs/nanostream/windows/nanostream_windows_license_help.md similarity index 86% rename from docs/nanostream/windows/windows_license_help.md rename to docs/nanostream/windows/nanostream_windows_license_help.md index cef8ddca1..fd21710ef 100644 --- a/docs/nanostream/windows/windows_license_help.md +++ b/docs/nanostream/windows/nanostream_windows_license_help.md @@ -1,18 +1,30 @@ -# Setting the license on windows +--- +id: nanostream_windows_license_help +title: Setting the license +sidebar_label: Setting the license +--- The nanocosmos Live Encoder Application needs a properly set up license to work. There are a few different ways you can set the license. In general the Live Encoder Application needs a license to be set as a key within the windows registry. Doing this manually is described in the last paragraph of this site. An easier way is using the License Tool. This tool helps you to set you license without changing the registry by yourself. + + ## Setting the license key during setup (License Tool starts automatically): -1. Select “License Tool” at the end of the Setup. -2. Select Application/Product +1. Select *License Tool* at the end of the Setup. +2. Select *Application/Product* 3. Paste your License Key from the Clipboard (displayed in the download page or delivered to you by email) + + ## Setting or updating the License Key by manually starting the License Tool: + 1. Go to the *Start* - *All Programs* - *nanocosmos* - *LiveVideoEncoder* - *Tools* - *License Tool* -2. Select Application/Product +2. Select *Application/Product* 3. Paste your License Key from the Clipboard + + ## Setting the license key in the registry + The registry contains previous licenses (if any), you can place a new or an updated license in one of the following locations: diff --git a/docs/nanostream/windows/windows_networkwriter.md b/docs/nanostream/windows/nanostream_windows_networkwriter.md similarity index 57% rename from docs/nanostream/windows/windows_networkwriter.md rename to docs/nanostream/windows/nanostream_windows_networkwriter.md index 6f40819b8..47f6f0a7d 100644 --- a/docs/nanostream/windows/windows_networkwriter.md +++ b/docs/nanostream/windows/nanostream_windows_networkwriter.md @@ -1,103 +1,149 @@ -# RTMP Network Renderer & Writer +--- +id: nanostream_windows_networkwriter +title: RTMP Network Renderer & Writer +sidebar_label: RTMP Network Renderer & Writer +--- + ## Purpose -Writing RTMP compatible video/audio streams over a network connection +Writing `RTMP` compatible video/audio streams over a network connection - DirectShow filter for streaming to Wowza and Flash Media Servers - Supported Architectures: Microsoft DirectShow, Windows XP, Vista, 7, Server -- Supported Formats: H.264 + AAC +- Supported Formats: `H.264` + `AAC` + + ## Module / Version + nanocosmos RTMP Network Writer -nRtmpRenderer.ax Version 3.0.3.1 +`nRtmpRenderer.ax` Version 3.0.3.1 + + ## DirectShow Connectivity + The RTMP Writer is implemented as a “Renderer Filter”, which means it only has 2 input pins for compressed video and audio and no output pin. The input is accepting connections matching the following media types: 1. Pin 1 Media Types: - MEDIATYPE_Video -&nbsp; - Pin 1 Media Subtypes: -&nbsp; - FourCCs: H264, h264 + Pin 1 Media Subtypes: + FourCCs: `H264`, `h264` + + + * Pin 1 Formats: -* FORMAT_MPEG2_VIDEO, -* FORMAT_NONE + + `FORMAT_MPEG2_VIDEO`, + + `FORMAT_NONE` + + + * Pin 2 Major Media Types: -* MEDIATYPE_Audio + + `MEDIATYPE_Audio` + + + * Pin 2 Media Subtypes: -* MEDIASUBTYPE_AAC, FourCC: 0x000000FF + + `MEDIASUBTYPE_AAC`, + + `FourCC: 0x000000FF` + + + * Pin 2 Formats: -* FORMAT_WaveFormatEx, -* FORMAT_NONE +* `FORMAT_WaveFormatEx`, +* `FORMAT_NONE` ![rtmp_writer_prop](img/windows_networkwriter_properties.png) - The filter's property page offers a subset of encoding parameters, containing the most important options. -URL formatting: -`rtmp: [hostname / IP address]/[application]+[stream name] for example:` -`rtmp:127.0.0.1/live+myStream` -with: -`IP address: 127.0.0.1` -Application name: live, Stream name: myStream +URL formatting:`rtmp: [hostname / IP address]/[application]+[stream name]` for example: + +`rtmp:127.0.0.1/live+myStream` with:`IP address: 127.0.0.1` +Application name: `live`, Stream name: `myStream` + + ## Connection Test + Connect/Disconnect buttons. Allows to connect before starting the graph and disconnect during the streaming (this stops the running graph). + + ## RTMP Authentication + RTMP Authentication expects a user name and a password for unlocking access to the Media Server. This has been verified with Flash Media Server (3.x and 4) and Wowza Media Server (2.x). CDNs are supported on a case-by-case basis. Special tuning as been made for some CDN access (e.g. Limelight). + + ## Automatic Reconnection: -Attempts to restore network connection after n seconds to the server in case of network interrupts. During the reconnect attempts the graph still playing. 0 means no attempts to reconnect to server. + +`Attempts` to restore network connection after n seconds to the server in case of network interrupts. During the reconnect attempts the graph still playing. 0 means no attempts to reconnect to server. + + ## Advanced Configuration Options + The advanced options should be handled carefully. They can severely affect network and streaming performance. Contact support if you want to fine tune any settings. *Buffering:* Data Flow: RTMP multiplexed data → application buffer → socket buffer → network. There are 2 buffer types: + 1. Socket level buffer: Size of the network socket buffer, much dependent on the underlying network architecture 2. Application level buffer (Output Buffer Size, Output packet size), 0=no buffer Affects bandwidth utilization, prevents bitrate changes and puts the sending process to a separate thread. + + ## Advanced Settings + - Live Mode: Turns on/off blocking of input pins. (should be off by default) -- TCP No Delay: Activates the TCP_NODELAY option for TCP transmission ("Nagle Algorithm") +- TCP No Delay: Activates the `TCP_NODELAY` option for TCP transmission ("Nagle Algorithm") - Timecode Options: Sends Time Code in RTMP Meta Data -- Allow B Frames: should be on, it reduces the buffer/delay in H.264 Main Profile without B Frames. No effect in Baseline Mode. +- Allow B Frames: should be on, it reduces the buffer/delay in `H.264 Main Profile` without B Frames. No effect in Baseline Mode. - Timecode Options: send Time Code in RTMP Meta Data + + ## Connection Status Notification There are two possibilities to get the status of the connection to the server: -- Event messages are sent via IMediaEventSink with the event code EC_NANO_RTMP_WRITER_STATUS declared in RTMPWriterOptions.h (#define EC_NANO_RTMP_WRITER_STATUS EC_USER+181). A message is sent when the connection state changes. The different states are represented by (also declared in RTMPWriterOptions.h): -- RTMPWriterConnected=0 -- RTMPWriterDisconnected=1 -- RTMPWriterReconnecting=2 +- Event messages are sent via IMediaEventSink with the event code EC_NANO_RTMP_WRITER_STATUS declared in `RTMPWriterOptions.h` (`#define EC_NANO_RTMP_WRITER_STATUS EC_USER+181`). A message is sent when the connection state changes. The different states are represented by (also declared in `RTMPWriterOptions.h`): +- `RTMPWriterConnected=0` +- `RTMPWriterDisconnected=1` +- `RTMPWriterReconnecting=2` - Using a callback function, which is called when the connection state changes: -- Query for the interface IRTMPStatusNotify -- Set the callback function via SetStatusNotifyHandler() + - Query for the interface `IRTMPStatusNotify` + - Set the callback function via `SetStatusNotifyHandler()` + + -## Rtmp Writer Filter crashes when using SetStatusNotifyHandler() +## Rtmp Writer Filter crashes when using `SetStatusNotifyHandler()` This problem is probably caused by calling a function declared with one calling convention with a function pointer declared with a different calling convention. Here is a good explanation of the problem: -[Visual Studio Runtime Error][55129935] -[Run Time Check Failure][7436dd8a] +[Visual Studio Runtime Error](http://stackoverflow.com/questions/301655/c-visual-studio-runtime-error) +[Run Time Check Failure](http://stackoverflow.com/questions/10079625/c-run-time-check-failure-0-the-value-of-esp-was-not-properly-saved-across-a) + + + +**Conclusion**: Make sure you use `stdcall` in your declaration -Conclusion: Make sure you use `stdcall` in your declaration ## Log / Debug Configuration Registry Settings + `Key: HKEYCURRENTUSER\Software\DebugNano\ nRtmpRenderer.ax` ### File name Sets the output file name. The folder must exist. -Value name: LogToFile -Value type: REG_SZ / String +Value name: `LogToFile` +Value type: `REG_SZ / String` Valid values: a valid output file name to enable file logging or an empty string ### Logging level - A higher value increases the amount of logging messages sent, and messages get more detailed. -- Value name: TRACE -- Value type: REG_DWORD -- Valid values: 0 (minimal logging) - 9 (maximal logging) - - -[55129935]: http://stackoverflow.com/questions/301655/c-visual-studio-runtime-error "http://stackoverflow.com/questions/301655/c-visual-studio-runtime-error" -[7436dd8a]: http://stackoverflow.com/questions/10079625/c-run-time-check-failure-0-the-value-of-esp-was-not-properly-saved-across-a "http://stackoverflow.com/questions/10079625/c-run-time-check-failure-0-the-value-of-esp-was-not-properly-saved-across-a" +- Value name: `TRACE` +- Value type: `REG_DWORD` +- Valid values: 0 (minimal logging) - 9 (maximal logging) \ No newline at end of file diff --git a/docs/nanostream/windows/windows_binares.md b/docs/nanostream/windows/windows_binares.md deleted file mode 100644 index 130eb578a..000000000 --- a/docs/nanostream/windows/windows_binares.md +++ /dev/null @@ -1,97 +0,0 @@ -# nanoStream Live Video Encoder - Binary Modules for Windows -This list covers the Windows binaries. -**NOTES:** -You require a distribution license agreement to use any specific module for distributing it to 3rd parties -Usually it is recommended and best practice to use our nanostream-plugins setup for redistribution -A typical distribution license does NOT include the application files (exe) -Not all combinations of modules will work out of the box. -**nanoStream Runtime Installer** -For Windows and MacOS, you usually should use the [runtime installer][a6957aa7] to deploy nanoStream components. -## Applications -| Module | Description | Dependencies | -|--------|-------------|--------------| -| LiveEnc.exe | nanoStream Live Video Encoder (GUI) | nanoATLServer.dll | -| LiveEncCmd.exe | nanoStream Live Video Encoder (Command Line) | nanoATLServer.dll | -| nanoLicenseTool.exe | | | - -## Plugins - -| Module | Description | Dependencies | -|--------|-------------|--------------| -| nanoStream.ax | nanoStream Plugin for ActiveX and Internet Explorer | nanoATLServer.dll | -| np_nanoStream.dll | nanoStream Plugin for Mozilla | nanoATLServer.dll | - -## MPEG-2 Based DirectShow Filters - -| Module | Description | Dependencies | -|--------|-------------|--------------| -| nmpeg2enc.ax | nanocosmos MPEG-2 Video Encoder | nanoATLServer.dll | -| nmpeg2dec.ax | nanocosmos MPEG-2 Video Decoder | nanoATLServer.dll | -| nmpaenc.ax | nanocosmos MPEG Audio Encoder | nanoATLServer.dll | -| nmpegsplitter.ax | nanocosmos MPEG Splitter | nanoATLServer.dll | -| nanotswriter.ax | nanocosmos MPEG Multiplexer for Transport Stream | nanoATLServer.dll | - -## MPEG-4/H.264 Based DirectShow Filters - -| Module | Description | Dependencies | -|--------|-------------|--------------| -| nh264enc.ax | nanocosmos H.264 Video Encoder | nanoATLServer.dll, libiomp5md.dll | -| nh264dec.ax | nanocosmos H.264 Video Decoder | nanoATLServer.dll | -| naacenc.ax | nanocosmos AAC Audio Encoder | nanoATLServer.dll | -| naacdec.ax | nanocosmos AAC Audio Decoder | nanoATLServer.dll | -| nmp4splitter.ax | nanocosmos MP4 Splitter | nanoATLServer.dll | -| nmp4mux.ax | nanocosmos MP4 Multiplexer | nanoATLServer.dll | - -## Streaming DirectShow Filters - -| Module | Description | Dependencies | -|--------|-------------|--------------| -| nRTMPSource.ax | nanocosmos RTMP Source | nanoATLServer.dll | -| nRTMPRenderer.ax | nanocosmos RTMP Writer | nanoATLServer.dll | -| nRTSPSource.ax | nanocosmos RTSP Source | nanoATLServer.dll | -| nRTSPSink.ax | nanocosmos RTSP Writer | nanoATLServer.dll | -| nanoNetSource.ax | nanocosmos UDP Source | nanoATLServer.dll | -| nanoNetSink.ax | nanocosmos UDP Writer | nanoATLServer.dll | - -## Capture DirectShow Filters - -| Module | Description | Dependencies | -|--------|-------------|--------------| -| nscreencap.ax | nanocosmos Live Screen Capture | nanoATLServer.dll | -| VoiceCaptureFilter.dll | nanocosmos AEC Voice Capture Source | nanoATLServer.dll | - -## Image Processing DirectShow Filters - -| Module | Description | Dependencies | -|--------|-------------|--------------| -| nVideoMixer.ax | nanocosmos Video Mixer | nanoATLServer.dll | -| nVideoMixer2.ax | nanocosmos Video Mixer 2 | nanoATLServer.dll | -| nremixer3d.ax | nanocosmos Video Remixer 3D | nanoATLServer.dll | -| nVideoOverlay.ax | nanocosmos Video Overlay | nanoATLServer.dll | -| nresizer2.ax | nanocosmos Video Resizer 2 | nanoATLServer.dll | -| ncolconv.ax | nanocosmos Color Space Converter | nanoATLServer.dll | - -## Other DirectShow Filters - -| Module | Description | Dependencies | -|--------|-------------|--------------| -| nanodump.ax | nanocosmos File Dump | nanoATLServer.dll | -| nAudioVolume.ax | nanocosmos Audio Volume | | -| nWavWriter.ax | nanocosmos Wave Writer | nanoATLServer.dll | - -## Related Modules - -| Module | Description | Dependencies | -|--------|-------------|--------------| -| nMediaBridge.ax | nanocosmos Media Bridge - *add support for seemless switch / live encoding / file streaming* | | - -## Dependencies -**Note:** Only the nanoATLServer.dll is mandatory. The Intel and MS files may be optional, dependent on your OS. - -| Module | Description | Dependencies | -|--------|-------------|--------------| -| nanoATLServer.dll | nanocosmos License Server | | -| libiomp5md.dll | Intel OpenMP Library | | -| vcomp90.dll | MS OpenMP Library | | - - [a6957aa7]: http://nanocosmos.de/get/nanostream "http://nanocosmos.de/get/nanostream" diff --git a/docs/nanostream/windows/windows_developer_manual.md b/docs/nanostream/windows/windows_developer_manual.md deleted file mode 100644 index e78945e6c..000000000 --- a/docs/nanostream/windows/windows_developer_manual.md +++ /dev/null @@ -1,55 +0,0 @@ -# Windows nanoStream SDK components - -Note: Not all modules are contained in all configurations. Please ask for availability and prices. -## Live Video Capture Active-X Control (npvidcap.ax) -Active-X-Control compatible with Internet Explorer and other ActiveX technologies -API compatible to Javascript, C/C++, NET/C#, VisualBasic, Delphi, and others - -## Live Video Capture NP Plugin (np_vidcap.dll) -Plugin for Mozilla/Netscape based browsers, Javascript interface (Firefox, Safari) - -## nanocosmos H.264 video encoder (Filename: nh264enc.ax) -DirectShow video encoder filter for encoding live video to H.264 - -## nanocosmos AAC audio encoder (Filename: naacenc.ax) -DirectShow audio encoder filter for encoding live audio to AAC - -## nanocosmos MP4 File Writer -DirectShow filter for creating MP4 files with H.264 support - -## nanocosmos RTMP Network Writer (Filename: nRtmpRenderer.ax) -DirectShow filter for streaming to Wowza and Flash Media Servers -Example URL: rtmp://localhost/live+myStream - -## HD / UDP Streaming Filters -DirectShow Streaming components for HD video streaming in Local Area Networks: -Point-to-Point, Broadcast, Multicast support -Example URL: udp://localhost:1234 - -## WindowsMedia Encoding and Streaming -Streaming component compatible to Microsoft WindowsMedia Video Formats: - -## Additional Extensions: -- nanocosmos Stereoscopic 3D-Video Mixer supporting Side-by-side/Interlaced/Color Anaglyph -modes -- Video Resizer for resizing and deinterlacing video -- Overlay Filter for blending of, Texts, Bitmaps, Tickers, etc. -- Desktop Capture / Screen Grabber Filter for Application Streaming e.g. Games (upon request) -- Remote Control Function for Keyboard Feedback -- Player/Clients for DirectShow/Applications or Browser-Plugin or Flash based -- Live Video Encoder Application -Reference Application to show functionality in a simple end user program - -# DirectShow Filter usage with GraphEdit / GraphStudioNext -All Live Video Encoder components are available as DirectShow filters and may be used within DirectShow applications. - -We recommend using [GraphStudio][387c48a0] as a replacement for GraphEdit, as RTMP URLs may be set easily with this software. - - -![live_encoding_graph](img/windows_developer_manual_graph_studio.png) -## Setting DirectShow properties from C++ -The H.264 parameters may be set by calling the `InanoCodecOpts` interface. The RTMP output path may be set by calling the `SetFileName()` method of the default DirectShow `FileSinkFilter` interface. - - - -[387c48a0]: https://code.google.com/p/graph-studio-next/ "https://code.google.com/p/graph-studio-next/" diff --git a/docs/sidebar.md b/docs/sidebar.md deleted file mode 100644 index d16f5804c..000000000 --- a/docs/sidebar.md +++ /dev/null @@ -1,44 +0,0 @@ - -# h5live -## H5Live Player -- [Intro](nanoplayer/nanoplayer_introduction) -- [Getting Started](nanoplayer/nanoplayer_getting_started) -- [Supported Browsers](nanoplayer/nanoplayer_supported_browsers) -- [Token Security](nanoplayer/nanoplayer_token_security) -## API -- [Classes](nanoplayer/nanoplayer_api_class) -- [Events](nanoplayer/nanoplayer_api_events) -- [Globals](nanoplayer/nanoplayer_api_global) - -# webrtc -## WebRTC.live - [Intro](webrtc/nanostream_webrtc_introduction) - [](webrtc/nanostream_webrtc_getting_started) - [](webrtc/nanostream_webrtc_browser_api) - [](webrtc/nanostream_webrtc_api) - -# cloud -## nanoStream Cloud - cloud/cloud_introduction - cloud/cloud_getting_started - cloud/cloud_ios_streaming_app - -# nanostream -## nanoStream SDKs/Apps - nanostream/nanostream - nanostream/android/nanostream-android-sdk - nanostream/ios/nanostream-ios-sdk - nanostream/ios/nanostream_ios_license_deployment - -# faq - Live Streaming - faq/faq_streaming - faq/faq_devices_support - faq/faq_adv_codec_config - faq/faq_3d_stereo_vr - faq/programming_sdk_api - faq/faq_nanostream_sdk_win - -# Other Info - -[Blog](nanoplayer/nanoplayer_blogposts) diff --git a/docs/webrtc/nanostream_webrtc_api.md b/docs/webrtc/nanostream_webrtc_api.md index 6d8aee1c5..10d003420 100644 --- a/docs/webrtc/nanostream_webrtc_api.md +++ b/docs/webrtc/nanostream_webrtc_api.md @@ -1,7 +1,7 @@ --- id: nanostream_webrtc_api title: nanoStream WebRTC API -sidebar_label: WebRTC API +sidebar_label: Class --- diff --git a/docs/webrtc/nanostream_webrtc_browser_api.md b/docs/webrtc/nanostream_webrtc_browser_api.md index a82a0f530..55ef1c801 100644 --- a/docs/webrtc/nanostream_webrtc_browser_api.md +++ b/docs/webrtc/nanostream_webrtc_browser_api.md @@ -4,332 +4,4 @@ title: nanoStream WebRTC Browser API sidebar_label: Browser API --- -## nanoStream WebRTC Browser API - -The nanoStream WebRTC Browser API is based on a Javascript API connected to the nanoStream WebRTC Server. It can be used for creating your own live video broadcast web page for plugin-free live streaming with WebRTC. - -See the separate documentation for our ready-to-use web page for instant streaming. - -See our [blog article](https://www.nanocosmos.de/blog/2016/11/setting-up-nanostream-webrtc-for-live-video-broadcast/). - - - -### Hosting Requirements - -You will need the following requirements to be fulfilled in order to host a WebRTC driven website on your own infrastructure: - -- HTTPS: **WebRTC client web pages need to be hosted via HTTPS** for accessing media devices within the browser and for connecting to the server component. Therefore you will need a valid SSL certificate. -- Supported browsers: As of 2018, Chrome, Firefox, Edge and Safari are supported. For mobile platforms we recommend Safari on iOS (min iOS11) and Chrome for Android. - - - -### Broadcast Sample - -The following sample shows how to initiate a broadcast (one-to-many stream) from a WebRTC enabled HTML5 browser. - -The stream is sent to an `RTMP` ingest point which you can get from our bintu.live API. -Playback can be done with nanoStream H5Live Player. - -Be sure to attach a video device (webcam) to your computer. - -You also find a full running [sample at codepen](https://codepen.io/nanocosmos-ol/pen/Xybadx) - - - -### Setup The User Interface & Embed The Library - -Within your HTML: -```xml - - - - - - - - - - - - -``` - - - -### Minimal Broadcast Sample - -```javascript - -``` - - - -## API Documentation - -See the full documentation on the window.nanowebrtc.user object: - -https://webrtc.nanocosmos.de/release/doc/webrtc/index.html - - - -## nanoStream Cloud End-To-End Workflow - -The following describes a plugin free end to end streaming solution with nanostream WebRTC, nanostream cloud and nanostream h5live player. - - - -## Creating a live stream for broadcasting - -To create a live stream to broadcast to your audience, you need to obtain an `RTMP` ingest URL from either nanoStream Cloud / bintu.live or your own `RTMP` server. - - - -### Creating a stream for bintu.live with bintu.js - -If you don't already have a stream url you can create a new webrtc enabled stream with our bintu.js which is included in the nanoStream WebRTC Browser API. - -```javascript - - - -``` - -for more information see: [bintu.js documentation](https://webrtc.nanocosmos.de/release/doc/bintu/Bintu.html) - - - -### Streaming to an RTMP URL - -If you have a valid `RTMP` URL, you can use this to create a live broadcast: (see the example above): - -```javascript -// example bintu rtmp url -// you should use the bintu api to obtain a valid ingest URL (see below) -var myOutputStream = "rtmp://bintu-stream.nanocosmos.de/live/P4gSV-12345"; -var broadcastConfig = { - transcodingTargets: { - output: myOutputStream; - } -}; -``` - - - -## Live Stream Configuration - -```javascript -var broadcastConfig = { - transcodingTargets: { - output: rtmpurl, // rtmp live stream URL - videobitrate: entries.videoBitrate, // rtmp/h264 video bitrate - audiobitrate: entries.audioBitrate, // rtmp/aac audio bitrate - framerate: entries.framerate, // rtmp/h264 video framerate - dropframes: this.dropframes, // rtmp/h264 allow dropframes - h264passthrough: this.h264passthrough, // rtmp/h264 passthrough streaming - } -} -``` - - - -## Streaming to nanoStream Cloud - -The bintu.live REST API or Dashboard can be used to generate and manage live streams. - -https://www.nanocosmos.de/v4/documentation/documentation#nanostream_cloud_bintulive_api - - - -## Stream Status - -the call to https://bintu.nanocosmos.de/doc/#stream-stream-info should give you all the info. The "state" value should be "live" when your broadcast is running. - -Example: - -```json -{ - "id":"123456-e7a1-46a6-9572-1037beff926c", - "state":"live", - "type":"low-latency", - "created_at":"2018-10-02T08:53:50.377Z", - "webrtc":true, - "transcoding":false, - "webrtc_server":"https://rtc1.nanocosmos.de/prod", - "tags":[ - "myTag" - ], -} -``` - - - -## Playing back from our servers - -For additional info on the h5live player, see [here](https://www.nanocosmos.de/v4/documentation/nanoplayer-h5live) - - - -## Camera / Capture Device Testing - -https://webrtc.github.io/samples/src/content/devices/input-output/ - - - -## Screen Sharing - -`WebRTC` supports screen sharing! You can use a screen or a window, depending on a browser used, as a live video source instead of a web camera. - -Screen sharing is currently available in: - - * Google Chrome - * Firefox - - - -## Screen sharing with Google Chrome - -Chrome on Desktop since version 72 supports screen sharing without any further installation. -For former versions, a certified browser extension was required due to Google security policy. - -You find the nanoStream branded screen capture extension [here](https://chrome.google.com/webstore/detail/nanostream-screen-capture/jfjljfmoopheadghnkjbonkmgbkjhjdo) - - - -## Reporting bugs or issues - -To report any bugs or issues, please send a complete issue report including the following: - -- a description of the issue and expected results -- the configuration you are using for webrtc, bintu.live and h5live -- potential stream IDs which show the issue -- how to replicate the issue - - - -### Log information - -#### browser console log - -Press `Ctrl+Shift+J` or `F12` (Windows / Linux) or `Cmd+Opt+J` (Mac) -copy/paste the result of the console - - - -#### use debug-log information - -Enhanced logging can be enabled by adding `&debug=3` to the web page URL - - - -#### Chrome webrtc-internals - -Open a separate browser tab and open the URL `chrome://webrtc-internals` click `dump` and download the data and send to us. - - - -### Remote Support - -- any potential issues might be best resolved based on a remote support session, - dependent on your support level. - Please contact us to arrange an online meeting. - +Moved to getting-started \ No newline at end of file diff --git a/docs/webrtc/nanostream_webrtc_demos.md b/docs/webrtc/nanostream_webrtc_demos.md new file mode 100644 index 000000000..1cee99347 --- /dev/null +++ b/docs/webrtc/nanostream_webrtc_demos.md @@ -0,0 +1,91 @@ +--- +id: nanostream_webrtc_demos +title: Browser demos +sidebar_label: Browser Demos +--- + +## Easy and quick demo for simple tests + +1. Click [here](https://www.nanocosmos.de/v6/webrtc) to try the WebRTC.live demo. + +
+ +2. On the right-hand side of the page you see the WebRTC.live broadcast from your camera. + + +![img](https://i2.wp.com/www.nanocosmos.de/blog/wp-content/uploads/2018/03/3.png?resize=360%2C361&ssl=1) + +
+3. Click on the image for a webcam preview. + +![img](https://i2.wp.com/www.nanocosmos.de/blog/wp-content/uploads/2018/03/4.png?resize=360%2C384&ssl=1) + +
+4. Click on the orange button to start the broadcast. You will need to provide your email first. + +![img](https://i0.wp.com/www.nanocosmos.de/blog/wp-content/uploads/2018/03/5.png?resize=360%2C394&ssl=1) + +
+5. Your broadcast will then start: the live stream is sent to nanoStream Cloud and a new window from nanoStream H5Live Player will appear right below with your live stream. + +![img](https://i0.wp.com/www.nanocosmos.de/blog/wp-content/uploads/2018/03/6.png?resize=360%2C388&ssl=1) +![img](https://i2.wp.com/www.nanocosmos.de/blog/wp-content/uploads/2018/03/7.png?resize=360%2C392&ssl=1) + +> The H5Live Player shows the low latency live stream coming from nanoStream Cloud. You can share the URL to test low latency live playback on any HTML5 browser. +----- + +## Try our sample page + + Click [here](https://webrtc.nanocosmos.de/release/webcast.html?bintu.apikey=YOURAPIKEY) to use our sample web page with all broadcast features for further testing. + +> **Note:** +> You need a nanoStream Cloud / bintu.live account and API key to use this page. +> Click [here](../cloud/cloud_getting_started) for more instructions. + +
+ +1. Open the page in a WebRTC-compatible browser (Chrome or Firefox) and add your bintu API key to the browser URL. + +``` +https://webrtc.nanocosmos.de/release/webcast.html?bintu.apikey=YOURAPIKEY +``` +
+![img](https://i1.wp.com/www.nanocosmos.de/blog/wp-content/uploads/2018/03/8.png?resize=800%2C444&ssl=1) + +
+2. You will see a preview of your camera image or screen in the `Local Video` window. + +
+3. If you want to choose another camera or microphone, select `options`. + +
+ +4. You are then ready to start your broadcast. Simply click on `broadcast` to start the live stream. + +![img](https://i1.wp.com/www.nanocosmos.de/blog/wp-content/uploads/2018/03/9.png?resize=360%2C79&ssl=1) + +
+5. The live stream is sent to nanoStream Cloud and can be played with the H5Live player. + To start playback click on `play h5live stream` below the Broadcast Settings. + +![img](https://i0.wp.com/www.nanocosmos.de/blog/wp-content/uploads/2018/03/10.png?resize=240%2C59&ssl=1) + +
+6. The player will open in a new web page. You share this web page and open on all HTML5 browsers to play the live stream in ultra-low-latency. + The player page also shows a Javascript code snippet to embed on your own web page. + + +[![img](https://i1.wp.com/www.nanocosmos.de/blog/wp-content/uploads/2018/03/h5live-2.png?resize=300%2C279&ssl=1)](https://i1.wp.com/www.nanocosmos.de/blog/wp-content/uploads/2018/03/h5live-2.png?ssl=1) + +> Click [here](http://docs.nanocosmos.de/docs/webrtc/nanostream_webrtc_getting_started) for more information on how to embed the H5LivePlayer on your own webpage. + +
+ +7. Broadcast configuration + +The WebRTC.live broadcast configuration is automatically set to `H264 video` with `500 kbits/s`. Audio is sent with the `Opus audio codec` and will be transcoded automatically to `AAC` for live distribution with nanoStream Cloud. + +[![img](https://i0.wp.com/www.nanocosmos.de/blog/wp-content/uploads/2018/03/Screenshot-2018-03-28-11.20.21.png?resize=640%2C804&ssl=1)](https://i0.wp.com/www.nanocosmos.de/blog/wp-content/uploads/2018/03/Screenshot-2018-03-28-11.20.21.png?resize=640%2C804&ssl=1) + +----- + diff --git a/docs/webrtc/nanostream_webrtc_getting_started.md b/docs/webrtc/nanostream_webrtc_getting_started.md index 370db96e6..6213cf143 100644 --- a/docs/webrtc/nanostream_webrtc_getting_started.md +++ b/docs/webrtc/nanostream_webrtc_getting_started.md @@ -9,100 +9,276 @@ It is very simple to test and use nanoStream WebRTC.live as your live encoder to ### Create your own nanoStream Cloud account -To stream directly to nanoStream Cloud you will need to register at [bintu.live](http://bintu.nanocosmos.de/) . +To stream directly to nanoStream Cloud you will need to register at [bintu.live](https://bintu.nanocosmos.de/) . ->Bintu.live is the rest API and stream management tool included in nanoStream Cloud. You can find the step-by-step guide to register by [clicking here.](https://www.nanocosmos.de/blog/2016/07/live-streaming-with-bintu-live/) +>Bintu.live is the rest API and stream management tool included in nanoStream Cloud. You can find the step-by-step guide to register by [clicking here.](http://docs.nanocosmos.de/docs/cloud/cloud_getting_started) > >Once registered, you can create new URLs by calling the bintu API with a valid API key. ----- -### Easy and quick demo for simple tests +## nanoStream WebRTC Browser API -1. Click [here]([https://nanocosmos.de/webrtc) to try the WebRTC.live demo. +The nanoStream WebRTC Browser API is based on a Javascript API connected to the nanoStream WebRTC Server. It can be used for creating your own live video broadcast web page for plugin-free live streaming with WebRTC. -
-2. On the right-hand side of the page you see the WebRTC.live broadcast from your camera. -![img](https://i2.wp.com/www.nanocosmos.de/blog/wp-content/uploads/2018/03/3.png?resize=360%2C361&ssl=1) +### Hosting Requirements -
-3. Click on the image for a webcam preview. +You will need the following requirements to be fulfilled in order to host a WebRTC driven website on your own infrastructure: -![img](https://i2.wp.com/www.nanocosmos.de/blog/wp-content/uploads/2018/03/4.png?resize=360%2C384&ssl=1) +- HTTPS: **WebRTC client web pages need to be hosted via HTTPS** for accessing media devices within the browser and for connecting to the server component. Therefore you will need a valid SSL certificate. +- Supported browsers: As of 2018, Chrome, Firefox, Edge and Safari are supported. For mobile platforms we recommend Safari on iOS (min iOS11) and Chrome for Android. -
-4. Click on the orange button to start the broadcast. You will need to provide your email first. -![img](https://i0.wp.com/www.nanocosmos.de/blog/wp-content/uploads/2018/03/5.png?resize=360%2C394&ssl=1) -
-5. Your broadcast will then start: the live stream is sent to nanoStream Cloud and a new window from nanoStream H5Live Player will appear right below with your live stream. +## Broadcast Sample -![img](https://i0.wp.com/www.nanocosmos.de/blog/wp-content/uploads/2018/03/6.png?resize=360%2C388&ssl=1) -![img](https://i2.wp.com/www.nanocosmos.de/blog/wp-content/uploads/2018/03/7.png?resize=360%2C392&ssl=1) +The following sample shows how to initiate a broadcast (one-to-many stream) from a WebRTC enabled HTML5 browser. -> The H5Live Player shows the low latency live stream coming from nanoStream Cloud. You can share the URL to test low latency live playback on any HTML5 browser. ------ +The stream is sent to an `RTMP` ingest point which you can get from our bintu.live API. +Playback can be done with nanoStream H5Live Player. + +Be sure to attach a video device (webcam) to your computer. -### Try our sample page +You also find a full running [sample at codepen](https://codepen.io/nanocosmos-ol/pen/Xybadx) - Click [here](https://webrtc.nanocosmos.de/release/webcast.html?bintu.apikey=YOURAPIKEY) to use our sample web page with all broadcast features for further testing. -> Note: You need a nanoStream Cloud / bintu.live account and API key to use this page. Click [here](www.bintu.live) for instructions. -
+### Setup The User Interface & Embed The Library -1. Open the page in a WebRTC-compatible browser (Chrome or Firefox) and add your bintu API key to the browser URL. +Within your HTML: +```xml + + + + + + + + + + + ``` -https://webrtc.nanocosmos.de/release/webcast.html?bintu.apikey=YOURAPIKEY + + + +### Minimal Broadcast Sample + +```javascript + ``` -
-![img](https://i1.wp.com/www.nanocosmos.de/blog/wp-content/uploads/2018/03/8.png?resize=800%2C444&ssl=1) -
-2. You will see a preview of your camera image or screen in the `Local Video` window. -
-3. If you want to choose another camera or microphone, select `options`. -
+## nanoStream Cloud End-To-End Workflow -4. You are then ready to start your broadcast. Simply click on `broadcast` to start the live stream. +The following describes a plugin free end to end streaming solution with nanostream WebRTC, nanostream cloud and nanostream h5live player. -![img](https://i1.wp.com/www.nanocosmos.de/blog/wp-content/uploads/2018/03/9.png?resize=360%2C79&ssl=1) -
-5. The live stream is sent to nanoStream Cloud and can be played with the H5Live player. -To start playback click on `play h5live stream` below the Broadcast Settings. -![img](https://i0.wp.com/www.nanocosmos.de/blog/wp-content/uploads/2018/03/10.png?resize=240%2C59&ssl=1) +## Creating a live stream for broadcasting -
-6. The player will open in a new web page. You share this web page and open on all HTML5 browsers to play the live stream in ultra-low-latency. - The player page also shows a Javascript code snippet to embed on your own web page. +To create a live stream to broadcast to your audience, you need to obtain an `RTMP` ingest URL from either nanoStream Cloud / bintu.live or your own `RTMP` server. -[![img](https://i1.wp.com/www.nanocosmos.de/blog/wp-content/uploads/2018/03/h5live-2.png?resize=300%2C279&ssl=1)](https://i1.wp.com/www.nanocosmos.de/blog/wp-content/uploads/2018/03/h5live-2.png?ssl=1) +### Creating a stream for bintu.live with bintu.js -> Click [here](www.test.com) for more information on how to embed the H5LivePlayer on your own webpage. +If you don't already have a stream url you can create a new webrtc enabled stream with our bintu.js which is included in the nanoStream WebRTC Browser API. -
+```javascript + -7. Broadcast configuration + +``` + +> You can find the bintu.js documentation [here](https://webrtc.nanocosmos.de/release/doc/bintu/Bintu.html) + + + +### Streaming to an RTMP URL + +If you have a valid `RTMP` URL, you can use this to create a live broadcast: (see the example above): + +```javascript +// example bintu rtmp url +// you should use the bintu api to obtain a valid ingest URL (see below) +var myOutputStream = "rtmp://bintu-stream.nanocosmos.de/live/P4gSV-12345"; +var broadcastConfig = { + transcodingTargets: { + output: myOutputStream; + } +}; +``` + + + +## Live Stream Configuration + +```javascript +var broadcastConfig = { + transcodingTargets: { + output: rtmpurl, // rtmp live stream URL + videobitrate: entries.videoBitrate, // rtmp/h264 video bitrate + audiobitrate: entries.audioBitrate, // rtmp/aac audio bitrate + framerate: entries.framerate, // rtmp/h264 video framerate + dropframes: this.dropframes, // rtmp/h264 allow dropframes + h264passthrough: this.h264passthrough, // rtmp/h264 passthrough streaming + } +} +``` + + + +## Streaming to nanoStream Cloud + +The bintu.live REST API or Dashboard can be used to generate and manage live streams. + +> More information can be found [here](http://docs.nanocosmos.de/docs/cloud/cloud_getting_started). + + + +## Stream Status + +The call to +``` +/stream/ +``` +should give you all the info. The `state` value should be `live` when your broadcast is running. + +> You can find the full bintu.live documentation [here](https://bintu.nanocosmos.de/doc/#stream-stream-info). + + + +Example: + +```json +{ + "id":"123456-e7a1-46a6-9572-1037beff926c", + "state":"live", + "type":"low-latency", + "created_at":"2018-10-02T08:53:50.377Z", + "webrtc":true, + "transcoding":false, + "webrtc_server":"https://rtc1.nanocosmos.de/prod", + "tags":[ + "myTag" + ], +} +``` + + +## Playing back from our servers + +You can play back from our servers with the [H5Live Player](http://docs.nanocosmos.de/docs/nanoplayer/nanoplayer_introduction) -The WebRTC.live broadcast configuration is automatically set to `H264 video` with `500 kbits/s`. Audio is sent with the `Opus audio codec` and will be transcoded automatically to `AAC` for live distribution with nanoStream Cloud. -[ -![img](https://i0.wp.com/www.nanocosmos.de/blog/wp-content/uploads/2018/03/Screenshot-2018-03-28-11.20.21.png?resize=640%2C804&ssl=1)](https://www.nanocosmos.de/blog/wp-content/uploads/2018/03/Screenshot-2018-03-28-11.20.21.png) ------ -### Embed nanoStream WebRTC.live as a live encoder and nanoStream H5Live Player in your own webpage +## Camera / Capture Device Testing -TODO +https://webrtc.github.io/samples/src/content/devices/input-output/ -Click [here](www.test.de) to read on *how to embed nanoStream WebRTC.live and nanoStram H5Live Player in your own web page* in no time. \ No newline at end of file diff --git a/docs/webrtc/nanostream_webrtc_screen_sharing.md b/docs/webrtc/nanostream_webrtc_screen_sharing.md new file mode 100644 index 000000000..e559d2b98 --- /dev/null +++ b/docs/webrtc/nanostream_webrtc_screen_sharing.md @@ -0,0 +1,23 @@ +--- +id: nanostream_webrtc_screen_sharing +title: Screen Sharing +sidebar_label: Screen Sharing +--- + +## Screen Sharing + +`WebRTC` supports screen sharing! You can use a screen or a window, depending on a browser used, as a live video source instead of a web camera. + +Screen sharing is currently available in: + + * Google Chrome + * Firefox + + + +## Screen sharing with Google Chrome + +Chrome on Desktop since version 72 supports screen sharing without any further installation. +For former versions, a certified browser extension was required due to Google security policy. + +You find the nanoStream branded screen capture extension [here](https://chrome.google.com/webstore/detail/nanostream-screen-capture/jfjljfmoopheadghnkjbonkmgbkjhjdo) \ No newline at end of file diff --git a/docs/webrtc/nanostream_webrtc_support.md b/docs/webrtc/nanostream_webrtc_support.md new file mode 100644 index 000000000..c438bef19 --- /dev/null +++ b/docs/webrtc/nanostream_webrtc_support.md @@ -0,0 +1,44 @@ +--- +id: nanostream_webrtc_support +title: Support +sidebar_label: Support +--- + +## Reporting bugs or issues + +To report any bugs or issues, please send a complete issue report including the following: + +- a description of the issue and expected results +- the configuration you are using for webrtc, bintu.live and h5live +- potential stream IDs which show the issue +- how to replicate the issue + + + +### Log information + +#### browser console log + +Press `Ctrl+Shift+J` or `F12` (Windows / Linux) or `Cmd+Opt+J` (Mac) +copy/paste the result of the console + + + +#### use debug-log information + +Enhanced logging can be enabled by adding `&debug=3` to the web page URL + + + +#### Chrome webrtc-internals + +Open a separate browser tab and open the URL `chrome://webrtc-internals` click `dump` and download the data and send to us. + + + +### Remote Support + +- any potential issues might be best resolved based on a remote support session, + dependent on your support level. + +**Please [contact](mailto:support@nanocosmos.de) us to arrange an online meeting.** \ No newline at end of file diff --git a/website/i18n/en.json b/website/i18n/en.json index 498d1e92c..0d6916834 100644 --- a/website/i18n/en.json +++ b/website/i18n/en.json @@ -3,11 +3,8 @@ "localized-strings": { "next": "Next", "previous": "Previous", - "tagline": "nanoStream Cloud & H5Live Player - Around The World in 1 Second", + "tagline": "True interactive live streaming to engage your audience", "docs": { - "about": { - "title": "about" - }, "bintu/android/bintu-android-sdk": { "title": "bintu/android/bintu-android-sdk" }, @@ -50,6 +47,26 @@ "title": "Capture Devices and Camera Support", "sidebar_label": "Capture Devices and Camera Support" }, + "faq/faq_h5live_player_adjust_style": { + "title": "Adjust/Style", + "sidebar_label": "Adjust/Style" + }, + "faq/faq_h5live_player_bintu": { + "title": "bintu", + "sidebar_label": "bintu" + }, + "faq/faq_h5live_player_general": { + "title": "General", + "sidebar_label": "General" + }, + "faq/faq_h5live_player_metrics": { + "title": "Metrics", + "sidebar_label": "Metrics" + }, + "faq/faq_h5live_player_security": { + "title": "Security", + "sidebar_label": "Security" + }, "faq/faq_nanostream_sdk_win": { "title": "nanoStream SDK for Windows", "sidebar_label": "nanoStream SDK for Windows" @@ -62,6 +79,18 @@ "title": "FAQ nanoStream Live Streaming", "sidebar_label": "Live Streaming" }, + "faq/faq_WebRTC_broadcast": { + "title": "Broadcast", + "sidebar_label": "Broadcast" + }, + "faq/faq_WebRTC_devices": { + "title": "Devices", + "sidebar_label": "Devices" + }, + "faq/faq_WebRTC_general": { + "title": "General", + "sidebar_label": "General" + }, "faq/faq": { "title": "faq/faq" }, @@ -103,12 +132,6 @@ "title": "Programming", "sidebar_label": "Programming" }, - "index": { - "title": "index" - }, - "mkdocs": { - "title": "mkdocs" - }, "nanoplayer/nanoplayer_api_class": { "title": "Class", "sidebar_label": "Class" @@ -133,9 +156,6 @@ "title": "Getting started", "sidebar_label": "Getting started" }, - "nanoplayer/nanoplayer_gettingstarted_frameworks": { - "title": "nanoplayer/nanoplayer_gettingstarted_frameworks" - }, "nanoplayer/nanoplayer_introduction": { "title": "Introduction", "sidebar_label": "Introduction" @@ -158,33 +178,21 @@ "nanostream/adobe/nanostream_flex_app_64bit_ane": { "title": "nanostream/adobe/nanostream_flex_app_64bit_ane" }, - "nanostream/android/android_developer_manual_playback": { - "title": "nanostream/android/android_developer_manual_playback" + "nanostream/android/nanostream_android_developer_manual_playback": { + "title": "Android Playback", + "sidebar_label": "Playback" }, - "nanostream/android/android_developer_manual_sample": { - "title": "nanostream/android/android_developer_manual_sample" + "nanostream/android/nanostream_android_developer_manual_sample": { + "title": "Sample", + "sidebar_label": "Sample" }, - "nanostream/android/android_developer_manual_streaming": { - "title": "nanostream/android/android_developer_manual_streaming" + "nanostream/android/nanostream_android_developer_manual_streaming": { + "title": "Streaming Media", + "sidebar_label": "Streaming Media" }, - "nanostream/android/android_feedback": { - "title": "nanostream/android/android_feedback" - }, - "nanostream/android/android_getting_started": { - "title": "nanostream/android/android_getting_started" - }, - "nanostream/android/android_rtmp_playback": { - "title": "nanostream/android/android_rtmp_playback" - }, - "nanostream/android/android-advanced-settings": { - "title": "nanostream/android/android-advanced-settings" - }, - "nanostream/android/nanostream-android-index": { - "title": "nanostream/android/nanostream-android-index" - }, - "nanostream/android/nanostream-android-sdk": { - "title": "SDK for Android", - "sidebar_label": "SDK for Android" + "nanostream/android/nanostream_android_getting_started": { + "title": "Getting started", + "sidebar_label": "Getting started" }, "nanostream/android/sample/android_sample_player": { "title": "nanostream/android/sample/android_sample_player" @@ -228,74 +236,40 @@ "nanostream/android/streaming/android_stream_type": { "title": "nanostream/android/streaming/android_stream_type" }, - "nanostream/directshow/directshow_audio_volume": { - "title": "nanostream/directshow/directshow_audio_volume" - }, - "nanostream/directshow/directshow_avc_h264": { - "title": "nanostream/directshow/directshow_avc_h264" - }, - "nanostream/directshow/directshow_code_statistics": { - "title": "nanostream/directshow/directshow_code_statistics" - }, - "nanostream/directshow/directshow_h264_video_decoder": { - "title": "nanostream/directshow/directshow_h264_video_decoder" - }, - "nanostream/directshow/directshow_h264_video_encoder": { - "title": "nanostream/directshow/directshow_h264_video_encoder" - }, - "nanostream/directshow/directshow_license_api": { - "title": "nanostream/directshow/directshow_license_api" - }, - "nanostream/directshow/directshow_mpeg_audio_encoder": { - "title": "nanostream/directshow/directshow_mpeg_audio_encoder" - }, - "nanostream/directshow/directshow_mpeg2_broadcast_sdk": { - "title": "nanostream/directshow/directshow_mpeg2_broadcast_sdk" - }, - "nanostream/directshow/directshow_mpeg2_video_decoder": { - "title": "nanostream/directshow/directshow_mpeg2_video_decoder" - }, - "nanostream/directshow/directshow_mpeg2_video_encoder": { - "title": "nanostream/directshow/directshow_mpeg2_video_encoder" - }, - "nanostream/directshow/directshow_nanoAVC_decoding_sdk": { - "title": "nanostream/directshow/directshow_nanoAVC_decoding_sdk" - }, - "nanostream/directshow/directshow_nanoAVC_encoding_sdk": { - "title": "nanostream/directshow/directshow_nanoAVC_encoding_sdk" - }, - "nanostream/directshow/directshow_overlay_mixing": { - "title": "nanostream/directshow/directshow_overlay_mixing" - }, - "nanostream/directshow/directshow_quicktime_imx": { - "title": "nanostream/directshow/directshow_quicktime_imx" - }, - "nanostream/directshow/directshow_rtmp_source": { - "title": "nanostream/directshow/directshow_rtmp_source" + "nanostream/directshow/index": { + "title": "nanostream/directshow/index" }, - "nanostream/directshow/directshow_rtmp_status_statistics": { - "title": "nanostream/directshow/directshow_rtmp_status_statistics" + "nanostream/directshow/nanostream_directshow_audio_volume": { + "title": "Audio Volume", + "sidebar_label": "Audio Volume" }, - "nanostream/directshow/directshow_rtmp_writer": { - "title": "nanostream/directshow/directshow_rtmp_writer" + "nanostream/directshow/nanostream_directshow_h264": { + "title": "H264", + "sidebar_label": "H264" }, - "nanostream/directshow/directshow_rtsp_sink": { - "title": "nanostream/directshow/directshow_rtsp_sink" + "nanostream/directshow/nanostream_directshow_mpeg": { + "title": "MPEG", + "sidebar_label": "MPEG" }, - "nanostream/directshow/directshow_rtsp_source": { - "title": "nanostream/directshow/directshow_rtsp_source" + "nanostream/directshow/nanostream_directshow_quicktime": { + "title": "Quicktime IMX Playback", + "sidebar_label": "Quicktime IMX Playback" }, - "nanostream/directshow/directshow_screen_capture_filter": { - "title": "nanostream/directshow/directshow_screen_capture_filter" + "nanostream/directshow/nanostream_directshow_rtmp": { + "title": "RTMP", + "sidebar_label": "RTMP" }, - "nanostream/directshow/directshow_udp_ts_streaming": { - "title": "nanostream/directshow/directshow_udp_ts_streaming" + "nanostream/directshow/nanostream_directshow_rtsp": { + "title": "RTSP", + "sidebar_label": "RTSP" }, - "nanostream/directshow/directshow_video_mixer": { - "title": "nanostream/directshow/directshow_video_mixer" + "nanostream/directshow/nanostream_directshow_udp_streaming": { + "title": "UDP/TS Streaming", + "sidebar_label": "UDP/TS Streaming" }, - "nanostream/directshow/index": { - "title": "nanostream/directshow/index" + "nanostream/directshow/nanostream_directshow_video_filter": { + "title": "Video Filter", + "sidebar_label": "Video Filter" }, "nanostream/general/nanocosmos_contact": { "title": "nanostream/general/nanocosmos_contact" @@ -303,19 +277,21 @@ "nanostream/general/nanocosmos_method_parameter_header": { "title": "nanostream/general/nanocosmos_method_parameter_header" }, - "nanostream/ios/ios-quick-start": { - "title": "nanostream/ios/ios-quick-start" - }, "nanostream/ios/nanostream_ios_license_deployment": { "title": "License Deployment Information", "sidebar_label": "License Deployment Information" }, - "nanostream/ios/nanostream-ios-sdk": { + "nanostream/ios/nanostream_ios_quick_start": { + "title": "Developer Quickstart", + "sidebar_label": "Developer Quickstart" + }, + "nanostream/ios/nanostream_ios_sdk": { "title": "SDK for iOS", "sidebar_label": "SDK for iOS" }, - "nanostream/macos/nanostream-macos-sdk": { - "title": "nanostream/macos/nanostream-macos-sdk" + "nanostream/macos/nanostream_macos_sdk": { + "title": "MacOSX API", + "sidebar_label": "MacOSX API" }, "nanostream/nanostream": { "title": "Introduction", @@ -369,50 +345,46 @@ "nanostream/support/rtmp/nanostream_rtmp_statistics": { "title": "nanostream/support/rtmp/nanostream_rtmp_statistics" }, - "nanostream/web/live_video_encoder_-_plugin_jscript": { - "title": "nanostream/web/live_video_encoder_-_plugin_jscript" - }, - "nanostream/web/nanostream-4.x-web-api": { - "title": "nanostream/web/nanostream-4.x-web-api" - }, - "nanostream/windows/language_integration/nanostream_activex_visualcpp_mfc": { - "title": "nanostream/windows/language_integration/nanostream_activex_visualcpp_mfc" - }, - "nanostream/windows/language_integration/nanostream_activex_visualcpp": { - "title": "nanostream/windows/language_integration/nanostream_activex_visualcpp" + "nanostream/web/nanostream_4.x_web_api": { + "title": "nanoStream Web API 4.x", + "sidebar_label": "nanoStream Web API 4.x" }, - "nanostream/windows/language_integration/nanostream_cpp_integration": { - "title": "nanostream/windows/language_integration/nanostream_cpp_integration" + "nanostream/web/nanostream_live_video_encoder_-_plugin_jscript": { + "title": "Live Video Encoder - Plugin API", + "sidebar_label": "Live Video Encoder - Plugin API" }, - "nanostream/windows/language_integration/nanostream_csharp_integration": { - "title": "nanostream/windows/language_integration/nanostream_csharp_integration" + "nanostream/windows/nanostream_windows_binaries": { + "title": "Binary Modules for Windows", + "sidebar_label": "Binary Modules for Windows" }, - "nanostream/windows/language_integration/nanostream_delphi_integration": { - "title": "nanostream/windows/language_integration/nanostream_delphi_integration" + "nanostream/windows/nanostream_windows_developer_manual": { + "title": "Developer Manual", + "sidebar_label": "Developer Manual" }, - "nanostream/windows/windows_binares": { - "title": "nanostream/windows/windows_binares" + "nanostream/windows/nanostream_windows_language_integration": { + "title": "Language Integration", + "sidebar_label": "Language Integration" }, - "nanostream/windows/windows_developer_manual": { - "title": "nanostream/windows/windows_developer_manual" + "nanostream/windows/nanostream_windows_license_help": { + "title": "Setting the license", + "sidebar_label": "Setting the license" }, - "nanostream/windows/windows_license_help": { - "title": "nanostream/windows/windows_license_help" - }, - "nanostream/windows/windows_networkwriter": { - "title": "nanostream/windows/windows_networkwriter" - }, - "sidebar": { - "title": "sidebar" + "nanostream/windows/nanostream_windows_networkwriter": { + "title": "RTMP Network Renderer & Writer", + "sidebar_label": "RTMP Network Renderer & Writer" }, "webrtc/nanostream_webrtc_api": { "title": "nanoStream WebRTC API", - "sidebar_label": "WebRTC API" + "sidebar_label": "Class" }, "webrtc/nanostream_webrtc_browser_api": { "title": "nanoStream WebRTC Browser API", "sidebar_label": "Browser API" }, + "webrtc/nanostream_webrtc_demos": { + "title": "Browser demos", + "sidebar_label": "Browser Demos" + }, "webrtc/nanostream_webrtc_getting_started": { "title": "Getting started", "sidebar_label": "Getting started" @@ -420,6 +392,14 @@ "webrtc/nanostream_webrtc_introduction": { "title": "Introduction", "sidebar_label": "Introduction" + }, + "webrtc/nanostream_webrtc_screen_sharing": { + "title": "Screen Sharing", + "sidebar_label": "Screen Sharing" + }, + "webrtc/nanostream_webrtc_support": { + "title": "Support", + "sidebar_label": "Support" } }, "links": { @@ -436,11 +416,13 @@ "WebRTC.live": "WebRTC.live", "nanoStream Cloud": "nanoStream Cloud", "nanoStream SDKs/Apps": "nanoStream SDKs/Apps", + "Android": "Android", + "iOS": "iOS", + "MacOSX": "MacOSX", + "Windows": "Windows", + "DirectShow": "DirectShow", "Live Streaming": "Live Streaming", - "Purchase and License": "Purchase and License", - "nanoStream SDK for Windows, Codecs Setup": "nanoStream SDK for Windows, Codecs Setup", - "First Category": "First Category", - "Second Category": "Second Category" + "Purchase and License": "Purchase and License" } }, "pages-strings": { diff --git a/website/pages/en/index.js b/website/pages/en/index.js index 73c6fe265..571e2f494 100644 --- a/website/pages/en/index.js +++ b/website/pages/en/index.js @@ -31,7 +31,7 @@ class HomeSplash extends React.Component { const Logo = props => (
- Project Logo + Project Logo
); @@ -42,16 +42,7 @@ class HomeSplash extends React.Component { ); - const PromoSection = props => ( -
-
-
{props.children}
-
-
- ); - const Button = props => ( -
{props.children} @@ -62,12 +53,14 @@ class HomeSplash extends React.Component { return (
- - - - - +
+ +
+ + +
+
); @@ -79,8 +72,99 @@ class Index extends React.Component { const {config: siteConfig, language = ''} = this.props; const {baseUrl} = siteConfig; + const Block = props => ( + + + + ); + + const Button = props => ( +
+ ); + + const Showcase = () => { + + return ( +
+

Power your live streaming

+
+
+

nanoStream WebRTC.live: browser-based live encoder

+ +
+
+

nanoStream WebRTC.live: browser-based live encoder

+ +
+
+
+ Project Logo +
+
+ ); + }; + + + const Features = () => ( +
+
+

Join a new live streaming era

+
+ + {[ + { + content: 'Create awesome interactive live streams with real-time feedback from your audience. nanoStream Cloud has ultra-low latency and doesn\'t take more than 1 second to get you live around the world.', + title: 'Interactive', + }, + { + content: 'Reach your viewers all over the world through a trustful live streaming Cloud. Don\'t worry about contantly changing viewership, nanoStream Cloud will rock your live streams.', + title: 'Scalable', + }, + { + content: 'Create awesome interactive live streams with real-time feedback from your audience. nanoStream Cloud has ultra-low latency and doesn\'t take more than 1 second to get you live around the world.', + title: 'Interactive', + }, + { + content: 'Reach your viewers all over the world through a trustful live streaming Cloud. Don\'t worry about contantly changing viewership, nanoStream Cloud will rock your live streams.', + title: 'Scalable', + }, + ]} + +
+ ); + + const Help = () => ( +
+
+

Need Help?

+
+
+ + +
+
+ ); + return ( - +
+ +
+ + + +
+
); } } diff --git a/website/sidebars.json b/website/sidebars.json index fe321e6da..3b73116bf 100644 --- a/website/sidebars.json +++ b/website/sidebars.json @@ -17,29 +17,68 @@ "WebRTC.live": [ "webrtc/nanostream_webrtc_introduction", "webrtc/nanostream_webrtc_getting_started", - "webrtc/nanostream_webrtc_browser_api", - "webrtc/nanostream_webrtc_api" + "webrtc/nanostream_webrtc_demos", + "webrtc/nanostream_webrtc_screen_sharing", + "webrtc/nanostream_webrtc_support" ], - "Other Information" : ["nanoplayer/nanoplayer_blogposts"] + "API": [ + "webrtc/nanostream_webrtc_api" + ] }, "cloud": { "nanoStream Cloud": [ "cloud/cloud_introduction", "cloud/cloud_getting_started", "cloud/cloud_ios_streaming_app" - ], - "Other Information" : ["nanoplayer/nanoplayer_blogposts"] + ] }, "nanostream": { "nanoStream SDKs/Apps": [ - "nanostream/nanostream", - "nanostream/android/nanostream-android-sdk", - "nanostream/ios/nanostream-ios-sdk", + "nanostream/nanostream" + ], + "Android" : [ + "nanostream/android/nanostream_android_getting_started", + "nanostream/android/nanostream_android_developer_manual_playback", + "nanostream/android/nanostream_android_developer_manual_streaming", + "nanostream/android/nanostream_android_developer_manual_sample" + ], + "iOS" : [ + "nanostream/ios/nanostream_ios_quick_start", + "nanostream/ios/nanostream_ios_sdk", "nanostream/ios/nanostream_ios_license_deployment" ], - "Other Information" : ["nanoplayer/nanoplayer_blogposts"] + "MacOSX" : ["nanostream/macos/nanostream_macos_sdk"], + "Windows" : [ + "nanostream/windows/nanostream_windows_binaries", + "nanostream/windows/nanostream_windows_developer_manual", + "nanostream/windows/nanostream_windows_language_integration", + "nanostream/windows/nanostream_windows_license_help", + "nanostream/windows/nanostream_windows_networkwriter" + ], + "DirectShow": [ + "nanostream/directshow/nanostream_directshow_audio_volume", + "nanostream/directshow/nanostream_directshow_h264", + "nanostream/directshow/nanostream_directshow_mpeg", + "nanostream/directshow/nanostream_directshow_quicktime", + "nanostream/directshow/nanostream_directshow_rtmp", + "nanostream/directshow/nanostream_directshow_rtsp", + "nanostream/directshow/nanostream_directshow_udp_streaming", + "nanostream/directshow/nanostream_directshow_video_filter" + ] }, "faq" : { + "H5Live Player": [ + "faq/faq_h5live_player_general", + "faq/faq_h5live_player_bintu", + "faq/faq_h5live_player_adjust_style", + "faq/faq_h5live_player_metrics", + "faq/faq_h5live_player_security" + ], + "WebRTC.live": [ + "faq/faq_WebRTC_general", + "faq/faq_WebRTC_devices", + "faq/faq_WebRTC_broadcast" + ], "Live Streaming" : [ "faq/faq_streaming", "faq/faq_devices_support", @@ -49,12 +88,6 @@ "faq/faq_nanostream_sdk_win", "faq/programming" ], - "Purchase and License" : ["faq/faq_purchase_and_license"], - "nanoStream SDK for Windows, Codecs Setup" : [ - ] - }, - "docs-other": { - "First Category": ["doc5"], - "Second Category": ["doc3"] + "Purchase and License" : ["faq/faq_purchase_and_license"] } } diff --git a/website/siteConfig.js b/website/siteConfig.js index f0d66aa05..7c0202f1e 100644 --- a/website/siteConfig.js +++ b/website/siteConfig.js @@ -10,7 +10,7 @@ const siteConfig = { title: 'nanocosmos Documentation', // Title for your website. - tagline: 'nanoStream Cloud & H5Live Player - Around The World in 1 Second', + tagline: 'True interactive live streaming to engage your audience', url: 'https://docs.nanocosmos.de', // Your website URL baseUrl: '/', // Base URL for your project */ // For github.io type URLs, you would set the url and baseUrl like: @@ -33,7 +33,8 @@ const siteConfig = { {doc: 'webrtc/nanostream_webrtc_introduction', label: 'WebRTC.live'}, //{doc: 'webrtc', label: 'WebRTC'}, {doc: 'nanostream/nanostream', label: 'nanoStream Apps and SDKs'}, - {doc: 'faq/faq_streaming', label: 'FAQ'} + {doc: 'faq/faq_streaming', label: 'FAQ'}, + // {page: 'livesupport', label: 'Live Support'} ], /* path to images for header/footer */ @@ -47,20 +48,6 @@ const siteConfig = { secondaryColor: '#205C3B', }, - /* Custom fonts for website */ - /* - fonts: { - myFont: [ - "Times New Roman", - "Serif" - ], - myOtherFont: [ - "-apple-system", - "system-ui" - ] - }, - */ - //docsSideNavCollapsible : true, // This copyright info is used in /core/Footer.js and blog RSS/Atom feeds. copyright: `Copyright © ${new Date().getFullYear()} nanocosmos GmbH`, @@ -71,7 +58,10 @@ const siteConfig = { }, // Add custom scripts here that would be placed in