notube-export/lib/constants.dart

61 lines
1.9 KiB
Dart

import 'package:flutter/material.dart';
const colorBackgroundBlack = Color.fromRGBO(32, 33, 37, 1);
const colorMainWhite = Color.fromRGBO(255, 255, 255, 1);
const colorMainGrey = Color(0xFF333333);
const colorMainRed = Color.fromRGBO(204, 0, 0, 1);
const colorDarkRed = Color.fromRGBO(153, 0, 0, 1);
const colorMainBlue = Color(0xFF1f74ad);
enum Format {
mp3(
format: 'MP3',
ffmpegCmd: '-f mp3 -loglevel quiet -ab 192k -vn',
extension: 'mp3'),
mp3HD(
format: 'MP3 HD',
ffmpegCmd: '-f mp3 -loglevel quiet -ab 320k -vn',
extension: 'mp3'),
mp4(format: 'MP4'),
mp4HD(
ytCmd:
"bestvideo[height=1080][ext=mp4][vcodec~='^(avc|h264)']+bestaudio[ext=m4a]/bestvideo[height<=1080][ext=mp4]+bestaudio[ext=m4a]/bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best",
format: 'MP4 HD'),
mp42K(
ytCmd:
"bestvideo[height=1440][ext=mp4]+bestaudio[ext=m4a]/bestvideo[height<=1080][ext=mp4][vcodec~='^(avc|h264)']+bestaudio[ext=m4a]/bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best",
format: 'MP4 2K'),
tGP(
format: '3GP',
ffmpegCmd:
'-movflags frag_keyframe+empty_moov -r 20 -s 352x288 -vb 400k -acodec aac -strict experimental -ac 1 -ar 8000 -ab 24k -f 3gp',
extension: '3gp'),
flv(
format: 'FLV',
ffmpegCmd:
'-vcodec libx264 -preset slower -b 512k -bt 512k -threads 0 -s 640x360 -aspect 16:9 -acodec libmp3lame -ar 44100 -ab 32 -progress pipe:1',
extension: 'flv'),
m4a(format: 'M4A'),
;
final String ytCmd;
final String format;
final String ffmpegCmd;
final String extension;
const Format({
this.ytCmd =
'"18/22/bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best"',
this.format = 'MP4',
this.ffmpegCmd = '',
this.extension = '',
});
}
const convertedFormats = [
Format.mp3,
Format.mp3HD,
Format.tGP,
Format.flv,
];