-
-
Notifications
You must be signed in to change notification settings - Fork 781
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
Wrong FPS when recording MP4 to local storage #1668
Comments
Hello, Try this gradle: implementation 'com.github.pedroSG94.RootEncoder:library:ec02c81361' This is the last commit in master and should fix your problem. I have plan to upload a release after receive a confirmation of a fix. |
So, after using the above commit, when my app calls
Which i was never getting before. Before calling
You can ignore the |
Hello, I think that the problem is that you are receiving an error in prepareVideo here:
The reason is because I added sanity checks in the parameters, Now set fps to 0 is not a valid value. You should set a valid value, the equivalent to previous versions is 30fps |
That seems to have been it! I had used that as a quick hack since that object only sometimes needs video, but mostly is audio-only. Not a huge deal to set it to 1 fps. Thanks for the help! FPS and TBR values reported by ffprobe are now consistent with what values i set again. |
Closing as solved. You can open other issue if you need it. |
Describe the bug
After upgrading from v2.4.8 to v.2.5.0 (and also v2.5.4), video's recorded (with audio) on our devices use the incorrect FPS value.
To Reproduce
Steps to reproduce the behavior:
ffprobe -i
on final video to get average fps and tbrExpected behavior
That fps from ffprobe reflects the fps set on the device when calling 'prepareVideo'
Smartphone (please complete the following information):
Additional context
We passed
prepareVideo
a value of 15 fps, which has always worked for us. It results in a video which has ~15 fps and ~15 tbr when runningffprobe -i
on the resulting mp4 file. An example output from this ffprobe command from a video recorded with version 2.4.8 is:Stream #0:0[0x1](eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt470bg/bt470bg/smpte170m, progressive), 720x720, 558 kb/s, **14.97 fps, 14.92 tbr**, 90k tbn (default)
Which we can see has a resolution of 720x720, with 14.97 fps and 14.92 tbr. All of this is correct.
After upgrading the library version to 2.5.4 (and later downgrading to 2.5.0), videos now have ~30 fps and ~30 tbr, despite setting the fps to 15 in
prepareVideo
. An example output on a video recorded with this version of the library would be:Stream #0:0[0x1](eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt470bg/bt470bg/smpte170m, progressive), 720x720, 558 kb/s, **29.89 fps, 29.93 tbr,** 90k tbn (default)
Which looks correct, except the video SHOULD be 15 fps, not 30. This has an impact on the battery life for the devices and deployment we have.
All tests and code uses the GenericStream from StreamBase, a Camera2Source with preview stopped and Microphone source.
The text was updated successfully, but these errors were encountered: