2
0
Fork 0
mirror of https://git.asonix.dog/asonix/pict-rs synced 2024-12-22 11:21:24 +00:00

Enable copying input av1 stream from mp4 to webm

This commit is contained in:
asonix 2023-08-30 20:40:08 -05:00
parent b48a9233b2
commit 92ee60549f

View file

@ -276,7 +276,10 @@ impl InputVideoFormat {
transcode_audio,
}
}
Self::Mp4 { audio_codec, .. } => {
Self::Mp4 {
video_codec,
audio_codec,
} => {
let (audio_codec, transcode_audio) = webm_audio(
allow_audio,
audio_codec.is_some(),
@ -289,7 +292,7 @@ impl InputVideoFormat {
video_codec: WebmCodec::Av1,
audio_codec,
},
transcode_video: true,
transcode_video: !video_codec.is_av1(),
transcode_audio,
}
}
@ -450,6 +453,10 @@ impl OutputVideoFormat {
}
impl Mp4Codec {
const fn is_av1(self) -> bool {
matches!(self, Self::Av1)
}
const fn const_eq(self, rhs: Self) -> bool {
match (self, rhs) {
(Self::Av1, Self::Av1) | (Self::H264, Self::H264) | (Self::H265, Self::H265) => true,