0

Processing has a Movie class (http://processing.org/reference/libraries/video/Movie.html) which is capable of playing videos. I have no problem with playing local video files with the following code.

public void setup() 
{
    size(WIDTH, HEIGHT);
    myMovie = new Movie(this,/Users/mike/Documents/abc.mp4");

    myMovie.play();

}

public void draw() 
{
    //(WIDTH-myMovie.width)/2
    image(myMovie, 0, 0);
}


// Called every time a new frame is available to read
public void movieEvent(Movie m) 
{
    m.read();
}

But now i want to play streaming video from the internet, I don't know how to do it. I tried to just change the file name to a url link which ends with .mp4 (such as http://www.abc.com/abc.mp4), but it didn't work.

Anyone knows how to play streaming videos with processing?

4

1 回答 1

0

来自http://processing.org/reference/libraries/video/Movie.html上的处理参考

Datatype for storing and playing movies in Apple's QuickTime format.
Movies must be located in the sketch's data directory or an accessible
place on the network to load without an error.

如果你想播放普通内容类型的电影,如 mp4、ogg 等,你将不得不使用真正的视频库,而不是内置的 Movie 对象。

于 2013-02-06T20:28:24.777 回答