Comments (9)
代码在Main.vue
第280行左右
// 开始转码
startCommand() {
// 基于fluentFFmpeg的转码
if (this.activeTab === "video") {
if (this.video === "") {
this.msg("视频路径为空", "warning");
return;
}
this.fluentFFmpeg(
ffmpegBinary(this.video)
.videoCodec(this.decoding)
.videoBitrate(this.bit_rate) // 改变视频的比特率(提高或者减少就能改变视频质量和大小)
.toFormat("mp4"),
".mp4"
);
}
默认我是通过调整视频的比特率改变视频质量和大小的(videoBitrate
), 我文档里有提到,先是读取默认的比特率然后提高1.5倍
from ffmpeggui.
其实使用ffmpeg 的x264 可以使用 ffmpeg -i $di/$mz/$ss -b:v 3000k -x264opts crf=20:keyint=25:ref=1:vbv-bufsize=20000:vbv-maxrate=4000 -ac 2 -ar 44100 -b:a 192k /data/media-ok/$sj/$mz/$mz".mp4"
如果选择字幕: ffmpeg -i $di/$mz/$ss -vf subtitles=$di/$mz/$mz.ass -b:v 3000k -x264opts crf=20:keyint=25:ref=1:vbv-bufsize=20000:vbv-maxrate=4000 -ac 2 -ar 44100 -b:a 192k /data/media-ok/$sj/$mz/$mz".mp4"
当然,参数大小可以按照需求来设置
from ffmpeggui.
@rookie-z 谢谢,有空我试下
from ffmpeggui.
你是用的参数,利用Gpu来转码,我尝试过许多参数都不行,或者是还需要什么其他的东西,才能利用gpu转码
from ffmpeggui.
@rookie-z 默认是我调用intel的内置GPU进行转码的,其它CPU由于没有相关硬件暂时无法测试,请问你是什么CPU?如果你想自定义硬件加速请参考我文档第一条,里面有讲是如何开启硬件加速的
from ffmpeggui.
英伟达,使用很多方法都不行,已经使用了你文档里面的,但是没有效果
from ffmpeggui.
@rookie-z 我试过用自己的A卡开启硬件加速,完全没问题,或者等等我进行更多测试,完善下代码,手上硬件有限暂时无法做更多测试
from ffmpeggui.
你已经实现了再windows下,ffmpeg 内嵌字幕的方法吗?
from ffmpeggui.
@rookie-z 这个功能没实现,理论上是可以支持的,现在主要任务是把基础功能做好,然后在扩展新功能😏
from ffmpeggui.
Related Issues (9)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ffmpeggui.