2015. 7. 9. 13:22
avformat.h

1.

int 

avformat_open_input (AVFormatContext **ps, 

                              const char *filename, 
                              AVInputFormat *fmt

                              AVDictionary **options)



입력 스트림을 열고 헤더를 읽는다.

avformat_close_input( )를 사용하여 꼭 닫아야 한다


  • 파라미터

- ps : avformat_alloc_context( )으로 할당한 AVFormatContext의 포인터

- filename : 열기를 할 스트림의 파일 이름

- fmt : 구체적인 입력 포멧

- options :  AVFormatContext로 채워진 dictionary와 demuxer-private 옵션 


2. 

int 

avformat_find_stream_info (AVFormatContext *ic, 
                                      AVDictionary **options)


avformat_open_input( ) 보다 더 많은 정보를 얻는다
파일을 조금 더 읽어서 구체적인 정보를 AVFormatContext에 저장한다.


3. 

void av_dump_format (AVFormatContext *ic, int index, const char *url, int is_output)


입력, 출력 형식과 같은 상세한 정보를 출력한다. 
 비트레이트, 스트림, 컨테이너, 프로그램, 메타데이타 등등

4.
AVCodec avcodec_find_decoder (enum AVCodecID id)

AVFormatContext에 있는 codec_id를 이용하여 AVCodec을 얻는다.

codecContext를 복사한다


6. 
int avcodec_open2 (AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)

주어진 AVCodec코덱으로 AVCodecContext를 초기화한다

7.