How to capture image with the help of Android/IOS devices with correct width and height in unity?

I am trying to capture an image.I am applying the texture to a Rawimage which contains an aspectRatio fitter.Its Aspect Mode is Envelope Parent and aspect ratio 1.333.Used a button to capture the current view to a application persistent path.

The problem I faced is that the live camera view from my ipad looks like a zoomed version(more width).After I capture the image,the image looks like a normal portrait version that is the saved image contains more height.What is seen in the ipad and the final captured image looks different.How to get exact as what is seen in the ipad?

Attaching the two images.1)Screenshot of Ipad camera view and 2)Final captured image.

private WebCamTexture backcamtexture;

public RawImage background;
public AspectRatioFitter fit;

// Start is called before the first frame update
void Start()
{

    WebCamDevice[] devices = WebCamTexture.devices;

    if(devices.Length ==0 )
    {
        Debug.Log("No cam Available");
        camAvailable = false;
        return;
    }

    for (int i = 0; i < devices.Length; i++)
    {
        if(!devices[i].isFrontFacing)
        {
            backcamtexture = new WebCamTexture(devices[i].name, Screen.width, Screen.height);
        }
    }

    if(backcamtexture==null)
    {
        Debug.Log("No back cam");
        return;
    }
    backcamtexture.Play();
    background.texture = backcamtexture;

    camAvailable = true;
}


// Update is called once per frame
void Update()
{
    if (!camAvailable)
        return;
    float ratio = (float)backcamtexture.width / (float)backcamtexture.height;
    fit.aspectRatio = ratio;

    float scaleY = backcamtexture.videoVerticallyMirrored ? -1f:1f;
    background.rectTransform.localScale = new Vector3(1f, scaleY, 1f);

    int orient = -backcamtexture.videoRotationAngle;
    background.rectTransform.eulerAngles = new Vector3(0, 0, orient);


}

public void TakeSnap()
{
    Texture2D photo = new Texture2D(backcamtexture.width, backcamtexture.height);
    photo.SetPixels(backcamtexture.GetPixels());

    photo=rotate(photo);
    photo.Apply();


    //Encode to a PNG
    byte[] bytes = photo.EncodeToPNG();
    //Write out the PNG. Of course you have to substitute your_path for something sensible
    //File.WriteAllBytes(Application.persistentDataPath + "photo.png", bytes);

    string path = Application.persistentDataPath + "/" + "photo.png";
    File.WriteAllBytes(path, bytes);
}

Did you found any solution ?