Click to See Complete Forum and Search --> : How to read/write video or audio in database?
July 25th, 2000, 02:14 AM
Hi,
I would like to write and read audio/video data into/from a database.
Could any one tell me how to do it?
Thanks in advance.
Lothar Haensler
July 25th, 2000, 02:55 AM
in SQL Server treat these data as data type image and use ADO's AppendChunk/GetChunk methods to read and write data.
The online help has sample source code for these methods.
July 27th, 2000, 08:29 AM
Hi,
Problem is how to handle the data: as far as I know before writting my program, I should firstly load audio/video from file into my project (e.g. for avi-files I use
CAnimateCtrl class). I can then play the audio/video in a frame of a dialog. I really do not know how to pack audio/video stream data and send them to database. If I
can pack them into for instance a VARIANT-variable, so it is no problem to insert this variable into a field of database using AppendChunk. The same problem is
by converting data, received after using GetChunk, into a data type so that one can play them.
Could you tell me more details about the principle to handle those data?
Thank you very much in advance.
Lothar Haensler
July 27th, 2000, 08:36 AM
what language do you use? sounds like C++?
well, anyway, treat those data as bytes (in VB Byte data type, in C++, I guess unsigned char).
For reading: use Getchunk and write the data to a file that you can then load into your program.
For writing: read your file and write it to the database using appendchunk
July 28th, 2000, 02:44 AM
Thank you very much.
>> what language do you use? sounds like C++?
I use VC++ 6.0 for implementing it.
>> well, anyway, treat those data as bytes (in VB Byte data type, in C++, I guess unsigned char).
>> For reading: use Getchunk and write the data to a file that you can then load into your program.
Is it possible to directly loading or converting the data into a format available in my program without
writting it into file? In your example you use unsigned char to save this data. Could you telle
me how to save this data to file?
>> For writing: read your file and write it to the database using appendchunk
it seems to be for me more difficult than by reading. For example I load avi-file
into my program using CAnimateCtrl-class. Which information must I get from
this class to create a unsigned char representing avi-data?
It is very nice if you explain me datails using some pieces of source code.
Could you send me your recommendation using my e-mail:
tob@ifak.fhg.de
Thanks
Thanks very much.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.