Cita:
Empezado por MAXIUM
Hola, ¿nos puedes decir como lo hicisteis o mejor, un código de ejemplo? Muchas gracias
|
Disculpen, debí comentar como lo hice para que le pueda servir a otros
Pues yo cargo los archivos en un stringlist y de ahi los leo y le obtengo los metadatos con este codigo:
Código Delphi
[-] if (MediaInfoDLL_Load('MediaInfo.dll') = false) then
begin
MsgError('Error al cargar MediaInfo.dll', 'Error');
Exit;
end;
for i:=0 to ListaTagAcum.Count - 1 do
begin
Cad:=ListaTagAcum.Strings[i];
Ruta:=ExtractFilePath(Cad);
Archivo:=ExtractFileName(Cad);
Handle:=MediaInfo_New();
MediaInfo_Open(Handle,PWideChar(Ruta + Archivo)); sgListaMetaDatos.Cells[0, i+1]:=Archivo;
sgListaMetaDatos.Cells[1, i+1]:=MediaInfo_Get(Handle, Stream_General, 0, 'FileSize/String', Info_Text, Info_Name);
sgListaMetaDatos.Cells[2, i+1]:=MediaInfo_Get(Handle, Stream_General, 0, 'Duration/String2', Info_Text, Info_Name);
sgListaMetaDatos.Cells[3, i+1]:=MediaInfo_Get(Handle, Stream_General, 0, 'Format', Info_Text, Info_Name);
Resol:=MediaInfo_Get(Handle, Stream_Video, 0, 'Width', Info_Text, Info_Name) + 'x' + MediaInfo_Get(Handle, Stream_Video, 0, 'Height', Info_Text, Info_Name);
sgListaMetaDatos.Cells[4, i+1]:=Resol;
sgListaMetaDatos.Cells[5, i+1]:=MediaInfo_Get(Handle, Stream_General, 0, 'BitRate/String', Info_Text, Info_Name);
sgListaMetaDatos.Cells[6, i+1]:=MediaInfo_Get(Handle, Stream_Video, 0, 'Format', Info_Text, Info_Name);
sgListaMetaDatos.Cells[7, i+1]:=MediaInfo_Get(Handle, Stream_Audio, 0, 'BitRate/String', Info_Text, Info_Name);
sgListaMetaDatos.Cells[8, i+1]:=MediaInfo_Get(Handle, Stream_Audio, 0, 'SamplingRate', Info_Text, Info_Name);
sgListaMetaDatos.Cells[9, i+1]:=MediaInfo_Get(Handle, Stream_Audio, 0, 'Format', Info_Text, Info_Name);
pbProgress.Progress:=i;
pbProgress.Repaint;
Application.ProcessMessages;
end;