Skip to content

Commit

Permalink
Merge pull request #5 from JonFranklin301/feat-custom-encoding
Browse files Browse the repository at this point in the history
Feat: custom encoding
  • Loading branch information
JonFranklin301 authored Mar 3, 2021
2 parents 8ca66ee + 55a4003 commit 3f5f387
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 3f5f387

Please sign in to comment.