I want to record a long video (> 30 min). The file size is custom for every device. I would like to know the approximate file size per minute recorded (min/MB) for different video qualities (low, medium, high) to choose the appropriate video quality. How can I do this without recording beforehand in different qualities?
This is the class:
CameraController(cam, ResolutionPreset.low);
2
Answers
Why not recording one video for each resolution quality during three minutes to have a average file size by minute ?
on
MediaTranscodingManager.java
there is a function to calculate default bit rate :we can use this to calculate approximated video size, based on Duration :
based on resolution_preset.dart :
here the result i get so far:
not precise, but close.
copy paste this code and run it (need some packages like video_player) :
This means that if the preset is not available, it not applies only to the lower preset, but to the high preset as well. For ex. the device not supported the
ultraHigh
preset it will select theveryHigh
preset if available., this is the wrong thing. Somehow, we must get the actual preset being used in native code. And its actual size will be very smaller than the approximated size. But since its just approximated, I guess its ok for it to be smaller.And when on low preset, its very small than approx, maybe the fps gets lower than 30 fps. While, I am not sure about the audio bit rate, i hope it helps and gives you some direction. Cheers!