0 purchases
dart libass
File subtitle = File('./test/1.ass');
File subtitle2 = File('./test/2.ass');
File defaultFont = File('./test/Montserrat-Bold.ttf');
DartLibass dartLibass = DartLibass(
subtitle: subtitle,
defaultFont: defaultFont,
defaultFamily: 'Montserrat-Bold',
width: 1920,
height: 1080,
fonts: [defaultFont],
);
await dartLibass.init();
dartLibass.setTrack(subtitle2);
Image img = await dartLibass.getFrame(25001);
dartLibass.dispose();
ByteData? pngBytes = await img.toByteData(format: ImageByteFormat.png);
File('test.png').writeAsBytesSync(
pngBytes!.buffer.asUint8List(
pngBytes.offsetInBytes,
pngBytes.lengthInBytes,
),
);
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.