Corrected onCopy Hevc stream

This commit is contained in:
Brage 2024-01-16 00:15:19 +01:00
parent 0283739e19
commit 0cc161e612

View File

@ -135,7 +135,13 @@ class EncodeArgumentCreatorTask(@Autowired override var coordinator: Coordinator
if (preference.pixelFormatPassthrough.none { it == videoStream.pix_fmt }) { if (preference.pixelFormatPassthrough.none { it == videoStream.pix_fmt }) {
optionalParams.addAll(listOf("-pix_fmt", preference.pixelFormat)) optionalParams.addAll(listOf("-pix_fmt", preference.pixelFormat))
} }
val codecParams = if (isVideoCodecEqual()) listOf("-vcodec", "copy") val codecParams = if (isVideoCodecEqual()) {
val default = mutableListOf("-c:v", "copy")
if (getCodec(videoStream.codec_name) == "libx265") {
default.addAll(listOf("-vbsf", "hevc_mp4toannexb"))
}
default
}
else { else {
optionalParams.addAll(listOf("-crf", preference.threshold.toString())) optionalParams.addAll(listOf("-crf", preference.threshold.toString()))
listOf("-c:v", getCodec(preference.codec.lowercase())) listOf("-c:v", getCodec(preference.codec.lowercase()))