JavaScript 中的 FFMPEG 命令 [英] FFMPEG commands in JavaScript

查看:76
本文介绍了JavaScript 中的 FFMPEG 命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用如下命令:ffmpeg -i video_1920.mp4 -vf scale=640:360 video_640.mp4 -hide_banner 在纯 JavaScript 中降低视频的分辨率.例如,我有一个下拉菜单,其中有 <> 标签,所以我想通过点击带有 JS 的菜单超链接来进行视频质量选择.如何正确实施,请帮忙.

Is it possible to use command like: ffmpeg -i video_1920.mp4 -vf scale=640:360 video_640.mp4 -hide_banner to reduce the resolution of a video in the pure JavaScript. For example I got a dropdown menu in which I have < a > tag, so I want to do a video quality selection by clicking on that menu hyperlink with JS. How to implement that properly, please help.

推荐答案

如果您想在浏览器中完成工作,即在用户机器上而不是您的服务器上,有许多项目提供了 ffmpeg 包装器Javascript.这个是目前最流行的,我相信:

If you want to do the work in the browser, i.e. on the users machine rather than your server, there are a number of projects which provide an ffmpeg wrapper in Javascript. This one is the most popular at the moment, I believe:

您需要进行一些测试 - 视频处理是计算密集型的,在浏览器中可能不适合您.

You would need to do some testing - video processing is very compute intensive and may not work well for you in the browser.

如果您想在服务器端进行,例如在基于 Javascript 的服务器(例如 node)中,那么还有可用的库 - 例如:

If you want to do it server side, in a Javascript based server like node for example, then again there are libraries available - e.g.:

这篇关于JavaScript 中的 FFMPEG 命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆