I'm building a video display in Unity 3D using the Easy Movie Texture asset and everytime I try to play my mp4 file on the video manager object my video skips and jitters (specifically in my iOS build, haven't deployed to Android yet). Has anybody else had this experience with the Easy Movie Texture with iOS? And if so, what were your solutions to solve it? Mind you I've tried OGV files and MOV files and they don't play well either.
Related
I am doing 3 things,video record,take photo, play the video.
However, 3 option works on unity but when I build the app for hololens and test it, just video recording is working. I can't take photos and play the video. Basically, I am using these scripts https://learn.microsoft.com/en-us/windows/mixed-reality/develop/unity/locatable-camera-in-unity . The crazy part is Hololens uses flash while taking photos but I can't see my photos in the folder. Also, I can't see the holograms in recorded video.
The issue was Unity Version I was using 2020.3.12f1. I updated to 2020.3.33f1 now video playing is working.
I'm building an audio visualizer app in Unity and I'm currently using WASAPI to get the audio from any app playing audio.
I recently had someone with a GoXLR test it and the visualizer wasn't picking up the audio. I think all the audio is going directly to the GoXLR bypassing WASAPI. I can't debug it myself as I don't have a GoXLR so I wanted to know how I could pick up the audio from the GoXLR.
I'm trying to integrate Agora voice SDK in a multiplayer project (built using Photon). The level has loads of 3D spacial audio setup and a background music that is properly audible. The moment I join a voice channel, all the in-game audio levels drop drastically. The voice chat volume itself sounds fine however. And this happens only on actual device(iOS), not on Unity editor.
I tried reproducing this issue in the HelloUnity3D sample scene that comes with the SDK. No code change. Simply added an audio source in the scene with a music clip. Seems to be happening there as well.
Is this expected? How do I keep Agora from modifying other audio sources?
Unity version:2020.3.28f1. Agora SDK version: 3.5.0.70
For anyone running into this issue, I was able to fix it by setting the audio profile to AUDIO_SCENARIO_GAME_STREAMING.
mRtcEngine.SetAudioProfile(AUDIO_PROFILE_TYPE.AUDIO_PROFILE_SPEECH_STANDARD, AUDIO_SCENARIO_TYPE.AUDIO_SCENARIO_GAME_STREAMING);
The idea is to simply treat the voice chat audio as media volume instead of 'call' volume.
This answer about audio ducking with the Agora SDK is likely what you're after. You might have to add some iOS specific code to your project to achieve it:
https://stackoverflow.com/a/62840934/2156765
Our application has a scene that does video calling built on agora.io and another scene which plays videos using the Unity VideoPlayer. The problem is that when opening the video player scene after leaving an agora.io call the video playback does not have any audio. This only seems to be a problem on iOS. Android playback is fine.
In xcode when trying play the video we see a lot of the below error repeating while the video plays:
AudioSampleProvider buffer overflow. 4096 sample frames discarded.
Is it possible that you can provide a stripped-down sample project that reproduces this issue?
Otherwise, my recommendation is try a few things:
Do not destroy the Agora engine or disable audio when leaving the Agora scene.
Check if the volume of playback is set to zero (with/without #1 above)
Call the following private API before joining the agora channel:
// Stops the Agora SDK from ending the audio session
mRtcEngine.SetParameters("{\"che.audio.keep.audiosession\": true}");
I'm currently developing using Unity 3D, however my background is Apple development. In iOS/OSX development I can use AVFoundation to load an mp4 and get frame by frame data from it as it plays in BGRA format.
I was wondering what the equivalent of this is for .NET (Unity uses .NET 2.0)?
I know it's possible to call functions in an Objective-C++ file from unity but I need a way to do this on any platform not just iOS.
AFAIK there is no builtin way to access the video frame data on mobile in Unity. Playing videos in Unity on mobile devices is just sad. All they offer out of the box is this that basically only works for full screen videos, like cut scenes.
If you want to do more complex things, like pipe a videos to a texture, you have two options:
Mobile Movie Texture
Easy Movie Texture
Note: there are more available on the asset store, but these are the two we use.
The best option?..
Easy Movie Texture
We use Easy Movie Texture for our VR apps (Gear VR & Cardboard). There we decode up to 4k videos on an S6.
For stereo videos we use a component that comes with the plugin, VideoCopyTexture, that copies the texture data from the video into a material (to avoid duplicate decoding & rendering). It references MediaPlayerCtrl.GetVideoTexture() that returns a Unity Texture2D, so from there you should have access to all the data you need!
The not so great option, but we kind of use it so I thought I would mention it anyway...
Mobile Movie Texture
Mobile Movie Texture only works with ogg encoded videos. I don't think it gives you access to the raw frame data, I would invite you to contact the dev directly or check the docs.
But that can be "hacked". You can use a render texture, a separate camera that looks at a plane/quad with the video playing on it. Then grab that texture's bitmap data. It's not ideal, but should do the trick.
Long story short, I use a similar render to texture mechanism to pipe the video data to Scaleform, in Unity, and didn't see any performance loss. Mobile Movie Texture is not the fastest to start with and in our case even decodes in software on some devices. But it works everywhere. So we only use it for small videos.
Cheers,
J.