Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Splitting an AVI with ltmmSampleTarget
Started by twhif at 02-13-2008 23:47. Topic has 8 replies.

Print Search « Previous Thread Next Thread »
  02-13-2008, 23:47
twhif is not online. Last active: 3/7/2008 1:39:39 PM twhif

Top 500 Posts
Joined on 12-30-2007
Posts 9
Splitting an AVI with ltmmSampleTarget
Reply Quote
The code provided in the SDK for splitting an AVI into multiple bitmaps works great with uncompressed videos but when I try a compressed video file the sample data retrieved from ltmmSampleTarget->GetSample doesn't appear to be a bitmap. I'm assuming the sample's data buffer contains a compressed bitmap instead considering the values of the sample's BufferSize and ActualDataLength are much smaller than a frame's bitmap size (height X width X bytes/pixel). If this is the case, then how can I get the uncompressed bitmap for a sample like you would get when using a callback filter?
   Report 
  02-14-2008, 9:33
Qasem Lubani is not online. Last active: 9/2/2008 11:31:52 AM Qasem Lubani



Top 10 Posts
Joined on 08-13-2006
Posts 1,044
Re: Splitting an AVI with ltmmSampleTarget
Reply Quote

You can force a de-compressor to be inserted by simply using any processor filter that requires uncompressed RGB input, such as the LEAD Video RGB converter filter.

 

Another approach you could use is to do the splitting using our LEAD Still Image Write filter. This filter can take a video stream and output still images such as BMP or JPEG. This filter is part of the LEADTOOLS Multimedia toolkit, but not all output formats are included in the price. If you need more details about this point, please send an email to sales@leadtools.com
Qasem Al-Lubani
LEAD Technical Support
www.leadtools.com
   Report 
  02-17-2008, 21:16
twhif is not online. Last active: 3/7/2008 1:39:39 PM twhif

Top 500 Posts
Joined on 12-30-2007
Posts 9
Re: Splitting an AVI with ltmmSampleTarget
Reply Quote
I think I'm missing something here.

When I try adding the RGB converter filter my test app crashes when the filter is added to the converter's selected processors. Even when I don't use the ltmmSampleTarget object and just set the converter target file to NUL then StartConvert fails.

I have 4 sample videos I'm testing with. The count.avi video used by the LEADTOOLS samples works fine. The other 3 are all avi files encoded with different codecs.

Each video works fine when I use the callback filter, however, there are other reasons I can't use that filter. Also, the still image writer filter doesn't sound like it would work for what I'm trying to do.

I feel that I'm missing a step. Is there a limitation as to the types of source videos the RGB convert filter can handle? Is there another filter I might try instead?
   Report 
  02-18-2008, 5:33
Qasem Lubani is not online. Last active: 9/2/2008 11:31:52 AM Qasem Lubani



Top 10 Posts
Joined on 08-13-2006
Posts 1,044
Re: Splitting an AVI with ltmmSampleTarget
Reply Quote

About the videos that fail, do they play correctly using our Player demos? If yes, can you add the RGB filter in the player demo?

If any of them doesn't play, are you sure you have the correct decoder installed for this file? Is any of them small enough to be attached here or in email? If yes, please put it in a ZIP or RAR file before you try to attach it.
Qasem Al-Lubani
LEAD Technical Support
www.leadtools.com
   Report 
  02-19-2008, 0:02
twhif is not online. Last active: 3/7/2008 1:39:39 PM twhif

Top 500 Posts
Joined on 12-30-2007
Posts 9
Re: Splitting an AVI with ltmmSampleTarget
Reply Quote
The .NET C# player and convert demos work (with and without the RGB filter). The C++ player and convert demos crash.

I've attached a test video I've been using. I got it somewhere off the Microsoft website. It's an old video but behaves the same as the new videos I'll be working with.

Another bit of information. When I try using ltmmSampleTarget in a C# test app, I have a problem similar to the C++ test app I've mentioned previously. Specifically I can't set both the TargetObject of a converter to an ltmmSampleTarget object and also set the RGB filter for the converter. I've tried changing the order these are set and the app always crashes or hangs when setting the second one.
   Report 
  02-19-2008, 0:05
twhif is not online. Last active: 3/7/2008 1:39:39 PM twhif

Top 500 Posts
Joined on 12-30-2007
Posts 9
Re: Splitting an AVI with ltmmSampleTarget

Attachment: SAMPLE.zip
Reply Quote
I don't see my attachment. Let's try posting without previewing first...
   Report 
  02-19-2008, 5:49
Qasem Lubani is not online. Last active: 9/2/2008 11:31:52 AM Qasem Lubani



Top 10 Posts
Joined on 08-13-2006
Posts 1,044
Re: Splitting an AVI with ltmmSampleTarget
Reply Quote

I tried our C++ demos here with this vide and they worked. The problem might be specific to your PC, possibly caused by a third-party DirectShow filter or codec, or by an old build of one of our own filters.

One way to see which filters are being used is to check the internal filter graph using our EditGraph() function right before or after the StartPlay() call.

 

To see the graph, you'll need the Microsoft DirectShow GraphEdit utility. If you don't have it, you can get it from the following post on our forum:

 

http://support.leadtools.com/SupportPortal/cs/forums/3889/ShowPost.aspx#3889
Qasem Al-Lubani
LEAD Technical Support
www.leadtools.com
   Report 
  03-07-2008, 8:59
twhif is not online. Last active: 3/7/2008 1:39:39 PM twhif

Top 500 Posts
Joined on 12-30-2007
Posts 9
Re: Splitting an AVI with ltmmSampleTarget
Reply Quote
Sorry for the delay in following up on this...

The C++ player sample crashes when calling IltmmPlay::put_SourceFile well before trying to play the video. I tried checking the filter graph prior to this call but when I connect to the remote graph using GraphEdit nothing appears. I assume that's because the filter graph not in place at this point.

How can I check the versions of the files being used? I'm using the LEADTOOLS Multimedia 15 setup dated 11/29/2007. I'm also building with the Msft DirectX SDK from November 2007.

I'm not sure what else to check or how to check it.
   Report 
  03-09-2008, 5:57
Qasem Lubani is not online. Last active: 9/2/2008 11:31:52 AM Qasem Lubani



Top 10 Posts
Joined on 08-13-2006
Posts 1,044
Re: Splitting an AVI with ltmmSampleTarget
Reply Quote

You could try to use the latest LEADTOOLS multimedia toolkit setup by downloading it from our site. However, if a third-party component is causing the problem, this might not solve it.

One way to see which codecs and filters are loaded by the program before it crashes is to run the program inside the Visual Studio debugger (or any Win32 debugger), and check the list of loaded modules in the Debug window, which would look something like this:

Loaded 'C:\Windows\System32\module1.OCX'

Loaded 'C:\Windows\System32\module2.DLL'

Loaded 'C:\Windows\System32\module3.AX'

...


Qasem Al-Lubani
LEAD Technical Support
www.leadtools.com
   Report 
Post
LEAD Support Fo... » Enduser » Capture & Conve... » Splitting an AVI with ltmmSampleTarget

Powered by Community Server, by Telligent Systems