Open hamzasidd3634 opened 1 year ago
this issue should have top priority, basically undercuts the whole point of the package
Our team is working on it and will get the best update. Stay tuned....💪
Since March No breakthrough yet on the video Quality issue?
I found a solution.
Created my own watermark class that extends watermark, and i modified the toCommand fuction by adding bitrate command. You can add your own commands. FFMEG documentation
class QualityWatermark extends Watermark {
final String bitrate;
QualityWatermark({
required super.image,
required super.watermarkAlignment,
required super.watermarkSize,
required this.bitrate,
});
@override
Future<String> toCommand() async {
final command = await super.toCommand();
return "$command -b:v $bitrate";
}
}
and use it at VideoWatermark class.
VideoWatermark(
sourceVideoPath: videoFile.path,
watermark: QualityWatermark(
image: WatermarkSource.file(watermarkFile.path),
watermarkAlignment: WatermarkAlignment.topLeft,
watermarkSize: WatermarkSize(
size?.width ?? -1,
size?.height ?? -1,
),
bitrate: '1M',
),
outputFormat: OutputFormat.mp4,
onSave: (path) => completer.complete(path),
);
I am lazy to create enum values for bitrate field. 😄
By this method, you can inject additional commands.
I found a solution.
Created my own watermark class that extends watermark, and i modified the toCommand fuction by adding bitrate command. You can add your own commands. FFMEG documentation
class QualityWatermark extends Watermark { final String bitrate; QualityWatermark({ required super.image, required super.watermarkAlignment, required super.watermarkSize, required this.bitrate, }); @override Future<String> toCommand() async { final command = await super.toCommand(); return "$command -b:v $bitrate"; } }
and use it at VideoWatermark class.
VideoWatermark( sourceVideoPath: videoFile.path, watermark: QualityWatermark( image: WatermarkSource.file(watermarkFile.path), watermarkAlignment: WatermarkAlignment.topLeft, watermarkSize: WatermarkSize( size?.width ?? -1, size?.height ?? -1, ), bitrate: '1M', ), outputFormat: OutputFormat.mp4, onSave: (path) => completer.complete(path), );
I am lazy to create enum values for bitrate field. 😄
By this method, you can inject additional commands.
its work for me too. you should create PR for this issue dude @emreaktrk . thanks anyway.
btw its 1 year+ since @SuganDevp reply working on this issue 🤣
Video quality is compromising after adding watermark please fix this issue