1
0
mirror of https://github.com/mifi/lossless-cut.git synced 2024-11-25 11:43:17 +01:00

Handle ENOENT for cut as well (windows)

Also log stderr and stdout of ffmpeg on error
This commit is contained in:
Mikael Finstad 2016-11-21 18:42:31 +01:00
parent 32c61e2feb
commit fd03dcc139

View File

@ -191,7 +191,10 @@ class App extends React.Component {
this.setState({ working: true }); this.setState({ working: true });
return ffmpeg.cut(filePath, this.state.fileFormat, cutStartTime, cutEndTime) return ffmpeg.cut(filePath, this.state.fileFormat, cutStartTime, cutEndTime)
.catch((err) => { .catch((err) => {
if (err.code === 1) { console.error('stdout:', err.stdout);
console.error('stderr:', err.stderr);
if (err.code === 1 || err.code === 'ENOENT') {
alert('Whoops! ffmpeg was unable to cut this video. It may be of an unknown format or codec combination'); alert('Whoops! ffmpeg was unable to cut this video. It may be of an unknown format or codec combination');
return; return;
} }