Closed helferapp closed 12 months ago
Hi, I'm using iOS device in portrait mode, capturing a video from WebCamTexture
cameraInstance.texture = new WebCamTexture(cameraInstance.name, 720, 1280, 30/*FPS*/); cameraInstance.texture.requestedWidth = 720; cameraInstance.texture.requestedHeight = 1280; cameraInstance.texture.requestedFPS = 30; cameraInstance.texture.Play(); if (cameraInstance.texture.isPlaying) { GameObject go = new GameObject(); cameraInstance.capture = go.AddComponent<CaptureFromWebCamTexture>(); Codec h264Codec = CodecManager.FindCodec(CodecType.Video, "H264"); Codec aacCodec = CodecManager.FindCodec(CodecType.Audio, "AAC"); if (h264Codec != null && aacCodec != null) Debug.Log("Codecs found"); // Assign a specific codec for capture cameraInstance.capture.NativeForceVideoCodecIndex = h264Codec.Index; cameraInstance.capture.NativeForceAudioCodecIndex = aacCodec.Index; cameraInstance.capture.IsRealTime = true; cameraInstance.capture.OutputTarget = OutputTarget.VideoFile; cameraInstance.capture.OutputFolder = CaptureBase.OutputPath.RelativeToVideos; cameraInstance.capture.FilenamePrefix = shortVideoFileName; cameraInstance.capture.FrameRate = 30; cameraInstance.capture.StopMode = StopMode.None; cameraInstance.capture.WebCamTexture = cameraInstance.texture; cameraInstance.capture.AudioCaptureSource = AudioCaptureSource.Microphone; cameraInstance.capture.ForceAudioInputDeviceIndex = MicId;//default cameraInstance.capture.CompletedFileWritingAction += OnCompleteFinalFileWriting; /* this will not work on iOS * //video is saved landscape, when I insert these lines, no video is saved VideoEncoderHints hints = cameraInstance.capture.GetEncoderHints().videoHints; // Android only hints.androidNoCaptureRotation = true; */ cameraRenderImage.texture = cameraInstance.texture; ...
after saving the MP4 video is rotated. How to fix this?
Greetings Frank
Linking #234, #235
Try the workarounds in those links
Hi, I'm using iOS device in portrait mode, capturing a video from WebCamTexture
after saving the MP4 video is rotated. How to fix this?
Greetings Frank