{"id":486,"date":"2017-04-26T12:14:30","date_gmt":"2017-04-26T05:14:30","guid":{"rendered":"http:\/\/www.uptoyou.life\/article\/?p=486"},"modified":"2025-08-15T15:56:18","modified_gmt":"2025-08-15T08:56:18","slug":"%e0%b9%83%e0%b8%8a%e0%b9%89-node-js-%e0%b9%81%e0%b8%9b%e0%b8%a5%e0%b8%87-file-video-%e0%b8%94%e0%b9%89%e0%b8%a7%e0%b8%a2-ffmpeg","status":"publish","type":"post","link":"http:\/\/www.uptoyou.life\/article\/%e0%b9%83%e0%b8%8a%e0%b9%89-node-js-%e0%b9%81%e0%b8%9b%e0%b8%a5%e0%b8%87-file-video-%e0%b8%94%e0%b9%89%e0%b8%a7%e0%b8%a2-ffmpeg\/","title":{"rendered":"\u0e43\u0e0a\u0e49 Node.js \u0e41\u0e1b\u0e25\u0e07 File video  \u0e14\u0e49\u0e27\u0e22 FFMPEG"},"content":{"rendered":"<p>FFMPEG \u0e40\u0e1b\u0e47\u0e19\u0e17\u0e35\u0e48\u0e23\u0e39\u0e49\u0e01\u0e31\u0e19\u0e27\u0e48\u0e32\u0e40\u0e1b\u0e47\u0e19 \u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e21\u0e37\u0e2d\u0e17\u0e35\u0e48\u0e40\u0e02\u0e32\u0e43\u0e0a\u0e49\u0e01\u0e31\u0e19\u0e41\u0e1e\u0e23\u0e48\u0e2b\u0e25\u0e32\u0e22\u0e43\u0e19\u0e01\u0e32\u0e23\u0e41\u0e1b\u0e25\u0e07\u0e44\u0e1f\u0e25\u0e4c Vidoe \u00a0\u0e43\u0e19 Post \u0e19\u0e35\u0e49\u0e08\u0e30\u0e40\u0e02\u0e35\u0e22\u0e19\u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19 \u00a0FFMPEG \u0e14\u0e49\u0e27\u0e22 Node.js \u00a0\u0e42\u0e14\u0e22\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e43\u0e0a\u0e49 \u00a0library \u0e02\u0e2d\u0e07 <a href=\"https:\/\/www.npmjs.com\/package\/fluent-ffmpeg\">fluent-ffmpeg<\/a> \u00a0\u0e40\u0e02\u0e35\u0e22\u0e19\u0e21\u0e32\u0e01\u0e44\u0e1b\u0e2d\u0e32\u0e08\u0e08\u0e30\u0e07\u0e07 \u00a0\u0e07\u0e31\u0e49\u0e19\u0e21\u0e32\u0e25\u0e2d\u0e07\u0e17\u0e33\u0e01\u0e31\u0e19\u0e40\u0e25\u0e22 \u00a0(\u0e43\u0e19\u0e17\u0e35\u0e48\u0e19\u0e35\u0e49\u0e1c\u0e21\u0e43\u0e0a\u0e49\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07 Mac \u0e19\u0e30\u0e04\u0e23\u0e31\u0e1a)<\/p>\n<h3><strong><br \/>\n<\/strong>\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e01\u0e32\u0e23\u0e25\u0e07\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21<\/h3>\n<p>1. <a href=\"https:\/\/nodejs.org\/en\/download\/\">Download \u00a0Node.js<\/a> \u00a0\u0e21\u0e32\u0e25\u0e07\u0e17\u0e35\u0e48\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e41\u0e25\u0e49\u0e27 Install \u00a0 \u0e2b\u0e23\u0e37\u0e2d \u0e40\u0e1b\u0e34\u0e14 Terminal \u00a0\u0e41\u0e25\u0e49\u0e27\u0e1e\u0e34\u0e21\u0e1e\u0e4c<\/p>\n<pre class=\"lang:default decode:true\">$ brew install node<\/pre>\n<p><!--more--><\/p>\n<p>2. \u00a0Install FFMPEG \u00a0 \u0e40\u0e1b\u0e34\u0e14 Terminal \u00a0\u0e41\u0e25\u0e49\u0e27\u0e1e\u0e34\u0e21\u0e1e\u0e4c<\/p>\n<pre class=\"\">$ brew install ffmpeg<\/pre>\n<p>3. \u00a0\u0e2a\u0e23\u0e49\u0e32\u0e07 Project \u0e2d\u0e31\u0e19\u0e19\u0e35\u0e49\u0e01\u0e47\u0e41\u0e25\u0e49\u0e27\u0e41\u0e15\u0e48\u0e27\u0e48\u0e32\u0e08\u0e30\u0e43\u0e0a\u0e49 Tools \u0e2d\u0e31\u0e19\u0e44\u0e2b\u0e19 \u0e02\u0e2d\u0e07\u0e1c\u0e21\u0e43\u0e0a\u0e49 <a href=\"https:\/\/expressjs.com\/en\/starter\/generator.html\">Express<\/a><\/p>\n<p>4. \u00a0\u0e43\u0e19 Terminal \u0e43\u0e2b\u0e49\u0e40\u0e02\u0e49\u0e32\u0e44\u0e1b\u0e17\u0e35\u0e48 Path \u0e02\u0e2d\u0e07\u0e42\u0e1b\u0e23\u0e40\u0e08\u0e04 \u0e41\u0e25\u0e49\u0e27\u0e17\u0e33\u0e01\u0e32\u0e23 Install \u00a0fluent-ffmpeg \u0e40\u0e02\u0e49\u0e32\u0e44\u0e1b<\/p>\n<pre class=\"lang:default decode:true \">$ cd myproject\n$\u00a0npm\u00a0install\u00a0fluent-ffmpeg<\/pre>\n<p>\u0e40\u0e17\u0e48\u0e32\u0e19\u0e35\u0e49\u0e01\u0e47\u0e1e\u0e23\u0e49\u0e2d\u0e21\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e41\u0e25\u0e49\u0e27<\/p>\n<h3>\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e40\u0e02\u0e35\u0e22\u0e19\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21<\/h3>\n<p>1. \u00a0\u0e40\u0e23\u0e35\u0e22\u0e01\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u00a0fluent-ffmpeg<\/p>\n<pre class=\"lang:js decode:true\">var ffmpeg = require('fluent-ffmpeg');<\/pre>\n<p>2. \u0e17\u0e14\u0e25\u0e2d\u0e07\u0e43\u0e02\u0e49\u0e07\u0e32\u0e19<\/p>\n<pre class=\"lang:js decode:true\">var ffmpeg = require('fluent-ffmpeg');\nvar proc = new ffmpeg({ source: 'test.avi', nolog: true })\n.toFormat('mp4')\n.on('end', function() {\nconsole.log('file has been converted succesfully');\n})\n.on('error', function(err) {\nconsole.log('an error happened: ' + err.message);\n})\n.saveToFile('output.mp4');<\/pre>\n<h4>\u0e08\u0e32\u0e01\u0e2a\u0e04\u0e23\u0e34\u0e1b\u0e02\u0e49\u0e32\u0e07\u0e1a\u0e19<\/h4>\n<pre class=\"lang:js decode:true\">var proc = new ffmpeg({ source: 'test.avi', nolog: true })<\/pre>\n<p>\u0e40\u0e1b\u0e47\u0e19\u0e01\u0e32\u0e23\u0e40\u0e23\u0e35\u0e22\u0e01\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19 ffmpeg \u0e41\u0e25\u0e30\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e44\u0e1f\u0e25\u0e4c\u0e15\u0e49\u0e19\u0e17\u0e32\u0e07\u0e27\u0e48\u0e32\u0e2d\u0e22\u0e39\u0e48\u0e17\u0e35\u0e48\u0e44\u0e2b\u0e19<\/p>\n<pre class=\"lang:js decode:true\">.toFormat('mp4')<\/pre>\n<p>\u0e40\u0e1b\u0e47\u0e19\u0e01\u0e32\u0e23\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e0a\u0e19\u0e34\u0e14\u0e44\u0e1f\u0e25\u0e4c Output<\/p>\n<pre class=\"lang:js decode:true \">.on('end', function() {<\/pre>\n<p>\u0e1f\u0e31\u0e07\u0e0a\u0e31\u0e48\u0e19\u0e19\u0e35\u0e49\u0e08\u0e30\u0e17\u0e33\u0e07\u0e32\u0e19\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e08\u0e1a<\/p>\n<pre class=\"lang:js decode:true\">.on('error', function(err) {<\/pre>\n<p>\u0e1f\u0e31\u0e07\u0e0a\u0e31\u0e48\u0e19\u0e19\u0e35\u0e49\u0e08\u0e30\u0e17\u0e33\u0e07\u0e32\u0e19\u0e40\u0e21\u0e37\u0e48\u0e2d \u0e40\u0e01\u0e34\u0e14\u0e02\u0e49\u0e2d\u0e1c\u0e34\u0e14\u0e1e\u0e25\u0e32\u0e14<\/p>\n<pre class=\"lang:js decode:true\">.saveToFile('output.mp4');<\/pre>\n<p>\u0e01\u0e33\u0e2b\u0e19\u0e14 part \u0e41\u0e25\u0e30\u0e0a\u0e37\u0e48\u0e2d\u0e44\u0e1f\u0e25\u0e4c Output<\/p>\n<p>\u0e40\u0e17\u0e48\u0e32\u0e19\u0e35\u0e49\u0e40\u0e23\u0e32\u0e01\u0e47\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e41\u0e1b\u0e25\u0e07\u0e44\u0e1f\u0e25\u0e4c\u0e15\u0e32\u0e21\u0e17\u0e35\u0e48\u0e40\u0e23\u0e32\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e44\u0e14\u0e49\u0e41\u0e25\u0e49\u0e27 \u00a0\u0e2a\u0e48\u0e27\u0e19\u0e40\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e40\u0e0b\u0e15\u0e04\u0e48\u0e32\u0e2d\u0e30\u0e44\u0e23\u0e44\u0e14\u0e49\u0e1a\u0e49\u0e32\u0e07 \u00a0\u0e04\u0e48\u0e2d\u0e19\u0e02\u0e49\u0e32\u0e07\u0e23\u0e30\u0e40\u0e2d\u0e35\u0e22\u0e14\u0e25\u0e2d\u0e07\u0e14\u0e39\u0e40\u0e2d\u0e01\u0e2a\u0e32\u0e23\u0e02\u0e2d\u0e07\u0e17\u0e32\u0e07\u00a0<a href=\"https:\/\/www.npmjs.com\/package\/fluent-ffmpeg\">fluent-ffmpeg<\/a> \u00a0\u0e08\u0e30\u0e14\u0e35\u0e01\u0e27\u0e48\u0e32\u0e04\u0e23\u0e31\u0e1a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>FFMPEG \u0e40\u0e1b\u0e47\u0e19\u0e17\u0e35\u0e48\u0e23\u0e39\u0e49\u0e01\u0e31\u0e19\u0e27\u0e48\u0e32\u0e40\u0e1b\u0e47\u0e19 \u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e21\u0e37\u0e2d\u0e17\u0e35\u0e48\u0e40\u0e02\u0e32\u0e43\u0e0a\u0e49\u0e01\u0e31\u0e19\u0e41\u0e1e\u0e23\u0e48\u0e2b\u0e25\u0e32\u0e22\u0e43\u0e19\u0e01\u0e32\u0e23\u0e41\u0e1b\u0e25\u0e07\u0e44\u0e1f\u0e25\u0e4c Vidoe \u00a0\u0e43\u0e19 Post \u0e19\u0e35\u0e49\u0e08\u0e30\u0e40\u0e02\u0e35\u0e22\u0e19\u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19 \u00a0FFMPEG \u0e14\u0e49\u0e27\u0e22 Node.js \u00a0\u0e42\u0e14\u0e22\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e43\u0e0a\u0e49 \u00a0library \u0e02\u0e2d\u0e07 fluent-ffmpeg \u00a0\u0e40\u0e02\u0e35\u0e22\u0e19\u0e21\u0e32\u0e01\u0e44\u0e1b\u0e2d\u0e32\u0e08\u0e08\u0e30\u0e07\u0e07 \u00a0\u0e07\u0e31\u0e49\u0e19\u0e21\u0e32\u0e25\u0e2d\u0e07\u0e17\u0e33\u0e01\u0e31\u0e19\u0e40\u0e25\u0e22 \u00a0(\u0e43\u0e19\u0e17\u0e35\u0e48\u0e19\u0e35\u0e49\u0e1c\u0e21\u0e43\u0e0a\u0e49\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07 Mac \u0e19\u0e30\u0e04\u0e23\u0e31\u0e1a) \u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e01\u0e32\u0e23\u0e25\u0e07\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21 1. Download \u00a0Node.js \u00a0\u0e21\u0e32\u0e25\u0e07\u0e17\u0e35\u0e48\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e41\u0e25\u0e49\u0e27 Install \u00a0 \u0e2b\u0e23\u0e37\u0e2d \u0e40\u0e1b\u0e34\u0e14 Terminal \u00a0\u0e41\u0e25\u0e49\u0e27\u0e1e\u0e34\u0e21\u0e1e\u0e4c $ brew install node<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[51,53,52,30],"class_list":["post-486","post","type-post","status-publish","format-standard","hentry","category-other","tag-ffmpeg","tag-fluent-ffmpeg","tag-node-js","tag-video"],"_links":{"self":[{"href":"http:\/\/www.uptoyou.life\/article\/wp-json\/wp\/v2\/posts\/486","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.uptoyou.life\/article\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.uptoyou.life\/article\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.uptoyou.life\/article\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.uptoyou.life\/article\/wp-json\/wp\/v2\/comments?post=486"}],"version-history":[{"count":10,"href":"http:\/\/www.uptoyou.life\/article\/wp-json\/wp\/v2\/posts\/486\/revisions"}],"predecessor-version":[{"id":641,"href":"http:\/\/www.uptoyou.life\/article\/wp-json\/wp\/v2\/posts\/486\/revisions\/641"}],"wp:attachment":[{"href":"http:\/\/www.uptoyou.life\/article\/wp-json\/wp\/v2\/media?parent=486"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.uptoyou.life\/article\/wp-json\/wp\/v2\/categories?post=486"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.uptoyou.life\/article\/wp-json\/wp\/v2\/tags?post=486"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}