🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.multimedia
9 messages
9 total messages Started by Zsolt Kendi Sun, 08 May 2005 08:15
AVI read with BCB6
#122
Author: Zsolt Kendi
Date: Sun, 08 May 2005 08:15
3 lines
1111 bytes
If I try to prcess avi file with bcb6 (AVIStream functions) the during the AVIStreamRead always get AVIERR_ERROR. This occured always at the same frame. 
Anybody have idea how to possible solve this problem?
Re: AVI read with BCB6
#124
Author: Remy Lebeau (TeamB)
Date: Mon, 09 May 2005 16:57
18 lines
1388 bytes
"Zsolt Kendi" <kzsolt@datanet.hu> wrote in message
news:427dcab5$1@newsgroups.borland.com...

> If I try to prcess avi file with bcb6 (AVIStream functions) the during
> the AVIStreamRead always get AVIERR_ERROR. This occured
> always at the same frame.

Maybe the frame in question is corrupted to begin with?  Maybe you are using
AVIStreamRead() incorrectly?

> Anybody have idea how to possible solve this problem?

Your description is much too vague to diagnose your problem.  Please provide
more details.


Gambit
Re: AVI read with BCB6
#134
Author: Sergio Velastin
Date: Fri, 13 May 2005 17:09
45 lines
2231 bytes
I guess one way of checking is opening the file with a conventional 
media player. It might also be a matter that you dont have the right 
codec on your system (the conventional media player will tell you that).


Remy Lebeau (TeamB) wrote:
> "Zsolt Kendi" <kzsolt@datanet.hu> wrote in message
> news:427dcab5$1@newsgroups.borland.com...
> 
> 
>>If I try to prcess avi file with bcb6 (AVIStream functions) the during
>>the AVIStreamRead always get AVIERR_ERROR. This occured
>>always at the same frame.
> 
> 
> Maybe the frame in question is corrupted to begin with?  Maybe you are using
> AVIStreamRead() incorrectly?
> 
> 
>>Anybody have idea how to possible solve this problem?
> 
> 
> Your description is much too vague to diagnose your problem.  Please provide
> more details.
> 
> 
> Gambit
> 
> 

-- 
Dr Sergio A. Velastin
Digital Imaging Research Centre
School of Computing & Information Systems
Kingston University
Penrhyn Road
Kingston-upon-Thames
Surrey KT1 2EE
United Kingdom
Tel: +44 (20) 8547 7719
Fax: +44 (20) 8547 7719 / 7972

sergio.velastin@kingston.ac.uk
sergio.velastin@iee.org
http://www.king.ac.uk/dirc
Re: AVI read with BCB6
#141
Author: Zsolt Kendi
Date: Mon, 16 May 2005 13:37
50 lines
2278 bytes
We have more test avi file, each different length, and form 4 differenet source. All can played with MSMP9.


Sergio Velastin <sergio.velastin@iee.org> wrote:
>I guess one way of checking is opening the file with a conventional 
>media player. It might also be a matter that you dont have the right 
>codec on your system (the conventional media player will tell you that).
>
>
>Remy Lebeau (TeamB) wrote:
>> "Zsolt Kendi" <kzsolt@datanet.hu> wrote in message
>> news:427dcab5$1@newsgroups.borland.com...
>> 
>> 
>>>If I try to prcess avi file with bcb6 (AVIStream functions) the during
>>>the AVIStreamRead always get AVIERR_ERROR. This occured
>>>always at the same frame.
>> 
>> 
>> Maybe the frame in question is corrupted to begin with?  Maybe you are using
>> AVIStreamRead() incorrectly?
>> 
>> 
>>>Anybody have idea how to possible solve this problem?
>> 
>> 
>> Your description is much too vague to diagnose your problem.  Please provide
>> more details.
>> 
>> 
>> Gambit
>> 
>> 
>
>-- 
>Dr Sergio A. Velastin
>Digital Imaging Research Centre
>School of Computing & Information Systems
>Kingston University
>Penrhyn Road
>Kingston-upon-Thames
>Surrey KT1 2EE
>United Kingdom
>Tel: +44 (20) 8547 7719
>Fax: +44 (20) 8547 7719 / 7972
>
>sergio.velastin@kingston.ac.uk
>sergio.velastin@iee.org
>http://www.king.ac.uk/dirc
Re: AVI read with BCB6
#142
Author: Zsolt Kendi
Date: Mon, 16 May 2005 13:39
147 lines
6462 bytes
Here is the code (structure) used by ours:

/* avidemo.cpp */


AVIOpen()
	{
        hResult = AVIFileOpen(&(pSD->pInfile), StrArgs.FromFname.c_str(), OF_READ, 0L);
        if(hResult)
                // error
        // avi file info
       	hResult = AVIFileInfo( pSD->pInfile, &(pSD->thisPfi), sizeof(AVIFILEINFO));
        if(hResult)
                // error
	}

AudioOpen()
	{
        hResult = AVIFileGetStream(pSD->pInfile, &(pSD->pAudioInStream), streamtypeAUDIO, 0);
	if(hResult)   // ha hiba volt
                // error
        pSD->AInstreastartS = AVIStreamStart(pSD->pAudioInStream);  // autdio stream start pos
        hResult = AVIStreamReadFormat(pSD->pAudioInStream, pSD->AInstreastartS, NULL, &laudioinfosize);  // avi file format info hossza
	if(hResult)   // ha hiba volt
                // error
        pSD->pChunkAudio = new BYTE[laudioinfosize+8];  // allokaljuk a szukseges teruletet, biztos ami biztos
        if(!(pSD->pChunkAudio))   // ha hiba volt
                // error
        if(AVIStreamReadFormat(pSD->pAudioInStream, pSD->AInstreastartS, pSD->pChunkAudio, &laudioinfosize))    // retrive info now!
	        {   // ha hiba volt
                // error
                }
        }

VideoOpen()
	{
        // open video stream
         hResult = AVIFileGetStream(pSD->pInfile, &(pSD->pVideoInStream), streamtypeVIDEO, 0);
        if(hResult)
                // error
        pSD->VInstreastartS = AVIStreamStart(pSD->pVideoInStream);     // az elso frame
        hResult = AVIStreamReadFormat(pSD->pVideoInStream, pSD->VInstreastartS , NULL, &lvideoinfosize);  // avi file format info hossza
        if(hResult)
                // error
        pSD->pChunkVideo = new BYTE[lvideoinfosize+8];  // allokaljuk a szukseges teruletet, biztos ami biztos
        if(!(pSD->pChunkVideo))   // ha hiba volt
                // error
        if(AVIStreamReadFormat(pSD->pVideoInStream, pSD->VInstreastartS, pSD->pChunkVideo, &lvideoinfosize))    // retrive info now!
	        {   // ha hiba volt
                // error
                }
        pInfo = (LPBITMAPINFO)pSD->pChunkVideo;
        if( pInfo->bmiHeader.biSize != sizeof(BITMAPINFOHEADER) )       // ha nem stimmel a header hossza
                // error
        CopyMemory(&(pSD->bminfo),pInfo,sizeof(BITMAPINFO));     // a bitmap info az utokornak
#if 0   // tankonyv szerint, viszont az eredmeny rossz!
        lpbi = &(pInfo->bmiHeader);
#else   // info form first frame, ugy nez ki ez pontosabb!

        pSD->pgetfrm = AVIStreamGetFrameOpen(pSD->pVideoInStream, NULL);    // get frame for info only
        lpbi = (LPBITMAPINFOHEADER)AVIStreamGetFrame(pSD->pgetfrm, pSD->VInstreastartS);   // az elso frame falbol
#endif
}


Audioproc()
	{
        AudioSstart = pSD->AInstreastartS;     // indulo stream pozicio
        AudioSnum = (pSD->asamplpers / nAudioSample); // ennyi sample-t dogozunk fel egyszerre
        do
                {
                        // behozzuk az audio mintakat
                savedAhResult = AhResult = AVIStreamRead(pSD->pAudioInStream,AudioSstart,AudioSnum,NULL,0,&AudioPlen,NULL);   // lekerujuk a szukseges buffer meretet
                if(AhResult != 0)
                        // error
                pABuffer = new BYTE[AudioPlen]; // allocate frame buffer
                if(!(pABuffer))
                        // error
                savedAhResult = AhResult = AVIStreamRead(pSD->pAudioInStream,AudioSstart,AudioSnum, pABuffer, AudioPlen, NULL, &AudioSnumact );
                if(AhResult != 0)
                        // error
                asp = (INT16 *)pABuffer; // itt vannak az audio mintak AudioSnum szamban
                //
                // sample processing ..
                //
                AudioSstart += AudioSnum;       // ennyit megettunk
                }
        while();
        }


Videoproc()
	{
        VideoSstart = pSD->VInstreastartS;     // indulo stream pozicio
        VideoSnum = 1; // ennyi sample-t dogozunk fel egyszerre
        do
                {
                lpbi = (LPBITMAPINFOHEADER)AVIStreamGetFrame(pVgetframe,VideoSstart);    // read frame
                if(lpbi == NULL)
                       {       // ha hiba volt
                       VhResult = 29;
                       break;       // ha hiba volt, kilepunk
                       }
                pData = MakepData(lpbi,pSD);    // eloallitjuk a bitmezo elejet
                //
                // bitmap processing ...
                //
                VideoSstart += VideoSnum;       // ennyit megettunk
                }
        while();
        }


main()
        {
        AVIOpen();
        VideoOpen();
        AudioOpen();
        Audioproc();
        Videoproc();

        // cleanup...
        }


"Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> wrote:
>
>"Zsolt Kendi" <kzsolt@datanet.hu> wrote in message
>news:427dcab5$1@newsgroups.borland.com...
>
>> If I try to prcess avi file with bcb6 (AVIStream functions) the during
>> the AVIStreamRead always get AVIERR_ERROR. This occured
>> always at the same frame.
>
>Maybe the frame in question is corrupted to begin with?  Maybe you are using
>AVIStreamRead() incorrectly?
>
>> Anybody have idea how to possible solve this problem?
>
>Your description is much too vague to diagnose your problem.  Please provide
>more details.
>
>
>Gambit
>
>
Re: AVI read with BCB6
#150
Author: Zsolt Kendi
Date: Tue, 17 May 2005 08:45
8 lines
1109 bytes
Some more information:

Our opsys is MSWXP with or without SP2.

If the problem occured at frame n (does not matter audio or video):
- if we start read at frame n-4 then the error occured at frame n.
- if we start read at frame n+4 then  the error occured at frame n+4.
Re: AVI read with BCB6
#151
Author: Zsolt Kendi
Date: Tue, 17 May 2005 11:11
5 lines
1274 bytes
Some more more information:

We maybe found some rule.
The AVIERR_ERROR always occured nearly in 1Gbyte point of file. This is independent form the genrator of the file (trys with pinnacle stu8, amcap, amcapnoeld, ativideoin), and independent form the outputformat (RGB or 2YUY)
Re: AVI read with BCB6
#152
Author: Mark Jacobs
Date: Tue, 17 May 2005 12:26
10 lines
1688 bytes
Zsolt Kendi wrote:
> Some more more information:
> 
> We maybe found some rule.
> The AVIERR_ERROR always occured nearly in 1Gbyte point of file. This is independent form the genrator of the file (trys with pinnacle stu8, amcap, amcapnoeld, ativideoin), and independent form the outputformat (RGB or 2YUY)

You've found a bug with Windows XP!?! Well I never ...
-- 
Mark Jacobs
http://www.dkcomputing.co.uk
Re: AVI read with BCB6
#155
Author: Zsolt Kendi
Date: Tue, 17 May 2005 17:21
16 lines
2000 bytes
Mark Jacobs <http://www.jacobsm.com/mjmsg.htm?mj@critical> wrote:
>Zsolt Kendi wrote:
>> Some more more information:
>> 
>> We maybe found some rule.
>> The AVIERR_ERROR always occured nearly in 1Gbyte point of file. This is independent form the genrator of the file (trys with pinnacle stu8, amcap, amcapnoeld, ativideoin), and independent form the outputformat (RGB or 2YUY)
>
>You've found a bug with Windows XP!?! Well I never ...
>-- 
>Mark Jacobs
>http://www.dkcomputing.co.uk

I think not. But may we found bug in SDK doku. So, about the stream length we have two information. First is AVIFILEINFO dwLength, second is the AVIStreamLength(). What if the two value are different? 
Otherwords, we can read with the above sample code the dwLength number of frames, but we cannot read AVIStreamLength() frames (AVIERR_ERROR). According the SDK doku the AVIStreamLength() is the reference, but not work.
Where is the truth?
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads