createStream with and height

cheinan

Member
Hello
In session.createStream, When we set the video width and height properties to: 640 x 480
Many streams stay with wide screen resolution like 1280 x 720.
Is it possible to set the video to one fix size to all the streams?
And if so, what is the way to do that?

Thanks
Cheinan
 

Max

Administrator
Staff member
It depends on browser and camera.
If you set video resolution 640x480 and browser can't take this resolution from camera, it can either raise error or adapt ratio to supported format.
Try to use 16:9 ratio everywhere. All modern cams and browsers should support such ratio (i.e. 1280x720 or 640x 360).
 

cheinan

Member
What about: resample_video
In the flashphoner.properties config file.
What is the default value, true or false?
Is it recommended to use? and if so:
Is it always will set the outgoing stream to ratio of 16:9 even if the browser adapt ratio is 4:3
Does it have a fix size of: 400x225 or i can set the size, except true or false?

Thanks
Cheinan
 

Max

Administrator
Staff member
Rescaling is not recommended because to rescale you need perform full video transcoding.
1) Decode H.264.
2) Rescale.
3) Encode H.264.
To resample and transcode video, you can just pass width and height in the player
Code:
session.createStream({name:'stream1',constraints:{audio:true,video:{width:640,height:480}}}).play();
The rescalingshould preserve ratio.
So if your publishing stream is 1280x720 and you request 640x480, it will be rescaled to 640x360 to preserve ratio.
Therefore ratio will be preserved anyway, regardless rescaling.
 
Top