优化ffmpeg合并输出后缀

This commit is contained in:
nilaoda 2022-08-08 23:11:10 +08:00
parent 2e6d9ec7a0
commit 707eca6a65
2 changed files with 5 additions and 1 deletions

View File

@ -356,7 +356,8 @@ namespace N_m3u8DL_RE.DownloadManager
{
var files = FileDic.Values.Select(v => v!.ActualFilePath).OrderBy(s => s).ToArray();
Logger.InfoMarkUp(ResString.ffmpegMerge);
mergeSuccess = MergeUtil.MergeByFFmpeg(DownloaderConfig.FFmpegBinaryPath!, files, Path.ChangeExtension(output, null), "mp4");
var ext = streamSpec.MediaType == MediaType.AUDIO ? "m4a" : "mp4";
mergeSuccess = MergeUtil.MergeByFFmpeg(DownloaderConfig.FFmpegBinaryPath!, files, Path.ChangeExtension(output, null), ext);
}
}

View File

@ -85,6 +85,9 @@ namespace N_m3u8DL_RE.Util
case ("FLV"):
command.Append("\" -map 0 -c copy -y " + (useAACFilter ? "-bsf:a aac_adtstoasc" : "") + " \"" + outputPath + ".flv\"");
break;
case ("M4A"):
command.Append("\" -map 0 -c copy -y " + (useAACFilter ? "-bsf:a aac_adtstoasc" : "") + " \"" + outputPath + ".m4a\"");
break;
case ("TS"):
command.Append("\" -map 0 -c copy -y -f mpegts -bsf:v h264_mp4toannexb \"" + outputPath + ".ts\"");
break;