video_export_processing
video_export_processing copied to clipboard
NoSuchFieldError: frame error - On alpha processing versions
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: https://github.com/processing/processing4/issues/54
Processing 3.x works fine
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.
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.
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.
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.
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! :)
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.
-
Install the VideoExport library as you would usually
-
Look inside the
C:\Users\hi\Documents\Processing\libraries\VideoExport\libraryfolder and copyjna-platform.jarandjna.jar. -> Paste them intoG:\sandbox\mySketchFolder\code\ -
Look inside
C:\Users\hi\Documents\Processing\libraries\VideoExport\src\com\folder and copy theVideoExport.javafile -> Paste it intoG:\sandbox\mySketchFolder\ -
In that
VideoExport.javafile replaceJOptionPane.showMessageDialog(parent.frame,withJOptionPane.showMessageDialog(null,( the fix mentionned above by @hamoid ) -
Remove
import com.hamoid.*;from your sketch (will automatically be imported as it is inside the sketch folder
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 !
:-)
I just added a jar to test, in case someone for some strange reason doesn't want to build it themselves XD