khjxiaogu / MiraiSongPlugin

用mirai机器人搜索音乐并以卡片的形式分享
GNU Affero General Public License v3.0
266 stars 29 forks source link

[BUG]插件无法识别FFmpeg #38

Closed Moyulingjiu closed 2 years ago

Moyulingjiu commented 2 years ago
java.lang.RuntimeException: java.io.IOException: Cannot run program "": CreateProcess error=87, 参数错误。
        at com.khjxiaogu.MiraiSongPlugin.Utils.exeCmd(Utils.java:173)
        at com.khjxiaogu.MiraiSongPlugin.MiraiSongPlugin.onEnable(MiraiSongPlugin.java:294)
        at net.mamoe.mirai.console.internal.plugin.JvmPluginInternal.internalOnEnable$mirai_console(JvmPluginInternal.kt:113)
        at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.enable(BuiltInJvmPluginLoaderImpl.kt:122)
        at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt)
        at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt:36)
        at net.mamoe.mirai.console.plugin.PluginManager.enablePlugin(PluginManager.kt:129)
        at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.enableAllLoadedPlugins$mirai_console(PluginManagerImpl.kt:172)
        at net.mamoe.mirai.console.internal.MiraiConsoleImplementationBridge.doStart$mirai_console(MiraiConsoleImplementationBridge.kt:208)
        at net.mamoe.mirai.console.MiraiConsoleImplementation$Companion.start(MiraiConsoleImplementation.kt:276)
        at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon(MiraiConsoleTerminalLoader.kt:152)
        at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon$default(MiraiConsoleTerminalLoader.kt:151)
        at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.main(MiraiConsoleTerminalLoader.kt:47)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.itxtech.mcl.Utility.bootMirai(Utility.java:83)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:138)
        at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:226)
        at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1692)
        at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1013)
        at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
        at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:412)
        at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3578)
        at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:107)
        at org.mozilla.javascript.ArrowFunction.call(ArrowFunction.java:43)
        at org.mozilla.javascript.InterfaceAdapter.invokeImpl(InterfaceAdapter.java:155)
        at org.mozilla.javascript.InterfaceAdapter.lambda$invoke$0(InterfaceAdapter.java:105)
        at org.mozilla.javascript.Context.call(Context.java:554)
        at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:522)
        at org.mozilla.javascript.InterfaceAdapter.invoke(InterfaceAdapter.java:105)
        at org.mozilla.javascript.jdk18.VMBridge_jdk18$1.invoke(VMBridge_jdk18.java:126)
        at jdk.proxy1/jdk.proxy1.$Proxy4.run(Unknown Source)
        at org.itxtech.mcl.script.ScriptManager.phaseBoot(ScriptManager.java:106)
        at org.itxtech.mcl.Loader.lambda$start$3(Loader.java:176)
        at org.itxtech.mcl.Loader.tryCatching(Loader.java:145)
        at org.itxtech.mcl.Loader.start(Loader.java:176)
        at org.itxtech.mcl.Loader.main(Loader.java:68)
Caused by: java.io.IOException: Cannot run program "": CreateProcess error=87, 参数错误。
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
        at com.khjxiaogu.MiraiSongPlugin.Utils.exeCmd(Utils.java:170)
        ... 42 more
Caused by: java.io.IOException: CreateProcess error=87, 参数错误。
        at java.base/java.lang.ProcessImpl.create(Native Method)
        at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:494)
        at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:159)
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
        ... 44 more
2021-12-01 19:58:07 W/点歌插件: ffmpeg启动失败,语音功能失效!

image 已经安装了FFmpeg,但是插件仍然报错。使用的mirai console版本为: image

Moyulingjiu commented 2 years ago

在按照配置配置了FFmpeg path之后。报错变成了如下:

2021-12-01 20:10:08 E/点歌插件: net.mamoe.yamlkt.YamlDecodingException: Top-level decoder: deserializing nested class for '0' in 'kotlin.collections.LinkedHashMap'
...9-git-86a2123a6e-full_build\bin"
                                  ^ at line 1, column 86

net.mamoe.yamlkt.YamlDecodingException: Top-level decoder: deserializing nested class for '0' in 'kotlin.collections.LinkedHashMap'
...9-git-86a2123a6e-full_build\bin"
                                  ^ at line 1, column 86

        at net.mamoe.yamlkt.internal.YamlUtils__ContextualExceptionKt.contextualDecodingException(ContextualException.kt:154)
        at net.mamoe.yamlkt.internal.YamlUtils.contextualDecodingException(Unknown Source)
        at net.mamoe.yamlkt.internal.YamlDecoder$AbstractDecoder.decodeSerializableElement(YamlDecoder.kt:172)
        at kotlinx.serialization.encoding.CompositeDecoder$DefaultImpls.decodeSerializableElement$default(Decoding.kt:535)
        at kotlinx.serialization.internal.MapLikeSerializer.readElement(CollectionSerializers.kt:100)
        at kotlinx.serialization.internal.MapLikeSerializer.readElement(CollectionSerializers.kt:84)
        at kotlinx.serialization.internal.AbstractCollectionSerializer.readElement$default(CollectionSerializers.kt:51)
        at kotlinx.serialization.internal.AbstractCollectionSerializer.merge(CollectionSerializers.kt:36)
        at kotlinx.serialization.internal.AbstractCollectionSerializer.deserialize(CollectionSerializers.kt:43)
        at net.mamoe.yamlkt.internal.YamlElementMapSerializer.deserialize(YamlElementSerializer.kt)
        at net.mamoe.yamlkt.internal.YamlMapSerializer.deserialize(YamlElementSerializer.kt:150)
        at net.mamoe.yamlkt.internal.YamlMapSerializer.deserialize(YamlElementSerializer.kt:142)
        at net.mamoe.yamlkt.Yaml.decodeFromString(Yaml.kt:162)
        at net.mamoe.yamlkt.Yaml.decodeYamlMapFromString(Yaml.kt:182)
        at com.khjxiaogu.MiraiSongPlugin.MiraiSongPlugin.onEnable(MiraiSongPlugin.java:199)
        at net.mamoe.mirai.console.internal.plugin.JvmPluginInternal.internalOnEnable$mirai_console(JvmPluginInternal.kt:113)
        at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.enable(BuiltInJvmPluginLoaderImpl.kt:122)
        at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt)
        at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt:36)
        at net.mamoe.mirai.console.plugin.PluginManager.enablePlugin(PluginManager.kt:129)
        at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.enableAllLoadedPlugins$mirai_console(PluginManagerImpl.kt:172)
        at net.mamoe.mirai.console.internal.MiraiConsoleImplementationBridge.doStart$mirai_console(MiraiConsoleImplementationBridge.kt:208)
        at net.mamoe.mirai.console.MiraiConsoleImplementation$Companion.start(MiraiConsoleImplementation.kt:276)
        at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon(MiraiConsoleTerminalLoader.kt:152)
        at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon$default(MiraiConsoleTerminalLoader.kt:151)
        at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.main(MiraiConsoleTerminalLoader.kt:47)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.itxtech.mcl.Utility.bootMirai(Utility.java:83)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:138)
        at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:226)
        at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1692)
        at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1013)
        at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
        at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:412)
        at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3578)
        at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:107)
        at org.mozilla.javascript.ArrowFunction.call(ArrowFunction.java:43)
        at org.mozilla.javascript.InterfaceAdapter.invokeImpl(InterfaceAdapter.java:155)
        at org.mozilla.javascript.InterfaceAdapter.lambda$invoke$0(InterfaceAdapter.java:105)
        at org.mozilla.javascript.Context.call(Context.java:554)
        at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:522)
        at org.mozilla.javascript.InterfaceAdapter.invoke(InterfaceAdapter.java:105)
        at org.mozilla.javascript.jdk18.VMBridge_jdk18$1.invoke(VMBridge_jdk18.java:126)
        at jdk.proxy1/jdk.proxy1.$Proxy4.run(Unknown Source)
        at org.itxtech.mcl.script.ScriptManager.phaseBoot(ScriptManager.java:106)
        at org.itxtech.mcl.Loader.lambda$start$3(Loader.java:176)
        at org.itxtech.mcl.Loader.tryCatching(Loader.java:145)
        at org.itxtech.mcl.Loader.start(Loader.java:176)
        at org.itxtech.mcl.Loader.main(Loader.java:68)
Caused by: net.mamoe.yamlkt.YamlDecodingException: Illegal escape '_' when reading double quoted String
ffmpeg_path: "E:\_environment\FFmpeg\ffmpeg-2021-1...
                 ^ at line 1, column 19

        at net.mamoe.yamlkt.internal.YamlUtils__ContextualExceptionKt.contextualDecodingException(ContextualException.kt:154)
        at net.mamoe.yamlkt.internal.YamlUtils.contextualDecodingException(Unknown Source)
        at net.mamoe.yamlkt.internal.YamlUtils__ContextualExceptionKt.contextualDecodingException$default(ContextualException.kt:128)
        at net.mamoe.yamlkt.internal.YamlUtils.contextualDecodingException$default(Unknown Source)
        at net.mamoe.yamlkt.internal.YamlUtils__EscapeKt.readDoubleQuotedString(Escape.kt:319)
        at net.mamoe.yamlkt.internal.YamlUtils.readDoubleQuotedString(Unknown Source)
        at net.mamoe.yamlkt.internal.TokenStream.prepareStringAndNextToken(TokenStream.kt:304)
        at net.mamoe.yamlkt.internal.TokenStream.nextToken(TokenStream.kt:282)
        at net.mamoe.yamlkt.internal.YamlDecoder$AbstractDecoder.nextToken(YamlDecoder.kt:89)
        at net.mamoe.yamlkt.internal.YamlDecoder.beginStructureImpl$nextToken(YamlDecoder.kt:739)
        at net.mamoe.yamlkt.internal.YamlDecoder.beginStructureImpl$yamlkt(YamlDecoder.kt:810)
        at net.mamoe.yamlkt.internal.YamlDecoder$AbstractDecoder.beginStructure(YamlDecoder.kt:143)
        at net.mamoe.yamlkt.internal.YamlElementSerializer.deserialize(YamlElementSerializer.kt:193)
        at net.mamoe.yamlkt.internal.YamlElementSerializer.deserialize(YamlElementSerializer.kt:30)
        at net.mamoe.yamlkt.internal.YamlDecoder$AbstractDecoder.decodeSerializableElement(YamlDecoder.kt:170)
        ... 53 more
khjxiaogu commented 2 years ago

请贴出你的配置文件。

Moyulingjiu commented 2 years ago

请贴出你的配置文件。

问题已解决,原因是不能自动识别exe必须补全exe的路径,我只是写到了bin目录。配置环境变量是没有用的。