2012-03-20 2 views
0

ffmpeg에 대한 질문이 있습니다.ffmpeg C++ 및 AVFormatContext

내 프로그램에서 AVFormatContext를 초기화하는 방법. av_open_input_file을 만들고 parametres 중 하나 인 AVFormatContext를 사용할 수는 있지만 파일에 디코딩하지 않으려는 데이터는 사용할 수 있다는 것을 알고 있습니다. 내 프로그램의 다른 구성 요소에서 char * 배열로 가져온다. 이 데이터 배열을 사용하는 경우에만 AVFormatContext 구조체를 초기화 할 수 있습니까?

답변

0

이러한 기능을 살펴보면 유용 할 수 있습니다.

AVInputFormat *av_find_input_format(const char *short_name); 

AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened); 

AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max); 

AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened, int *score_ret); 

int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, 
          const char *filename, void *logctx, 
          unsigned int offset, unsigned int max_probe_size); 

I는 출력 데이터가 아닌 데이터 입력이 않았다 (내 입력 데이터는 원시 프레임은 비디오 장치에서 움켜이었다). 당신은 입력 데이터가 무엇입니까?

+0

소켓 연결에서 내 데이터를 h.264로 인코딩 된 char *로 가져옵니다. 그리고 그것으로부터 디코딩 된 비디오 프레임을 가져야합니다. – mmmaaak