Adobe Air Native Process 仅适用于 Flash 环境,但部署后出现错误 #3219

发布于 2024-11-27 06:29:55 字数 401 浏览 0 评论 0原文

我一直在尝试将 ffmpeg 与我在 flash cs5.5 中制作的 Air 应用程序一起使用。我有它,因此 ffmpeg.exe 需要位于air应用程序的安装目录(File.applicationDirectory.nativePath)中。

由于某种原因,这只在我通过闪存开发环境运行程序时才有效。但当我实际部署应用程序时,出现错误#3219:无法启动 NativeProcess。 ffmpeg.exe 位于同一文件夹中。

我实际上不知道它给出的完整消息......不确定当我捕获它时会给我该消息的错误的属性是什么。我所知道的是错误 3219。

这会是配置文件问题吗?如果我没有扩展桌面桌面配置文件,我认为我不会收到此错误,我会收到配置文件错误,不是吗?

我也禁用了用户访问控制...我使用的是 Windows 7。

I've been trying to use ffmpeg with an air app that I made in flash cs5.5. I have it so that ffmpeg.exe needs to be located in the directory where the air app is installed (File.applicationDirectory.nativePath).

For some reason this only works when I run the program through the flash dev environment. But when I actually deploy the app, I get error #3219:The NativeProcess could not be started. ffmpeg.exe is located in the same folder.

I actually don't know the full message that it gives...not sure what the property of the error that will give me that message when I catch it. All I know is that it's error 3219.

Would this be a profile issue? If i didn't have the extended desktop desktop profile, I don't think I would be able to get this error, I'd get a profiling error wouldn't I?

I've disabled user access control as well...I'm using windows 7.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

初与友歌 2024-12-04 06:29:55

所以我是OP,我刚刚意识到,如果您不通过exe 安装程序(这是发布设置中的一个选项)安装air 应用程序,则无法使用本机进程调用。我一直在使用空气安装程序。

So I'm the OP, and I just realized that you can't use native process calls if you do not install the air application through the exe installer, which is an option in publish settings. I've been using the air installer.

薄情伤 2024-12-04 06:29:55

需要提到的一件事是(我相信您已经知道)NativeProcess 仅适用于编译它的操作系统,因此如果您在 Windows 机器上编译,您的 NativeProcess 将仅适用于 Windows 而不是 unix/mac。

我不知道你如何调用本机进程,但这是我从我的一个工作类中提取的代码片段,也许将它与你的方法进行比较,它会给你一些发现问题的提示:)

        import flash.desktop.*;
        import flash.errors.*;
        import flash.events.*;
        import flash.filesystem.*;

        public function execute():void
    {
                    var executablePath:String = "C:\ffmpeg.exe";
                    var parametersString:String = "-i input.avi -b 64k output.avi";

        if(NativeProcess.isSupported) {

            var args:Vector.<String> = new Vector.<String>();
                var file:File = new File(String(executablePath));
            var parameters:Array;
            parameters = parametersString.split(" ");
            for each ( var parameter:String in parameters ) {
                    args.push(parameter);
            }
        }

        var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
        nativeProcessStartupInfo.executable = file;
        nativeProcessStartupInfo.arguments = args;

        startExecution(nativeProcessStartupInfo);
    }

    private function startExecution(nativeProcessStartupInfo:NativeProcessStartupInfo):void
    {
        var nativeProcess:NativeProcess = new NativeProcess();
                nativeProcess.addEventListener(NativeProcessExitEvent.EXIT, onExitError);
            var msg:String = "";

                try {
                    nativeProcess.start(nativeProcessStartupInfo);
                    trace("Trying to start process");
                } catch (error:IllegalOperationError) {
                    trace("Illegal Operation: "+error.toString());
                } catch (error:ArgumentError) {
                    trace("Argument Error: "+error.toString());
                } catch (error:Error) {
                    trace("Error: "+error.toString());
                }

                if (nativeProcess.running) {
                    trace("Native Process Support");
                }
    }

    public function onExitError(event:NativeProcessExitEvent):void
    {
        trace("Native Process Exit code: "+event.exitCode);
    }

one thing to mention is that (I'm sure you already know) the NativeProcess works only on that OS where it was compiled, so if you compile on a windows box your NativeProcess will only work on windows and not on unix/mac.

I don't know how you call the native process, but here is a code snippet that I extracted of one of my working Classes, maybe comparing it with your aproach it will give you some hint to find the problem :)

        import flash.desktop.*;
        import flash.errors.*;
        import flash.events.*;
        import flash.filesystem.*;

        public function execute():void
    {
                    var executablePath:String = "C:\ffmpeg.exe";
                    var parametersString:String = "-i input.avi -b 64k output.avi";

        if(NativeProcess.isSupported) {

            var args:Vector.<String> = new Vector.<String>();
                var file:File = new File(String(executablePath));
            var parameters:Array;
            parameters = parametersString.split(" ");
            for each ( var parameter:String in parameters ) {
                    args.push(parameter);
            }
        }

        var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
        nativeProcessStartupInfo.executable = file;
        nativeProcessStartupInfo.arguments = args;

        startExecution(nativeProcessStartupInfo);
    }

    private function startExecution(nativeProcessStartupInfo:NativeProcessStartupInfo):void
    {
        var nativeProcess:NativeProcess = new NativeProcess();
                nativeProcess.addEventListener(NativeProcessExitEvent.EXIT, onExitError);
            var msg:String = "";

                try {
                    nativeProcess.start(nativeProcessStartupInfo);
                    trace("Trying to start process");
                } catch (error:IllegalOperationError) {
                    trace("Illegal Operation: "+error.toString());
                } catch (error:ArgumentError) {
                    trace("Argument Error: "+error.toString());
                } catch (error:Error) {
                    trace("Error: "+error.toString());
                }

                if (nativeProcess.running) {
                    trace("Native Process Support");
                }
    }

    public function onExitError(event:NativeProcessExitEvent):void
    {
        trace("Native Process Exit code: "+event.exitCode);
    }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文