problem with mciSendStr()

problem with mciSendStr()

Postby Roger Seiler » Mon Jun 09, 2008 8:11 pm

To play a video containing both moving picture and sound, I use the mci code below. If I run the program in XP it works fine - the sound is heard and the moving picture is displayed.

But if I run it in Vista Home Premium, the sound is heard but the moving picture is not displayed.

What am I doing wrong?

- Roger

Code: Select all  Expand view
STATIC FUNCTION VidPlay(oDlg,cBuffer,oBmp3,cFileV)
LOCAL nStart := 0

      cBuffer:=Space(200)

      IF EMPTY(cFileV)
         cFileV := "MyVideo.avi"
      ENDIF

      mciSendStr("OPEN AVIVIDEO!"+Upper(Alltrim(cFileV))+" ALIAS VIDEO PARENT ";
               +Alltrim(str(oBmp3:hWnd)),@cBuffer,oDlg:hWnd)
      mciSendStr("put video destination at 0 0 220 174",@cBuffer,oDlg:hWnd) 
      mciSendStr("WINDOW VIDEO HANDLE "+Alltrim(str(oBmp3:hWnd)),@cBuffer,oDlg:hWnd)
      mciSendStr("PLAY VIDEO FROM "+ALLTRIM(STR(nStart)),@cBuffer,oDlg:hWnd)

RETURN nil

User avatar
Roger Seiler
 
Posts: 223
Joined: Thu Dec 01, 2005 3:34 pm
Location: Nyack, New York, USA

Postby Antonio Linares » Tue Jun 10, 2008 5:08 pm

Roger,

It could be a missing AVI required codec in Vista.

Are you able to properly play the AVI from the Media Player ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Roger Seiler » Wed Jun 11, 2008 12:17 am

Antonio,

Your suggestion pointed me in the right direction, but there is still a problem.

If I play my video Harry.avi or Shuttle3.avi on my Vista computer's Windows Media Player, again only the sound plays with no picture. But if I play Sample.avi (provided by Microsoft with Win '95) on the Vista Win Media Player, then I get BOTH sound and picture. Then, if I play Sample.avi on Vista in my FWH/xHb app, I also get both sound and picture. So it seems to not be an FWH/xHb problem.

As I mentioned earlier, Harry.avi and Shuttle3.avi play with both picture and sound in XP and Win '98. So it seems that Vista doesn't like some kinds of .avi files.

I've uploaded both Shuttle3.avi (works only on XP) and Sample.avi (works on both XP and Vista) to the URLs below in case you care to look at them and see if you can see some technical difference in them. If so, it would be useful to all of us to know this difference. Each file is under 2 MB in size.

[/url]http://www.leadersoft.com/files/Sample.avi[url]

[/url]http://www.leadersoft.com/files/Shuttle3.avi[url]

Thanks for your help,

- Roger[/url]
User avatar
Roger Seiler
 
Posts: 223
Joined: Thu Dec 01, 2005 3:34 pm
Location: Nyack, New York, USA

Postby Roger Seiler » Fri Jun 13, 2008 3:00 am

Well, now I'm learning about codec files - what a mess!

Oh for the good old days when IBM ruled the roost and everything was perfect. ;-)
User avatar
Roger Seiler
 
Posts: 223
Joined: Thu Dec 01, 2005 3:34 pm
Location: Nyack, New York, USA

Postby Antonio Linares » Fri Jun 13, 2008 8:28 am

Roger,

Yes, I agree, codecs are a real mess :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Roger Seiler » Fri Jun 27, 2008 6:03 pm

For anyone else who is working with AVI video and who might be interested in the solution that I found to this problem, here it is...

My original video had been edited and output to AVI using Pinnacle Studio 7. In outputing to AVI, I had originally used the Intel Indeo R3.2 codec compression tool. (A codec is a dll that compresses the video into a much more compact disk space than the "raw" avi, taking a 100 mb "raw" avi and squeezing it down to less than 10 mb in a compressed avi.)

My output AVI could be displayed okay on Windows 95, 98, 2000 and XP, but on Vista the audio could be heard but the video picture did not appear. Curiously, I found that the codec file for Indeo R3.2 does in fact exist in the Win Vista system32 folder, but for some unknown reason wouldn't show the moving image part of the video.

So I went back to Studio 7 and experimented with other codecs (different methods of video compression). The only codec supplied with Studio 7 that works on Vista (showing the moving picture) is Cinepak Codek by Radius - which is also supplied by default with Win Vista. Its compression is not as tight as Indeo R3.2, but at least it works on Vista as well as XP.

If one upgrades to Pinnacle Studio 12, there are apparently more codecs included that are compatible with Vista, and which may offer greater compression than Cinepak.

- Roger
User avatar
Roger Seiler
 
Posts: 223
Joined: Thu Dec 01, 2005 3:34 pm
Location: Nyack, New York, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 103 guests