-
Notifications
You must be signed in to change notification settings - Fork 1
ffmpeg with nice/ionice #1192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
ffmpeg with nice/ionice #1192
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #!/bin/bash -ex | ||
| # Run ffmpeg with low CPU (nice) and IO (ionice) priority | ||
| # so it doesn't interfere with other processes too much | ||
| nice -n19 ionice -c2 -n7 ffmpeg "$@" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ func MuxTStoMP4(tsInputFile, mp4OutputFile string) ([]string, error) { | |
| // transmux the .ts file into a standalone MP4 file | ||
| ffmpegErr := bytes.Buffer{} | ||
| err := ffmpeg.Input(tsInputFile). | ||
| SetFfmpegPath("/path/to/ffmpeg-nice.sh"). | ||
| Output(mp4OutputFile, ffmpeg.KwArgs{ | ||
| "analyzeduration": "15M", // Analyze up to 15s of video to figure out the format. We saw failures to detect the video codec without this | ||
| "movflags": "faststart", // Need this for progressive playback and probing | ||
|
|
@@ -81,7 +82,7 @@ func MuxTStoFMP4(fmp4ManifestOutputFile string, inputs ...string) error { | |
|
|
||
| timeout, cancel := context.WithTimeout(context.Background(), 10*time.Minute) | ||
| defer cancel() | ||
| cmd := exec.CommandContext(timeout, "ffmpeg", args...) | ||
| cmd := exec.CommandContext(timeout, "/path/to/ffmpeg-nice.sh", args...) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is pseudo-code or just a starting point for discussion. I'm not even sure if these two places are the correct ones for VOD processing
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is just the MP4 generation step. There's ffmpeg usage in different places for for segmenting, thumbnailing, clipping, etc. Just grep-ing
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So we're not fully sure yet but it looks like some |
||
|
|
||
| var outputBuf bytes.Buffer | ||
| var stdErr bytes.Buffer | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://pkg.go.dev/github.com/u2takey/ffmpeg-go#Stream.SetFfmpegPath