Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Win API / December 2008



Tip: Looking for answers? Try searching our database.

Problems with AVI playback

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Simon Woods - 13 Nov 2008 17:15 GMT
Hi

I am using some code which makes references to various AVI API calls and
  the AVIFILEINFO type.

I have a progress bar .gif which I have downloaded and am converting in
Camtasia studio (probably overkill) to an AVI file.

I have several AVIs which work fine (from the vbNet site).

When I view the file the progress bar, which plays fine in MediaPlayer,
is obviously not correct in that although there is animation, the images
which appear in the gif and the avi in mediat player are  "all over the
place" e.g. the start of the progress bar is actually in the middle of
the progress bar, it wraps round, there is a black horizontal line down
the middle of the bar.

I've not worked with AVIs before and am wondering what I should bve
looking at to correct the AVI. Camtasia gives me certain control over
the type of encoding and I am not trying to do anything whatsoever (True
Color, 10 fps, no audio, no compression.

I am not sure whether I need to do something with the AVI  or do other
stuff with the code which is animating it.

I hope I've given sufficient information.

Thx

Simon
MikeD - 13 Nov 2008 17:45 GMT
> Hi
>
[quoted text clipped - 15 lines]
>
> I hope I've given sufficient information.

Not really.  What specific "AVI API" calls are you making?  Post some code.

Signature

Mike

Simon Woods - 13 Nov 2008 18:03 GMT
>> Hi
>>
[quoted text clipped - 17 lines]
>
> Not really.  What specific "AVI API" calls are you making?  Post some code.

I don't know whether it is a coding issue or not. I don't know enought
about AVIs etc.

I'm using Karl P's animation class (VBPJ 1998). In addition, I can
download the avi's from
http://vbnet.mvps.org/index.html?code/avi/index.html and they all work
"out of the box".

Anyway, fyi, the calls I'm using are ...

Private Type t_AVIFILEINFO
    dwMaxBytesPerSec As Long
    dwFlags As Long
    dwCaps As Long
    dwStreams As Long
    dwSuggestedBufferSize As Long
    dwWidth As Long
    dwHeight As Long
    dwScale As Long
    dwRate As Long
    dwLength As Long
    dwEditCount As Long
    szFileType(1 To 64) As Byte
End Type

Private Declare Function AVIFileOpen Lib "avifil32" ( _
    ppfile As Long, _
    ByVal szFile As String, _
    ByVal mode As Long, _
    ByVal pclsidHandler As Long) As Long
Private Declare Function AVIFileRelease Lib "avifil32" ( _
    ByVal pfile As Long) As Long
Private Declare Function AVIFileInfo Lib "avifil32" Alias "AVIFileInfoA" ( _
    ByVal pfile As Long, _
    pfi As t_AVIFILEINFO, _
    ByVal lSize As Long) As Long

But because certain AVI's are displaying okay, I was assuming that these
calls are fine. I would have thought that it must be something to do
with the way I'm converting the AVI (encoding etc). I've checked the
file properties and the encoding/fps etc all look pretty similar
betweent the working avi and bad ones.

But the problem is, I'm not sure how to dig any deeper to try and work
out why the AVI playback is so badly corrupted

I'm not sure if I've helped any more.

Thx though for responding

Simon
Simon Woods - 14 Nov 2008 06:54 GMT
>> Hi
>>
[quoted text clipped - 17 lines]
>
> Not really.  What specific "AVI API" calls are you making?  Post some code.

I don't know whether it is a coding issue or not. I don't know enought
about AVIs etc.

I'm using Karl P's animation class (VBPJ 1998). In addition, I can
download the avi's from
http://vbnet.mvps.org/index.html?code/avi/index.html and they all work
"out of the box".

Anyway, fyi, the calls I'm using are ...

Private Type t_AVIFILEINFO
    dwMaxBytesPerSec As Long
    dwFlags As Long
    dwCaps As Long
    dwStreams As Long
    dwSuggestedBufferSize As Long
    dwWidth As Long
    dwHeight As Long
    dwScale As Long
    dwRate As Long
    dwLength As Long
    dwEditCount As Long
    szFileType(1 To 64) As Byte
End Type

Private Declare Function AVIFileOpen Lib "avifil32" ( _
    ppfile As Long, _
    ByVal szFile As String, _
    ByVal mode As Long, _
    ByVal pclsidHandler As Long) As Long
Private Declare Function AVIFileRelease Lib "avifil32" ( _
    ByVal pfile As Long) As Long
Private Declare Function AVIFileInfo Lib "avifil32" Alias "AVIFileInfoA" ( _
    ByVal pfile As Long, _
    pfi As t_AVIFILEINFO, _
    ByVal lSize As Long) As Long

implemented in

Private Function GetMovieDimensions(ByVal p_sAVIFile As String, _
                                        p_nWidth As Long, _
                                        p_nHeight As Long) As Boolean
 Dim l_bRes As Boolean
 Dim l_nHandle As Long
 Dim l_tInfo As t_AVIFILEINFO

    On Error GoTo ErrorHandler

    l_bRes = False

    p_nWidth = 0
    p_nHeight = 0

    If AVIFileOpen(l_nHandle, p_sAVIFile, 0, 0) = 0 Then
        l_bRes = (AVIFileInfo(l_nHandle, l_tInfo, Len(l_tInfo)) = 0)
        If l_bRes Then
            p_nWidth = l_tInfo.dwWidth * Screen.TwipsPerPixelX
            p_nHeight = l_tInfo.dwHeight * Screen.TwipsPerPixelY
        End If

        AVIFileRelease l_nHandle
    End If

ExitRoutine:

    GetMovieDimensions = l_bRes
    Exit Function

ErrorHandler:

    l_bRes = False
    Resume ExitRoutine
End Function

But because certain AVI's are displaying okay, I was assuming that these
calls are fine. I would have thought that it must be something to do
with the way I'm converting the AVI (encoding etc). I've checked the
file properties and the encoding/fps etc all look pretty similar
betweent the working avi and bad ones.

But the problem is, I'm not sure how to dig any deeper to try and work
out why the AVI playback is so badly corrupted

I'm not sure if I've helped any more.

Thx though for responding

Simon
Simon Woods - 15 Nov 2008 08:31 GMT
>> Hi
>>
[quoted text clipped - 17 lines]
>
> Not really.  What specific "AVI API" calls are you making?  Post some code.

(4th attempt to respond!)

I don't know whether it is a coding issue or not. I don't know enought
about AVIs etc.

I'm using Karl P's animation class (VBPJ 1998). In addition, I can
download the avi's from
http://vbnet.mvps.org/index.html?code/avi/index.html and they all work
"out of the box".

Anyway, fyi, the calls I'm using are ...

Private Type t_AVIFILEINFO
    dwMaxBytesPerSec As Long
    dwFlags As Long
    dwCaps As Long
    dwStreams As Long
    dwSuggestedBufferSize As Long
    dwWidth As Long
    dwHeight As Long
    dwScale As Long
    dwRate As Long
    dwLength As Long
    dwEditCount As Long
    szFileType(1 To 64) As Byte
End Type

Private Declare Function AVIFileOpen Lib "avifil32" ( _
    ppfile As Long, _
    ByVal szFile As String, _
    ByVal mode As Long, _
    ByVal pclsidHandler As Long) As Long
Private Declare Function AVIFileRelease Lib "avifil32" ( _
    ByVal pfile As Long) As Long
Private Declare Function AVIFileInfo Lib "avifil32" Alias "AVIFileInfoA" ( _
    ByVal pfile As Long, _
    pfi As t_AVIFILEINFO, _
    ByVal lSize As Long) As Long

implemented in

Private Function GetMovieDimensions(ByVal p_sAVIFile As String, _
                                        p_nWidth As Long, _
                                        p_nHeight As Long) As Boolean
 Dim l_bRes As Boolean
 Dim l_nHandle As Long
 Dim l_tInfo As t_AVIFILEINFO

    On Error GoTo ErrorHandler

    l_bRes = False

    p_nWidth = 0
    p_nHeight = 0

    If AVIFileOpen(l_nHandle, p_sAVIFile, 0, 0) = 0 Then
        l_bRes = (AVIFileInfo(l_nHandle, l_tInfo, Len(l_tInfo)) = 0)
        If l_bRes Then
            p_nWidth = l_tInfo.dwWidth * Screen.TwipsPerPixelX
            p_nHeight = l_tInfo.dwHeight * Screen.TwipsPerPixelY
        End If

        AVIFileRelease l_nHandle
    End If

ExitRoutine:

    GetMovieDimensions = l_bRes
    Exit Function

ErrorHandler:

    l_bRes = False
    Resume ExitRoutine
End Function

But because certain AVI's are displaying okay, I was assuming that these
calls are fine. I would have thought that it must be something to do
with the way I'm converting the AVI (encoding etc). I've checked the
file properties and the encoding/fps etc all look pretty similar
betweent the working avi and bad ones.

But the problem is, I'm not sure how to dig any deeper to try and work
out why the AVI playback is so badly corrupted

I'm not sure if I've helped any more.

Thx though for responding

Simon
Simon Woods - 17 Nov 2008 08:02 GMT
>> Hi
>>
[quoted text clipped - 17 lines]
>
> Not really.  What specific "AVI API" calls are you making?  Post some code.

(5th attempt to respond!)

I don't know whether it is a coding issue or not. I don't know enought
about AVIs etc.

I'm using Karl P's animation class (VBPJ 1998). In addition, I can
download the avi's from
http://vbnet.mvps.org/index.html?code/avi/index.html and they all work
"out of the box".

Anyway, fyi, the calls I'm using are ...

Private Type t_AVIFILEINFO
    dwMaxBytesPerSec As Long
    dwFlags As Long
    dwCaps As Long
    dwStreams As Long
    dwSuggestedBufferSize As Long
    dwWidth As Long
    dwHeight As Long
    dwScale As Long
    dwRate As Long
    dwLength As Long
    dwEditCount As Long
    szFileType(1 To 64) As Byte
End Type

Private Declare Function AVIFileOpen Lib "avifil32" ( _
    ppfile As Long, _
    ByVal szFile As String, _
    ByVal mode As Long, _
    ByVal pclsidHandler As Long) As Long
Private Declare Function AVIFileRelease Lib "avifil32" ( _
    ByVal pfile As Long) As Long
Private Declare Function AVIFileInfo Lib "avifil32" Alias "AVIFileInfoA" ( _
    ByVal pfile As Long, _
    pfi As t_AVIFILEINFO, _
    ByVal lSize As Long) As Long

implemented in

Private Function GetMovieDimensions(ByVal p_sAVIFile As String, _
                                        p_nWidth As Long, _
                                        p_nHeight As Long) As Boolean
 Dim l_bRes As Boolean
 Dim l_nHandle As Long
 Dim l_tInfo As t_AVIFILEINFO

    On Error GoTo ErrorHandler

    l_bRes = False

    p_nWidth = 0
    p_nHeight = 0

    If AVIFileOpen(l_nHandle, p_sAVIFile, 0, 0) = 0 Then
        l_bRes = (AVIFileInfo(l_nHandle, l_tInfo, Len(l_tInfo)) = 0)
        If l_bRes Then
            p_nWidth = l_tInfo.dwWidth * Screen.TwipsPerPixelX
            p_nHeight = l_tInfo.dwHeight * Screen.TwipsPerPixelY
        End If

        AVIFileRelease l_nHandle
    End If

ExitRoutine:

    GetMovieDimensions = l_bRes
    Exit Function

ErrorHandler:

    l_bRes = False
    Resume ExitRoutine
End Function

But because certain AVI's are displaying okay, I was assuming that these
calls are fine. I would have thought that it must be something to do
with the way I'm converting the AVI (encoding etc). I've checked the
file properties and the encoding/fps etc all look pretty similar
betweent the working avi and bad ones.

But the problem is, I'm not sure how to dig any deeper to try and work
out why the AVI playback is so badly corrupted

I'm not sure if I've helped any more.

Thx though for responding

Simon
Simon Woods - 16 Dec 2008 06:49 GMT
Mike

Just to say that I tried about 12 times to post a response to this but
nothing got through ... and I gave up. Since I got through on the vb.com
ng I thought I try again.

I didn't want to appear as if I was ignoring your reply. Obviously time
has passed and this is now no longer an issue - FYI I think I re-worked
one of our existing user controls to get the effect I achieved.

Simon

>> Hi
>>
[quoted text clipped - 17 lines]
>
> Not really.  What specific "AVI API" calls are you making?  Post some code.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.