当前位置:网站首页>VB. Net calls ffmpeg to simply process video (class Library-6)
VB. Net calls ffmpeg to simply process video (class Library-6)
2022-07-04 05:24:00 【Xiaoyu 163】
There are a lot of them on the Internet C# The tutorial is about FFmpeg Video processing , Actually, change to VB.net, It's still the same
First download from the Internet to FFmpeg.exeFFmpeg-FFmpeg
And then FFmpeg.exe Drag it into your application folder
Because it is related to class libraries , You can turn over what I wrote before call ( Class library 1-5)
Now open our class library , Create a new class ( Name yourself ):VideoProcess
Public Class VideoProcess
''' <summary>
''' Add audio to the video , Pay attention to the duration of video and audio
''' </summary>
''' <param name="ffmpeg"> Given FFmpeg Absolute path </param>
''' <param name="mp3"> Given audio path </param>
''' <param name="video"> Given video path </param>
''' <param name="out"> Path to output video </param>
''' <returns>null</returns>
Public Function AddAudio(ffmpeg As String, mp3 As String, video As String, out As String)
Process.Start(ffmpeg, "-i " & video & " -i " & mp3 & " -codec copy " & out)
Return vbNull
End Function
''' <summary>
''' Delete audio for video , Pay attention to the video duration of the original video and the duration of the original audio
''' </summary>
''' <param name="ffmpeg"> Given FFmpeg Absolute path </param>
''' <param name="video"> Given video path </param>
''' <param name="out"> Path to output video </param>
''' <returns>null</returns>
Public Function DeleteAudio(ffmpeg As String, video As String, out As String)
Process.Start(ffmpeg, "-i " & video & " -c:v copy -an " & out)
Return vbNull
End Function
End Class
Put an audio on the desktop in advance , A video
Private Sub Button9_Click(sender As Object, e As EventArgs) Handles Button9.Click
GDIvid.AddAudio(Application.StartupPath & "\ffmpeg.exe", "C:\Users\Administrator\Desktop\105.mp3", "C:\Users\Administrator\Desktop\test.mp4", "C:\Users\Administrator\Desktop\test1.mp4")
End Sub
Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click
GDIvid.DeleteAudio(Application.StartupPath & "\ffmpeg.exe", "C:\Users\Administrator\Desktop\test1.mp4", "C:\Users\Administrator\Desktop\test2.mp4")
End SubAfter adding audio , The length of the video will change
边栏推荐
- Sécurité du réseau dans les écoles professionnelles secondaires - preuve de mémoire
- LM小型可编程控制器软件(基于CoDeSys)笔记二十二:错误4268/4052
- [matlab] matlab simulates digital baseband transmission system - digital baseband transmission system
- Ping port artifact psping
- Letter meaning and parameter abbreviation of optical module Daquan
- We believe that the development of consumer Internet will still be limited to the Internet industry itself
- 远程桌面客户端 RDP
- Appearance of LabVIEW error dialog box
- 2022G2电站锅炉司炉特种作业证考试题库及答案
- [matlab] general function of communication signal modulation inverse Fourier transform
猜你喜欢

Etcd database source code analysis - initialization overview

2022广东省赛——编码信息获取 解析flag

2022 t elevator repair operation certificate examination question bank and simulation examination

2022年R2移动式压力容器充装复训题库及答案

Fault analysis | mongodb 5.0 reports an error, and the legal instruction solves it

Unity is connected to the weather system

Just do it with your hands 7 - * project construction details 2 - hook configuration

如何使用postman实现简单的接口关联【增删改查】
![How to use postman to realize simple interface Association [add, delete, modify and query]](/img/e9/bf89eacdebcf2ec84c8a08c28b9ca8.png)
How to use postman to realize simple interface Association [add, delete, modify and query]

Zhongke panyun-d module analysis and scoring standard
随机推荐
Unity2d -- character moves and turns
2022 t elevator repair operation certificate examination question bank and simulation examination
[technology development -25]: integration technology of radio and television network, Internet, telecommunication network and power grid
[high concurrency, high performance and high availability of massive data MySQL practice-7] - memory data drop disk
VB.net 简单的处理图片,黑白(类库——7)
Just do it with your hands 7 - * project construction details 2 - hook configuration
Get the ID of the record just inserted from laravel
简易零钱通
C basic (VII) document operation
Zzulioj:1201: mode problem
Detailed comparison of Hynix emmc5.0 and 5.1 series
cmake
Li Kou's 300th weekly match
[matlab] matlab simulates digital baseband transmission system - digital baseband transmission system
【兴趣阅读】Adversarial Filtering Modeling on Long-term User Behavior Sequences for Click-Through Rate Pre
【雕爷学编程】Arduino动手做(105)---压电陶瓷振动模块
谷歌 Chrome 浏览器将支持选取文字翻译功能
How to build your own knowledge engine? Community open application
中科磐云—2022广东木马信息获取解析
Analysis of classical pointer and array written test questions in C language