Skip to content

Commit dfb0a5c

Browse files
committed
losslessly convert pcm_bluray to pcm_s24le
for non-mpegts output formats fixes #476 fixes #895
1 parent 3f91f70 commit dfb0a5c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/util/streams.js

+9
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,15 @@ function getPerStreamQuirksFlags({ stream, outputIndex, outFormat, manuallyCopyD
132132
}
133133
}
134134

135+
// pcm_bluray should only ever be put in Blu-ray-style m2ts files, Matroska has no format mapping for it anyway.
136+
// Use normal PCM (ie. pcm_s16le or pcm_s24le depending on bitdepth).
137+
// https://forum.doom9.org/showthread.php?t=174718
138+
// https://github.com/mifi/lossless-cut/issues/476
139+
// ffmpeg cannot encode pcm_bluray
140+
if (outFormat !== 'mpegts' && stream.codec_type === 'audio' && stream.codec_name === 'pcm_bluray') {
141+
args = [...args, `-c:${outputIndex}`, 'pcm_s24le'];
142+
}
143+
135144
// when concat'ing, disposition doesn't seem to get automatically transferred by ffmpeg, so we must do it manually
136145
if (manuallyCopyDisposition && stream.disposition != null) {
137146
const activeDisposition = getActiveDisposition(stream.disposition);

0 commit comments

Comments
 (0)