prof. jin wan park chung-ang univ. gsaim, future media art lab #9

Post on 05-Jan-2016

213 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Prof. Jin Wan ParkChung-Ang Univ. GSAIM, Future Media Art Lab

#9

숙제 뭐 잘 해오셨을 것이라 생각함

Video processing.org>Reference>Libraries>VideoBuilt in Library – 별도의 Lib 필요 없음그러나…Quicktime 필요함 VDIG 필요함

Video VDIG? QuickTime is of course the well-known framework for handling time-based

media such as video and audio. It is the secret weapon behind the media capabilities of several of Apple's products on Mac OS X. It is also the best choice for developers wanting a top-quality media handling library on Windows. However, the Windows version of QuickTime has at least one notable hole, and that is that there is no Video Digitizer component (VDIG) in QuickTime for Windows. The video digitizer is there, but there are no components implementing the bridge between hardware such as DV cameras and webcams and QuickTime. In most cases, this is down to the developers of the hardware, since most write their drivers with capability only targeting DirectShow, Microsoft's rather buggy media handling library. A few top-quality products do come with a commercial VDIG for Windows, made by AbstractPlane.

www.vdig.com (x)

fma.cau.ac.kr>board> 문지문화원 >winvdig.zip

Video 주요 함수들을 살펴볼 것일반적으로 알만한 것들…

그럼 직접 무비를 하나 올려보자

Video – 기본 플레이 import processing.video.*; // 라이브러리를 불러오거라 ! Movie myMovie; // 무비라는 타입의 변수를 선언한다 Declare // 당연하지만 myMovie 라는 이름은 니맘대로 바꿔도 무방

void setup() { size(400,400,P3D); myMovie = new Movie(this, "c:/temp/Very_Nervous_System.mov"); // Create & Assign 이제부터 myMovie 라는 놈은 위의 무비이다 . myMovie.play(); // 플레이를 시작하거라 , 없으면 ? }

void draw() { image(myMovie, mouseX, mouseY); // 마치 이미지처럼 쓰인다 . myMovie.read(); // 다음 프레임 걸리는 것을 읽어라 }

Video - 응용 import processing.video.*; Movie myMovie; // 앞의 Movie 는 변수의 타입 (int Pimage..) 뒤의 myMovie 는 내맘대로이름

void setup() { size(200, 200,P3D); myMovie = new Movie(this, "c:/temp/Very_Nervous_System.mov"); // Create myMovie.loop(); // Play + 끝나도 계속 돌려라 }

void draw() { tint(255, 20); image(myMovie, mouseX, mouseY); }

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

// Called every time a new frame is available to read

void movieEvent(Movie m) { m.read();}

Video - speed import processing.video.*;Movie myMovie; void setup() { size(320,240,P3D); myMovie = new Movie(this,

"c:/temp/Very_Nervous_System.mov"); myMovie.play();}void draw() { image(myMovie, 0, 0); myMovie.read(); myMovie.speed(mouseX/100.0);}

Video – duration, jump import processing.video.*; Movie myMovie; float movie_length;

void setup() { size(400,300,P3D); myMovie = new Movie(this, "c:/temp/Very_Nervous_System.mov"); myMovie.loop(); movie_length = myMovie.duration(); // 전체 동영상의 길이를 sec 으로 myMovie.jump(movie_length/2.0); // 동영상의 중간부분으로 점프 ! } void draw() { image(myMovie, 0, 0, 400, 300); myMovie.read(); myMovie.speed((mouseX/50.0)-4.0); // 오른쪽은 앞으로 , 왼쪽은 뒤로 }

Video – 응용 , 랜덤 점프 import processing.video.*; Movie myMovie;

void setup() { frameRate(15); size(400,300,P3D); myMovie = new Movie(this, "c:/temp/Very_Nervous_System.mov"); myMovie.loop(); }

void draw() { image(myMovie, 0, 0, 400, 300); myMovie.jump(random(myMovie.duration())); myMovie.read(); }

Video – 직접 해 보기무비를 가져와서일단 스톱시키고 ‘1’ 키를 누르면 1 배속 ‘2’ 키를 누르면 2 배속 ‘4’ 키를 누르면 4 배속으로 플레이 하는 프로그램을지금 당장 짜시오 ~!

Video – 얼추 정답 import processing.video.*; Movie myMovie; float my_speed=0;

void setup() { size(400,300,P3D); myMovie = new Movie(this, "c:/temp/Very_Nervous_System.mov"); myMovie.loop(); } void draw() { image(myMovie, 0, 0, 400, 300); myMovie.read(); if(key=='1') { my_speed = 1; } else if(key=='2') { my_speed = 2; } else if(key=='4') { my_speed = 4; } else { my_speed = 0; } myMovie.speed(my_speed); }

Timescapeby Ji-Hoon Byun & E.J. Gone Photographs made from a continious 1 pixel

lines captured by a camera. http://www.phantasian.com/timescape/

timescape.htm

One Pixel Painting import processing.video.*; Movie myMovie; int time_goes_by = 0;

void setup() { size(1200, 480,P3D); myMovie = new Movie(this, "c:/temp/Very_Nervous_System.mov"); myMovie.loop(); }

void draw() { myMovie.read(); if (time_goes_by>width) { // 세로 페인팅의 포인터의 위치가 그림보다 넘어가면… save("c:/temp/timecompress.tif"); // 끝까지 가면 세이브 myMovie.stop(); noLoop(); } else { image(myMovie, time_goes_by, 0, 1, height); // 포인터의 위치에 세로로 길게 time_goes_by++; // 포인터를 이동 } }

image(myMovie, time_goes_by, 0, 1, height);

Video – 어떻게 했을까http://www.youtube.com/watch?v=I2MsDogV4g4

1. 맨 아래줄이 가장 먼저 보인다 ( 현재 )2. 그 윗 줄은 과거 이미지 , 현재 -1 프레임에 있던

이미지이다 .3. 그 윗줄은… 현재 – n 프레임에 있던 이미지이

다 .4. 맨 윗줄은… 현재 – height 프레임에 있던

이미지이다 .

할일들…여러 프레임에 동시에 접근해야 하므로 과거를 저장할 이미지의

저장소를 만들어야 한다 .

PImage[] img_array; img_array = new PImage[max_idx]; for(int i=0;i<max_idx;i++) { img_array[i] = get(0,0,width,height); // 일단 초기화 해서

쓰레기 데이터가 없도록 뭔가 채워 넣는다}

이미지를 차곡 차곡 저장해 둔다 . img_array[c_idx] = myMovie.get(0,0,width,height);

할일들… 과거로부터 한줄씩 빼서 차곡 차곡 쌓아보자 .

max_idx = height/step; // 너무 느릴까 걱정되서 조금 조정

for(int y=0;y<height;y+=step) // 위에서부터 아래로… { temp_img=img_array[(idx_head+idx)

%max_idx].get(0,y,width,step); // 헷갈리지 ? 각 저장된 이미지의 해당 y 줄을 발췌 idx++; image(temp_img,0,y,width,step); // 위에서 뽑아서 같은 곳에 } idx_head = (idx_head+1)%(max_idx); // 원형 큐의 머리위치 새로 지정

import processing.video.*; Movie myMovie; PImage[] img_array; int max_idx = 0; int step =2; int idx_head = 0;

void setup() { size(320,240,P3D); // 동영상의 원래 크기대로 할 것 max_idx = height/step; img_array = new PImage[max_idx]; for(int i=0;i<max_idx;i++) { img_array[i] = get(0,0,width,height); // 일단 초기화 해서 쓰레기 데이터가 없도록 뭔가 채워 넣는다 } myMovie = new Movie(this, "c:/temp/Very_Nervous_System.mov"); // myMovie.jump(40.0); 앞이 좀

지겨워서리 myMovie.loop(); }

void draw() { PImage temp_img; myMovie.read(); int idx=0; img_array[idx_head] = myMovie.get(0,0,width,height); for(int y=0;y<height;y+=step) { temp_img = img_array[(idx_head+idx)%max_idx].get(0,y,width,step); // 헷갈리지 ? idx++; image(temp_img,0,y,width,step); // 위에서 뽑아서 같은 곳에 } idx_head = (idx_head+1)%(max_idx); }

import processing.video.*; Movie myMovie; MovieMaker mm; // Declare MovieMaker object

PImage[] img_array; int max_idx = 0; int step =1; int c_idx = 0;

void setup() { size(400,300,P3D); // 동영상의 원래 크기대로 할 것 max_idx = height/step; img_array = new PImage[max_idx]; for(int i=0;i<max_idx;i++) { img_array[i] = get(0,0,width,height); } myMovie = new Movie(this, "c:/temp/01.mov"); myMovie.play(); mm = new MovieMaker(this, width, height, "c:/temp/drawing.mov",30, MovieMaker.H263, MovieMaker.HIGH); }

void draw() { PImage temp_img; myMovie.read(); int count=0; img_array[c_idx] = myMovie.get(0,0,width,height); for(int y=0;y<height;y+=step) { temp_img = img_array[(c_idx+count)%max_idx].get(0,y,width,step); count++; image(temp_img,0,y,width,step); } c_idx = (c_idx+1)%(max_idx); mm.addFrame();

if(key=='q'||(myMovie.duration()<=myMovie.time())) { mm.finish(); myMovie.stop(); noLoop(); } }

import processing.video.*; Movie myMovie;

int mov_w = 2000; int mov_h = 2000; int blocks = 200;float mov_pointer = 0.0; float inc = 0.0; int i = 0; float mov_dur = 0.0;

void setup() { size(mov_w, mov_h, P3D); myMovie = new Movie(this, "temp.mov"); mov_dur = myMovie.duration(); inc = mov_dur/(blocks*blocks); // 200by200 타일로 만들고 싶어서… println(mov_dur); myMovie.loop(); }

void draw() { if (mov_pointer>mov_dur) { // 무비파일이 끝나면 끝난다는 뜻 print("\n The End"); save("pornorama.tga"); myMovie.stop(); myMovie.noLoop(); noLoop(); } myMovie.jump(mov_pointer); if(myMovie.available()) { myMovie.read(); i++; image(myMovie, (i%blocks)*(mov_w/blocks), (i/blocks)*(mov_h/blocks), mov_w/blocks,

mov_h/blocks); } // 간단하게 , 전체 영화를 200by200 즉 40000 으로 나눠서 각각의 이미지를 각각의 위치에 넣는다 mov_pointer=mov_pointer+inc;}

특강아트센터 나비 노소영 관장목요일 오전 11 시교양학관 302 호

숙제 오늘 배운 것을 중심으로 해 봅시다 .영화 전체를 한 장 이미지로 만들어 봅시다 .

정보시각화에 관심을 가지고 접근할 것선택한 동영상을 변환시켜 봅시다 .

한 화면에서의 시간의 이동을 실험해 볼 것그 밖의 창의적인 시도

색상 , 꼴라주…등등이 기회에 나만의 signature 가 될 새로운

표현방법을 개발하도록 노력할 것

top related