Skip to content

Commit

Permalink
Merge pull request #205 from gaohan085/dev
Browse files Browse the repository at this point in the history
decrease cpu usage while encode video
  • Loading branch information
gaohan085 authored Mar 26, 2024
2 parents 064a4ed + cfb5749 commit 9051c9b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion database/video-convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func (v *VideoConvert) ReadLog(chInter <-chan int, chDone <-chan int) error { //
func (v *VideoConvert) ConvertOnFFmpegServer(chInter chan<- int, chDone chan<- int) error {
v.OutputName = lib.GetFilenameWithoutExt(v.FileName) + "_cvt.mp4"
var script = fmt.Sprintf(`
ffmpeg -y -progress ffreport.log -i %s -movflags faststart -acodec copy -vcodec libx264 %s
taskset -c 0,1,2 ffmpeg -y -progress ffreport.log -i %s -movflags faststart -acodec copy -vcodec libx264 %s
`, v.PlaySource, v.OutputName)

cmd := exec.Command("bash")
Expand Down
2 changes: 1 addition & 1 deletion handlers/v2/post-progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func PostProgress(ctx *fiber.Ctx) error {
}

if err := video.Update(); err != nil {
return err
return ctx.SendStatus(fiber.StatusInternalServerError)
}

if video.Status == "done" {
Expand Down

0 comments on commit 9051c9b

Please sign in to comment.