Unity-Technologies / arfoundation-samples

Example content for Unity projects based on AR Foundation
Other
2.98k stars 1.11k forks source link

Camera Resolution 640x480 #1051

Closed KamranUnity123 closed 1 year ago

KamranUnity123 commented 1 year ago

How to change camera resolution? I am working in AR Camera recording on android. everything working fine but resolution always 640*480.

KamranUnity123 commented 1 year ago

How to resolve this issue

tdmowrer commented 1 year ago

There's a sample that shows how to do this. See https://github.com/Unity-Technologies/arfoundation-samples#camera

KamranUnity123 commented 1 year ago

Thank you

On Thu, Jan 26, 2023 at 7:33 PM Tim Mowrer @.***> wrote:

There's a sample that shows how to do this. See https://github.com/Unity-Technologies/arfoundation-samples#camera

— Reply to this email directly, view it on GitHub https://github.com/Unity-Technologies/arfoundation-samples/issues/1051#issuecomment-1405091813, or unsubscribe https://github.com/notifications/unsubscribe-auth/AX36562VKRM2ZRYRMG3ZBPDWUKDK3ANCNFSM6AAAAAAUE6UYU4 . You are receiving this because you authored the thread.Message ID: @.*** com>

--

Muhammad KamranUnity Game Developer

@.** | (m) +92 3095586608 | (S) muhammad .kamran.BiM bigimmersive.com http://www.bigimmersive.com/ |163 CCA | DHA Phase-6 | Lahore, Pakistan*

Connect with me on LinkedIn https://www.linkedin.com/in/muhammad-kamran-bb5539198/ | Follow Big Immersive https://www.linkedin.com/company/big-immersive/ The information in or attached to this email is confidential and may be legally privileged. If you are not the intended recipient of this message any use, disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. All the information sent and received by the originator and recipient is official correspondence and legally sustainable. If you have received this message in error, please notify the sender immediately by return email and delete this message and any copies from your computer and network. Big immersive does not warrant that this email and any attachments are free from viruses and accepts no liability for any loss resulting from infected email transmissions.

KamranUnity123 commented 1 year ago

@tdmowrer how to change resolution ? width and height not change in android

tdmowrer commented 1 year ago

What does the sample do for you? Does it list resolutions other than 640x480?

KamranUnity123 commented 1 year ago

No Always Resolution is 640x480 Not other than resolution in list

tdmowrer commented 1 year ago

Different phones have different capabilities; maybe the one you are using only supports a single resolution. What is it?

It's probably worth logging a bug at this point since the initial question was a how-to, and now you know how to, but it isn't working as expected.

KamranUnity123 commented 1 year ago

Basically, I am recording video through AR camera. Everything working fine, but Resolution always 640*480 in every android device. I am testing below mention android devices
Samsung s10 Oppo f21 pro 5g Samsung s9 Xomi s10 pro

tdmowrer commented 1 year ago

I suggest logging a bug then.

KamranUnity123 commented 1 year ago

StartRecording

public void StartRecording() { if (m_Session.subsystem is ARCoreSessionSubsystem subsystem) { //m_Mp4Path = Path.Combine(Application.persistentDataPath, "arcore-session"+aRRecorderPlayBackHolder.videosList.Count+".mp4"); var session = subsystem.session; if (session == null) return;

            var playbackStatus = subsystem.playbackStatus;
            var recordingStatus = subsystem.recordingStatus;

            if (!playbackStatus.Playing() &&
                !recordingStatus.Recording())
            {
                if (playbackStatus != ArPlaybackStatus.Finished)
                {
                    using (var config = new ArRecordingConfig(session))
                    {
                        config.SetMp4DatasetFilePath(session, m_Mp4Path);
                        config.SetRecordingRotation(session, GetRotation());
                        var status = subsystem.StartRecording(config);
                        Log($"StartRecording to {config.GetMp4DatasetFilePath(session)} => {status}");
                        //customCofigNativeArray.CustomNativeConfig();
                    }
                }
            }
        }
    }

StopRecording

public void StopRecording() { if (m_Session.subsystem is ARCoreSessionSubsystem subsystem) { var session = subsystem.session; if (session == null) return;

            var playbackStatus = subsystem.playbackStatus;
            var recordingStatus = subsystem.recordingStatus;
            if (recordingStatus.Recording())
            {
                var status = subsystem.StopRecording();
                Debug.Log($"StopRecording() => {status}");

                if (status == ArStatus.Success)
                {
                   Debug.Log(File.Exists(m_Mp4Path)
                        ? $"ARCore session saved to {m_Mp4Path} ({GetFileSize(m_Mp4Path)})"
                        : "Recording completed, but no file was produced.");
                }
            }
        }
    }
KamranUnity123 commented 1 year ago

I am use this code to Record AR Camera Start Recording and Stop Recording working fine but resolution always 640*480 in all android devices how to set this resolution according to device Thank You

KamranUnity123 commented 1 year ago

Saved Video Resolution is 640*480

KamranUnity123 commented 1 year ago

@tdmowrer answer please?

tdmowrer commented 1 year ago

Have you logged a bug? I don't work at Unity and just try to be helpful where I can. This sounds like unexpected behavior that requires a repro case and investigation by Unity.

KamranUnity123 commented 1 year ago

Thank You

andyb-unity commented 1 year ago

Closing this issue due to inactivity. Feel free to re-open it if you still have questions. If you do so, please include your bug number.