線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:2846
推到 Plurk!
推到 Facebook!

關於在BCB上播放影片不能超過4527 frames的問題?

尚未結案
Llj
一般會員


發表:1
回覆:1
積分:0
註冊:2007-01-04

發送簡訊給我
#1 引用回覆 回覆 發表時間:2007-01-04 11:44:13 IP:140.113.xxx.xxx 訂閱
之前用BCB寫的撥放器撥avi的影片 當撥到影片4500左右的frame後,之後就show不出來了,請問有沒有人碰過一樣的問題?
Llj
一般會員


發表:1
回覆:1
積分:0
註冊:2007-01-04

發送簡訊給我
#2 引用回覆 回覆 發表時間:2007-05-29 22:23:40 IP:140.113.xxx.xxx 訂閱
各位前輩好 我是使用之前 TmyAvi版友所發表的avi轉bmp範例http://delphi.ktop.com.tw/board.php?cid=31&fid=79&tid=41765


來改寫作為讀avi frame的程式
下面是GetFrame的部分
---------------------------

void __fastcall TMyAVI::GetFrame(Graphics::TBitmap *pBitmap, long Index)
{
PGETFRAME pGetFrame;
if(pStreamInfo->dwLength != 0 && (DWORD)Index < pStreamInfo->dwLength)
{
// Prepare to decompress video frames from the specified video stream
// CALL: [API] AVIStreamGetFrameOpen()
pGetFrame = AVIStreamGetFrameOpen(pVideoStream, pBIH);

// NOTE: If the system cannot find a decompressor that can decompress
// the stream to the given format, or to any RGB format, the
// function returns NULL.
if(pGetFrame == NULL)
{
MessageBox(NULL, "ERROR: AVIStreamGetFrameOpen( ) can't find a decompressor.", "Can't find decoder!", MB_OK);
AVIStreamGetFrameClose(pGetFrame);
return;
}

// Return the address of a decompressed video frame
// CALL: [API] AVIStreamGetFrame()
Byte *pDIB = (Byte *)AVIStreamGetFrame(pGetFrame, Index);

// get the data of 'real bitmap'
Byte *pDest = (Byte *)pFBitmap->ScanLine[FHeight - 1];
CopyMemory(pDest, pDIB 0x28, pBIH->biSizeImage);
// and copy to desired TBitmap
pBitmap->Assign(pFBitmap);

// Finally, release resources used to decompress video frames
// CALL: [API] AVIStreamGetFrameClose()
AVIStreamGetFrameClose(pGetFrame);
}
}


----------------------------
但當影片frames讀取到數千張(不同的電腦當的frame數都不一樣)時 程式就會當掉
錯誤顯示在getframe( )裡面
是不是有memory的部分沒有釋放完全?
錯誤的地方如下:
圖示
編輯記錄
Llj 重新編輯於 2007-05-29 22:24:50, 註解 無‧
Llj 重新編輯於 2007-05-29 22:25:38, 註解 無‧
Llj 重新編輯於 2007-05-29 22:32:12, 註解 無‧
系統時間:2024-05-18 19:27:37
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!