Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoSuchFieldError: frame error - On alpha processing versions #68

Open
danieltorrer opened this issue Jun 17, 2021 · 8 comments
Open

NoSuchFieldError: frame error - On alpha processing versions #68

danieltorrer opened this issue Jun 17, 2021 · 8 comments

Comments

@danieltorrer
Copy link

Newer processing releases have dropped the use of PApplet's frame. Trying to export a video using any of the examples now shows this message NoSuchFieldError: frame

The change was introduced in this version: https://github.com/processing/processing4/releases/tag/processing-1271-4.0a2 so any version before that should be fine. The release notes mention remove the java.awt.Frame object from PApplet but I cant find the commit yet (i'll update here when I found it)

Seems that .frame is used once here: https://github.com/hamoid/video_export_processing/blob/master/src/com/hamoid/VideoExport.java#L486 could it be that removing that reference makes the library work again in newer versions?

More info about the removal of frame:
processing/processing4#54

Processing 3.x works fine

@hamoid
Copy link
Owner

hamoid commented Jun 17, 2021

Thank you for the detailed report. .frame is used to open a dialog.

I worked on an update but it's not finished and didn't take the source with me. Will only get access to it in 2 weeks.

I wonder if someone would like to adopt this project or at least help with the code. I should ask in the forum.
For the last years I've been maintaining it for others as I now use OPENRNDR which comes with easy creation of video files.

@danieltorrer
Copy link
Author

danieltorrer commented Jun 17, 2021

Thanks, I realized that the dialog is shown when FFMEPG is not set, so I set it using v3.X and then I opened processing in version v4. This time I got another error, but I guess that's progress haha

I could help into looking at the recent breaking changes so the library works again in v4.0.0. I'll post my findings

I'm actually currently using your processing->p5 w/ intelli j -> p5 w kotlin -> openrndr migration guide because of openrndr's "native" capabilities for exporting videos.

@hamoid
Copy link
Owner

hamoid commented Sep 8, 2021

The following code works:

import javax.swing.JOptionPane;
String r=JOptionPane.showInputDialog(null, "What?", "Hmm..", JOptionPane.QUESTION_MESSAGE);
text(r, 9, 9);

Therefore I think I could replace

JOptionPane.showMessageDialog(parent.frame,

with

JOptionPane.showMessageDialog(null,

I will try that.

@rsepierre
Copy link

JOptionPane.showMessageDialog(null,

Did that fix work on your testings ?

I know you're busy trying to rewrite the whole library in Kotlin (and probably other things ^^ ).
I wanted to implement the fix and/or try to see if I could find a solution if that wasn't enough. But I actually have no clue how to compile the library from the source.
I'm kind of stuck because i'm using a library that would not work in processing 3 and that one who would not work in processing 4 haha.
I think I might just stick to exporting png and make a local script to turn them into video.

@hamoid
Copy link
Owner

hamoid commented Nov 19, 2021

Hii :) I'm very sorry about taking forever... I work on it like twice a year XD

I just pushed this new branch:

https://github.com/hamoid/video_export_processing/tree/kotlinGradle

with some instructions. I quickly tested it in Processing 3 and 4 and it worked. I hope it can help someone!

Cheers! :)

@rsepierre
Copy link

rsepierre commented Nov 19, 2021

For anyone trying to make the Video Export library work today on processing4 and avoid the NoSuchFieldError: frame and don't know how to compile a library from the source here's a hacky way to make it work:
I'll use paths that are correct for me, I will let you change them according to your computer/platform.

  1. Install the VideoExport library as you would usually

  2. Look inside the C:\Users\hi\Documents\Processing\libraries\VideoExport\library folder and copy jna-platform.jar and jna.jar.
    -> Paste them into G:\sandbox\mySketchFolder\code\

  3. Look inside C:\Users\hi\Documents\Processing\libraries\VideoExport\src\com\ folder and copy the VideoExport.java file
    -> Paste it into G:\sandbox\mySketchFolder\

  4. In that VideoExport.java file replace JOptionPane.showMessageDialog(parent.frame, with JOptionPane.showMessageDialog(null, ( the fix mentionned above by @hamoid )

  5. Remove import com.hamoid.*; from your sketch (will automatically be imported as it is inside the sketch folder

@rsepierre
Copy link

Hii :) I'm very sorry about taking forever... I work on it like twice a year XD

I just pushed this new branch:

https://github.com/hamoid/video_export_processing/tree/kotlinGradle

with some instructions. I quickly tested it in Processing 3 and 4 and it worked. I hope it can help someone!

Cheers! :)

aha, you replied 10 second before I share my hack. Thank you for this.
I'll leave it up as it might still be valuable to some !

@hamoid
Copy link
Owner

hamoid commented Nov 19, 2021

:-)

I just added a jar to test, in case someone for some strange reason doesn't want to build it themselves XD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants