LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to display live video (mpeg2) data

I have a hardware card that is generating an MPEG2 video data stream in real time. What is the best way of displaying the video scene on a CVI panel? I had a look at the NI example which plays a movie file using Windows Media Player in an ActiveX control and it looks as though I should be able to use a similar approach. Unfortunately I have a stream, not a file and I could not see any obvious function within the msdxm.fp instrument that I could call (instead of MediaPlayer_IMediaPlayer2SetFileName()). Optimistically, I looked at the corresponding instrument source code for inspiration but still nothing was obvious. (msdxm.c - 17000 lines of code without a single comment; who wrote this? There is no useful help in the .fp, either - how are we expected to know what the instrument functions and parameters actually do?)
 
Is one of these (500 odd) instrument functions suitable, or is there a better approach I should look at?
 
JR
0 Kudos
Message 1 of 6
(3,968 Views)
Morning JR,
 
is the data being streamed as a URL?
 
You may find creating the "Windows Media Steaming Plugin Type Library" activeX control may create a library of the functions you are looking for.
If this isn't the case, what card are you using to obtain the data, and does the manufacturer supply any drivers, example codes, dll's that would help with this functionality?
 
Post back if you need any more help
 
AdamB
NIUK
Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 2 of 6
(3,934 Views)

Adam,

The card manufacturer supplies support software for the card that will allow writing to and reading from a file. (The card is also a decoder as well as an encoder.) Their expected use for their system is to have two cards, one encoding live video at the source and another one decoding directly to video output at the destination. My requirement is to implement a software display, so that the rest of the application can use CVI features to control other system components. So they do not have any software to help me, apart from the statement that the data stream from the encoder is MPEG-2 compatible. It would be possible, I suppose, to generate a local URL on the machine and re-package the data accordingly? Not sure exactly how, though.

Where do I find this "Windows Media Steaming Plugin Type Library" activeX control you mention? The closest thing I could find on my system was the standard "Windows Media Player" activeX control that the NI example uses. (I have CVI 7.0.0, running on Windows XP.) Do I need to download it from somewhere? Or is it possible simply to pass a URL in place of the filename in the NI example. (I can't try this easily - my standalone CVI development system is not on the net and our internet systems are locked down so I can't install test software onto them...)

JR

0 Kudos
Message 3 of 6
(3,930 Views)

OK please ignore my second paragraph above - I found the plug-in. Just need to figure out how to use it. (All hints and tips gratefully received!)

JR

0 Kudos
Message 4 of 6
(3,924 Views)

JR,

You may not be able to see this library due to a version differnce in Media player (or XP SP2).  I am running XP SP2 and WMP v10.Try searching for the library on the Microsoft website.  (I found it by going to >>Tools>>Create ActiveX Controler and searching through for the appropriate library.)

I myself have not seen how to stream the data as an MPEG2 format but it may be wise to check the card manufacturers website for any further information regarding how the data is steamed, wheather a URL is already produced locally, or if a memory location is used to steam the data.

Which example have you used?  I can't seem to find the NI example you could have used under the CVI environment under the activex examples.

I fear you need to know a lot more information about how the data is actually steamed from the card before we can assertain a decent method for decoding and dislplaying the data.

I'll look into this for.

 

AdamB

 

Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 5 of 6
(3,924 Views)

Adam,

I found the example at ftp://ftp.ni.com/contrib/epd/CC09486B4F312BEBE034080020E74861/mediaplayer.zip when I searched the forums and Developer Zone last week.

I am assuming at the moment that the data streamed from the card hardware will be in exactly the same format as a standard MPEG-2 file. (As per the example file, fig1b.mpeg, that accompanies the above sample.) I haven't actually got the card in my hands at the moment so I can't verify this, but it seems a reasonable assumption for now. I have been known to be wrong...

The card will be built in to one of our systems, so any required URL generation will be down to me.

JR

0 Kudos
Message 6 of 6
(3,918 Views)