Fix bitrate value used for video transcoding (#5183)

* Fix bitrate value used for video transcoding:

It should be 1000 times what it is now. The video size estimation was wrong since the retrieved duration value was in milliseconds, not seconds.

* Use `Duration` as the result type for `getDuration`
This commit is contained in:
Jorge Martin Espinosa
2025-08-18 23:12:11 +02:00
committed by GitHub
parent aac9642159
commit 5feb7a99a9
5 changed files with 15 additions and 8 deletions

View File

@@ -38,7 +38,7 @@ class VideoCompressorHelper(
val pixelsPerFrame = outputSize.width * outputSize.height
// Apparently, 0.1 bits per pixel is a sweet spot for video compression
val bitsPerPixel = 0.1f
return (pixelsPerFrame * bitsPerPixel * frameRate).toLong() / 1000
return (pixelsPerFrame * bitsPerPixel * frameRate).toLong()
}
}