Transcoding running on Edge server

Homer

Member
I have setup a transcoder server in between origin and edge . Why is my Edge server still doing the transcoding despite pulling resources from transcoder?

This is my setup.. RTMP publish to Origin Server -> Transcoder pull from Origin Server-> Edge server pull transcoder server and client subscribe via WSplayer .

Why is my transcoder server not working. Any idea?
 

Max

Administrator
Staff member
Good day.
WSPlayer uses MPV codec for video and PCMU (ulaw) codec for audio. The maximum resolution supported for video is 480p. You should set the following special profile in /usr/local/FlashphonerWebCallServer/conf/cdn_profiles.yml file on Edge server:
YAML:
profiles:
 -wsplayer:
  audio:
    codec : ulaw
  video:
    height : 480
    width : 640
    codec : mpv
and check if mpv and ulaw are listed in codecs parameter in flasphoner.properties file
Code:
codecs=opus,alaw,ulaw,g729,speex16,g722,mpeg4-generic,telephone-event,h264,vp8,flv,mpv
and not listed in codecs_exclude_cdn parameter.
With the settings above, there should not be transcoding on Edge server.
Note that we do not recommend to use WSPlayer at all because this technology is intended for legacy iOS devices which do not support WebRTC. Please use HLS if WebRTC cannot be played.
 

Homer

Member
sorry Max, i have tried your solution .. but still Edge server doing the transcoding.. am i missing anything in egde flashphoner.properties?

Code:
profiles:
 -wsplayer:
  audio:
    codec : ulaw
  video:
    height : 480
    width : 854
    codec : mpv
this is in my cdn_profile.yml , i remove the rest(in edge server)

Code:
cdn_enabled=true
cdn_ip=myip
cdn_point_of_entry=transcoder.mydomain.com
cdn_role=edge
codecs_exclude_cdn=opus,alaw,g729,speex16,g722,mpeg4-generic,telephone-event,h264,vp8,flv
ws_read_socket_timeout=false
flashphoner.properties (in edge server)
 

Max

Administrator
Staff member
sorry Max, i have tried your solution .. but still Edge server doing the transcoding.. am i missing anything in egde flashphoner.properties?
You should strictly set 640x480 resolution for WSPlayer profile
YAML:
profiles:
 -wsplayer:
  audio:
    codec : ulaw
  video:
    height : 480
    width : 640
    codec : mpv
Please also make sure you requesting a stream on Edge by stream name with profile suffix, for example stream-wsprofile
 

Homer

Member
You should strictly set 640x480 resolution for WSPlayer profile
YAML:
profiles:
-wsplayer:
  audio:
    codec : ulaw
  video:
    height : 480
    width : 640
    codec : mpv
Please also make sure you requesting a stream on Edge by stream name with profile suffix, for example stream-wsprofile
noted on the height and width

Im using these stream names..
101wide_480p
102wide_480p
103wide_480p
104wide_480p
105wide_480p
106wide_480p
301_480p
302_480p
501wide_480p
502wide_480p
701wide_480p
how should i put in into cdn profiles?
 

Max

Administrator
Staff member
how should i put in into cdn profiles?
To transcode stream by profile, you should add profile name to stream name as a suffix when requesting stream from Edge to play, for example 101wide_480p-wsplayer if stream name is 101wide_480p and profile name is -wsplayer
 

Homer

Member
To transcode stream by profile, you should add profile name to stream name as a suffix when requesting stream from Edge to play, for example 101wide_480p-wsplayer if stream name is 101wide_480p and profile name is -wsplayer
noted, i did the changes on stream name ..i got the transcoder server to work Max , but now there's another problem .. I saw both CPU process on transcoder and Edge machine spike up almost the same time , in context transcoder machine cpu process should be higher than edge .. is there a possibility that transcoder and edge running transcoding at the same time?
 

Max

Administrator
Staff member
I saw both CPU process on transcoder and Edge machine spike up almost the same time , in context transcoder machine cpu process should be higher than edge .. is there a possibility that transcoder and edge running transcoding at the same time?
Please check statistics page http://wcs:8081/?action=stat both for transcoder and edge server. Pay attention to stream transcoding statistics section
Code:
-----Transcoding info-----
transcoding_video_decoding_resolutions=1920x1080/1
transcoding_video_decoding_average_time=1920x1080/21.0
transcoding_video_decoding_max_time=1920x1080/21
transcoding_video_decoding_average_queue_size=1920x1080/0.0
transcoding_video_decoding_max_queue_size=1920x1080/0
transcoding_video_decoding_load=51840000
transcoding_video_encoding_resolutions=0x0/1;426x240/1;640x360/1;852x480/1
transcoding_video_encoding_average_time=0x0/0.0;426x240/4.0;640x360/7.0;852x480/15.0
transcoding_video_encoding_max_time=0x0/0;426x240/4;640x360/7;852x480/15
transcoding_video_encoding_average_queue_size=0x0/0.0;426x240/0.0;640x360/0.0;852x480/0.0
transcoding_video_encoding_max_queue_size=0x0/0;426x240/0;640x360/0;852x480/0
transcoding_video_encoding_load=18540000
and native resources section
Code:
-----Native Resources-----
native_resources=140374796991488,mpeg4-generic,-687667;140374785781888,NENC:H264/OPENH264,1084;140374797194368,RESAMPLER:44100/48000,2063040;140365850199936,FFDecoderNative:H264/FFMPEG,10815255;140366154196032,NENC:H264/OPENH264,1084;140374797485504,NENC:H264/OPENH264,1084;140365950935040,mpeg4-generic,13981696
native_resources.audio_codecs=2
native_resources.audio_resamplers=1
native_resources.video_transcoders=0
native_resources.video_decoders=1
native_resources.video_encoders=3
native_resources.writers=0
The examples above shows transcoding on server.
Transcoding can be enabled on edge if:
1. Streamer and player codecs do not match by name.
For example, streamer publishes H.264 stream and player tries to play VP8.
2. H.264 codecs are differ by packetization-mode parameter
For example, streamer publishes stream with packetization-mode=1 (default value) and player explicitly sets packetization-mode=0. The situation is quite rare, because almost all players support packetization-mode=1
3. Player resolution is explicitly set.
Example:
Code:
session.createStream({name:"stream1", constraints:{audio:true, video:{width:640,height:480}}}).play();
If the player explicitly sets the resolution desired, transcoding will be enabled even when the player resolution exactly matches the publisher one. This is done because WebRTC browser can change video resolution while publishing stream. To adapt the stream to the resolution that is specified by player, the stream should be transcoded.
4. Player bitrate is explicitly set.
Example
Code:
session.createStream({name:"stream1", constraints:{audio:true, video:{bitrate:300}}}).play();
So if, for example, client tries to play via WebRTC a stream which is transcoded to WSPlayer requirements, Edge will perform transcoding.
 

Homer

Member
Please check statistics page http://wcs:8081/?action=stat both for transcoder and edge server. Pay attention to stream transcoding statistics section
Code:
-----Transcoding info-----
transcoding_video_decoding_resolutions=1920x1080/1
transcoding_video_decoding_average_time=1920x1080/21.0
transcoding_video_decoding_max_time=1920x1080/21
transcoding_video_decoding_average_queue_size=1920x1080/0.0
transcoding_video_decoding_max_queue_size=1920x1080/0
transcoding_video_decoding_load=51840000
transcoding_video_encoding_resolutions=0x0/1;426x240/1;640x360/1;852x480/1
transcoding_video_encoding_average_time=0x0/0.0;426x240/4.0;640x360/7.0;852x480/15.0
transcoding_video_encoding_max_time=0x0/0;426x240/4;640x360/7;852x480/15
transcoding_video_encoding_average_queue_size=0x0/0.0;426x240/0.0;640x360/0.0;852x480/0.0
transcoding_video_encoding_max_queue_size=0x0/0;426x240/0;640x360/0;852x480/0
transcoding_video_encoding_load=18540000
and native resources section
Code:
-----Native Resources-----
native_resources=140374796991488,mpeg4-generic,-687667;140374785781888,NENC:H264/OPENH264,1084;140374797194368,RESAMPLER:44100/48000,2063040;140365850199936,FFDecoderNative:H264/FFMPEG,10815255;140366154196032,NENC:H264/OPENH264,1084;140374797485504,NENC:H264/OPENH264,1084;140365950935040,mpeg4-generic,13981696
native_resources.audio_codecs=2
native_resources.audio_resamplers=1
native_resources.video_transcoders=0
native_resources.video_decoders=1
native_resources.video_encoders=3
native_resources.writers=0
The examples above shows transcoding on server.
Transcoding can be enabled on edge if:
1. Streamer and player codecs do not match by name.
For example, streamer publishes H.264 stream and player tries to play VP8.
2. H.264 codecs are differ by packetization-mode parameter
For example, streamer publishes stream with packetization-mode=1 (default value) and player explicitly sets packetization-mode=0. The situation is quite rare, because almost all players support packetization-mode=1
3. Player resolution is explicitly set.
Example:
Code:
session.createStream({name:"stream1", constraints:{audio:true, video:{width:640,height:480}}}).play();
If the player explicitly sets the resolution desired, transcoding will be enabled even when the player resolution exactly matches the publisher one. This is done because WebRTC browser can change video resolution while publishing stream. To adapt the stream to the resolution that is specified by player, the stream should be transcoded.
4. Player bitrate is explicitly set.
Example
Code:
session.createStream({name:"stream1", constraints:{audio:true, video:{bitrate:300}}}).play();
So if, for example, client tries to play via WebRTC a stream which is transcoded to WSPlayer requirements, Edge will perform transcoding.
I noticed that when im using pc browser to open the stream via wsplayer , the stream was transcoded in the transcoder server .. native resources and transcoding info are almost empty in the stats page..

but when i tried to run in on my iphone via wsplayer ,the video was transcoded in the edge server ..

Here's the details on the edge server
Code:
-----Native Resources-----
native_resources=139789242338112,NENC:MPV/FFMPEG,2374;94353757378048,FFDecoderNative:MPV/FFMPEG,630491;139788772921088,FFDecoderNative:MPV/FFMPEG,1984087;139788772714080,NENC:MPV/FFMPEG,304;139788917879616,FFDecoderNative:MPV/FFMPEG,1316639;139788911402720,FFDecoderNative:MPV/FFMPEG,2953706;139788779648576,NENC:MPV/FFMPEG,1432;139788773954496,FFDecoderNative:MPV/FFMPEG,94517;139788920667840,NENC:MPV/FFMPEG,31;139788782195008,FFDecoderNative:MPV/FFMPEG,4612599;139788914664416,NENC:MPV/FFMPEG,1512;139788914983296,NENC:MPV/FFMPEG,1452
And the transcoding info

Code:
-----Transcoding info-----
transcoding_video_decoding_resolutions=854x480/9
transcoding_video_decoding_average_time=854x480/-0.3333333333333333
transcoding_video_decoding_max_time=854x480/1
transcoding_video_decoding_average_queue_size=854x480/0.0
transcoding_video_decoding_max_queue_size=854x480/0
transcoding_video_decoding_load=97970880
transcoding_video_encoding_resolutions=0x0/9;854x480/5
transcoding_video_encoding_average_time=0x0/0.0;854x480/4.4
transcoding_video_encoding_max_time=0x0/0;854x480/7
transcoding_video_encoding_average_queue_size=0x0/0.0;854x480/0.0
transcoding_video_encoding_max_queue_size=0x0/0;854x480/0
transcoding_video_encoding_load=56568960
are there changes in cdn_profiles based on these info?
 

Max

Administrator
Staff member
Good day.
We cannot reproduce the issue in our test environment with iOS 13.4 (both in Safari and Chrome browsers).
Please collect a report from Transcoder and Edge as described here including client debug logs and send to support@flashphoner.com. Also please provide SSH access to your CDN, we will try to reproduce the issue.
 
Top