Request video stream DestWidth, DestHeight ignored

var videoParams = new VideoParams
                {
                    CameraId = cameraId,
                    DestWidth = destinationWidth,
                    DestHeight = destinationHeight,
                    CompressionLvl = 83,
                    FPS = 15,
                    RequestSize = true,
                    MethodType = StreamParamsHelper.MethodType.Push,
                    SignalType = StreamParamsHelper.SignalType.Live,
                    StreamType = StreamParamsHelper.StreamType.FragmentedMP4,
                    KeyFramesOnly = false
                };

When I requesting stream with StreamType = StreamParamsHelper.StreamType.FragmentedMP4 then DestWidth and DestHeight is ignored and I’m getting the full video resolution from camera.

When I requesting stream with StreamType = StreamParamsHelper.StreamType.Transcoded, it works as expected and resolution of stream is set based on DestWidth and DestHeight.

Is this ok or am I doing something wrong for FragmentedMP4?

Also when I call changeStream method to change the video resolution, it works only for transcoded video. It does not do anything for FragmentedMP4.

Hi Michal,

Your observations are correct and described behavior is by design.

In Transcoded mode DestWidth and DestHeight specify the exact dimensions of the result stream. In FragmentedMP4 mode those are used by Mobile Server for choosing the optimal stream resolution among existing ones defined for that camera (if multiple streams are available).

The reason is that in FragmentedMP4 video data is not being pre-processed (transcoded), as described in this article. A major benefit from that is that this is much more CPU-efficient than transcoding the image. One of the drawbacks is that client has no way to obtain a custom-sized stream.

You should keep providing DestWidth and DestHeight - those are used for calculations, just the end result is not what you expected. Luckily, video players don’t require that the size of the stream is the same as the size of the player so I don’t see any inconvenience for you.

Br,

Nikolay