flashphoner wcs


Получаем лиц триал

https://flashphoner.com/download/#trial

Player api

 

wget https://flashphoner.com/download-wcs5.2-server.tar.gz
tar -xvzf download-wcs5.2-server.tar.gz
cd FlashphonerWebCallServer*
apt install -y openjdk-11-jre-headless 
./install.sh
/usr/local/FlashphonerWebCallServer/bin.activation.sh
service webcallserver start
# test
echo open  https://host:8444
tail -f /usr/local/FlashphonerWebCallServer/logs/server_logs/flashphoner.log

 


https://flashphoner.com/support-web-call-server-in-docker/

 

https://habr.com/ru/companies/flashphoner/articles/566360/

 

 

sudo docker network create \
 --subnet 192.168.1.1/24 \
 --gateway=192.168.1.1 \
 --driver=bridge \
 --opt com.docker.network.bridge.name=br-testnet testnet

docker run \
-e PASSWORD=password \
-e LICENSE=code \
-e LOCAL_IP=192.168.1.10 \
--net testnet --ip 192.168.1.10 \
--name wcs-docker-test --rm -d flashphoner/webcallserver:latest

ssh root@192.168.1.10
# allow rest
cat <<EOT>> /usr/local/FlashphonerWebCallServer/conf/flashphoner.properties
# rest active by default
#disable_rest_requests=false
rest_request_timeout=15
rest_client_request_retry_count=1
#
http.port=8011
https.port=8444
hls.http.port=8012
rtmfp.port=1934
rtmp.port=1934
EOT

 

ssh -p 2001 admin@localhost
 ssh -p 2001 admin@localhost -o HostKeyAlgorithms\ ssh-rsa
# admin

# можно создать приложение
add app live MyAppKey "http://localhost:9090/"
#
add app-rest-method MyAppKey connect
update app -l http://localhost:9090/index.php flashStreamingApp
# для всех методов 
add app-rest-method -a MyAppKey

 

 

 

# Настройки Transcoder узлов (origin) для hls abr
transcoder_align_encoders=true
video_filter_enable_fps=true
video_filter_fps=25
video_filter_fps_gop_synchronization=50

 

# Настройки HLS Edge узлов
hls_preloader_enabled=false
hls_player_width=0
hls_player_height=0
cat << EOT > cdn_profiles.yml
profiles:
 -360p:
  audio:
    codec : mpeg4-generic
    rate : 48000
  video:
    height : 360
    bitrate : 500
    gop : 50
    codec : h264
 -480p:
  video:
    height : 480
    bitrate : 600
    gop : 50
    codec : h264
 -720p:
  video:
    height : 720
    bitrate : 1000
    gop : 50
    codec : h264
EOT
hls_abr_enabled=true
hls_abr_stream_name_suffix=-abr
# Клиент должен запрашивать плейлист HLS ABR, указывая имя потока с суффиксом
curl https://server:8445/test_0-HLS-ABR-STREAM/test_0-HLS-ABR-STREAM.m3u8

 

# origin
docker run \
-e PASSWORD=password \
-e LICENSE=code \
-e LOCAL_IP=192.168.1.10 \
--net testnet --ip 192.168.1.10 \
--name origin -d flashphoner/webcallserver:latest
# edge
docker run \
-e PASSWORD=password \
-e LICENSE=code \
-e LOCAL_IP=192.168.1.11 \
--net testnet --ip 192.168.1.11 \
--name edge -d flashphoner/webcallserver:latest

# 
docker cp origin:/usr/local/FlashphonerWebCallServer/conf/flashphoner.properties flashphoner.properties
cat <<EOT >> flashphoner.properties
cdn_enabled=true
cdn_ip=192.168.1.10
cdn_role=origin
transcoder_align_encoders=true
video_filter_enable_fps=true
video_filter_fps=25
video_filter_fps_gop_synchronization=50
hls_store_segment_in_memory=true
hls_min_list_size=6
EOT
docker cp flashphoner.properties origin:/usr/local/FlashphonerWebCallServer/conf/flashphoner.properties
rm flashphoner.properties
#
docker cp edge:/usr/local/FlashphonerWebCallServer/conf/flashphoner.properties flashphoner.properties
docker cp edge:/usr/local/FlashphonerWebCallServer/conf/cdn_profiles.yml cdn_profiles.yml
cat <<EOT >> flashphoner.properties
cdn_enabled=true
cdn_ip=192.168.1.11
cdn_point_of_entry=192.168.1.10
cdn_role=edge
hls_preloader_enabled=false
hls_player_width=0
hls_player_height=0
hls_abr_enabled=true
hls_abr_stream_name_suffix=-abr
hls_store_segment_in_memory=true
hls_min_list_size=6
EOT
cat << EOT > cdn_profiles.yml
profiles:
 -360p:
  audio:
    codec : mpeg4-generic
    rate : 48000
  video:
    height : 360
    bitrate : 500
    gop : 50
    codec : h264
 -480p:
  video:
    height : 480
    bitrate : 600
    gop : 50
    codec : h264
 -720p:
  video:
    height : 720
    bitrate : 1000
    gop : 50
    codec : h264
EOT
docker cp flashphoner.properties edge:/usr/local/FlashphonerWebCallServer/conf/flashphoner.properties
docker cp cdn_profiles.yml edge:/usr/local/FlashphonerWebCallServer/conf/cdn_profiles.yml
rm flashphoner.properties
rm cdn_profiles.yml
#
#
docker restart origin edge
#

docker exec -it origin bash
docker exec -it edge bash
docker stop origin edge
docker rm origin edge


curl -s -X POST -d "{\"name\":\"qwe\"}" http://192.168.1.10:8081/rest-api/hls/startup

 

 

Получение сертификатов

cp /usr/local/FlashphonerWebCallServer/conf/wss.jks /usr/local/FlashphonerWebCallServer/conf/wss.jks.bak
openssl pkcs12 -export -in /etc/letsencrypt/live/domaincom/fullchain.pem -inkey /etc/letsencrypt/live/domaincom/privkey.pem -out /etc/letsencrypt/live/domaincom/pkcs.p12 -name domaincom
keytool -importkeystore -srckeystore /etc/letsencrypt/live/domaincom/pkcs.p12 -srcstoretype PKCS12 -destkeystore /usr/local/FlashphonerWebCallServer/conf/wss.jks
# пароль по умолчания такой
password
#
service webcallserver restart

в доке написано что можно задать другой пароль но это не сработало у меня 

wss.keystore.password=123123

 

Авторизация

 

cat <<EOT >> /usr/local/FlashphonerWebCallServer/conf/flashphoner.properties 
disable_rest_auth=false
EOT
# 
ssh -p 2001 admin@localhost -o HostKeyAlgorithms\ ssh-rsa
add user rest pass

Настройка для прода

Рекомендации по тонкой настройке сервера

# для нод отключить апи
cat <<EOT >> /usr/local/FlashphonerWebCallServer/conf/flashphoner.properties 
http_enable_paths=rest,action,shared,embed_player,empty
disable_rest_requests=true
EOT
# 
cat <<EOT >> /usr/local/FlashphonerWebCallServer/conf/flashphoner.properties 
media_port_from        =20001
media_port_to          =40000
enable_extended_logging=false
EOT
#
cat <<EOT >> /usr/local/FlashphonerWebCallServer/conf/log4j.properties
log4j.rootLogger=error, stdout, fAppender
EOT