fixed audio stream mapping

This commit is contained in:
mertalev 2023-09-02 14:35:56 -04:00
parent 19fb0fc345
commit fccca4759e
No known key found for this signature in database
GPG key ID: 9181CD92C0A1C5E3
3 changed files with 74 additions and 74 deletions

View file

@ -315,8 +315,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf format=yuv420p',
'-preset ultrafast',
@ -356,8 +356,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf format=yuv420p',
'-preset ultrafast',
@ -382,8 +382,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf scale=-2:720,format=yuv420p',
'-preset ultrafast',
@ -411,8 +411,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf format=yuv420p',
'-preset ultrafast',
@ -438,8 +438,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf scale=720:-2,format=yuv420p',
'-preset ultrafast',
@ -465,8 +465,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf scale=-2:720,format=yuv420p',
'-preset ultrafast',
@ -492,8 +492,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf scale=-2:720,format=yuv420p',
'-preset ultrafast',
@ -543,8 +543,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf scale=-2:720,format=yuv420p',
'-preset ultrafast',
@ -575,8 +575,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf scale=-2:720,format=yuv420p',
'-preset ultrafast',
@ -604,8 +604,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf scale=-2:720,format=yuv420p',
'-preset ultrafast',
@ -635,8 +635,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf scale=-2:720,format=yuv420p',
'-cpu-used 5',
@ -668,8 +668,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf scale=-2:720,format=yuv420p',
'-cpu-used 2',
@ -700,8 +700,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf scale=-2:720,format=yuv420p',
'-row-mt 1',
@ -731,8 +731,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf scale=-2:720,format=yuv420p',
'-cpu-used 5',
@ -761,8 +761,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf scale=-2:720,format=yuv420p',
'-preset ultrafast',
@ -791,8 +791,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf scale=-2:720,format=yuv420p',
'-preset ultrafast',
@ -821,8 +821,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf scale=-2:720,format=yuv420p',
'-preset ultrafast',
@ -854,8 +854,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf scale=-2:720,format=yuv420p',
'-preset ultrafast',
@ -925,8 +925,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf format=nv12,hwupload_cuda,scale_cuda=-2:720',
'-preset p1',
@ -967,8 +967,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf format=nv12,hwupload_cuda,scale_cuda=-2:720',
'-preset p1',
@ -1005,8 +1005,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf format=nv12,hwupload_cuda,scale_cuda=-2:720',
'-preset p1',
@ -1044,8 +1044,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf format=nv12,hwupload_cuda,scale_cuda=-2:720',
'-cq:v 23',
@ -1079,8 +1079,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf format=nv12,hwupload_cuda,scale_cuda=-2:720',
'-preset p1',
@ -1114,8 +1114,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf format=nv12,hwupload=extra_hw_frames=64,scale_qsv=-1:720',
'-preset 7',
@ -1151,8 +1151,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf format=nv12,hwupload=extra_hw_frames=64,scale_qsv=-1:720',
'-global_quality 23',
@ -1185,8 +1185,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-low_power 1',
'-v verbose',
'-vf format=nv12,hwupload=extra_hw_frames=64,scale_qsv=-1:720',
@ -1226,8 +1226,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf format=nv12,hwupload,scale_vaapi=-2:720',
'-compression_level 7',
@ -1257,8 +1257,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf format=nv12,hwupload,scale_vaapi=-2:720',
'-compression_level 7',
@ -1290,8 +1290,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf format=nv12,hwupload,scale_vaapi=-2:720',
'-qp 23',
@ -1319,8 +1319,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf format=nv12,hwupload,scale_vaapi=-2:720',
'-compression_level 7',
@ -1344,8 +1344,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf format=nv12,hwupload,scale_vaapi=-2:720',
'-compression_level 7',
@ -1376,8 +1376,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf scale=-2:720,format=yuv420p',
'-preset ultrafast',
@ -1413,8 +1413,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf zscale=t=linear:npl=100,tonemap=hable:desat=0,zscale=p=bt709:t=bt709:m=bt709:range=pc,format=yuv420p',
'-preset ultrafast',
@ -1440,8 +1440,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf zscale=t=linear:npl=100,tonemap=hable:desat=0,zscale=p=bt709:t=bt709:m=bt709:range=pc,format=yuv420p',
'-preset ultrafast',
@ -1467,8 +1467,8 @@ describe(MediaService.name, () => {
'-c:a aac',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:v:0',
'-map 0:a:0',
'-map 0:0',
'-map 0:1',
'-v verbose',
'-vf zscale=t=linear:npl=250,tonemap=mobius:desat=0,zscale=p=bt709:t=bt709:m=bt709:range=pc,format=yuv420p',
'-preset ultrafast',

View file

@ -41,10 +41,10 @@ class BaseConfig implements VideoCodecSWConfig {
'-movflags faststart',
'-fps_mode passthrough',
// explicitly selects the video stream instead of leaving it up to FFmpeg
`-map 0:v:${videoStream.index}`,
`-map 0:${videoStream.index}`,
];
if (audioStream) {
options.push(`-map 0:a:${audioStream.index}`);
options.push(`-map 0:${audioStream.index}`);
}
return options;
}

View file

@ -20,7 +20,7 @@ const probeStubDefaultVideoStream: VideoStreamInfo[] = [
];
const probeStubDefaultAudioStream: AudioStreamInfo[] = [
{ index: 0, codecName: 'aac', codecType: 'audio', frameCount: 100 },
{ index: 1, codecName: 'aac', codecType: 'audio', frameCount: 100 },
];
const probeStubDefault: VideoInfo = {
@ -119,7 +119,7 @@ export const probeStub = {
}),
audioStreamMp3: Object.freeze<VideoInfo>({
...probeStubDefault,
audioStreams: [{ index: 0, codecType: 'audio', codecName: 'aac', frameCount: 100 }],
audioStreams: [{ index: 1, codecType: 'audio', codecName: 'aac', frameCount: 100 }],
}),
matroskaContainer: Object.freeze<VideoInfo>({
...probeStubDefault,