I am stuck at the last step in playing a AVI file using DirectShow in
playing the video in full screen . Full screen playing does not
necessarily mean that i am setting IVideoWindow in put_FullScreenMode
(OATRUE).
After much attempts i have 3 roads ahead and i am seeking help from
you guys in atleast one of these 3 methods. All these methods have no
issues in Windowed mode.
1. Flickering and EC_COMPLETE issue :
My video when started in full screen mode, flickers very badly. The
refresh happens so fast that not a full texture is displayed on screen
because immediately next textures tries to redraw on it. I have
overwritten WM_ERASEBKGND , handled WM_GRAPHNOTIFY as per MSDN but to
no avail. Also i may not always receive EC_COMPLETE event , though i
checked the AVI file with GraphEdit events. I have NOT used
WaitForCompletion(..,..) API here..
2. Video Overlay Issue:
I have extended the above method and one strange thing I observed is
in this approach is WaitForCompletion(INFINITE,&event) when used in
processing DirectShow events within GetEvent(..,..,..,) loop , the
flickering disappears !! Also EC_COMPLETE is received perfectly. As i
understand this happens because, WaitForCompletion() blocks all
windows messages and put them in queue until completion of video. Thus
repaints and flickers do not occur. But another new problem arises
which is the Video Overlay issue, where in sometimes Video renders on
screen but is not actually seen on window. Only I can hear the audio
of it. This happens very randomly. I have checked with my hardware
acceleration settings but no combination clicked. I am not sure if the
codec i am using are causing any deadlocks. If so, which codec i have
to go for?
3. Video not fully stretched in put_FullScreen(OATRUE) mode:
Another way i found to get rid of flickering and overlay issue is to
use IVideoWindow::put_FullScreen(OATRUE) at the start of the graph.
Also EC_COMPLETE would be received. But problem is that video is
cropped to 800 * 600 extent only where as my resolution is 1024*768.
rest part is filled with black background. Seems like the video window
is stretched but not the actual video. Why does
IVideoWindow::put_FullScreen(OATRUE) does not stretch the video fully
to resolution size? where as the video is stretched under ordinary
circumstances.
Note that this approach is to be used only under worst case scenarios
where you are forcing the full screens for improper graphic cards.
(Refer MSDN) . Also on completion of video, there would be a ugly
closure of videowindow as if minimizes and opens another window.
I am keen on the first two approaches particularly and third would be
the last option if i get any fix. But can someone give suitable
pointers for me to fix this issue.
I cannot give up at this stage and switch to VMR-7 or 9 Windowless way
which i know is far efficient than DirectShow. (i use a NVIDIA graphic
card with 512mb video memory)
Thanks
Neo
P.S: I guess i have summed up common problems with VideoWindow which
if discussed here would be helpful to one and all.
Well, then, what DOES it mean?
>After much attempts i have 3 roads ahead and i am seeking help from
>you guys in atleast one of these 3 methods. All these methods have no
>issues in Windowed mode.
>
>1. Flickering and EC_COMPLETE issue :
>My video when started in full screen mode, flickers very badly. The
>refresh happens so fast that not a full texture is displayed on screen
>because immediately next textures tries to redraw on it. I have
>overwritten WM_ERASEBKGND , handled WM_GRAPHNOTIFY as per MSDN but to
>no avail. Also i may not always receive EC_COMPLETE event , though i
>checked the AVI file with GraphEdit events. I have NOT used
>WaitForCompletion(..,..) API here..
What is your video hardware? FullScreenMode is kind of a strange beast. If
you are using VMR7 and your hardware overlay doesn't go full screen, or if
you are using VMR9 and your textures can't go full screen, then the graph
will try to use the FullScreenRenderer, which actually disables your
display driver and switches to the stock SuperVGA display driver. The
performance of that driver, as you might imagine, sucks.
>I cannot give up at this stage and switch to VMR-7 or 9 Windowless way
>which i know is far efficient than DirectShow. (i use a NVIDIA graphic
>card with 512mb video memory)
Which video renderer are you using?
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.
> >. Full screen playing does not necessarily mean that i am setting IVideoWindow in put_FullScreenMode(OATRUE).
>
> Well, then, what DOES it mean?
I should have put it more clearly. I meant that in one approach i was
setting IVideoWindow as a child clipped to my main window . Here i was
NOT at all using IVideoWindow:: put_FullScreenMode(OATRUE). Simply i
didn't had to. When my game window is set in full screen, the video
window which is set as child of this game window would also be set to
full screen. When i handled the graph events and put my
IMediaControl::WaitForCompletion() , the video runs in fullscreen
without any flickering. But i had a Overlay issue where my video is
rendering but randomly was not showing on screen (say like 3 out of 10
times). Only when i press Ctrl+Alt+Del and ESC, my video will be shown
on screen. I guess it has something to do with deadlocks. I couldn't
think of a way to fix this and so i gave up this method. This is where
i started using IVideoWindow:: put_FullScreenMode(OATRUE).
> Which video renderer are you using?
I am playing my video in my TGEA (Torque Game Engine Advanced) which
internally uses a Direct3D rendering system.
IVideoWindow:: put_FullScreenMode(OATRUE) only works when my game
window is in Windowed Mode (Strangely the video window which is child
of game window would also be in Windowed mode but the actual video
will be played on Full Screen perfectly).
But when my game runs in Full screen mode, IVideoWindow::
put_FullScreenMode(OATRUE) does NOT give a full screen video but
actually plays the original size of the video (800 * 600 whereas my
screen resolution usually is 1024*768) . So what i see is some
unrendered blank space. Worse my game may crash pointing to a stretch
Bitmap function where the garbage values are filled in destination
rectangle.
It would be of great help if you suggest how i can fix a screen
overlay issue (where video renders but not shown on screen. only audio
is heard) or how do i stretch my video to full screen using
IVideoWindow:: put_FullScreenMode(OATRUE) when my Game Window is in
Full screen mode??
I need to fix this ASAP.
Thanks
Neo
I forgot to mention that i am NOT using VMR-7 or VMR-9 in my
application, though i am running on a XP system. I am simply using
DirectShow and relevant files which i have taken from Platform SDK .
But I have also tried using VMR-7 in windowless mode and i was facing
the same problems (Screen Overlay issue) . I have noticed a good
performance using VMR-7 but is of no use if it doesn't show the video
on screen everytime i play (here even Ctrl+Alt+Del and Esc will not be
of help because screen goes blank) and and also i will face
flickering issues if i don't use IMediaContol::WaitForCompletion()
which eventually blocks any other message handling during Video play.
Neo
>
>>
>> > Which video renderer are you using?
>>
>> I am playing my video in my TGEA (Torque Game Engine Advanced) which
>> internally uses a Direct3D rendering system.
>
>I forgot to mention that i am NOT using VMR-7 or VMR-9 in my
>application, though i am running on a XP system. I am simply using
>DirectShow and relevant files which i have taken from Platform SDK .
Are you handling IVideoWindow::put_FullScreenMode in your renderer? If the
standard video renderer can't go full screen, DirectShow's fallback
position is to insert the "FullScreenRenderer", which turns off your
graphics driver and installs a stock SuperVGA driver in a simple graphics
mode. The performance of that mode is not optimal.
Tim, thanks again for the reply. My operating system is XP . So my
default rendering system using Direct Show would be "Video Renderer".
I did not understand when you said to HANDLE
IVideoWindow::put_FullScreenMode in my renderer. Do we separately
handle it instead of simply asking it to put in Full Screen? If we
don't handle like you said, my graphics dirver is turned off.
But my question now is IVideoWindow::put_FullScreenMode should work
BOTH when my application window is in Full Screen and in Window Mode.
But it doesn't. The observations are :
1. put_FullScreenMode puts my video in full screen ONLY when my
application window is in Windowed Mode.
2. put_FullScreenMode gives the native video size (800*600) and leaves
the other space of screen blank when my application window is in Full
screen mode. Sometimes my application crashes pointing to a empty
source rectangle while stretching the video bitmaps during rendering.
Since my application uses high resolutions (even 1024*768 or more) and
is required to work in FullScreen, i need to somehow stretch the video
to full screen and not get its native size.
I hope you got my problem. Ii know we don't have much control over the
video when we use IVideoWindow::put_FullScreenMode but i have seen
that nearly all Platform SDK samples use this and they work fine as
stand-alone applications. It is only when i integrate with my game i
have these above problems.
If the above problems are inherent while using the API and there's no
way to fix, would you suggest me some other method to go forward with?
I have had overlay issues (sometimes video not shown on screen) with
other approaches even while using VMR-7 windowless method.
I was on the verge of giving it up but picked up when you started
replying.
Thanks
Neo
http://msdn.microsoft.com/en-us/library/dd375812(VS.85).aspx
The newer video cards are capable of handling full screen and so that
filter was deprecated. I am not using it.
Neo
I thought you said you were using a renderer that you wrote. In that case,
your renderer would implement IVideoWindow, and would hence have a function
called put_FullScreenMode that does the work of going to full screen mode.
>But my question now is IVideoWindow::put_FullScreenMode should work
>BOTH when my application window is in Full Screen and in Window Mode.
>But it doesn't.
Well, maybe there's an aspect I'm missing here. When you say your
application window is in Full Screen mode, what do you mean? Do you mean a
Direct3D full screen app?
> I thought you said you were using a renderer that you wrote.
...
Note that the OP has multi-posted here:
--
Please read this before replying:
1. Dshow & posting help: http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others: follow up if you are helped or you found a solution
Yes, I meant a Direct3D full screen app and No, i am not writing my
own put_FullScreenMode. Simply using IVideoWindow::put_FullScreenMode
Though my problem remains unsolved, I wish to end the discussion here
obliging to the forum rules in TMH's help links. I was unaware of
multi posting (in different forums) previously.
Nevertheless I would carry the discussion with the experts at
Thanks one and all.
Neo
Well, then, who is implementing it? The renderer is supposed to implement
IVideoWindow, and whoever implements IVideoWindow is the one that is going
to handle the put_FullScreenMode call.
>Though my problem remains unsolved, I wish to end the discussion here
>obliging to the forum rules in TMH's help links. I was unaware of
>multi posting (in different forums) previously.
OK.