Skip to content
This repository has been archived by the owner on Jun 14, 2021. It is now read-only.

Commit

Permalink
Merge pull request #56 from Ragg-/fix/cant-resolve-ffmpeg-on-macos
Browse files Browse the repository at this point in the history
Fix failed to spawn ffmpeg on macOS
  • Loading branch information
Ragg committed Apr 7, 2017
2 parents 85494e2 + c5de6de commit c192455
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/delir-core/src/renderer/renderer.ts
Expand Up @@ -472,6 +472,7 @@ export default class Renderer {
exportPath: string,
tmpDir: string,
targetCompositionId: string,
ffmpegBin: string,
})
{
return new ProgressPromise(async (
Expand Down Expand Up @@ -512,6 +513,7 @@ export default class Renderer {
},
inputFramerate: rootComp.framerate,
dest: tmpMovieFilePath,
ffmpegBin,
})

const progPromise = Renderer.render({
Expand Down Expand Up @@ -567,7 +569,7 @@ export default class Renderer {

notifier({state: 'Concat and encoding...'})
await new Promise((resolve, reject) => {
const ffmpeg = spawn('ffmpeg', [
const ffmpeg = spawn(ffmpegBin, [
'-y',
// '-f',
// 'utvideo',
Expand Down
8 changes: 8 additions & 0 deletions src/renderer/services/renderer.ts
Expand Up @@ -4,6 +4,7 @@ import {join} from 'path'
import * as Delir from 'delir-core'
import {ProjectHelper} from 'delir-core'

import * as Platform from '../utils/platform'
import dispatcher from '../dispatcher'
import {KnownPayload} from '../actions/PayloadTypes'

Expand Down Expand Up @@ -129,6 +130,12 @@ const handlePayload = (payload: KnownPayload) => {
}

case EditorStateDispatchTypes.RenderDestinate: (() => {
const appPath = remote.app.getPath('exe')
const ffmpegBin = require('path').resolve(
appPath,
Platform.isMacOS() ? '../../Resources/ffmpeg' : './ffmpeg.exe'
)

const file = remote.dialog.showSaveDialog(({
title: 'Destinate',
buttonLabel: 'Render',
Expand All @@ -152,6 +159,7 @@ const handlePayload = (payload: KnownPayload) => {
exportPath: file,
tmpDir: remote.app.getPath('temp'),
targetCompositionId: activeComp.id,
ffmpegBin
})
.progress(progress => {
if (progress.isRendering) {
Expand Down

0 comments on commit c192455

Please sign in to comment.