How can I reset the path of FFMPEG in the VideoExport library in Processing?

0

Note: This question was originally titled "How can I reset the path of FFMPEG in Java?" but, as it has been pointed out in the comments and the answer, the issue is not with Java, so I've changed the title to make it easier to find for others with the same issue.


I accidentally set the path for FFMPEG to a different folder, and I can't change it back.

I'm using Processing (the library and its IDE) and the user-created Video Export library to capture and write to an mp4 video file. The library required FFMPEG, so I downloaded and installed it. After I installed it, I ran the code, and the library called Java to request the path of FFMPEG. I wrongly set the path to a different folder (which I eventually deleted), and immediately realized my mistake. I ran the code again to see if I could trigger the prompt again to correct the path.


The console response I received was: (I'm sure most of it doesn't have to do with the actual issue. However, I wanted to show all of it in case it somehow does.)

Oct 24, 2016 10:23:25 PM java.util.prefs.WindowsPreferences WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5. java.io.IOException: Cannot run program "C:...\Processing\Octree_Graphics\data\FFMPEG\ff-prompt.bat": CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) at com.hamoid.VideoExport.startFfmpeg(Unknown Source) at com.hamoid.VideoExport.initialize(Unknown Source) at com.hamoid.VideoExport.saveFrame(Unknown Source) at Octree_Graphics.draw(Octree_Graphics.java:90) at processing.core.PApplet.handleDraw(PApplet.java:2399) at processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:731) at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:692) at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:674) at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:443) at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1293) at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147) at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:759) at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:81) at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:452) at com.jogamp.opengl.util.FPSAnimator$MainTask.run(FPSAnimator.java:178) at java.util.TimerThread.mainLoop(Timer.java:555) at java.util.TimerThread.run(Timer.java:505) Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.(ProcessImpl.java:386) at java.lang.ProcessImpl.start(ProcessImpl.java:137) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) ... 17 more VideoExport error: Ffmpeg failed. Study C:...\Processing\Octree_Graphics\basic.mp4.txt for more details.


I need to find a way to reset the path of FFMPEG that Java has. I have tried uninstalling and reinstalling the library, but I haven't tried Java (I don't want to mess with anything it has in its current state).

java
video
ffmpeg
processing
asked on Stack Overflow Oct 25, 2016 by bella • edited Apr 10, 2021 by bella

1 Answer

2

Firstly, from what I can tell, this is merely inside the library in Processing, not inside of Java itself.

I have found you can reset the ffmpeg directory by running the ".forgetFfmpegPath();" method on the VideoExport object. You only need to run it once then you can remove it.

Inside the Video Export docs the method has the description "Makes the library forget about where the ffmpeg binary was located."

You can find the documentation of the method in the VideoExport documentation, which can be found in the Processing IDE at "Help -> Libraries Reference -> Video Export". (Note the VideoExport library must be installed)

I understand this is two years old, but I am here for other people who have this issue. I just had this issue and found this question, but there was no answer, so I am giving the answer I found worked.

answered on Stack Overflow Oct 30, 2018 by Synchronic

User contributions licensed under CC BY-SA 3.0