Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multimedia Database 1

Status
Not open for further replies.

masper

Programmer
Sep 20, 2002
6
GB
Hi everyone. I'm new to Delphi and as part of a project I need to create a database. The database will server based and will store video clips (probably mpeg or AVI). I'm going to use Delphi and probably MySQL. Does anyone have any suggestions as to how I would go about this? Any tips would be greatly appreciated.
 
Hi

Perhaps you can just put into the DB the full parth of the file containing the clip. This can be a simple string, helping to save space. I think you don't really want to store the entire videoclip into the DB (the DB will soon become too big). But if this is the case, consider making BLOB fields and streaming data from the original file.

HTH Francesco Salvi
 
Hi,
If you want to put a file into a Blob:

SalvaFileNelDb(EmailTbl.FieldByName('File'),'C:\Deleteme.eml');

****
Procedure TMailDownloaderFrm.SalvaFileNelDb(Campo:TField; NomeFile:TFileName);
Var Blob:TStream;
FS:TFileStream;
Begin
If Not (Campo.DataSet.State in dsEditModes)
Then Campo.DataSet.Edit;

Blob := Campo.DataSet.CreateBlobStream(Campo, bmWrite);
Try
blob.Seek(0, soFromBeginning);
FS:=TFileStream.Create(NomeFile, fmOpenRead or fmShareDenyWrite);
try
Blob.CopyFrom(fs, fs.Size)
finally
fs.Free
end;
finally
Blob.Free
end
End;
****

Ciao,
Geppo Darkson.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top