Could not find codec parameters for stream 0 (Video: h264, 1 reference frame, none(left)): unspecified size Consider increasing the value for the ‘analyzeduration’ and ‘probesize’ options
以上错误经过各种google,据说是因为ffmpeg 内部默认支持的是udp 而我的摄像头是tcp ,我尝试这将他改成udp 发现根本无法浏览了
无奈只有如同很多解决方案说的需要改ffmpeg源码,然而打开的我的ubuntu,并找不到所说的那个方法,而且本人也不懂C啊,o(╥﹏╥)o
不敢轻举妄动啊,没办法只有再找找办法,果然皇天不负有心人啊~还是找到了 这里写代码片
// 强制使用tcp
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT, “rtsp_transport”, “tcp”);
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, “framedrop”, 60);
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, “max-fps”, 0);
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, “fps”, 30);
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_CODEC, “skip_loop_filter”, 48);
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, “overlay-format”, IjkMediaPlayer.SDL_FCC_YV12);
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, “packet-buffering”, 0);
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT, “fflags”, “nobuffer”);
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT, “max-buffer-size”, 1024);
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, “min-frames”, 10);
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, “start-on-prepared”, 1);
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT, “probsize”, “4096”);
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT, “analyzeduration”, “2000000”);
直接添加此段代码啊~
仅仅作为笔记~若有错误,请各路大神指出,以免误人子弟
参考地址:http://www.jianshu.com/p/512241bd655a
参考地址:http://blog.csdn.net/vblittleboy/article/details/41846373