KangLin 1d07eba81f CMake: add find_package(Threads) in examples před 4 roky
..
samples b39fe51365 Add h264 and opus samples před 5 roky
uwp 6b21637dd5 Make examples in /media, /sfu-media, and /streamer work in UWP. před 4 roky
ArgParser.cpp 4d407cf15e Replace getopt with custom arg parser před 5 roky
ArgParser.hpp 4d407cf15e Replace getopt with custom arg parser před 5 roky
CMakeLists.txt 1d07eba81f CMake: add find_package(Threads) in examples před 4 roky
README.md d1d71b2374 Clarified streamer example Readme před 4 roky
client.js 7730496bf9 Fix streamer example for safari před 5 roky
dispatchqueue.cpp d9aa1818b2 Add example project for h264 and opus streaming před 5 roky
dispatchqueue.hpp 226e849915 Include <functional> in dispatchqueue.hpp před 5 roky
fileparser.cpp 58fbc83df3 Fixed indentation před 4 roky
fileparser.hpp d9aa1818b2 Add example project for h264 and opus streaming před 5 roky
h264fileparser.cpp 4ca78db146 Reorganized stuff to make plog private před 4 roky
h264fileparser.hpp d9aa1818b2 Add example project for h264 and opus streaming před 5 roky
helpers.cpp c929be592b Fixed struct timeval undeclared on Windows před 4 roky
helpers.hpp b5699239cc Rename RtcpSRReporter to RtcpSrReporter for naming consistency před 5 roky
index.html 7730496bf9 Fix streamer example for safari před 5 roky
main.cpp cd68d1dba7 Use make_shared where possible před 4 roky
opusfileparser.cpp d9aa1818b2 Add example project for h264 and opus streaming před 5 roky
opusfileparser.hpp d9aa1818b2 Add example project for h264 and opus streaming před 5 roky
stream.cpp 4ca78db146 Reorganized stuff to make plog private před 4 roky
stream.hpp d9aa1818b2 Add example project for h264 and opus streaming před 5 roky

README.md

Streaming H264 and opus

This example streams H264 and opus1 samples to the connected browser client.

Start the example signaling server

$ python3 examples/signaling-server-python/signaling-server.py

Start a web server

$ cd examples/streamer
$ python3 -m http.server --bind 127.0.0.1 8080

Start the streamer

$ cd build/examples/streamer
$ ./streamer

Arguments:

  • -a Directory with OPUS samples (default: ../../../../examples/streamer/samples/opus/).
  • -b Directory with H264 samples (default: ../../../../examples/streamer/samples/h264/).
  • -d Signaling server IP address (default: 127.0.0.1).
  • -p Signaling server port (default: 8000).
  • -v Enable debug logs.
  • -h Print this help and exit.

You can now open the example at the web server URL http://127.0.0.1:8080.

Generating H264 and Opus samples

You can generate H264 and Opus sample with samples/generate_h264.py and samples/generate_opus.py respectively. This require ffmpeg, python3 and kaitaistruct library to be installed. Use -h/--help to learn more about arguments.

1 Opus samples are generated from music downloaded at bensound.