how to Add video or image, help me!

edited December 2015 in Library Questions

void setup() { size(displayWidth, displayHeight); theMov = new Movie(this, "video1.mov"); theMov2 = new Movie(this, "video2.mov"); theMov3 = new Movie(this, "video3.mov"); theMov4 = new Movie(this, "vid1o4.mov"); }

i don't know how to add video or image like in code? error: Could not load movie file video1.mov

Answers

  • _vk_vk
    edited December 2015

    The files must be inside data folder inside sketch folder are they?

    should look like

    mySketch/data/fileToLoad.jpg

    from loadImage ref:

    To load correctly, images must be located in the data directory of the current sketch... ... Alternatively, the file maybe be loaded from anywhere on the local computer using an absolute path (something that starts with / on Unix and Linux, or a drive letter on Windows), or the filename parameter can be a URL for a file found on a network.

  • Can you give me a source code, because i give file video in folder data but until error, thanks

  • I use example code loop of lib video, it run ok, but i great orther project and copy all code that, after run and error

  • _vk_vk
    edited December 2015

    The code seems not to be the problem here. I guess. The best code example is the one which comes with the library. Most likely is a path issue, or maybe the codec is not understood by the library. I'm speculating as I don't have used the video library recently.

    Can you load an image from data folder in this new sketch?

    but i great orther project and copy all code that

    have you copied the video to the new sketch as well?

  • I copy my video to folder data and use example code of library video, change name video of library, that's ok, but if i choose new and copy code that, error : "could not load video"

  • _vk_vk
    edited December 2015 Answer ✓

    Not sure if I folow you, but if you choose new (sketch) and copy code, then you need to move or copy the files and the folder also. The data folder is not Global or Library wide, it's one per sketch. You can just drop a file (movie or image or font... ) into the PDE that PDE will create the folder (if it isn't already there) and place the file properly for you.

  • ok, i did it, done, thank you very much!

Sign In or Register to comment.