使用 Ruby-Processing 导出 QuickTime 影片 [英] Exporting a QuickTime movie with Ruby-Processing

查看:52
本文介绍了使用 Ruby-Processing 导出 QuickTime 影片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Ruby-Processing 制作一个处理应用程序.如何导出应用的 QuickTime 影片?

I'm using Ruby-Processing to make a Processing app. How do I export a QuickTime movie of my app?

我尝试了以下方法:

load_library 'video'
import 'processing.video.MovieMaker'

def setup
  # stuff...
  @mm = MovieMaker.new(WIDTH, HEIGHT, "drawing.mov", 30, MovieMaker.H263, MovieMaker.HIGH)
end

def draw
  # stuff...
  @mm.add_frame
end

def mouse_pressed
  @mm.finish_movie
end

但这似乎不起作用,我收到此错误:

But this doesn't seem to work, and I get this error:

java.lang.reflect.InvocationTargetException
        at java.awt.EventQueue.invokeAndWait(EventQueue.java:1078)
        at quicktime.QTSession.<clinit>(QTSession.java:94)
        at quicktime.util.QTUtils.<clinit>(QTUtils.java:33)
        at processing.video.MovieMaker.<clinit>(MovieMaker.java:110)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
        at org.jruby.javasupport.JavaSupport.loadJavaClass(JavaSupport.java:147)
        at org.jruby.javasupport.JavaSupport.loadJavaClassVerbose(JavaSupport.java:156)
        at org.jruby.javasupport.JavaClass.forNameVerbose(JavaClass.java:944)
        at org.jruby.javasupport.JavaClass.for_name(JavaClass.java:956)
        at org.jruby.javasupport.Java.get_proxy_class(Java.java:445)
        at org.jruby.javasupport.JavaUtilities.get_proxy_class(JavaUtilities.java:34)
        at org.jruby.javasupport.JavaUtilities$s_method_1_0$RUBYINVOKER$get_proxy_class.call(org/jruby/javasupport/JavaUtilities$s_method_1_0$RUBYINVOKER$get_proxy_class.gen)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:310)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:149)
        at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
        at org.jruby.ast.ConstDeclNode.interpret(ConstDeclNode.java:97)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.ast.RootNode.interpret(RootNode.java:129)
        at org.jruby.evaluator.ASTInterpreter.evalSimple(ASTInterpreter.java:149)
        at org.jruby.RubyObject.evalUnder(RubyObject.java:435)
        at org.jruby.RubyObject.specificEval(RubyObject.java:414)
        at org.jruby.RubyModule.module_eval(RubyModule.java:2112)
        at org.jruby.RubyModule$i_method_multi$RUBYFRAMEDINVOKER$module_eval.call(org/jruby/RubyModule$i_method_multi$RUBYFRAMEDINVOKER$module_eval.gen)
        at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroOrOneOrTwoOrThreeOrNBlock.call(JavaMethod.java:293)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:350)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:229)
        at org.jruby.ast.FCallThreeArgNode.interpret(FCallThreeArgNode.java:40)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.ast.IfNode.interpret(IfNode.java:117)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
        at org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:317)
        at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:268)
        at org.jruby.runtime.Block.yield(Block.java:194)
        at org.jruby.RubyArray.eachCommon(RubyArray.java:1635)
        at org.jruby.RubyArray.each(RubyArray.java:1642)
        at org.jruby.RubyArray$i_method_0_0$RUBYFRAMEDINVOKER$each.call(org/jruby/RubyArray$i_method_0_0$RUBYFRAMEDINVOKER$each.gen)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:300)
        at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:118)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:123)
        at org.jruby.ast.CallNoArgBlockNode.interpret(CallNoArgBlockNode.java:64)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
        at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:192)
        at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:177)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:320)
        at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:158)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:163)
        at org.jruby.ast.FCallSpecialArgBlockPassNode.interpret(FCallSpecialArgBlockPassNode.java:38)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:112)
        at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:135)
        at org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:101)
        at org.jruby.runtime.callsite.SuperCallSite.cacheAndCall(SuperCallSite.java:267)
        at org.jruby.runtime.callsite.SuperCallSite.callBlock(SuperCallSite.java:50)
        at org.jruby.runtime.callsite.SuperCallSite.call(SuperCallSite.java:55)
        at org.jruby.ast.SuperNode.interpret(SuperNode.java:111)
        at org.jruby.ast.ReturnNode.interpret(ReturnNode.java:88)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.ast.IfNode.interpret(IfNode.java:117)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
        at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:173)
        at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:169)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:310)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:149)
        at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
        at org.jruby.evaluator.ASTInterpreter.evalClassDefinitionBody(ASTInterpreter.java:196)
        at org.jruby.ast.ClassNode.interpret(ClassNode.java:141)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.ast.RootNode.interpret(RootNode.java:129)
        at org.jruby.evaluator.ASTInterpreter.evalSimple(ASTInterpreter.java:149)
        at org.jruby.RubyObject.evalUnder(RubyObject.java:435)
        at org.jruby.RubyObject.specificEval(RubyObject.java:414)
        at org.jruby.RubyModule.module_eval(RubyModule.java:2112)
        at org.jruby.RubyModule$i_method_multi$RUBYFRAMEDINVOKER$module_eval.call(org/jruby/RubyModule$i_method_multi$RUBYFRAMEDINVOKER$module_eval.gen)
        at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroOrOneOrTwoOrThreeOrNBlock.call(JavaMethod.java:293)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:350)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:229)
        at org.jruby.ast.CallThreeArgNode.interpret(CallThreeArgNode.java:61)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
        at org.jruby.ast.IfNode.interpret(IfNode.java:119)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
        at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:136)
        at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:153)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:290)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:109)
        at usr.local.lib.ruby.gems.$1_dot_9_dot_1.gems.ruby_minus_processing_minus_1_dot_0_dot_9.lib.ruby_minus_processing.runners.run.__file__(run.rb:7)
        at usr.local.lib.ruby.gems.$1_dot_9_dot_1.gems.ruby_minus_processing_minus_1_dot_0_dot_9.lib.ruby_minus_processing.runners.run.load(run.rb)
        at org.jruby.Ruby.runScript(Ruby.java:628)
        at org.jruby.Ruby.runNormally(Ruby.java:550)
        at org.jruby.Ruby.runFromMain(Ruby.java:396)
        at org.jruby.Main.run(Main.java:272)
        at org.jruby.Main.run(Main.java:117)
        at org.jruby.Main.main(Main.java:97)
Caused by: java.lang.UnsatisfiedLinkError: /System/Library/Java/Extensions/libQTJNative.jnilib:  no suitable image found.  Did find:  /System/Library/Java/Extensions/libQTJNative.jnilib: no matching architecture in universal wrapper
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1827)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1716)
        at java.lang.Runtime.loadLibrary0(Runtime.java:823)
        at java.lang.System.loadLibrary(System.java:1045)
        at quicktime.QTSession$1.run(QTSession.java:96)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:677)
        at java.awt.EventQueue.access$000(EventQueue.java:85)
        at java.awt.EventQueue$1.run(EventQueue.java:638)
        at java.awt.EventQueue$1.run(EventQueue.java:636)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:647)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Exception in thread "Animation Thread" quicktime/QTSession.java:-2:in `Gestalt': java.lang.UnsatisfiedLinkError: quicktime.QTSession.Gestalt(I[I)S (NativeException)
        from quicktime/QTSession.java:935:in `gestalt'
        from quicktime/QTSession.java:641:in `open'
        from quicktime/QTSession.java:608:in `open'
        from processing/video/MovieMaker.java:199:in `<init>'
        from processing/video/MovieMaker.java:162:in `<init>'
        from sun/reflect/NativeConstructorAccessorImpl.java:-2:in `newInstance0'
        from sun/reflect/NativeConstructorAccessorImpl.java:39:in `newInstance'
        from sun/reflect/DelegatingConstructorAccessorImpl.java:27:in `newInstance'
        from java/lang/reflect/Constructor.java:513:in `newInstance'
        from org/jruby/javasupport/JavaConstructor.java:243:in `newInstanceDirect'
        from my-processing-app.rb:245:in `new_proxy'
        from my-processing-app.rb:261:in `setup'
        from :1
        ...internal jruby stack elided...
        from quicktime.QTSession.gestalt(QTSession.java:935)
        from quicktime.QTSession.open(QTSession.java:641)
        from quicktime.QTSession.open(QTSession.java:608)
        from processing.video.MovieMaker.<init>(MovieMaker.java:199)
        from processing.video.MovieMaker.<init>(MovieMaker.java:162)
        from sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        from sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        from sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        from java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        from org.jruby.javasupport.JavaConstructor.newInstanceDirect(JavaConstructor.java:243)

知道出了什么问题吗?

推荐答案

我猜你正在运行 Mac OS.
在这种情况下,您必须强制您的 JVM 处于 32 位模式.2 种可能性:

i guess you are running Mac OS.
In this case, you have to force your JVM in 32 bits mode. 2 possibilities:

  • 进入Utilities >Java Preferences 并拖动列表顶部的 32 位线.这应该可以解决问题.
  • 或获取最新的ruby-processing (gem install ruby​​-processing),并将以下几行放入YAML配置文件$HOME/.rp5rc
  • go in Utilities > Java Preferences and drag the 32 bits line on top of the list. This should fix the problem.
  • OR grab the latest ruby-processing (gem install ruby-processing), and put the following lines in the YAML configuration file $HOME/.rp5rc

java_args: -d32

java_args: -d32

这将强制 JVM 进入 32 位模式.

this will force the JVM in 32 bits mode.

希望对您有所帮助.

这篇关于使用 Ruby-Processing 导出 QuickTime 影片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆