Dspack 如何获得文件的播放时间?

LHRSoft 2004-05-01 07:12:33
在没有载入文件之前要获取文件播放时间,注意是要在没有载入之前。
...全文
123 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
hrbpengf 2004-08-16
  • 打赏
  • 举报
回复
procedure TFormDVDPlayer.FilterGraphDVDCurrentHMSFTime(sender: TObject;
HMSFTimeCode: tagDVD_HMSF_TIMECODE; TimeCode: tagDVD_TIMECODE);
var
ttt : tagDVD_HMSF_TIMECODE;
fps : ULONG;
begin
with HMSFTimeCode do
StatusBar.Panels.Items[0].Text :=
format('%d:%d:%d',[bHours, bMinutes ,bSeconds]);
with FilterGraph as IDvdInfo2 do GetTotalTitleTime(ttt, fps);
Edit1.Text := format('%d:%d:%d',[ttt.bHours, ttt.bMinutes ,ttt.bSeconds]);
if BeginPlay then
begin
if StrToTime(format('%d:%d:%d',[HMSFTimeCode.bHours, HMSFTimeCode.bMinutes ,HMSFTimeCode.bSeconds]))>StrToTime(format('%d:%d:%d',[ttt.bHours, ttt.bMinutes ,ttt.bSeconds]))-2 then
begin
MessageDlg('影片播放完毕', mtWarning, [mbOK], 0);
FilterGraph.Stop;
FilterGraph.ClearGraph;
end;
end;
end;
eliphe 2004-05-12
  • 打赏
  • 举报
回复
读取格式,自己测试各格式每M数据所播放的时间,然后读取文件长度相除,即可估计出时间。

但时间不一定准。
fengyvn 2004-05-02
  • 打赏
  • 举报
回复
WINAMP也是载入后才知道的.
因为媒体文件都有特定的格式,比如MP3最后128字节装载了关于这个文件的一些信息,我想大概是利用了STREAM来读取并显示给用户.
LHRSoft 2004-05-02
  • 打赏
  • 举报
回复
可以在没载入之前知道视频文件的大小,一定也可以在没载入前知道长度的。要不 winamp 和 wmp 怎么做?
fengyvn 2004-05-02
  • 打赏
  • 举报
回复
说笑,没载入前天知道.

1,183

社区成员

发帖
与我相关
我的任务
社区描述
Delphi GAME,图形处理/多媒体
社区管理员
  • GAME,图形处理/多媒体社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧