[Bug]: Stream gear imposes simplified aspect ratios, which does not seem necessary #385
Open
3 tasks done
Labels
BUG 🐛
Vidgear api's error, flaw or fault
EXEMPLARY 🎖️
Exemplary for newcomers
WORK IN PROGRESS 🚧
currently been worked on.
Milestone
Description
When providing frames of unconventional aspect ratios, StreamGear enforces a simplified aspect ratio, Which forces ffmpeg to use non-square pixels, and distorts the output video.
Issue Checklist
Expected behaviour
I expect StreamGear to faithfully stream my frames in any resolution they may come in, without distorting them.
Actual behaviour
As in title and description, my stream is getting distorted, while my application requires outputs to be perfectly aligned.
Steps to reproduce
You may reproduce a distorted steam and its reference image featuring a checkerboard pattern using the script in the "Python Code" section. The input 19:20 aspect ratio gets "rounded" to 9:10, which forces a non-square pixel ratio of
SAR 18:19
.It may be difficult to see the 5% image skew on the resulting video alone with the naked eye, but you can try to align the output image on top of the video to see the width and height cannot both be matched.
Here is "checkerboard.png" and a snapshot of "checkerboard.m3u8" for reference (they mismatch in height):
Terminal log output
Python Code(Optional)
VidGear Version
0.3.2
Python version
Python 3.9.18
OpenCV version
4.8.1
Operating System version
Microsoft Windows 10 Home, Version 10.0.19045 Build 19045
Any other Relevant Information?
I am fairly certain the issue is with these lines (in the current master branch):
vidgear/vidgear/gears/streamgear.py
Lines 427 to 430 in be6f3f0
Specifically,
.limit_denominator(10)
. Is that strictly necessary? I wonder if one of these fixed could be applied:.limit_denominator(10)
altogetherThe text was updated successfully, but these errors were encountered: