key88sf wrote:I am trying to generate a bitmap of an FLV movie downloaded from YouTube. My code first gets the total frames, then tries to set the frame number to the middle frame (total / 2), and then get a bitmap with FPCM_GET_FRAME_BITMAP.
However, the call to get total frames (using FPCM_GET_TOTALFRAMES) fails with E_FAIL:
SFPCGetTotalFrames.hr == E_FAIL
How can I fix this? Or is there a better way to get a bitmap "snapshot" of an FLV file?
key88sf wrote:FPCM_GET_FRAME_BITMAP is returning a bitmap which is completely black. How can I have it return a bitmap which is an actual screenshot of the movie?
key88sf wrote:Hi - your code works, but requires that I play the video up until the point when I take the snapshot.
key88sf wrote:What I want is: Code that can quickly open an FLV file, take a snapshot of the movie (near halfway point), and close the FLV file. There will be no UI to display the movie to the user...this will be in the background so it should happen fast to only generate a bitmap image.
I have tried in my code:
- load the FLV as you do
- play
- set frame
- take snapshot
- stop
but still just see all-black bitmap. I cannot let the video play halfway before taking the snapshot. Any ideas to help me??
key88sf wrote:There is no way other than to wait? If I try to play and then call FPCM_GET_TOTALFRAMES, it is returning 1. So it looks as if I cannot skip to the middle point in the movie? Is it possible to skip using a FlashVars= parameter when playing the FLV?
key88sf wrote:BOOL LoadFLV(LPCTSTR url, int layer = 0)
{
CString strFlashVars = _T("FLVPath=");
strFlashVars += url;
FPC_PutFlashVars(m_hWnd, strFlashVars);
return FPCPutMovieFromResource(m_hWnd, ModuleHelper::GetResourceInstance(), _T("FLVPlayer"), _T("SWF"));
}
Code: Select all
BOOL LoadFLV(LPCTSTR url, int layer = 0)
{
CString strFlashVars = _T("type_video=flv&url=");
strFlashVars += url;
FPC_PutFlashVars(m_hWnd, strFlashVars);
return FPCPutMovieFromResource(m_hWnd, ModuleHelper::GetResourceInstance(), _T("FLVPlayer"), _T("SWF"));
}
Users browsing this forum: No registered users and 18 guests