안녕하세요 안드로이드펍 가족님들..
현재 남은그루터기님 FFMPEG 공개 소스로 RTSP 를 스트리밍할려고합니다.
http://www.androidpub.com/1648388#comment_2535594
웹에서 스트리스받는건데요.
주소는 String fname = "http://www.wowza.com/_h264/BigBuckBunny_115k.mov";
이렇게 햇습니다 폰에있는 영상을 불러올때는 잘되구요.
리턴값을 가져 오니 -2 입니다.
int openResult = openMovie(fname);
Log.i("openError",String.valueOf(openResult));
BasicPlayer.c
int openMovie(const char filePath[])
{
int i;
if (gFormatCtx != NULL)
return -1;
if (av_open_input_file(&gFormatCtx, filePath, NULL, 0, NULL) != 0)
return -2;
if (av_find_stream_info(gFormatCtx) < 0)
return -3;
for (i = 0; i < gFormatCtx->nb_streams; i++) {
if (gFormatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
gVideoStreamIdx = i;
break;
}
}
if (gVideoStreamIdx == -1)
return -4;
gVideoCodecCtx = gFormatCtx->streams[gVideoStreamIdx]->codec;
gVideoCodec = avcodec_find_decoder(gVideoCodecCtx->codec_id);
if (gVideoCodec == NULL)
return -5;
if (avcodec_open(gVideoCodecCtx, gVideoCodec) < 0)
return -6;
gFrame = avcodec_alloc_frame();
if (gFrame == NULL)
return -7;
gFrameRGB = avcodec_alloc_frame();
if (gFrameRGB == NULL)
return -8;
gPictureSize = avpicture_get_size(PIX_FMT_RGB565LE, gVideoCodecCtx->width, gVideoCodecCtx->height);
gVideoBuffer = (uint8_t*)(malloc(sizeof(uint8_t) * gPictureSize));
avpicture_fill((AVPicture*)gFrameRGB, gVideoBuffer, PIX_FMT_RGB565LE, gVideoCodecCtx->width, gVideoCodecCtx->height);
return 0;
}
rtsp스트리밍 된다고 들었는데.. 머 다른거 변경해야하나요?
사악미소님 말씀으로는 남은그루터기님은 네트워크 옵션이 빠졌다고 하네요 ㅜㅜ
이러면 다시 처음부터해야하나요 어렵네요