如何在Flutter中使用light_compressor包设置视频的特定最小比特率?
我尝试使用 flutter 的 light_compressor 包来压缩我用手机拍摄或从 YouTube 下载的视频。
我参考下面的文章。 https://morioh.com/p/ac6f0d2c176b 本文中可以设置最小码率,默认值为2mbps。
但示例代码中只有isMinBitrateCheckEnabled标志,并没有设置具体码率的参数。
如何将视频压缩到我想要的比特率?
以下是示例代码的一部分。
import 'package:light_compressor/light_compressor.dart';
final LightCompressor _lightCompressor = LightCompressor();
final dynamic response = await _lightCompressor.compressVideo(
path: _sourcePath,
destinationPath: _destinationPath,
videoQuality: VideoQuality.medium,
isMinBitrateCheckEnabled: false,
frameRate: 24 /* or ignore it */);
I tried using flutter's light_compressor package to compress a video I shot with my phone or downloaded from YouTube.
I refer to the article below.
https://morioh.com/p/ac6f0d2c176b
In this article, the minimum bit rate can be set and the default value is 2mbps.
However, in the sample code, only the flag isMinBitrateCheckEnabled exists, and there is no parameter to set a specific bit rate.
How do I compress the video to my desired bitrate?
Below is a part of the sample code.
import 'package:light_compressor/light_compressor.dart';
final LightCompressor _lightCompressor = LightCompressor();
final dynamic response = await _lightCompressor.compressVideo(
path: _sourcePath,
destinationPath: _destinationPath,
videoQuality: VideoQuality.medium,
isMinBitrateCheckEnabled: false,
frameRate: 24 /* or ignore it */);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该函数的架构是:
您可以通过
videoBitrateInMbps
属性设置比特率。希望这对您有帮助。The schema for the function is:
You can set the bitrate through the
videoBitrateInMbps
attribute. Hope this helps you.