- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
I got a very simply Python app that reads USB camera and write the output to a file. When I run with an environment that uses the OpenVino build (4.5.3-openvino) the colors get altered on the saved video file. When I run with on the exact same machine with a user that doesn't have the environment variables set for OpenVino (openCV build is 4.5.3) the video output file is as expected.
Attached are frames from the OpenVino CV build and regular build. When I run my OpenVino version i get the following messages on the screen. I get a lot of these types of messages in my OpenVino applications so not sure if these are just noise or point to the problem.
[ WARN:0] global ../opencv/modules/videoio/src/cap_gstreamer.cpp (2057) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module filesink0 reported: Could not open file "VIDEO.avi" for writing.
[ WARN:0] global ../opencv/modules/videoio/src/cap_gstreamer.cpp (2057) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module filesink0 reported: GStreamer error: state change failed and some element failed to post a proper error message with the reason for the failure.
[ WARN:0] global ../opencv/modules/videoio/src/cap_gstreamer.cpp (1847) open OpenCV | GStreamer warning: GStreamer: cannot put pipeline to play
[ERROR:0] global ../opencv/modules/videoio/src/cap.cpp (589) open VIDEOIO(CV_IMAGES): raised OpenCV exception:
OpenCV(4.5.3-openvino) ../opencv/modules/videoio/src/cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): VIDEO.avi in function 'icvExtractPattern'
[ WARN:0] global ../opencv/modules/videoio/src/cap_gstreamer.cpp (2057) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module filesink0 reported: Could not open file "VIDEO.avi" for writing.
[ WARN:0] global ../opencv/modules/videoio/src/cap_gstreamer.cpp (2057) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module filesink0 reported: GStreamer error: state change failed and some element failed to post a proper error message with the reason for the failure.
[ WARN:0] global ../opencv/modules/videoio/src/cap_gstreamer.cpp (1847) open OpenCV | GStreamer warning: GStreamer: cannot put pipeline to play
[ERROR:0] global ../opencv/modules/videoio/src/cap.cpp (589) open VIDEOIO(CV_IMAGES): raised OpenCV exception:
OpenCV(4.5.3-openvino) ../opencv/modules/videoio/src/cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): VIDEO.avi in function 'icvExtractPattern'
My code is really simple just to recreate the issue...
cap = cv2.VideoCapture(0)
fourcc = cv2.VideoWriter_fourcc( 'm', 'j', 'p', 'g')
out = cv2.VideoWriter('driveway.avi', fourcc, 20.0, (640, 480))
while(True):
ret, frame = cap.read()
out.write(frame)
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Hi Davel,
I would like to share my findings with you when running OpenCV on Raspberry Pi 3B.
If I run using OpenCV-4.5.2-openvino, the video is generated and the output video is fine.
When I run using OpenCV-4.5.3-openvino, I get few similar errors as you, but the video is not generated at all.
Lastly, if I change the “mjpg” to capital letter and run using OpenCV-4.5.3-openvino again, the video is generated and the output video is fine.
fourcc = cv2.VideoWriter_fourcc(‘M’,’J’,’P’,’G’)
Regards,
Peh
링크가 복사됨
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Hi Davel,
Thanks for reaching out to us.
I’ve validated that the saved video by using OpenCV from OpenVINO™ (4.5.3-openvino) is working fine on Ubuntu 20.04 with Python 3.8.10.
Here is my output:
Regards,
Peh
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Interesting...i don't get those FFMPEG error messages that you have on your console - does that point to anything that would be different between our environments? I've read that some people get color mismatch with FFMPEG and OpenCV.
Im running from Rasberry Pi and i also wonder if that makes a difference...
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Hi Davel,
I would like to share my findings with you when running OpenCV on Raspberry Pi 3B.
If I run using OpenCV-4.5.2-openvino, the video is generated and the output video is fine.
When I run using OpenCV-4.5.3-openvino, I get few similar errors as you, but the video is not generated at all.
Lastly, if I change the “mjpg” to capital letter and run using OpenCV-4.5.3-openvino again, the video is generated and the output video is fine.
fourcc = cv2.VideoWriter_fourcc(‘M’,’J’,’P’,’G’)
Regards,
Peh
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Ok thanks - i'm getting the same GSStreamer errors so maybe it has to do with how i am specifying the forecc. I'll work on it but you've confirmed this isn't a bug and it has to be something about my environment or what i'm doing on my end.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Ok so i changed my fourcc to use upper case letters and for whatever reason that fixed my problem - very strange...
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Hi Davel,
Glad to know it works for you also.
Based on the tutorial for saving a video from OpenCV, the fourcc codes should be in capital letter (‘M’,’P’,’J’,’G’). But somehow smaller letter can also work in previous OpenCV version, OpenCV-4.5.2-openvino.
This thread will no longer be monitored since this issue has been resolved. If you need any additional information from Intel, please submit a new question.
Regards,
Peh
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
What version of FFMpeg is supported with openvino? Also my app is defaulting to GSStreamer back end. Could I have the wrong version of that by chance? Anything else you can think of in my envinromwnt that could cause this? On my windows I don’t have the issue…
