Skip to content
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

FPS is not accurate #3138

Closed
ashmetry opened this issue Dec 23, 2019 · 16 comments
Closed

FPS is not accurate #3138

ashmetry opened this issue Dec 23, 2019 · 16 comments
Labels
🐞 bug A bug, error, or breakage of any kind

Comments

@ashmetry
Copy link

ashmetry commented Dec 23, 2019

FPS is not accurate. Selecting for example 30 fps will generate 30.xx in the final video. This causes problems with services only accepting videos with specific FPS quality.

Steps to reproduce the behavior:
Steps I took:

  1. Download a sample video: I used this: https://www.sample-videos.com/video123/mp4/720/big_buck_bunny_720p_1mb.mp4
  2. Dragged the video to the timeline.
  3. Export Video (these are the settings I used: https://a.cl.ly/E0uE4pkb)
  4. The final video is 30.19 f/s see https://a.cl.ly/KouelXPP when it should be 30

Expected behavior:
A clear and concise description of what you expected to happen.

System Details:

  • OpenShot Version 2.4.4
  • Operating System / Distro: Windows 10
@ashmetry ashmetry added the 🐞 bug A bug, error, or breakage of any kind label Dec 23, 2019
@SuslikV
Copy link
Contributor

SuslikV commented Dec 23, 2019

Transcoding only or some heavy editing?

@ashmetry
Copy link
Author

ashmetry commented Dec 23, 2019

No editing whatsoever. Here are the steps I took:

1.Download a sample video: I used this: https://www.sample-videos.com/video123/mp4/720/big_buck_bunny_720p_1mb.mp4
2. Dragged the video to the timeline.
3. Export Video (these are the settings I used: https://a.cl.ly/E0uE4pkb)
4. The final video is 30.19 f/s see https://a.cl.ly/KouelXPP

@SuslikV
Copy link
Contributor

SuslikV commented Dec 23, 2019

Cannot reproduce this with the one of the latest Daily Builds ( https://www.openshot.org/download/ ). Can you give it a try?

@ashmetry
Copy link
Author

ashmetry commented Dec 23, 2019 via email

@SuslikV
Copy link
Contributor

SuslikV commented Dec 23, 2019

Can you share the exported file as well?

@ashmetry
Copy link
Author

You can find both files here: https://a.cl.ly/jkune79q

@SuslikV
Copy link
Contributor

SuslikV commented Dec 23, 2019

The file has constant FPS. Deltas is 159 samples of 512 deltas + last one at 0 delta for video, and 249 samples of 1024 deltas for audio - thus only two constant values but the last sample. No other variations is present. I not quite sure how Windows properties calculates the fps field for now. But the samples are OK in terms of constant fps and the last ISO I have seen for MP4 format. Am I wrong?

Some info.
output:
video
track timescale = 15360
track duration = 81408
thus track's duration is 5.3 sec

audio
track timescale = 48000
track duration = 254976
thus track's duration is 5.312 sec (the longest track = the length of the movie)

It looks like current version of the Windows simply takes the length of the video track (5.3 sec) and total number of the video samples (160) to calculate the FPS.

@ashmetry

  1. Is this causes any real difficulties when you importing the file to some service?
  2. Just for the experiment, can you say what corresponding Windows field says about the next file sample? - it was created using other software (OBS Studio),
    1280x720_444_709_tv_10sec_10sec.zip
  3. What build of the OpenShot you actually used for the posted exported file (in the .zip)? It has no faststart swap of the indexes tables for mp4. Did you made some changes to the source of the OpenShot or just posted the output file from the old setup? (it has nothing to do with the issue itself but I'm just wondering why it is not working for you)

@ashmetry
Copy link
Author

ashmetry commented Dec 24, 2019 via email

@SuslikV
Copy link
Contributor

SuslikV commented Dec 24, 2019

@ashmetry the technical info is not for you personally. I just using the site to inform other developers who may find something new.

@ashmetry Anyway, can you give the answer to other two questions as well?

From my point of view if there is problem then it is only in the last encoded video sample created by libopenshot lib. The posted Untitled Project-converted.mp4 has 1 sample of 2999 delta + 153 samples of 3000 delta for video, and 236 samples of 1023, 1024, 1025 deltas for audio (all values cycled in row and each lasts for 1 sample):

video
track timescale = 90000
track duration = 461999
thus track's duration is 5.13332(2) sec (the longest track = the length of the movie)

audio
track timescale = 48000
track duration = 241663
thus track's duration is 5.03464583(3) sec

Thus the 5.13332(2) sec / 154 (total video samples) possibly truncated to 0.03333 ms of about 30 fps.

The deviations in video fps is small in both cases. The standard I mentioned earlier is ISO/IEC 14496-12 edition 2015. There was info:

The time to sample boxes must give non‐zero durations for all samples with the possible exception of the last one. Durations in the stts box are strictly positive (non‐zero), except for the very last entry, which may be zero. This rule derives from the rule that no two time‐stamps in a stream may be the same. Great care must be taken when adding samples to a stream, that the sample that was previously last may need to have a non‐zero duration established, in order to observe this rule. If the duration of the last sample is indeterminate, use an arbitrary small value and a dwell edit.

That means that the Untitled Project-converted.mp4 (that has the first sample aside of the others by the 1/90000 sec) is actually not constant fps and the file mentioned in the issue is actually comply to the mp4 rules. Is it has variable frame rate? In my opinion - No.

Is the mentioned Amazon service is free? (to test with)

@ashmetry
Copy link
Author

ashmetry commented Dec 24, 2019 via email

@SuslikV
Copy link
Contributor

SuslikV commented Dec 24, 2019

Hope, Windows will change it back to the Win7 result - where it shows no variable fps for this file.

Still waiting for the answer on the two other questions.

@ferdnyc
Copy link
Contributor

ferdnyc commented Jan 21, 2020

@SuslikV

What build of the OpenShot you actually used for the posted exported file (in the .zip)? It has no faststart swap of the indexes tables for mp4.

The OP says OpenShot 2.4.4, I assume that means 2.4.4 release. Didn't faststart go in after the release?

@SuslikV
Copy link
Contributor

SuslikV commented Jan 22, 2020

@ferdnyc Release version? It always in few steps off of the daily build. Maybe you are right. I totally forgot about the release version.

@jonoomph
Copy link
Member

This is fixed in the daily build I believe. Closing issue for now.

@cohlar
Copy link

cohlar commented Jun 23, 2021

@jonoomph I still experience the same issue on version 2.5.1. As a result I am unable to upload the video to Amazon.

@JacksonRG
Copy link
Collaborator

@cohlar were you using a daily build?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug A bug, error, or breakage of any kind
Projects
None yet
Development

No branches or pull requests

6 participants