Skip to content

Issue with saving to video with the opencv patch #14

Description

@zhumxcq

Applying the opencv changes will cause the following code to fail

std::cout << cv::getBuildInformation() << std::endl;
cv::VideoWriter test_writer;
int fourcc = cv::VideoWriter::fourcc('F', 'F', 'V', '1');  // FFV1 codec (requires FFmpeg build)
test_writer.open("test_video.avi", fourcc, 30, cv::Size(640, 480), true);
cv::Mat frame_in = cv::Mat(480, 640, CV_8UC3);
frame_in = cv::Scalar(255, 122, 0);
test_writer.write(frame_in);
test_writer.write(frame_in);
test_writer.write(frame_in);
test_writer.write(frame_in);
test_writer.write(frame_in);
test_writer.release();

cv::VideoCapture test_reader("test_video.avi");
cv::Mat frame_out;
test_reader >> frame_out;
for (int i = 0; i < 7; ++i) {
	std::cout << "Pixel value row " << i << ": " << frame_out.at<cv::Vec3b>(i, 0) << std::endl;
}

Expected output -> OpenCV 3.4.5 without patch applied
Pixel value row 0: [255, 122, 0]
Pixel value row 1: [255, 122, 0]
Pixel value row 2: [255, 122, 0]
Pixel value row 3: [255, 122, 0]
Pixel value row 4: [255, 122, 0]
Pixel value row 5: [255, 122, 0]
Pixel value row 6: [255, 122, 0]

Actual output -> With eCON system patch applied
Pixel value row 0: [255, 122, 0]
Pixel value row 1: [122, 0, 255]
Pixel value row 2: [0, 255, 122]
Pixel value row 3: [255, 122, 0]
Pixel value row 4: [122, 0, 255]
Pixel value row 5: [0, 255, 122]
Pixel value row 6: [255, 122, 0]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions