Skip to content
Discussion options

You must be logged in to vote

The error you're encountering is related to OpenCV's color conversion requirements. The error sz.width % 2 == 0 && sz.height % 3 == 0 indicates that your cropped dimensions (687x1181) don't meet OpenCV's requirements for YUV420 to BGR conversion (1).

For proper cropping with go2rtc, you can use FFmpeg parameters in your stream configuration. The documentation shows how to re-encode video using FFmpeg parameters, which supports rotating and resizing video feeds (1).

Here's the correct approach for cropping streams:

go2rtc:
  streams:
    stream4K:
      - rtsp://user:[email protected]:554/Streaming/channels/101
    cropped:
      - "ffmpeg:stream4K#video=h264#raw=-vf crop=687:1181:3157:350#ha…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lukp-ke
Comment options

Answer selected by lukp-ke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment