在delphi.i中使用Iam初学者创建一个示例应用程序我需要一个help.how在Delphi中使用FFMPEG?如何在Delphi中使用FFMPEG
2
A
回答
1
4
FFMPEG是一个命令行应用程序,让您可以轻松地使用ShellExecute()
,一些例子here调用它。
首先,您需要决定使用哪些命令行开关。
如果您需要进一步的帮助,我可以在明天发布代码。
编辑:
这里是运行一个命令行应用程序的更先进的方法,包括:它的输出重定向到一个备忘录用于观看:
procedure GetDosOutput(CommandLine, WorkDir: string;aMemo : TMemo);
var
SA: TSecurityAttributes;
SI: TStartupInfo;
PI: TProcessInformation;
StdOutPipeRead, StdOutPipeWrite: THandle;
WasOK: Boolean;
Buffer: array[0..255] of AnsiChar;
BytesRead: Cardinal;
Handle: Boolean;
begin
AMemo.Lines.Add('Commencing processing...');
with SA do begin
nLength := SizeOf(SA);
bInheritHandle := True;
lpSecurityDescriptor := nil;
end;
CreatePipe(StdOutPipeRead, StdOutPipeWrite, @SA, 0);
try
with SI do
begin
FillChar(SI, SizeOf(SI), 0);
cb := SizeOf(SI);
dwFlags := STARTF_USESHOWWINDOW or STARTF_USESTDHANDLES;
wShowWindow := SW_HIDE;
hStdInput := GetStdHandle(STD_INPUT_HANDLE); // don't redirect stdin
hStdOutput := StdOutPipeWrite;
hStdError := StdOutPipeWrite;
end;
Handle := CreateProcess(nil, PChar('cmd.exe /C ' + CommandLine),
nil, nil, True, 0, nil,
PChar(WorkDir), SI, PI);
CloseHandle(StdOutPipeWrite);
if Handle then
try
repeat
WasOK := ReadFile(StdOutPipeRead, Buffer, 255, BytesRead, nil);
if BytesRead > 0 then
begin
Buffer[BytesRead] := #0;
AMemo.Text := AMemo.Text + Buffer;
end;
until not WasOK or (BytesRead = 0);
WaitForSingleObject(PI.hProcess, INFINITE);
finally
CloseHandle(PI.hThread);
CloseHandle(PI.hProcess);
end;
finally
CloseHandle(StdOutPipeRead);
AMemo.Lines.Add('Processing completed successfully.');
AMemo.Lines.Add('**********************************');
AMemo.Lines.Add('');
end;
end;
可以称为像这样:
cmd := 'ffmpeg.exe -i "'+InFile+'" -vcodec copy -acodec copy "'+OutFile+'"';
GetDosOutput(cmd,FFMPEGDirectory,MemoLog);
+0
嗨西蒙,你能给我举个例子 – periyasamy 2012-02-01 10:38:10
相关问题
- 1. 如何使用FFMPEG在php
- 2. 如何使用ffmpeg
- 3. 如何在iPHone中使用ffmpeg代码
- 4. 如何在ffmpeg中使用youtube-dl
- 5. 如何在yii中使用ffmpeg
- 6. 如何在android studio中使用Ffmpeg?
- 7. 如何使用parsedelimeter在Delphi
- 8. 如何在Delphi中使用Bloomberg API?
- 9. 如何在delphi中正确使用ListView?
- 10. 如何在Delphi XE7中使用TFDTable(FireDAC)?
- 11. 如何在Delphi中使用tagDEC
- 12. 如何在Delphi中使用Word和Excel?
- 13. 如何在delphi中使用MultiByteToWideChar?
- 14. 如何在Delphi 7中使用chm?
- 15. 如何在Delphi中使用水平TListbox?
- 16. 如何在delphi中使用windows IME?
- 17. 如何在delphi中使用isset()
- 18. 如何在Delphi中使用ManagementObjectSearcher?
- 19. 如何在Delphi XE3中使用Synapse库?
- 20. 如何使用Delphi
- 21. 如何在Delphi 7中使用delphi制作com界面
- 22. 如何获得使用FFMPEG
- 23. 如何使用的ffmpeg
- 24. 如何使用的ffmpeg
- 25. 如何使用的ffmpeg
- 26. 如何使用FFmpeg在Android ndk
- 27. 在Powershell中使用ffmpeg
- 28. 如何在Android中使用FFMpeg进行编码(使用H263)
- 29. Delphi如何使用TGridPanel
- 30. 如何使用线程Delphi
我看不出这个问题有什么问题 – Simon 2012-02-02 03:41:55
同样适合我,完全有效,因为我在寻找相同的信息 – ruhalde 2013-07-22 17:47:35