How To: Fix “No accelerated colorspace conversion found from yuv420p to bgr24.” | OpenCV-2.2.0 & Ubu

来源:互联网 发布:淘宝怎么咨询人工客服 编辑:程序博客网 时间:2024/06/06 07:12

This problem is basically an issue converting YUV to RGB using ffmpeg, in order for it to work ffmpeg needs to be recompiled with x264. To get around it use the following to recompile ffmpeg and OpenCV 2.1/2.2:

  1. Follow steps 1-to-4 of FakeOutdoorsman’s guide on ubuntuforums.org – here
  2. OpenCV 2.1/2.2 Install Guide by Sebastian Montabone - here


another solution:


http://ozbots.org/opencv-install-troubleshooting/


Problem
$ ./my_webcam_program
[swscaler @ 0x89c3e30]No accelerated colorspace conversion found from yuv420p to bgr24.
[swscaler @ 0x8893810]No accelerated colorspace conversion found from yuv420p to bgr24.
[swscaler @ 0x889c5b0]No accelerated colorspace conversion found from yuv420p to bgr24.
Last message repeated 1 times

 
Solution
The “accepted” solution is to rebuild x264 and ffmpeg with the shared library option. To rebuild x264, change to the directory where you untared the x264 source files, and enter the following commands:
./configure --enable-shared --enable-pic
make
sudo make install

 
To rebuild ffmpeg, change to the directory where you untared the ffmpeg source files, and enter the following commands:

./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-shared
make
sudo make install

After rebuilding x264 and ffmpeg, you do not need to rebuild OpenCV. If the swscaler message still occurs when you run your program, runsudo ldconfig, and run your program again.

This solution comes from the following thread on ubuntuforums.org: http://ubuntuforums.org/showthread.php?t=1471616

Unfortunately for me, configuring and recompiling x264 and ffmpeg does not make the warning meesage go away. If try the solution above, please let me know in the comments if it works for you.



原创粉丝点击