minimum video size

syspro

New Member
Can anyone tell me what is minimum video size is limit?
now i set playwidth and playheight is 100, but event i set less than 100 video size never change.
 

Max

Administrator
Staff member
Good day.
Minimum video width is 160 pixels, minimum video height is 120 pixels, as mentioned here.
 

syspro

New Member
Thanks, for your reply. Another question is i want to shrink the video size as small as possible. how can i shrink the size? The size what i want is 50px . how can i shrink the video size to get size 50px.
 
Last edited:

Max

Administrator
Staff member
Good day.
We tested the video resolution change.
Using transcoding you can resize it to the resolution you need.
In documentation describes an example of using video resolution constraint modifiers and transcoding management with the REST API.
When changing the video resolution, there will be no distortion in the video image, if the aspect ratio in the transcoded video is the same as in the original video (for example, the original video is 300x300, transcoded 50x50 or original 640x480, transcoded 320x240)
If you do not want to save aspect ratio, add settings in the flashphoner.properties :
Code:
video_transcoder_preserve_aspect_ratio=false
 
Last edited:

syspro

New Member
@Max, thank you for your answer. I think I did not describe my intention clearly. I just want to reduce the screen space occupied by the video and the video resolution is my concern. I try not to use transcoding for performance concern. Is there any way to achieve this? For example, some configuration or hacking in the player code which is running in the browser.
 

Max

Administrator
Staff member
Good day.
To resize video to fit parent div element of the page, you can use resizeVideo() function. Please see the Player example on GitHub. The code looks as follows:
Code:
 stream = session.createStream(options).on(STREAM_STATUS.PENDING, function(stream) {
        var video = document.getElementById(stream.id());
        ...
            //don't resize html5 video
            if (video.nodeName.toLowerCase() !== "video") {
                video.addEventListener('resize', function (event) {
                    var streamResolution = stream.videoResolution();
                    console.log("Stream resolution " + streamResolution);
                    if (Object.keys(streamResolution).length === 0) {
                        resizeVideo(event.target);
                    } else {
                        // Change aspect ratio to prevent video stretching
                        var ratio = streamResolution.width / streamResolution.height;
                        var newHeight = Math.floor(options.playWidth / ratio);
                        resizeVideo(event.target, options.playWidth, newHeight);
                    }
                });
            }
        }
...
});
stream.play();
You can pass to resizeVideo() function either div element to scale video to fit to or explicitly specified width and height. This function must be called on STREAM_STATUS.PENDING event.
The video will be resized on local page only, no transcoding is required in this case.
 
Top