Skip to content

Commit

Permalink
feat: added custom encoder option
Browse files Browse the repository at this point in the history
  • Loading branch information
JonFranklin301 committed Mar 3, 2021
1 parent 23f13e4 commit 55a4003
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ export interface EncoderConfig {
postFix: string
/** extension of the new file (e.g. .mp4) */
extension?: string
/** custom options. Ignores all other options */
custom?: string
/** discard streams */
discard?: {
video?: boolean
Expand Down
6 changes: 6 additions & 0 deletions src/background/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ export class Renderer extends EventEmitter {
private _getProcessArgs(step: RenderWorkstep) {
const args = ['-y', '-i', `"${step.input}"`]

if (step.encoderConfig.custom) {
args.push(step.encoderConfig.custom)
args.push(`"${step.output}"`)
return args
}

const discard = step.encoderConfig.discard || {}

if (discard.video) {
Expand Down
2 changes: 2 additions & 0 deletions src/types/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export interface EncoderConfig {
postFix: string
/** extension of the new file (e.g. .mp4) */
extension?: string
/** custom options. Ignores all other options */
custom?: string
/** discard streams */
discard?: {
video?: boolean
Expand Down

0 comments on commit 55a4003

Please sign in to comment.