git clone git://github.com/kolyvan/kxmovie.git
cd kxmovie
git submodule update --init
rake
ViewController *vc; vc = [KxMovieViewController movieViewControllerWithContentPath:path parameters:nil]; [self presentViewController:vc animated:YES completion:nil];
[rtsp @ 0x906cc00] UDP timeout, retrying withTCP
[rtsp @ 0x906cc00] Nonmatching transport in serverreply
[rtsp @ 0x906cc00] Could not find codec parametersfor stream 0 (Video: h264): unspecified size
Consider increasing the value for the'analyzeduration' and 'probesize' options
Couldn't find streaminformation
跟蹤代碼,錯誤是在avformat_find_stream_info獲取流信息失敗的時候的時候觸發。
if(avformat_find_stream_info(pFormatCtx,NULL) <0) {
av_log(NULL, AV_LOG_ERROR, "Couldn't find stream information\n");
goto initError;
}
……
// Open video file
pFormatCtx = avformat_alloc_context();
//有三種傳輸方式:tcp udp_multicastudp,強制採用tcp傳輸
AVDictionary*options = NULL;
av_dict_set(&options,"rtsp_transport", "tcp", 0);
if(avformat_open_input(&pFormatCtx, [moviePathcStringUsingEncoding:NSASCIIStringEncoding], NULL,&options) != 0) {
av_log(NULL, AV_LOG_ERROR, "Couldn't open file\n");
goto initError;
}
// Retrieve stream information
if(avformat_find_stream_info(pFormatCtx,NULL) <0) {
av_log(NULL, AV_LOG_ERROR, "Couldn't find stream information\n");
goto initError;
}轉載地址:http://blog.sina.com.cn/s/blog_4462d1710101k4ld.html