# Strange behavior loading video files from data path

**URL:** <https://discourse.processing.org/t/strange-behavior-loading-video-files-from-data-path/8996>\
**Category:** Libraries\
**Created:** [March 6, 2019, 2:04am UTC](https://discourse.processing.org/t/strange-behavior-loading-video-files-from-data-path/8996 "2019-03-06T02:04:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![grumo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/grumo/32/604_2.png) [@grumo](https://discourse.processing.org/u/grumo)\
**Post date:** [March 6, 2019, 2:04am UTC](https://discourse.processing.org/t/strange-behavior-loading-video-files-from-data-path/8996/1 "2019-03-06T02:04:16Z")

</div>

I’m making a script that mixes different videos on screen. The script works if I load the videos from the “data” path, but if i use subfolders like “data/something” I get an error (despite the files are loading correctly):

```auto
finishLifecycleAction(com.jogamp.opengl.util.FPSAnimator$3): ++++++ timeout reached ++++++ main-FPSAWTAnimator#00-Timer0
finishLifecycleAction(com.jogamp.opengl.util.FPSAnimator$3): OK false- pollPeriod 27, blocking true -> res false, waited 1001/1000 - main-FPSAWTAnimator#00-Timer0
 - com.jogamp.opengl.util.FPSAnimator[started true, animating true, paused false, drawable 1, totals[dt 0, frames 0, fps 0.0], modeBits 1, init'ed true, animThread Thread[main-FPSAWTAnimator#00-Timer0-FPSAWTAnimator#00-Timer1,5,main], exclCtxThread false(null)]
    [2]: com.jogamp.opengl.util.AnimatorBase.finishLifecycleAction(AnimatorBase.java:633)
    [3]: com.jogamp.opengl.util.FPSAnimator.stop(FPSAnimator.java:326)
    [4]: processing.opengl.PSurfaceJOGL.stopThread(PSurfaceJOGL.java:722)
    [5]: processing.core.PApplet.dispose(PApplet.java:3823)
    [6]: processing.core.PApplet.die(PApplet.java:3734)
    [7]: processing.core.PApplet.die(PApplet.java:3744)
    [8]: processing.video.Movie.initGStreamer(Unknown Source)
    [9]: processing.video.Movie.<init>(Unknown Source)
    [10]: sonusmap2.cargavideos(sonusmap2.java:85)
    [11]: sonusmap2.setup(sonusmap2.java:51)
    [12]: processing.core.PApplet.handleDraw(PApplet.java:2425)
    [13]: processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:866)
    [14]: jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:692)
    [15]: jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:674)
    [16]: jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:443)
    [17]: jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1293)
    [18]: jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147)
    [19]: com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:759)
    [20]: com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:81)
    [21]: com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:452)
    [22]: com.jogamp.opengl.util.FPSAnimator$MainTask.run(FPSAnimator.java:178)
    [23]: java.util.TimerThread.mainLoop(Timer.java:555)
    [24]: java.util.TimerThread.run(Timer.java:505)

```

The script to load from folder is a very common one (and is working in both cases):

```auto
String[] files(){

// The data path of the folder to look in (write your own)
java.io.File folder = new java.io.File(dir);
 
// let's set a filter (which returns true if file's extension is .jpg)
java.io.FilenameFilter pngFilter = new java.io.FilenameFilter() {
  public boolean accept(File dir, String name) {
    return name.toLowerCase().endsWith(".mp4");
  }
};
 
// list all the folders inside the main directory
String[] listFolders = folder.list(new java.io.FilenameFilter() {
  public boolean accept(File current, String name) {
    return new File(current, name).isDirectory();
  }
});
 
// list the files in the data folder, passing the filter as parameter
String[] filenames = folder.list(pngFilter);

return(filenames);
}

```

Any ideas? Somehow opengl won’t like files from a location different to “data”. This is nuts.

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [March 6, 2019, 2:35am UTC](https://discourse.processing.org/t/strange-behavior-loading-video-files-from-data-path/8996/2 "2019-03-06T02:35:59Z")

</div>

> [@File Listing Order](https://discourse.processing.org/t/file-listing-order/7148/23):
>
> When I need to code a very simple sketch, w/o any animations or even functions, I use what is so called “static sketch”. The standard 1 is called “interactive sketch”, in which we can have the callbacks setup() & draw(). More info on them here: [Processing.org/tutorials/overview/](http://Processing.org/tutorials/overview/) Here’s the my “static sketch” converted to “dynamic sketch”: grinning static final String PICS\_EXTS = "extensions=,png,jpg,jpeg,gif,tif,tiff,tga,bmp,wbmp"; void setup() { final File dir = dataFile(""); printl…
