-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
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
FFmpegWriter loses SAR (sample aspect ratio) on output videos #489
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I prefer to use square pixels and never looked into the non-square ones. Maybe you are right. |
I can confirm SAR is not maintained. I have been resampling each frame to square pixels and changing the resolution of the videos to accommodate in my software. |
Just to say that I would also really appreciate a fix for this as I am coming across the same issue when processing some miniDV footage. I do love this software overall, thanks all for your work. |
Thank you so much for submitting an issue to help improve OpenShot Video Editor. We are sorry about this, but this particular issue has gone unnoticed for quite some time. To help keep the OpenShot GitHub Issue Tracker organized and focused, we must ensure that every issue is correctly labelled and triaged, to get the proper attention. This issue will be closed, as it meets the following criteria:
We'd like to ask you to help us out and determine whether this issue should be reopened.
Thanks again for your help! |
While looking into OpenShot/openshot-qt#3329 some, I decided to export the test video I had set up with the "NTSC 23.98 fps" profile, which is the one with this definition:
However, when I exported the video, I was surprised to discover that despite the Aspect Ratio being set to 4:3 and the Pixel Ratio being set to 8:9 (confirmed on the Advanced / Profile tab), the resulting video detected differently in both VLC and MediaInfo:
Looking through the code, I noticed that while the
pixel_ratio
Fraction is passed in toSetVideoOptions()
, after that:It's stored in
info.pixel_ratio
(as.num
and.den
)libopenshot/src/FFmpegWriter.cpp
Lines 248 to 254 in 166f693
It's used to compute
info.display_ratio
from thewidth
andheight
:libopenshot/src/FFmpegWriter.cpp
Lines 264 to 272 in 166f693
...And then it's never used again. Nor is
display_ratio
! Neither of them are ever even accessed. Neither one is supplied to any FFmpeg context. In fact, other than setting theAVCodecContext
width
andheight
:libopenshot/src/FFmpegWriter.cpp
Lines 1207 to 1210 in 166f693
...there's nothing further in the code that sets the output sizing or attempts to define the
sample_aspect_ratio
of any of the output contexts.Meanwhile, if I rip DVD content from a 4:3 NTSC DVD, the results are different:
As a result, when I play the
VTS.avi
file in VLC, it automatically formats itself to 4:3 aspect — switching from "Default" to "4:3" has no discernible effect. However, if I play thataspect.mp4
test export from OpenShot, switching to "4:3" does change the size, because the "Default" presentation is not correctly sized due to the false 1:1 pixel ratio.Don't we need to be using the
info.pixel_ratio
to setsample_aspect_ratio
on the output context, when writing videos with non-uniform pixel ratios?cc: @jonoomph @eisneinechse @SuslikV
The text was updated successfully, but these errors were encountered: