We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
platform: maxOS version 10.13.4 (17E202) opencv_version 3.4.1
I come cross error "Slice parameters 0, 720 are invalid" when I run this file. the reason is following code which set camera frame size don't work.
cam.set(cv::CAP_PROP_FRAME_WIDTH, width); cam.set(cv::CAP_PROP_FRAME_HEIGHT, height);
you can debug code to find camera property CAP_PROP_FRAME_WIDTH and CAP_PROP_FRAME_HEIGHT, in my case, both of them are 1280, not 800 or 600.
the solution is to add cv::resize(image, image, cv::Size(width, height)); to stream_video function
cv::resize(image, image, cv::Size(width, height));
stream_video
do { cam >> image; cv::resize(image, image, cv::Size(width, height)); const int stride[] = {static_cast<int>(image.step[0])}; sws_scale(swsctx, &image.data, stride, 0, image.rows, frame->data, frame->linesize); frame->pts += av_rescale_q(1, out_codec_ctx->time_base, out_stream->time_base); write_frame(out_codec_ctx, ofmt_ctx, frame); } while (!end_of_stream);
The text was updated successfully, but these errors were encountered:
same problem open VID_20160502_162358.mp4 success! ret=0 [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid [swscaler @ 0x1582d00] Slice parameters 0, 720 are invalid
Sorry, something went wrong.
No branches or pull requests
platform:
maxOS version 10.13.4 (17E202)
opencv_version 3.4.1
I come cross error "Slice parameters 0, 720 are invalid" when I run this file. the reason is following code which set camera frame size don't work.
you can debug code to find camera property CAP_PROP_FRAME_WIDTH and CAP_PROP_FRAME_HEIGHT, in my case, both of them are 1280, not 800 or 600.
the solution is to add
cv::resize(image, image, cv::Size(width, height));
tostream_video
functionThe text was updated successfully, but these errors were encountered: