Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, May 15, 2012 3:51:20 AM(UTC)
JOO HYUN YOON

Groups: Registered
Posts: 16


I made a capture project using LTMM 17.5 capture demo.
I have a error about setting videosize.
When I using recording function with audio device,
I cannot change videosize after recording.

Without audio device, I don't have any problem.

I attach my source about recording/recording stop/and changing video deivce.
Please give me any advice.

----------------------------------------------
Recording
Public Sub RecordAVI()
Dim bError As Boolean
bError = False
Dim SysTime As SYSTEMTIME
Call GetLocalTime(SysTime)
Dim objTime As Date = DateTime.Now
Dim szFileName As String
Dim val, res As Integer
Dim count As Integer
Dim i As Integer
Dim name As String


Time = 0
Timehour = 0
Timemin = 0

szFileName = ("" & SysTime.wMonth.ToString("00") & SysTime.wDay.ToString("00") & SysTime.wHour.ToString("00") & SysTime.wMinute.ToString("00") & SysTime.wSecond.ToString("00"))

g_Recording = True


AxltmmCaptureCtrl1.TargetFile = strFolderPath + "\SDP_" + szFileName + ".avi"

Dim strPath As String = strFolderPath + "\SDP_" + szFileName
If Directory.Exists(strFolderPath) = True Then
Else
Directory.CreateDirectory(strFolderPath)
End If

Try
AxltmmCaptureCtrl1.AllocTarget(CType((1), Integer))
Catch ex As Exception
g_Recording = False
MessageBox.Show("You can't record a file now. ", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning)
Exit Sub
End Try

Time = 0
Timesec = 0
Timemin = -1
Timehour = 0

Try
AxltmmCaptureCtrl1.Hide()
If bError = False Then
If AudioDeviceIndex = True Then '// Audio device index
RecMode = CaptureMode.VideoAndAudio
AxltmmCaptureCtrl1.TimeLimit = CDbl(TimeLimit)
AxltmmCaptureCtrl1.UseTimeLimit = True

AxltmmCaptureCtrl1.FrameRate = FrameRateNumber
AxltmmCaptureCtrl1.UseFrameRate = True

count = AxltmmCaptureCtrl1.AudioDevices.Count

If (count > 0) Then
AxltmmCaptureCtrl1.AudioDevices.Item(AudioDeviceSelect).Selected = True
AxltmmCaptureCtrl1.AudioCompressors.Item(MAdpcm_index).Selected = True
AxltmmCaptureCtrl1.MasterStream = Leadtools.Multimedia.CaptureMasterStream.None
DoCapture(CaptureMode.VideoAndAudio)
Else
AxltmmCaptureCtrl1.MasterStream = Leadtools.Multimedia.CaptureMasterStream.None
DoCapture(CaptureMode.Video)
End If

Else
AxltmmCaptureCtrl1.TimeLimit = CDbl(TimeLimit)
AxltmmCaptureCtrl1.UseTimeLimit = True

AxltmmCaptureCtrl1.FrameRate = FrameRateNumber
AxltmmCaptureCtrl1.UseFrameRate = True

AxltmmCaptureCtrl1.MasterStream = Leadtools.Multimedia.CaptureMasterStream.None
DoCapture(CaptureMode.Video)
End If

End If
Catch ex As Exception

End Try


End Sub
-----------------------------------------------
Recording stop
Public Sub RecordStop()
Try
AxltmmCaptureCtrl1.StopCapture()
AxltmmCaptureCtrl1.AudioDevices.Item(AudioDeviceSelect).Selected = False

RecordTimer.Enabled = False
Time = 0
Timehour = 0
Timemin = 0
Timesec = 0
WriteCaptureStatus(True)

Catch ex As Exception
OutputDebugString("ERROR")
Exit Sub
End Try
End Sub
------------------------------------------
Changing Resolution
Sub ResolutionXGA()
Try
AxltmmCaptureCtrl1.Hide()

Resolution = 2
Me.Width = 658
Me.Height = 660

Dim videosizes As CaptureSizes
videosizes = AxltmmCaptureCtrl1.VideoCaptureSizes

videosizes.Item(2).Selected = True

InputSXGA15Tool.Checked = False
InputVGA30Tool.Checked = False
InputXGA15Tool.Checked = True

AxltmmCaptureCtrl1.Show()
Application.DoEvents()
Catch ex As Exception
Exit Sub
End Try

End Sub

Sub ResolutionSXGA()

Try
Resolution = 3
Me.Width = 658
Me.Height = 660


Dim videosizes As CaptureSizes

videosizes = AxltmmCaptureCtrl1.VideoCaptureSizes
videosizes.Item(3).Selected = True

InputSXGA15Tool.Checked = True
InputVGA30Tool.Checked = False
InputXGA15Tool.Checked = False

AxltmmCaptureCtrl1.Show()
Application.DoEvents()
Catch ex As Exception
Exit Sub
End Try
End Sub

I have a error videosizes.item(i).selected = true line,
after recording with audio device. Of course recording file is OK.(size and playing).

When I remove "AxltmmCaptureCtrl1.AudioDevices.Item(AudioDeviceSelect).Selected = True" this part, I can change size normally. I can find where is mistake.

Please tell me anything.
Thx
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, May 15, 2012 5:58:24 AM(UTC)

mohamed  
mohamed

Groups: Registered, Tech Support
Posts: 179


Please try to disconnect the filter graph before you attempt changing the vide size. To do that, call AxltmmCaptureCtrl1.ResetTarget(), do the change, then assign the TargetFile anew.

If that doesn't solve it, check our Multimedia Capture Demo and do the following steps before start capturing:
1. Select your video device From "Options-> Video Device" menu item.
2. Select your audio device From "Options-> Audio Device" menu item.
3. Change the video size From "Options-> Video Capture size" menu item.
If the problem persists, please send email to support@leadtools.com and include the following information:
A. Your serial number if you have one (don't post it here).
B. the name of the devices you used.
C. Link to this forum post.
Mohamed Abedallah
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 
#3 Posted : Wednesday, May 16, 2012 8:36:58 PM(UTC)
JOO HYUN YOON

Groups: Registered
Posts: 16


I solve this problem.

Thx!!!
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.081 seconds.