using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace demo
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void PictureFile_Click(object sender, EventArgs e)
{
FolderBrowserDialog dlg = new FolderBrowserDialog();
if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
this.txtPath.Text = dlg.SelectedPath;
}
}
private void MP4File_Click(object sender, EventArgs e)
{
FolderBrowserDialog dlg = new FolderBrowserDialog();
if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
this.MP4Path.Text = dlg.SelectedPath;
}
}
private void txtPath_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
ImageGetVideo();
}
#region 图片转视频
public void ImageGetVideo()
{
string ffmpeg = string.Format("{0}ffmpeg.exe", AppDomain.CurrentDomain.BaseDirectory);
try
{
ProcessStartInfo startInfo = new ProcessStartInfo(ffmpeg);
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
// -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg //这是把视频转图片的
//及其耗CUP的指定帧截取图片帧 string.Format(" -i \"{0}\" -y -f image2 -ss {1} -s \"{2}\" \"{3}\"", vedioPath, catchTime, saveImgSize, saveImgPath)
startInfo.Arguments = string.Format(" -f image2 -i "+ txtPath.Text + @"\%d.jpg -vcodec libx264 -r 10 "+ MP4Path.Text + @"\test.mp4");
System.Diagnostics.Process.Start(startInfo).Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
return;
}
}
#endregion
private void MP4Path_Click(object sender, EventArgs e)
{
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
C# 图片帧转换mp4格式视频
共36个文件
cs:9个
cache:5个
exe:3个
3星 · 超过75%的资源 需积分: 40 206 下载量 144 浏览量
2018-10-16
11:27:40
上传
评论 5
收藏 11.75MB RAR 举报
温馨提示
本源码是ffmpeg转换视频,编译环境为vs2017,如需要转换其他格式视频填写对应的视频格式的编码格式【-f image2 -i c:\temp\d.jpg -vcodec libx264 test.mp4】,支持的图片格式为jpg,bmp,tiff等等。请注意对应的图片帧要以自然数命名,再次注意!本demo是以vs2017作为编译环境如出现打不开情况请查看文件夹的demo源码.txt。
资源推荐
资源详情
资源评论
收起资源包目录
图片转视频.rar (36个子文件)
打死不看的温馨提示.txt 46B
demo源码.txt 2KB
demo
.vs
demo
v15
.suo 43KB
Server
sqlite3
storage.ide 568KB
storage.ide-shm 32KB
db.lock 0B
storage.ide-wal 716KB
demo.sln 1KB
demo
bin
Debug
ffmpeg.exe 33.99MB
demo.exe.config 187B
demo.pdb 22KB
demo.exe 11KB
Form1.Designer.cs 7KB
demo.csproj 3KB
Program.cs 516B
obj
Debug
demo.csproj.CoreCompileInputs.cache 42B
demo.csproj.GenerateResource.cache 1012B
demo.pdb 22KB
TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs 0B
demo.exe 11KB
demo.csprojResolveAssemblyReference.cache 14KB
DesignTimeResolveAssemblyReferencesInput.cache 7KB
TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs 0B
DesignTimeResolveAssemblyReferences.cache 1KB
TempPE
demo.csproj.FileListAbsolute.txt 762B
TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs 0B
demo.Properties.Resources.resources 180B
demo.Form1.resources 180B
Form1.cs 2KB
Form1.resx 6KB
App.config 187B
Properties
Resources.resx 5KB
Settings.settings 249B
AssemblyInfo.cs 1KB
Settings.Designer.cs 1KB
Resources.Designer.cs 3KB
共 36 条
- 1
资源评论
- 静静202019-04-06这个好用,刚好解决了我目前所面临的问题,很值得
- 宇云雨巷2019-12-03不能用,LJ
- qq_219525192020-06-16生成的视频是0kb
- 雨网科技2022-03-19可以用,很好
- 765873098348902022-02-23ffmpeg可以用图片转mp4
「已注销」
- 粉丝: 2
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功