use super::{AudioEncoderConfig, ExportPreset, VideoEncoderConfig};
use crate::{AudioCodec, BitrateMode, VideoCodec};
pub(super) fn youtube_1080p() -> ExportPreset {
ExportPreset {
name: "youtube_1080p".to_string(),
video: Some(VideoEncoderConfig {
codec: VideoCodec::H264,
width: Some(1920),
height: Some(1080),
fps: Some(30.0),
bitrate_mode: BitrateMode::Crf(18),
pixel_format: None,
codec_options: None,
}),
audio: AudioEncoderConfig {
codec: AudioCodec::Aac,
sample_rate: 48000,
channels: 2,
bitrate: 192_000,
},
}
}
pub(super) fn youtube_4k() -> ExportPreset {
ExportPreset {
name: "youtube_4k".to_string(),
video: Some(VideoEncoderConfig {
codec: VideoCodec::H265,
width: Some(3840),
height: Some(2160),
fps: Some(30.0),
bitrate_mode: BitrateMode::Crf(20),
pixel_format: None,
codec_options: None,
}),
audio: AudioEncoderConfig {
codec: AudioCodec::Aac,
sample_rate: 48000,
channels: 2,
bitrate: 256_000,
},
}
}
pub(super) fn twitter() -> ExportPreset {
ExportPreset {
name: "twitter".to_string(),
video: Some(VideoEncoderConfig {
codec: VideoCodec::H264,
width: Some(1280),
height: Some(720),
fps: Some(30.0),
bitrate_mode: BitrateMode::Crf(23),
pixel_format: None,
codec_options: None,
}),
audio: AudioEncoderConfig {
codec: AudioCodec::Aac,
sample_rate: 48000,
channels: 2,
bitrate: 128_000,
},
}
}
pub(super) fn instagram_square() -> ExportPreset {
ExportPreset {
name: "instagram_square".to_string(),
video: Some(VideoEncoderConfig {
codec: VideoCodec::H264,
width: Some(1080),
height: Some(1080),
fps: Some(30.0),
bitrate_mode: BitrateMode::Crf(23),
pixel_format: None,
codec_options: None,
}),
audio: AudioEncoderConfig {
codec: AudioCodec::Aac,
sample_rate: 48000,
channels: 2,
bitrate: 128_000,
},
}
}
pub(super) fn instagram_reels() -> ExportPreset {
ExportPreset {
name: "instagram_reels".to_string(),
video: Some(VideoEncoderConfig {
codec: VideoCodec::H264,
width: Some(1080),
height: Some(1920),
fps: Some(30.0),
bitrate_mode: BitrateMode::Crf(23),
pixel_format: None,
codec_options: None,
}),
audio: AudioEncoderConfig {
codec: AudioCodec::Aac,
sample_rate: 48000,
channels: 2,
bitrate: 128_000,
},
}
}
pub(super) fn bluray_1080p() -> ExportPreset {
ExportPreset {
name: "bluray_1080p".to_string(),
video: Some(VideoEncoderConfig {
codec: VideoCodec::H264,
width: Some(1920),
height: Some(1080),
fps: Some(24.0),
bitrate_mode: BitrateMode::Crf(18),
pixel_format: None,
codec_options: None,
}),
audio: AudioEncoderConfig {
codec: AudioCodec::Ac3,
sample_rate: 48000,
channels: 2,
bitrate: 384_000,
},
}
}
pub(super) fn podcast_mono() -> ExportPreset {
ExportPreset {
name: "podcast_mono".to_string(),
video: None,
audio: AudioEncoderConfig {
codec: AudioCodec::Aac,
sample_rate: 48000,
channels: 1,
bitrate: 128_000,
},
}
}
pub(super) fn lossless_rgb() -> ExportPreset {
ExportPreset {
name: "lossless_rgb".to_string(),
video: Some(VideoEncoderConfig {
codec: VideoCodec::Ffv1,
width: None,
height: None,
fps: None,
bitrate_mode: BitrateMode::Crf(0),
pixel_format: None,
codec_options: None,
}),
audio: AudioEncoderConfig {
codec: AudioCodec::Flac,
sample_rate: 48000,
channels: 2,
bitrate: 0,
},
}
}
pub(super) fn web_h264() -> ExportPreset {
ExportPreset {
name: "web_h264".to_string(),
video: Some(VideoEncoderConfig {
codec: VideoCodec::Vp9,
width: Some(1280),
height: Some(720),
fps: Some(30.0),
bitrate_mode: BitrateMode::Crf(33),
pixel_format: None,
codec_options: None,
}),
audio: AudioEncoderConfig {
codec: AudioCodec::Opus,
sample_rate: 48000,
channels: 2,
bitrate: 128_000,
},
}
}