Skip to content

Commit

Permalink
refactor(CreateMediaArticle): simplify output pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
MrOrz committed Feb 28, 2024
1 parent 443cdb8 commit 35bfd67
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/graphql/mutations/CreateMediaArticle.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,13 @@ const VALID_ARTICLE_TYPE_TO_MEDIA_TYPE = {
*/
function getFFMpegTransform(setupFn = cmd => cmd) {
const input = new PassThrough();
const output = new PassThrough();
setupFn(
const output = setupFn(
ffmpeg(input)
.on('stderr', function(stderrLine) {
console.log('Stderr output: ' + stderrLine);
})
.inputFormat('mp4')
).pipe(output);
).pipe();

return Duplex.from({ readable: output, writable: input });
}
Expand Down

0 comments on commit 35bfd67

Please sign in to comment.