Skip to content

Commit

Permalink
h265方法不设置音频转码
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyiming748 committed Aug 13, 2024
1 parent 31288de commit ffa9200
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions conv/h265.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ func ProcessVideo2H265(in mediainfo.BasicInfo) {
out := strings.Join([]string{in.PurgePath, string(os.PathSeparator), middle, string(os.PathSeparator), dstPurgeName, ".mp4"}, "")
mp4 := strings.Replace(out, in.PurgeExt, "mp4", -1)

cmd := exec.Command("ffmpeg", "-i", in.FullPath, "-c:v", "libx265", "-tag:v", "hvc1", "-c:a", "libopus", "-ac", "1", "-map_chapters", "-1", mp4)
cmd := exec.Command("ffmpeg", "-i", in.FullPath, "-c:v", "libx265", "-tag:v", "hvc1", "-c:a", "copy", "-ac", "1", "-map_chapters", "-1", mp4)
if runtime.GOOS == "linux" && runtime.GOARCH == "arm64" {
cmd = exec.Command("ffmpeg", "-i", in.FullPath, "-threads", "1", "-c:v", "libx265", "-tag:v", "hvc1", "-c:a", "libopus", "-ac", "1", "-map_chapters", "-1", "-threads", "1", mp4)
cmd = exec.Command("ffmpeg", "-i", in.FullPath, "-threads", "1", "-c:v", "libx265", "-tag:v", "hvc1", "-c:a", "copy", "-ac", "1", "-map_chapters", "-1", "-threads", "1", mp4)
}
if width > 1920 && height > 1920 {
log.Printf("视频大于1080P需要使用其他程序先处理视频尺寸:%v\n", in)
Expand Down

0 comments on commit ffa9200

Please sign in to comment.