Quantcast
Channel: Questions in topic: "crash"
Viewing all articles
Browse latest Browse all 2383

Game crashes after using Android Plugin

$
0
0
Hello everybody, I wrote a Plugin in Android Studio that uses FFMPEG to process videos for my Unity game. the Plugin processes and generate videos successfully, when the plugin is done, the game keeps running but every interaction or click in the game makes it crash. Unity initiates the plugin as follows: const string pluginName = "com.aalamiapps.videoprocessorplugin.VideoProcessor"; static AndroidJavaClass _pluginClass; static AndroidJavaObject _pluginInstance; public static AndroidJavaClass PluginClass { get { if (_pluginClass == null) { _pluginClass = new AndroidJavaClass(pluginName); } return _pluginClass; } } public static AndroidJavaObject PluginInstance { get { if (_pluginInstance == null) { _pluginInstance = PluginClass.CallStatic("getInstance"); } return _pluginInstance; } } public void ProcessVideo(string videoToProcess, string previewVideo, int outSize, int cropX, int cropY ){ string command = "-y -i " + videoToProcess + " -vf crop=w=" + outSize + ":h=" + outSize + ":x=" + cropX + ":y=" + cropY + ",scale=360:360 -an " + previewVideo; PluginInstance.Call("executeCommand", command);} the Plugin responds using this method: public void sendCommandResult(String result){ UnityPlayer.UnitySendMessage("VideoProcessor", "HandleExecuteCommand",result); } does anyone have an idea why this is happening?

Viewing all articles
Browse latest Browse all 2383

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>