Jump to content

Contributions:AVMeetingExtension: Difference between revisions

From BCI2000 Wiki
Mellinger (talk | contribs)
Mellinger (talk | contribs)
Line 8: Line 8:


==SimpleRelayServer==
==SimpleRelayServer==
To build and run the necessary ''SimpleRelayServer'' on a Linux machine, follow these steps:
To allow connection between machines across local networks at different locations, it is necessary to
run a relay server located somewhere in the open internet, on a Linux server under the experimenter's control.
 
Follow these steps to build and run the necessary ''SimpleRelayServer'' executable on a Linux machine:
* Download <tt>SimpleRelayServer.cpp</tt> from
* Download <tt>SimpleRelayServer.cpp</tt> from
https://bci2000.org/svn/trunk/src/contrib/Application/AVStreamingTask/SimpleRelayServer/SimpleRelayServer.cpp
https://bci2000.org/svn/trunk/src/contrib/Application/AVStreamingTask/SimpleRelayServer/SimpleRelayServer.cpp

Revision as of 13:50, 10 April 2026

Synopsis

This task displays video from a remote location, and local video in a window, in conjunction with the SimpleRelayServer application running within a local network, or on the internet. Audio may be transferred in one direction as well. Bidirectional audio is possible but will lead to feedback unless earphones are used.

Authors

Jürgen Mellinger (mellinger@neurotechcenter.org)

SimpleRelayServer

To allow connection between machines across local networks at different locations, it is necessary to run a relay server located somewhere in the open internet, on a Linux server under the experimenter's control.

Follow these steps to build and run the necessary SimpleRelayServer executable on a Linux machine:

  • Download SimpleRelayServer.cpp from

https://bci2000.org/svn/trunk/src/contrib/Application/AVStreamingTask/SimpleRelayServer/SimpleRelayServer.cpp

  • cd to the download's directory and execute
g++ SimpleRelayServer.cpp -o SimpleRelayServer
  • Start the server with
./SimpleRelayServer 2>/dev/null

or just

./SimpleRelayServer 

if you want to see log messages on the console. By default, the server process will listen on all of the machine's interfaces, at port 1915. A different port may be specified by providing a command line argument:

./SimpleRelayServer 1928 2>/dev/null

Parameters

StreamingServer

The streaming server's address with port, as in bci2000.org:1915. This must match the SimpleRelayServer's listening address.

CameraIndex

The local camera's 0-based index into the video backend's list of detected cameras. Typically 0 unless multiple cameras are attached. A value of -1 disables video streaming.

AudioDeviceIndex

The local audio input device's 0-based index into the audio backend's list of detected audio devices. Specify -1 to disable audio streaming from the local machine.

VideoEncoder

The name of the desired video encoder to use, e.g. h264_mf or libx264. Specify auto to use h264_mf on Windows, and libx264 on non-Windows systems.

States

VideoStreamingLocalTotalFrames

A 32-bit state holding the current local frame number since the beginning of the current recording (BCI2000 run).

VideoStreamingRemoteTotalFrames

A 32-bit state holding the current remote frame number since the beginning of the current recording (BCI2000 run).

VideoStreamingLocalFrame

A 32-bit state holding the current local frame number since the beginning of the current file.

VideoStreamingRemoteFrame

A 32-bit state holding the current remote frame number since the beginning of the current file.

Files

Both local and remote video is being recorded into files in mp4 format. These files bear the current BCI2000 file's basename, followed with _VideoStreamingLocal and _VideoStreamingRemote, respectively.

NOTE: Seeking to individual frames is not possible for mp4 files unless frame time stamps exactly match the frame rate specified at the beginning of the file. To work around this, video files are created with the camera's nominal frame rate, and artificial time stamps proportional to frame number are used when writing frames to a file. In analysis, it will be possible to reconstruct actual time stamps using one of the frame count states.

However, replaying mp4 files written by AVStreamingTask with a standard video player may not result in proper playback speed.

See also

Contributions:Applications