{"_id":"@cofenster/nexrender-action-encode","_rev":"1-8e19d664fb05e7a2d02f1ea5f1cc0e3f","name":"@cofenster/nexrender-action-encode","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@cofenster/nexrender-action-encode","author":{"name":"cofenster"},"version":"1.0.0","main":"index.js","ffmpeg-static":{"version":"b4.2.2","url":"https://github.com/eugeneware/ffmpeg-static"},"publishConfig":{"access":"public"},"dependencies":{"date-fns":"^1.30.1","node-fetch":"^2.6.0","node-fetch-progress":"^1.0.2"},"description":"Encode your video to a specified format using built-in ffmpeg utility. You don't need to have ffmpeg installed on your system.","_id":"@cofenster/nexrender-action-encode@1.0.0","_nodeVersion":"12.16.3","_npmVersion":"6.14.5","dist":{"integrity":"sha512-/h2NSqldDLoW05mq7k0YATrCja/2iVnNX9KbkzzpeWP3z2Lv5a5EKE1iG6FeQHpRBF/d028EyPwjBTbMeI3Avw==","shasum":"8bfe55cd6d592e38359c8d424dafb7d1eb67c5f6","tarball":"https://registry.npmjs.org/@cofenster/nexrender-action-encode/-/nexrender-action-encode-1.0.0.tgz","fileCount":4,"unpackedSize":10149,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBFV5CRA9TVsSAnZWagAAvi4P/RuDS7swDy3f7slJ6nHZ\nwswnN+58RNScUWVg+UJzJ6jkrhqNxns1xcsV14ctlN8CViAIYeXwTpVM1Dz0\nKNV0012bRghFEuQnbLFPQHEkhNcj1XoCJLuozO6a4x9FfJrOwhe/RZVS8EEA\n1LB/W9I1pY+CYvDN5Ew5/7N8fvAJH/j4l7/9qqONa+jpg+uWXPg7VNsx37kX\nOPjCJsVRY/e9NM9asQnVypwj7n2QLZjvMBg355YM+zACrqyDzdlcK4CfVRcV\nJBr34pSQymnbDHBuZ89IuyRJcnYdEKjWURoPR8nCR/8EGDEQ909+3fIXo7P0\nq0m7hD8F0JACJ6K47DUWG+2Gj648sybGbrK5sYMXoIifutCDSkakeQU3LIs+\nxB849UFdjoDvcvdILC+71/lwgVAKKnOmrwhAN2FEYlUThx3dL+u/+pQafMlb\njNOGob+qo0toI7xUXUWGoRWgSQAsUxOUEvI+rnwkx0dEpfLdQym2ttpzienQ\nsqoedtgFpy62fGc+kdAS2eLoesyO2ERA/P1ascXZ9GKQfqb2pCjpkCZ8Uhbq\nGLb0488dBGnLWEL5O6SO7bGvuVRUCdsfCnTc8+pC1jgv28y66pH2yp5ceZhI\nDxOma25UuW4YB/ynUCB8+C+/6GC+nJvddpERUx3afLVV19S9VBgVPbYJi3s8\nvXlo\r\n=ilYk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICvM+zr06B4SF3F/Q8GOtUetQdiZa8gDNSFOHfVrxa2OAiBRPuDulxSiKtlz4JwelheJxV98Pm3gOEZBibAeqximNg=="}]},"maintainers":[{"name":"cofenster","email":"finn@cofenster.com"}],"_npmUser":{"name":"cofenster","email":"finn@cofenster.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nexrender-action-encode_1.0.0_1594119545121_0.4992252203486529"},"_hasShrinkwrap":false}},"time":{"created":"2020-07-07T10:59:05.081Z","1.0.0":"2020-07-07T10:59:05.302Z","modified":"2022-04-05T00:10:25.429Z"},"maintainers":[{"name":"cofenster","email":"finn@cofenster.com"}],"description":"Encode your video to a specified format using built-in ffmpeg utility. You don't need to have ffmpeg installed on your system.","author":{"name":"cofenster"},"readme":"# Action: Encode\n\nEncode your video to a specified format using built-in ffmpeg utility. You don't need to have ffmpeg installed on your system.\n\n## Installation\n\nIf you are using [binary](https://github.com/inlife/nexrender/releases) version of the nexrender,\nthere is no need to install the module, it is **included** in the binary build.\n\n```\nnpm i @nexrender/action-encode -g\n```\n\nThe module downloads a statically defined version of ffmpeg and places it into `/temp/nexrender` folder (by default).\nIf you have `ffmpeg` installed on your system already, you can provide an env variable to use it:\n\n```sh\n$ NEXRENDER_FFMPEG=/usr/bin/ffmpeg nexrender-cli ...\n```\n\n## Usage\n\nWhen creating your render job provide this module as one of the `postrender` actions:\n\n```json\n// job.json\n{\n    \"actions\": {\n        \"postrender\": [\n            {\n                \"module\": \"@nexrender/action-encode\",\n                \"output\": \"foobar.mp4\",\n                \"preset\": \"mp4\",\n                \"params\": {\"-vcodec\": \"libx264\", \"-r\": 25}\n            }\n        ]\n    }\n}\n```\n\n## Information\n\n* `output` is a path on your system where result will be saved to, can be either relative or absulte path.\n* `input` optional argument, path of the file you want to encode, can be either relative or absulte path. Defaults to current job output video file.\n* `preset` optional argument, if provided will be used as a preset for the renderer, if not, will take input directly from params\n* `params` optional argument, object containing additional params that will be provided to the ffmpeg binary\n\n## Presets\n\nThere are a couple of default presets included with the build. You can provide `params` field to override any of the values there.\n\n### mp4\n\n```js\n{\n    '-acodec': 'aac',\n    '-ab': '128k',\n    '-ar': '44100',\n    '-vcodec': 'libx264',\n    '-r': '25',\n}\n```\n\n### ogg\n\n```js\n{\n    '-acodec': 'libvorbis',\n    '-ab': '128k',\n    '-ar': '44100',\n    '-vcodec': 'libtheora',\n    '-r': '25',\n}\n```\n\n### webm\n\n```js\n{\n    '-acodec': 'libvorbis',\n    '-ab': '128k',\n    '-ar': '44100',\n    '-vcodec': 'libvpx',\n    '-b': '614400',\n    '-aspect': '16:9',\n}\n```\n\n### mp3\n\n```js\n{\n    '-acodec': 'libmp3lame',\n    '-ab': '128k',\n    '-ar': '44100',\n\n}\n```\n\n### m4a\n\n```js\n{\n    '-acodec': 'aac',\n    '-ab': '64k',\n    '-ar': '44100',\n    '-strict': '-2',\n}\n```\n\n### gif\n\n```js\n{\n    '-i': input,\n    \"-ss\": '61.0',\n    \"-t\": '2.5',\n    \"-filter_complex\": `[0:v] fps=12,scale=480:-1,split [a][b];[a] palettegen [p];[b][p] paletteuse`,\n}\n```\n","readmeFilename":"readme.md"}