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.