{"action":"created","issue":{"url":"https://api.github.com/repos/fluent-ffmpeg/node-fluent-ffmpeg/issues/807","repository_url":"https://api.github.com/repos/fluent-ffmpeg/node-fluent-ffmpeg","labels_url":"https://api.github.com/repos/fluent-ffmpeg/node-fluent-ffmpeg/issues/807/labels{/name}","comments_url":"https://api.github.com/repos/fluent-ffmpeg/node-fluent-ffmpeg/issues/807/comments","events_url":"https://api.github.com/repos/fluent-ffmpeg/node-fluent-ffmpeg/issues/807/events","html_url":"https://github.com/fluent-ffmpeg/node-fluent-ffmpeg/issues/807","id":306131413,"number":807,"title":"How to create and pass dynamically input to ffmpeg()?","user":{"login":"sesn","id":1553701,"avatar_url":"https://avatars1.githubusercontent.com/u/1553701?v=4","gravatar_id":"","url":"https://api.github.com/users/sesn","html_url":"https://github.com/sesn","followers_url":"https://api.github.com/users/sesn/followers","following_url":"https://api.github.com/users/sesn/following{/other_user}","gists_url":"https://api.github.com/users/sesn/gists{/gist_id}","starred_url":"https://api.github.com/users/sesn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sesn/subscriptions","organizations_url":"https://api.github.com/users/sesn/orgs","repos_url":"https://api.github.com/users/sesn/repos","events_url":"https://api.github.com/users/sesn/events{/privacy}","received_events_url":"https://api.github.com/users/sesn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-17T06:00:10Z","updated_at":"2018-03-22T17:41:53Z","closed_at":null,"author_association":"NONE","body":"<!-- Please fill the following template -->\r\n\r\n### Version information\r\n\r\n* fluent-ffmpeg version: fluent-ffmpeg@2.1.2\r\n* ffmpeg version: 3.4.2\r\n* OS: Mac High Sierra 10.13.3\r\n\r\n### Code to reproduce\r\n\r\n```\r\nconst ffmpeg = require('fluent-ffmpeg');\r\nconst command = ffmpeg();\r\nconst path = require('path');\r\nconst filePath = path.join(path.dirname(__dirname), 'public','uploads');\r\nffmpeg()\r\n        .input(path.join(filePath, 'demo.wav'))\r\n        .input(path.join(filePath, 'demo1.wav'))\r\n        .input(path.join(filePath, 'canvas-animation.mov'))\r\n        .complexFilter([\r\n            '[0]adelay=1000|1000[a]',\r\n            '[1]adelay=4000|4000[b]',\r\n            '[a][b]amix=2'\r\n        ])\r\n        .videoCodec('copy')\r\n        .save(path.join(filePath, 'server-generated.mp4'))\r\n        .on('error', function(err, stdout, stderr){\r\n            console.log(`cannot process the video ${err.message}`);\r\n        });\r\n\r\n```\r\n\r\nEverything works fine with the above code.\r\n\r\n### **How to make dynamic input based on the array and pass to ffmpeg()?**\r\n\r\nEg:\r\n```\r\nconst audioFiles = ['demo.wav', 'demo1.wav', 'demo2.wav', 'demo3.wav'];\r\n```\r\n\r\n### **how to generate input based on the array of input filenames?**"},"comment":{"url":"https://api.github.com/repos/fluent-ffmpeg/node-fluent-ffmpeg/issues/comments/375396173","html_url":"https://github.com/fluent-ffmpeg/node-fluent-ffmpeg/issues/807#issuecomment-375396173","issue_url":"https://api.github.com/repos/fluent-ffmpeg/node-fluent-ffmpeg/issues/807","id":375396173,"user":{"login":"sesn","id":1553701,"avatar_url":"https://avatars1.githubusercontent.com/u/1553701?v=4","gravatar_id":"","url":"https://api.github.com/users/sesn","html_url":"https://github.com/sesn","followers_url":"https://api.github.com/users/sesn/followers","following_url":"https://api.github.com/users/sesn/following{/other_user}","gists_url":"https://api.github.com/users/sesn/gists{/gist_id}","starred_url":"https://api.github.com/users/sesn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sesn/subscriptions","organizations_url":"https://api.github.com/users/sesn/orgs","repos_url":"https://api.github.com/users/sesn/repos","events_url":"https://api.github.com/users/sesn/events{/privacy}","received_events_url":"https://api.github.com/users/sesn/received_events","type":"User","site_admin":false},"created_at":"2018-03-22T17:41:53Z","updated_at":"2018-03-22T17:41:53Z","author_association":"NONE","body":"@gvsro The above code is not working. \r\n\r\nWhen u apply complex filter on the later stage, it is not taking passed inputs(inside forEach loop) into consideration.\r\n\r\nThe following is the error which is generated\r\n\r\n```cannot process the video ffmpeg exited with code 1: Invalid file index 0 in filtergraph description [0]adelay=1000|1000[a];[1]adelay=4000|4000[b];[a][b]amix=2.```"}}
{"actor":{"display_login":"sesn"}}