1

 

1.     과제 주제 (문제 개요)

 

- 기본적으로 과제를 위한 세팅이 되어있는 (조교가 제공한) GeekOS 에 작업을 한다.

    조교님께서 project3.tar.gz 라는 뼈대 프로젝트를 제공해 주셨다.

    내부에는 [ elf.c / kthread.c / user.c / userseg.c ] 들에 베이스 코드가 세팅되어있다.

    추가로 우리가 앞으로 해야 할 것들(앞으로 코딩해야 할 부분들, 생성해야할 함수 이름들,

    파라미터들에 대한 내용들)PPT로 제공해 주심으로써 실제로 우리가 해야 할 일은 적다.

 

 

-       1. GeekOS 안에 Scheduling 을 구현한다.

4 가지 스케줄러를 구현한다. [ Round-Robin, Multilevel Feedback Scheduling, Shortest Job First (Priority based), 그리고 마지막으로 우리 조만의 User made Scheduling algorithm ]

구체적인 요구 함수와 구현을 요구하는 내용은 아래와 같다.

 

[ kthead.c : 일반적으로 스케줄링 부분에 대한 코딩 ]

 

1.     Extern int g_Quantum    설정된 Quantum

2.     Int g_scheduleSelector 어떠한 스케줄러가 선택되었는지를 저장하는 변수

3.     Int sel_time = 0                         스케줄러

 

4.     Find_Best

위에서 언급한 4 가지 스케줄러들은 각자 최적의 Thread’룰 찾는 방법은 다양하다.

어느 알고리즘은 ThreadProcessPriority 를 기반으로 가장 중요한 Thread 혹은

Process를 선택한다. / 어느 알고리즘은 Time 시간을 기반으로 가장 최적의 Thread 혹은

Process를 선택한다. 이렇게 각 알고리즘에 맞는 최고의 Thread 를 찾기 위한 함수이다.

그래서 이름이 Find_Best 이다.

 

5.     Get_Next_Runnable( void )

              선택된 스케줄링에 대해 처리를 하는 함수. 각각의 스케줄링 케이스에 대해

그에 맞는 Find_Best를 호출하여 최적의 Thread(혹은 Process)를 찾아서 bestQueue 라는

곳에 저장을 하고, 지금 현재 처리한 큐 다음의 Thread 를 받아서 그 새로 받은 Thread

에 대한 또 Get_Next_Runnable 을 처리하기 위해 준비한다.

 

6.     Set_Scheduling_Policy( int policy, int quantum )

              선택된 스케줄링에 대해 처리를 하는 함수. Policy 라는 변수로 받은 스케줄링 정책에

              대한 Setting 을 담당한다. 실제로 스케줄링에 맞는 처리를 하는 것은 Get_Next_Runnable

              이고 이 Sys_Set 부분에서는 단순히 받은 Parameter 값들을 변수에다 세팅해

놓는 것 뿐이다.

 

 

-       2. GeekOS 안에 Semaphore 를 구현한다.

Thread들은 멀티 Thread 프로그램의 경우 동시에 Thread 가 돌아가면서 각자의 코드에

(Thread 들의 코드에) 서로 영향을 미칠 수 있다. 이를 방지하기 위해 Semaphore

이용하여 다중 LineThread 내부 코드를 Atomic 하게 묶어서 서로 다른 Thread들의

코드들이 영향을 주지 못하도록 보호한다.

 

[ syscall.c : 일반적으로 세마포어 부분에 대한 코딩 ]

 

1.     typedef struct Semaphore            세마포어 구조체(type)를 만들어 준다.

2.     Is_Thread_In_List                         현재 선택된 Thread 가 특정 List 안에 있는가?

3.     Is_Thread_List_Empty                   현재 선택된 Thread 가 특정 List 안에 없는가?

4.     Remove_Thread_List                    현재 선택된 Thread 를 특정 List 에서 제거하라.

5.     Sys_SetSchedulingPolicy              Set_Scheduling_Policy(policy, quantum) 를 호출하라

6.     Sys_GetTimeOfDay                      현재 시간을 return 하라

 

7.     Sys_CreateSemaphore                  세마포어 생성

8.     Sys_P                                                     세마포어 -

9.     Sys_V                                       세마포어 +

10.   Sys_DestroySemaphore                세마포어 제거

 

 

-       3. GeekOS 안에 Timing 을 구현한다.

스케줄링마다 각각 Process (혹은 Thread)들의 각각 다른 대기시간에 따라 다른 총 소요

시간이 도출된다. 이 총 소요 시간을 계산하여 각각의 스케줄링마다의 소요시간을 도출해

내어 그들의 값을 비교하고 어느 상황에서 어느 스케줄링이 알맞는지 선택할 수 있게 한다.

 

           [ timer.c : 일반적으로 타이밍 부분에 대한 코딩 ]

 

1.     Extern int g_scheduleSelector                   어떠한 스케줄러가 선택되었는지를 저장하는 변수

2.     Int g_Quantum = DEFAULT_MAX_TICKS       설정된 Quantum

3.     PrintQ(void)                 

현재의 g_Quantum 값을 알려주는 프린트 함수이다.

4.     Timer_Interrupt_Handler 

모든 Quantum이 모두 소모되기 이전에 현재의 프로세스를 낮은 우선순위의 큐로 이동시킨다.

 

 

 

 

 

Posted by 하늘_

 

 

Why is main() in java void?

http://stackoverflow.com/questions/540396/why-is-main-in-java-void

 

Q.

In the case of languages with a C-like syntax, we declare the main() method to return an int or float value (or void). Is it possible to declare a non-void return type from main() in Java? If not, then why not? Does this mean that a Java program doesn't return any value to the OS?

A - 1.

The main() method must indeed have a void return type. From the Java Language Specification on "Execution - Virtual Machine Start-Up" (§12.1.4):

The method main must be declared public, static, and void. It must accept a single argument that is an array of strings.

It goes on to describe when a program exits in "Execution - Program Exit" (§12.8):

A program terminates all its activity and exits when one of two things happens:

  • All the threads that are not daemon threads terminate.
  • Some thread invokes the exit method of class Runtime or class System and the exit operation is not forbidden by the security manager.

In other words, the program may exit before or after the main method finishes; a return value from main would therefore be meaningless. If you want the program to return a status code, call one of the following methods (note that all three methods never return normally):

Of the three, System.exit() is the conventional and most convenient way to terminate the JVM.

 

A - 2.

This is an interesting discussion on velocityreviews on the same topic:

Highlight:

Incidentally, this is considered bad style in C and C++ just because it's the wrong signature for main, not for any universal reason independent of programming languages. It's one of those things that is not really supposed to work, but might on your implementation.

In Java, the reason main returns void is threads. C and C++ were both designed as languages before multithreading was a widely known technique, and both had threads grafted onto them at a later date. Java was designed from the beginning to be a multithreaded environment, and frankly, it would be unusual to write any non-trivial Java application that doesn't use more than one thread. So the idea that a program moves linearly from the beginning to the end of main is a bit outdated.

written by

www.designacourse.com The Easiest Way to Train Anyone... Anywhere. Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation

 

 

Posted by 하늘_
Media Cloud/FFMPEG2013. 2. 27. 21:41


SDK, NDK, PDK, JNI는 무엇인가!?


■  SDK와 NDK, 그리고 PDK

  SDK Software Developer’s Kit의 약자로 주로 UI를 기반으로 특화된 API를 제공하여 Application Level에서의 개발을 쉽게 해주며, 기반은 Java Language이다.

  따 라서 SDK는 일반적인 Android Application 개발에 사용되며, Android Emulator를 내장하고 있어 Build와 동시에 바로 Test까지 가능하다.( 단, H/W를 직접 사용해야 하는 Application은 Test가 힘들다. )

 

  반면, NDK Native Developer’s Kit의 약자로, SDK와 마찬가지로 Application을 개발하는데에 사용되는 Framework이지만 Java 대신에 C/C++ Language를 이용하여 개발할 수 있다.

  따라서 NDK는 Application 뿐만 아니라 MiddleWare개발에도 사용되며, JNI를 통해 SDK에서 Linux에서 사용하던 C/C++을 사용할 수 있게 해준다. 그러므로, HAL( Hardware Abstraction Layer )의 구성/형태에 따라 굉장히 민감할 수 밖에 없다.

  결론적으로, 기본적으로 NDK는 JNI용 Library를 만드는 것이나, 약간의 변형을 통해 실행 파일( Executable File )도 만들 수 있다. 다만, 완벽한 형태의 Application의 제작은 NDK만으로는 사실상 불가능하다.

 

  PDKPlatform Developer's Kit의 약자로, Android의 Porting 개념으로서 SDK와 NDK를 포괄하는 개념이다.

  PDK는 반드시 Unix 계열의 OS에서 개발이 이루어져야 하며, Android의 전체 Source Code를 이용하여 개발한다. 결국 PDK는 Linux Kernel Level과 그 바로 위에 위치한 Native Library의 HAL 부분 등 Android의 깊숙한 부분에 대한 개발 방법이다. 따라서 AndroidApp 개발이 아닌 Kernel Level, 혹은 Core Frame의 개발이 목적이라면 PDK를 이용해 개발 해야 한다.



■  정리


SDK(Software development Kit) : Android App을 개발 시에 사용한다.


NDK(Native development Kit) : Android App의 개발시 C/C++의 code를 사용할 수 있다.


PDK(platform development Kit) : platfrom을 개발할 때 사용한다.



■ JNI

  Java Native Interface의 약자로, Java C/C++ Module을 연결해주는 매개체를 의미한다. , Java에서 지원하지 않는 하위(Low) 계층의 기능을 C/C++ 계층과의 연동을 통해 해결하도록 해준다.


참고 : www.flowdas.com/blog







Posted by 하늘_
Media Cloud/Hadoop2013. 2. 27. 21:35

- 위키 MapReduce 는 이 문서를 기반으로 작성되었다.

mapreduce-osdi04.pdf

http://static.googleusercontent.com/external_content/untrusted_dlcp/research.google.com/ko//archive/mapreduce-osdi04.pdf

 

google 의 폐쇄성 , Hadoop, Google의 MapReduce 이야기

http://freesearch.pe.kr/archives/1115

 

Hadoop을 이용한 분산 데이터 처리

http://cafe.naver.com/smartchip/1541

 

http://en.wikipedia.org/wiki/MapReduce


MapReduce


큰 데이터 셋들을 프로세싱하기 위한 프로그래밍 모델로 구글에 의해 지어진 implementation 모델의 이름이기도 하다.

맵리듀스는 전형적으로 컴퓨터들의 클러스터 집합에서 돌아가는 분산 컴퓨팅에서 사용된다.


이 모델은 functional 프로그래밍에서 흔히 사용되는 map 과 reduce 함수들에 영감을 받았다. (원 map reduce 함수들의 목적이 MapReduce 프레임워크와 다른 목적을 지녔음에도 불구하고)


맵리듀스 라이브러리들은 많은  프로그래밍언어로 짜여져왔으며, 제일 유명한 free implementation 은 Apache Hadoop 이 있다.



Overview


맵리듀스는 매우 큰 수의 컴퓨터들(노드들) 을 사용하는 큰 데이터셋에 분산되어 존재하는 평형화가능한(parallelizable) 문제들을 처리하기 위한 프레임워크이고, 전체적으로(collectively) 클러스터(만약 모든 노드들이 하나의 같은 로컬네트워크 그리고 같은 비슷한 하드웨어를 쓸 경우에 클러스터라고 부른다) 또는 그리드(노드들이 지리학적으로 그리고 행정상으로(경영상으로 : administratively) 분산된 시스템들에 분산되 있고, 성질이 다른 하드웨어들을 사용할땐 그리드라고 부른다)에서 언급된다. 


컴퓨터적인 프로세싱은 파일시스템(unstructured)에서나 데이터베이스(structured)에서나 어느 곳이든 저장되어있는 데이터들에서 발생할 수 있다. 맵리듀스는 데이터의 지역성(locality)의 이점을 가질 수 있다. 이는 저장소 주변에서 혹은 그 안에서 진행하는 데이터 프로세싱을 함으로서 데이터의 이동(transmission)을 최소한 감소시킴으로서 이루어 낸다.


"Map" 과정 : '마스터 노드'는 input 을 갖고, 이들을 작은 sub-problem 들로 나누어, 'worker 노드'들에게 분산한다. (maybe HDFS)

worker 노드는 멀티레벨의 트리 구조를 이끌어 이를 한번 더 돌아가면서 실행한다.(실질적 mapping)

( = A worker node may do this again in turn, leading to a multi-level tree structure )

워커노드는 작아진 problem 을 프로세싱하고, 그에 대한 답을(프로세싱의 결과를) 마스터 노드에게 전달한다.



"Reduce" 과정 : 마스터 노드는 모든 sub-problems 에 대한 해결책들을 각각 worker 노드들에게 모아서 이들을 '특정 몇몇의 방법'(= in some way) 을 이용해서 output 포맷으로 결합한다. - output = 맨 처음에 해결하기 위해 노력했던 그 문제 problem 에 대한 답변



맵리듀스는 맵과 리덕션의 분산 처리들을 위해 존재합니다. (allow for) 각각의 맵핑 작업에 제공되는것은 다른 것들과 독립적이기 때문에 모든 맵들은 평형적으로 작업을 수행합니다. - (실질적으로 그 작업들이 독립적인 데이터 자원(source)들의 수에 제한되고, 되거나 (and/or) 각 자원(source)들의 CPU 개수들에 제한되더라도)

비슷하게 리듀서들의 집합은 리덕션 부분을 처리할수있습니다. - '같은 키'들을 공유하는 맵 작업의 결과로서 제공받은 모든 결과들은 동시에 같은 (키의 = key) 리듀서들에게 수여되거나 (be presented to), 혹은 리덕션 함수가 associative 할때. (= 연상일때)

이 프로세스가 더 순차적인 (sequential) 알고리즘에 비교해보았을때 종종 비효율적으로 보일수도 있을 수 있으나, 맵리듀스는 상용 서버들이 다룰 수 있는것보다 매우 더 큰 (significantly larger) 데이터 셋들에 적용될 수 있다. - 큰 서버 팜도 페타바이트 데이터를 단 몇시간만에 분류하기 위해 맵리듀스를 사용할 수 있다.

평형성은 또한 작업중에 발생할 수 있는 서버 혹은 저장소의 부분적인 오류들을 회복할 수 있는 가능성들을 제공한다. : 만약 하나의 맵퍼나 리듀서가 실패한다면, 시행하고 있는 작업은 다시 리스케줄링될 수 있다. (input data 가 아직도 유효하다면)




Logical View


맵리듀스의 맵과 리듀스 함수는 모두 (key, value) 짝으로 표현되는 '데이터 구조'에 관하여, 대하여(with respect to) 정의된다.

Map 은 하나의 데이터 도메인(data domain)에서 하나의 타입을 갖는 하나의 데이터 짝을 가져가고, 앞과는 다른 도메인(different domain)의  짝들의 리스트 한개를 리턴한다. : Map(k1, v1) -> list(k2, v2) /

/ Map(String hello(txt name), String hello.txt) -> list(char word, int x(개수))

/ Map(String mov(mov name), Mov movPart1) -> list(int keypart1, Mov Enc_movPart1)

 

- 하나의 데이터 도메인 (데이터 도메인의 예로는 gender 에서의 W, M, U 과 같은 요소들을 뜻한다. 즉 특성들을 뜻하는 것으로 이해하면 된다.) 에서 하나의 타입을 갖는 (위의 예를 따르면 M 이 하나의 타입이 된다) 한 쌍의 데이터를 Map 이 take 해간다.

= 예 > input : 하나의 데이터 도메인을 갖는 하나의 짝 = 첫번째 줄(데이터 도메인 = 1)의 문장 = ( 1st sentence = apple is good and orange is bad. )

= 예 > return : 다른 도메인의 짝들의 리스트 한개 = word 들에 대한 리스트 ( 1st sentence's words = ( apple = 1, orange = 2 ) // 2nd sentence's words = ( apple = 2, orange = 7 ))

= 예 > pair = ( a = 3 ), a list of pairs = ( a = 3, b = 4 ... )


맵 함수는 input 데이터셋에 있는 각각의 쌍에 평형적으로 적용된다. 이는 각 call 에 대해 쌍들의 리스트 하나를 생성한다. 그 후에 맵리듀스 프레임워크는 모든 리스트들로 부터 같은 키값을 가진 모든 쌍들을 모아 그들을 묶어 각 키당 하나의 그룹을 생성한다. (one group for each key)

- 맵 함수가 input dataset 에 있는 각각의 pair 들에 대해 평형적으로 적용된다고 하는 말의 뜻은, 각 Mapper 들은 각각 하나의 쌍을 갖고 있고, 맵 함수는 각 Mapper 들에 있는 하나의 쌍에 대해 적용되고, Mapper 의 수는 많으므로 평형적으로 진행된다는 이야기이다.

- 각각의 call 에 대해 짝들의 리스트를 생성한다는건, 하나의 Call은 하나의 Mapper 에게 주어진 일이고, Map 에 대해 설명했듯이 input 은 하나의 a pair 이지만 결과 리턴값은 a list of pairs 라고 했으므로 하나의 call 은 a list of pairs 를 리턴한다는 뜻이다.

- 이렇게 각자의 call 들을 마치고 a list of pairs 를 도출해 낸 뒤에 맵리듀스 프레임워크는 이 각각의 a list of pairs 들을 모아서 모든 all pairs 에 대한 정보들을 수집한다.

= 예 > ( 'A' list of pairs : a = 1, o = 2) + ( 'B' list : a = 2, o = 7, b = 13) = ( ALL list : a = 1, a = 2, o = 2, o = 7, b = 13)


- 그리고 이렇게 다 합친 pair 정보들을 같은 key 를 기준으로 그룹들을 맺어준다.

= 예 > ( 'a' key group = ( a = 1, a = 2 ))


리듀스 함수는 각 그룹에 대해 평형적으로 적용된다. 그 그룹은 같은 도메인(= 같은 데이터 도메인) 상에 있는 값들의 모음을 차례대로 생성한다. : Reduce(k2, list(v2)) -> list (v3) /

/ Reduce(char word, list(x(개수))) -> lsit ([char word,] xsum(총 개수))

= 예 > ( a key group = ( a = 1, a = 2)) --> ( a sum = 3 )

 

하나의 콜이 하나의 값보다 더 많은것을 리턴하게끔 할당되어 있더라도, 각 리듀스(작업)는 전형적으로 하나의 값 v3 (위 예로 a sum = 3)이나, 빈 리턴값을 생성한다. 모든 콜들의 리턴값들은 원하는(desired) 결과 리스트로 모아진다.

즉, MapReduce 프레임워크는 (key, value)짝들의 리스트를 값들의 리스트로 변환시킨다. (a list of (key, value) pairs -> a list of values) 이 처리(behavior)는 map 과 reduce 의 조합을 전형적인 함수적(functional)으로 프로그래밍하는것 과는 다른것이다. 이 프로그래밍기법은 임의의 값들의 리스트를 받아 map 에 의해 리턴된 모든 값들을 모은 하나의 단일 값을 리턴한다. 


MapReduce 를 구현하기위해서 map 과 reduce 들의 구현을 추상화 시키는것은 필요하지만 충분하지는 않다. (it is necessary but not sufficient) MapReduce의 분산 구현은 Map 과 Reduce (map 과 reduce 와는 다르다 (소문자와 대문자)) 단계를 수행할 프로세스들을 연결하는 수단들이 필요하다. 이것이 분산 파일 시스템이다. (distributed file system)

맵핑 결과들을 그 결과들을 query 하는 리듀서들에게 건네주기 위해 mapper 에서 reducer 로 직접 스트리밍 혹은 맵핑 프로세서들을 위한 직접 스트리밍과 같은 다른 옵션들도 가능하다. 


 

Example : Wordcount

 

function map(String name, String document):
  // name: document name
  // document: document contents
  for each word w in document:
    emit (w, 1)
 
function reduce(String word, Iterator partialCounts):
  // word: a word
  // partialCounts: a list of aggregated partial counts
  sum = 0
  for each pc in partialCounts:
    sum += ParseInt(pc)
  emit (word, sum)

 


각각의 String document 는 words 들의 집합들로 분리되어 있고, 각각의 단어들은 단어들을 결과 key 값 (단순히 key 를 key 값이라고 표현할것이다. 절대 value 를 뜻하는게 아니다.)으로 사용하는 map 함수에 의해 세어진다. 프레임워크는 같은 key 값을 같는 모든 짝들을 한데 모으고, 그 모은 것들을 리듀스에 대한 같은 콜(the same call to reduce / 같은 콜이라는 의미는 map 작업을 한 애들이 자신에게 할당된 부분 문장에서 얻어낸 key 들에 대한 짝들을 갖고, 그대로 자신이 reduce 작업까지 이어나간다는 것이다.)에다가 넘겨준다. (feed) 이렇게 해서 이 함수는 단어의 전체 존재수들을 찾기 위해 단지 모든 그것의 입력 값들을 더하는것을 필요로한다.

 

 

Dataflow

 

MapReduce 프레임워크의 고정적인 부분은 (frozen part) 대형 분산 정렬이다. 애플리케이션이 정의하는 hot spots 들은 다음과 같다.

 

an input reader

a Map function

a partition function

a compare function

a Reduce function

an output writer

 

 

 

 

 

- 미완성

 

 

http://en.wikipedia.org/wiki/MapReduce

http://en.wikipedia.org/wiki/Hadoop#File_Systems

http://developer.yahoo.com/hadoop/tutorial/


http://gmyoul.tistory.com/8

http://www.hadoop.or.kr/?document_srl=1099

http://www.ibm.com/developerworks/kr/library/au-cloud_apache/index.html#figure2

http://www.firstpost.com/topic/place/taiwan-hadoop-in-taiwan-2012mohohan-an-on-line-video-transco-video-1lxE9ZB_LEE-79-1.html


아파치 하둡 위키 : http://wiki.apache.org/hadoop/HadoopMapReduce

HDFS 용어 : http://redju.tistory.com/256

하둡 용어 : http://gmyoul.tistory.com/8

하둡 정의 번역본 : http://www.hadoop.or.kr/?document_srl=1099








'Media Cloud > Hadoop' 카테고리의 다른 글

하둡(Hadoop) 정의  (0) 2012.12.26
Posted by 하늘_
Media Cloud/Hadoop2012. 12. 26. 18:38

하둡 (Hadoop)


분산 방식으로 대규모의 정형 또는 비정형 데이터를 분석하기 위한 오픈소스 기반 데이터 관리 기술


오라클로 대표되는 관계형 데이터베이스관리시스템(RDBMS)과 달리 하둡은 통상 비관계형 DBMS 로 분류되지만 SQL 쿼리를 사용하지 못하는 것은 아니며, SQL 뿐 아니라 다른 쿼리 시스템도 사용될 수 있는 NoSQL 데이터베이스


정형 데이터뿐 아니라 수 페타바이트에 달하는 웹로그, 클릭스트림, 소셜 미디어 콘텐츠 등 비정형 데이터 분석에 사용되고 있으며, 대표적인 기업은 야후로서 이미 5만개의 노드로 구성된 하둡 네트워크를 구축 중


하둡은 본질적으로 빅데이터 등 대용량 환경에만 베타적으로 사용되는 기술은 아니며, 활용 범위는 빅데이터보다 훨씬 광범위함


하둡이 페이스북과 야후의 빅데이터 분석에 사용되는 것은 강력한 확장성을 가지고 있기 때문이며, 데이터양이 작은 기업이라면 원하는 수준으로 규모를 축소시켜 자신들의 요구에 알맞게 하둡을 사용할 수 있음


하둡이 빅데이터를 처리할 수 있는 이유 

- 확장성을 기반으로 간단히 모든 데이터를 저장할 수 있기 때문

- 하둡이 모든 데이터를 저장할 수 있는 것은 경제적 비용이 매우 낮기 때문

- 연혁 데이터가 아닌 모든 데이터를 이용할 수 있다는 사실은 데이터를 인식하고 활용하는데 있어 엄청난 변화를 가져오고 있음

- 하둡 기술은 이러한 확장성 외에 유연성도 갖추고 있기 때문에 다양한 소스들로부터 보다 복잡한 분석을 수행할 수 있는 장점을 갖춤

- 하둡은 현재 오픈소스 플랫폼이지만 리눅스와 마찬가지로 상용 버전이 등장하면서 기업의 도입 속도를 촉진




'Media Cloud > Hadoop' 카테고리의 다른 글

MapReduce 정의  (0) 2013.02.27
Posted by 하늘_
카테고리 없음2012. 11. 26. 23:01



교수님 formal 서버 한글지원 ㅠㅠ!!


한글 언어팩 설치

http://blog.naver.com/PostView.nhn?blogId=jangso417&logNo=30083500331


한글 언어팩 적용과 최신으로 업데이트

http://hkebi.tistory.com/424




Trac Subversion 설정이 계속 안잡힌다. 분명히 제대로 설치도하고 set 도 다 했는데, version control systems 관련 오류


http://trac.edgewall.org/wiki/TracSubversion

  1. Have you got SVN disabled in your trac.ini file?

Starting with Trac 1.0, the Subversion components need to be explicitly enabled. See #tracopt above, if you haven't yet.

Before Trac 1.0, the Subversion specific modules were always enabled, but even then it could happen that for some reason, people had explicitly disabled those and possibly forgot about it. If so, set it/them to enabled (or simply delete the offending lines, since I believe they are enabled by default.)

[components]
trac.versioncontrol.api.repositorymanager = enabled
trac.versioncontrol.svn_authz.svnauthzoptions = enabled
trac.versioncontrol.svn_fs.subversionconnector = enabled
trac.versioncontrol.svn_prop.subversionmergepropertydiffrenderer = enabled
trac.versioncontrol.svn_prop.subversionmergepropertyrenderer = enabled
trac.versioncontrol.svn_prop.subversionpropertyrenderer = enabled

(so again, the above module svn_fs/svn_prop names are only valid before Trac 1.0, see #tracopt starting from 1.0)



http://trac.edgewall.org/wiki/TracSubversion#tracopt


Trac and Subversion

Trac has supported the Subversion VersionControlSystem since day one. Actually, Trac was even named svntrac back then!

However, things change and other version control systems gain in popularity… in Trac 1.0 we also support Git as an optional component below tracopt.versioncontrol.git.*. As to not make any first class, second class distinction, we also decided to move the subversion support over there, in tracopt.versioncontrol.svn.*.

In Trac 1.0 (trunk, starting from r11082), the components for Subversion support have been moved below tracopt. so you need to explicitly enable them in your TracIni#components-section:

[components]
tracopt.versioncontrol.svn.* = enabled

This can instead be enabled using the Admin → General → Plugins (Manage Plugins) select component the checkbox(es).

This page is intended to collect all the specific tips and tricks about Subversion support in Trac. This is not the place for general Subversion help. You can get more support options elsewhere.






http://trac.edgewall.org/wiki/TracIni#components-section

[components]

This section is used to enable or disable components provided by plugins, as well as by Trac itself. The component to enable/disable is specified via the name of the option. Whether its enabled is determined by the option value; setting the value to enabled or on will enable the component, any other value (typically disabled or off) will disable the component.

The option name is either the fully qualified name of the components or the module/package prefix of the component. The former enables/disables a specific component, while the latter enables/disables any component in the specified package/module.

Consider the following configuration snippet:

[components]
trac.ticket.report.ReportModule = disabled
webadmin.* = enabled

The first option tells Trac to disable the report module. The second option instructs Trac to enable all components in the webadmin package. Note that the trailing wildcard is required for module/package matching.

To view the list of active components, go to the Plugins page on About Trac (requires CONFIG_VIEW permissions).

See also: TracPlugins









Posted by 하늘_
카테고리 없음2012. 11. 23. 23:27


ffmpeg - I frame 을 뽑는 방법


http://ffmpeg-users.933282.n4.nabble.com/Extracting-I-Frames-from-Mpeg4-videos-td2952952.html


>> Is there any way to extract I-frames from a mpeg-4 video using ffmpeg ?


- One way to do it would be:
Use FFprobe firstly to determine which frames are I frames and then extract the frames with -vframes=1 and -ss. Ideally, automate the process.


- A more elegant solution: add frame-type properties to
AVFilterBufferRef, implement a filter for only outputting I-frames,
and connect this filter to a movie sink.

All this is not yet implemented, but would be a good exercise for
someone which is intereseted into contributing to FFmpeg/libavfilter.






 FFmpeg을 이용한 Android 동영상 플레이어 개발 - 그냥 도움이 될까 해서


http://helloworld.naver.com/helloworld/8794


NHN 동영상서비스개발2팀 김대웅

Android 는 오픈 플랫폼이어서 단말기가 제공하는 동영상 플레이어의 기능과 지원하는 포맷이 제조사마다 다릅니다. 그래서 더 효율적으로 동영상 서비스를 제공하려면 독자적인 동영상 플레이어가 있는 것이 좋습니다. 이 글에서는 오픈 소스인 FFmpeg의 레퍼런스 프로젝트인 FFPlay로 Android용 동영상 플레이어를 제작하기까지의 고민과 과정을 소개합니다.





How to hack ffmpeg to consider I-Frames as key frames?


http://stackoverflow.com/questions/8676651/how-to-hack-ffmpeg-to-consider-i-frames-as-key-frames


interace - http://hruj.tistory.com/5


- I'm trying to get ffmpeg to seek h264 interlaced videos, and i found that i can seek to any frame if i just force it.

I already hacked the decode,0ㅜㅐ                                                             r to consider I - Frames as keyframes, and it works nicely with the videos i need it to work with. And there will NEVER be any videos encoded with different encoders.

However, i'd like the seek to find me an I - Frame and not just any frame.

What i'd need to do is to hack The AVIndexEntry creation so that it marks any frame that is an I-Frame to be a key frame. Or alternatively, hack the search thing to return I - Frames.

The code does get a tad dfficult to follow at this point.

Can someone please point me at the correct place in ffmpeg code which handles this?


-This isn't possible as far as i can tell..

But if you do know where the I-Frames are, by either decoding the entire video or by just knowing, you can insert stuff into the AVIndexEntry information stored in the stream.

AVIndexEntries have a flag that tells if it's a keyframe, just set it to true on I-Frames.

Luckily, i happen to know where they are in my videos :)

-mika






HANDY TIP: Using FFprobe for stream analysis


http://forums.creativecow.net/thread/291/71



extracting key frames with ffmpeg ******************************* 아주 중요!

http://37rtm.host22.com/content/extracting-key-frames-ffmpeg





Google >> ffmpeg key frame


http://www.google.com/search?client=ubuntu&channel=fs&q=ffmpeg+I+frame&ie=utf-8&oe=utf-8#hl=ko&client=ubuntu&tbo=d&channel=fs&sclient=psy-ab&q=ffmpeg+key+frame&oq=ffmpeg+key+frame&gs_l=serp.3..0i7i10i30l2j0i7i30l2.6491.8714.0.8878.10.8.2.0.0.4.285.1526.0j3j4.7.0...0.0...1c.1.gMcseSKVMwU&pbx=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=35c0718840beb598&bpcl=38897761&biw=1301&bih=678




Extract a keyframe from a video with FFMpeg

http://kr3l.wordpress.com/2009/12/03/extract-a-keyframe-from-a-video-with-ffmpeg/




ffmpeg keyframe extraction


http://stackoverflow.com/questions/12538914/ffmpeg-keyframe-extraction





Google >> ffmpeg -vf select="eq(pict_type\,PICT_TYPE_I)"


http://www.google.com/search?client=ubuntu&channel=fs&q=ffmpeg+I+frame&ie=utf-8&oe=utf-8#hl=ko&client=ubuntu&tbo=d&channel=fs&sclient=psy-ab&q=ffmpeg+-vf+select%3D%22eq%28pict_type\%2CPICT_TYPE_I%29%22&oq=ffmpeg+-vf+select%3D%22eq%28pict_type\%2CPICT_TYPE_I%29%22&gs_l=serp.12...863595.863595.1.864751.1.1.0.0.0.0.184.184.0j1.1.0...0.0...1c.1.OhlvWZtOa2s&pbx=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=35c0718840beb598&bpcl=38897761&biw=1089&bih=518




FFmpeg-users - Using the "select" filter

http://ffmpeg-users.933282.n4.nabble.com/Using-the-quot-select-quot-filter-td4079651.html

http://ffmpeg.org/ffmpeg.html#select








Posted by 하늘_
카테고리 없음2012. 11. 20. 17:54

 

Posted by 하늘_
네트워크2012. 11. 15. 17:20

 

QT Atoms and Atom Containers

 

QT atom 들은 더 많은 일반-목적의 저장 포맷을 제공하고, simple atom 들을 이용할때 발생하는 몇몇 애매성들을 제거해주는 '향상된 data structure' 이다. QT atom 은 확장된 header 를 지니고 있다; size, type 필드들은 atom ID 에 대한 필드들과 child atom 의 개수를 따른다. (즉, 저들을 포함하여 size 와 type 을 결정한다.)

 

이는 같은 타입의 '복수의 child atom' 들이 식별번호를 통해 명시되게 만들어준다. 또한 알려지지않은 타입의 QT atom 의 컨텐츠들을 child atom 들의 트리구조를 걸어다니며, 분석하는것이 가능하게 만들어준다.

 

QT atom 들은 일반적으로 lock count 를 포함하고 있는 header 를 지닌 data structure 인 atom container 에 감싸여있다. 

 

 

 

 

 

 

'네트워크' 카테고리의 다른 글

[QTFF] Atoms  (0) 2012.11.09
[QTFF] QuickTime File Format Specification 시작부분  (0) 2012.11.09
Posted by 하늘_
네트워크2012. 11. 9. 23:00

 

Atoms

 

QuickTime file 에서의 기본적인 데이터 단위는 atom 이다. 각각의 atom 은 다른 data 들에 앞서서 size 와 type field 들을 포함하고 있다. size field 는 size 와 type field 들을 포함하여 atom 에 있는 총 바이트수를 표시하고, type field 는 atom 에 저장된 데이타의 타입과 데이터의 포맷(data format 은 암시에 의하여(by impilcation))을 명시한다. 어느 경우에는 size 와 type field 들이 version field 와 flags field 에 따라 나오기도 한다. 이러한 version, flags field 들을 포함한 atom 을 두고 종종 full atom 이라 부르기도 한다.

 

Note : 이 문서에서 서술된 atom 은 MPEG-4 와 Motion JPEG-2000 을 위한 ISO 사양(specifications) 에서 서술된 box 와 기능적으로 동일하다. 그리고 또한 이런 사양에서 정의된 full box 와 version 과 flags fields 를 포함한 atom (즉, full atom) 과 기능적으로 동일하다.

 

atom type 들은 전형적으로 ASCII code 4 글자로 번역될 수 있는 32-bit unsigned int 로 명시된다. (Apple, inc. 는 전부 소문자들로 이루어진 모든 4 글자 코드에 대해 법적 권리를 가지고 있다.) 만약 다른 언급이 없으면(Unless otherwise stated), QuickTime movie 의 모든 데이터들은 네트워크 바이트 ordering 으로 일반적으로 알려져있는 big-endian (MSB 가 가장 먼저 저장되고, 가장 먼저 전송되는) 으로 저장된다.

 

atom 은 본질적으로 계층구조를 갖고있다. 이 말은 즉슨, 하나의 atom 이 또 다른 것들을 포함할 가능성이 있는 다른 atom 들을 포함할 수 있다. 이런 계층구조는 종종 부모, 자식, 형제(siblings), 손주(grandchildren), 등등으로 표현되기도 한다. 다른 atom 을 포함하는 atom 을 container atom 이라고 부르며, parent atom 은 계층구조에서 주어진 atom 에서 정확히 한 단계 위의 container atom 을 가리킨다.

 

다른 atom 들을 포함하지 않는 atom 은 leaf atom 이라고 부른다. 이 leaf atom 은 전형적으로 하나 또는 더 많은 필드나 테이블(tables)로서의 data 를 포함한다. 하지만 어떤 몇몇의 leaf atom 들은 flags 나 placeholders 처럼 행동하고, size 와 type fields 외에는 어떠한 정보도 갖지 않는다.

 

given atom 에 저장된 데이타의 포맷은 항상 혼자서 atom 의 type field 에 의해 결정될 수 없다.; parent atom 의 타입 또한 중요할 수도 있다. 다른 말로, given atom 타입은 parent atom 에 의존하는 다른 종류의 정보들을 포함할 수 있다. 예를 들어 movie atom 안에 있는 profile atom 은 the movie 에 대한 정보들을 포함한다. 반면에 profile atom 이 track atom 안에 있다면, profile atom 은 트랙에 대한 정보들을 포함하게된다.

 

 

 

- Atom Layout

 

A sample atom

오른쪽 그림 1-1 (Figure 1-1 A sample atom) 에서 보여지는 leaf atom 은 간단히 오프셋에 의해 접근가능한 a series of data fields 를 포함한다.

 

Container Atom들 안에 있는 Atom들은 이 문서 내부에서 따로 특별하게 어떤 순서를 언급하지 않는한, 일반적으로 어떤 특정한 순서(order)을 갖지 않는다. 하나의 예를 들자면, 무조건 handle 하는 data 의 앞(before)부분에 위치해야하는 handler description atom 이 있다.

 

예를 들어, media handler description atom 은 media information atom 앞에(before) 위치해야하고, data handler description atom 은 data information atom 앞에(before) 위치해야한다.

 

 

 

- Atom Structure

 

Atom data 다음에 따라오는 Atom 들은 header 들로 구성되어 있다. header 는 atom의 크기를 bytes 단위로 갖는 atom의 크기필드, 그것의 타입을 갖는 atom의 타입필드를 갖는다. 또한 large atom을 64-bit integer 값으로 갖는 extended size field 도 포함하고 있다. 만약에 이 extended 필드가 존재한다면, 크기필드의 값은 1로 설정되어있을것이다. atom의 실질적인 크기는 8 바이트(minimum size of the type and size fields)보다 작은 값을 가지지 않는다. (최소 8 바이트이다.) 

 

몇 atom 들은 또한 version, flag fields 도 포함한다. 이들은 종종 full atoms 라고 불린다. flag 와 version field들은 이 문서 내부의 atom header의 부분으로 처리되지는 않는다. 그들은 full atoms 을 포함하는 각 atom type 에 특화된 (specific to each atom type) data fields 로 간주된다. (? : they are treated as data fields specific to each atom type that contains them.) 이러한 필드들은 따로 특별한 상황이 아니면, 항상 0 값으로 세팅되어있어야한다.

 

atom header 는 다음 필드들로 구성되어 있다.

 

Atom size

 

atom 의 컨텐츠(다른 포함된 atom들을 포함해서)들과, atom 의 헤더를 포함한 atom 의 크기를 가리키는 32-bis integer 이다. 일반저긍로 size field 는 32-bit unsigned integer 로 표현된 실제의 bytes 단위의 atom 크기를 포함한다. 하지만 size field 는 atom 크기를 정하는데 사용되는 다른 대안의 방법을 지칭하는 특별한 값을 가질수도 있다. (이 특별한 값은 일반적으로 media data atom ('mdat') 에만 사용된다.)

 

두 특별한 값은 사이즈 필드에서 유효한 값들이다 :

 

0 : 오직 top-level atom 만을 위해 허락된 값으로, 파일안에 마지막 atom 을 가리키고, 파일의 끝에서 확장된 것을 가르켜준다. 

(? : , designates the last atom in the file and indicates that the atom extends to the end of file.)

 

1 : 실제 크기는 extended size field 에 존재한다는 뜻이다. extended size field 는 type field 를 따르는 선택적인(optional) 64-bit filed 이다.

 

This accommodates media data atoms that contain more than 2^32 bytes.

이것은 2^32 바이트보다 더 많은것을 포함하는 media data atoms 를 수용한다. 

아래 Figure 1-2 는 어떻게 atom 의 크기를 계산하는지에 대해 나와있다.

 

Calculating atom sizes 

Figure 1-2 Caculating atom sizes 

 

Type

 

atom 의 타입을 가리키는 32-bis integer 이다. 이건 종종 mnemonic 값을 가진 4 char 필드로 유용하게 처리될 수 있다. 예를 들어 movie atom 을 위한 'moov' (0x6D6F6F76), 또는 track atom 을 위한 'trak' (0x7472616B) 이 있다. non-ASCII 값들도 이용되기도 한다. (예를 들어 0x00000001) 

 

atom 의 타입을 아는것은 당신이 그 data 를 해석하게 해준다. atom data 는 fields, tables, 다른 atom 들의 독자적인 모음으로서 나열될 수 있다. data structure 는 atom type 에 특화되어 있다. 주어진 type 에 대한 atom 은 각각 정의된 data structure 를 갖고 있다.

 

만약에 당신의 애플리케이션이 알려지지않은 type 의 atom 을 마주하였다고 하였을때, app 은 그 해당 atom data 를 해석하려는 시도하면 안된다. atom 과 그 해당 atom 이 포함하고 있는 content 들을 스킵하기 위하여 atom 의 size field 를 이용하여라. 이 행위는 QuickTime file format 를 확장하는것에 대한 a degree of forward compatibility 를 허락해준다. 

(* forward compatibility ? : (software) Capability of interoperating with anticipated future systems.)

 

Warning : 주어진 atom 의 타입에 대한 내부 구조는 새로운 버전이 출시될때 바뀔 수 있습니다. version 필드가 존재한다면, 항상 version 필드를 확인하십시오. 절대 Size or Extended Size 필드에서 정의된 atom 말고 그 외부에 떨어진 data 를 해석하려 시도하지 마십시오.

 

Extended Size

 

만약 atom 의 size 필드가 1 로 세팅되있다면 type 필드는 64-bit unsigned integer 형으로 atom 의 실제 크기를 갖는 64-bit extended size 필드를 자신의 뒤로 갖게 된다. (the type field is followed) 이는 media data atom 의 크기가 2^32 bytes 를 넘었을때 사용된다.

 

size field 가 atom 의 실제 크기를 가질때, extended size 필드는 존재하지 않는다. 이 뜻은 data 를 더함으로서 QuickTime atom 이 수정될 때, 그리고 그것의 크기가 2^32 바이트 제한 내에 있다면, 새로운 atom size 를 기록하기 위한 extended size 필드는 없다는 뜻이다. 결과적으로, 2^32 바이트를 넘어서는 atom 를 확장하는 것이 새로운 atom 에 그 해당 atom 의 컨텐츠를 복사하지 않고서는 항상 가능하진 않다.

 

이런 불편을 방지하기 위하여, media data atoms 는 전형적으로 64-bit placeholder atom (즉각적으로 movie file 안에서 media data 를 앞서는 atom) 을 생성한다. placeholder atom 은 kWideAtomPlaceholderType('wide') 라는 타입을 갖고 있다.

 

'free' 혹은 'skip' atom 과 유사하게 'wide' atom 은 예약된 공간이다, 하지만 in this case 이 공간은 특별한 목적을 위해 예약된다. 만약 'wide' atom 이 즉각적으로 second atom 을 앞선다면, 단순하게 atom header 를 8 바이트 빠르게 시작하고('wide' atom 을 overwriting), size 필드 값을 1로 세팅하고, extended size 필드에 더함으로서 second atom 은 32-bit 크기에서 64-bit 크기로 확장될 수 있다. 이 방법에서 샘플데이타를 위한 오프셋은 재계산될 필요가 없다.

(? : Much like a 'free' or 'skip' atom, the 'wide' atom is reserved space, but in this case the space is reserved for a specific purpose. If a 'wide' atom immediately precedes a second atom, the second atom can be extended from a 32-bit size to a 64-bit size simply by starting the atom header 8 bytes earlier (overwriting the 'wide' atom), setting the size field to 1, and adding an extended size field. This way the offsets for sample data do not need to be recalculated.)

 

'wide' atom 의 크기는 정확히 8 바이트이다. 그리고 자체적으로(solely) size, type 필드를 포함하고 있고 그 이외의 data 는 포함하고있지않다.

 

Note : 흔한 오류는 'wide' atom 은 extended size 를 포함하고 있다고 생각한다는 점이다. 'wide' atom 은 필요하다면 extended size 필드를 포함하는 atom header 에 의해 overwritten 될 수 있는 단지 placeholder 일 뿐이다.

 

 

 

 

 

 

 

'네트워크' 카테고리의 다른 글

[QTFF] QT Atoms and Atom Containers  (0) 2012.11.15
[QTFF] QuickTime File Format Specification 시작부분  (0) 2012.11.09
Posted by 하늘_