‎02-26-2010 07:30 PM
Okay im trying to automate an audio test on a IP video encoder. I can find the rtsp stream location but im not sure were to start on retrieving the stream. I have VLC playing the stream...i guess i could run a command line vlc to save a 5 second stream? then open the file for evaluation? What i would like is direct stream copy in labview so that i dont need 3rd party tools installed.
Maybe a .net call to do this would help?
Thanks in advance.
-Corey
Solved! Go to Solution.
‎02-28-2010 03:11 AM
‎03-01-2010 02:35 AM - edited ‎03-01-2010 02:36 AM
While you could implement RTSP directly in LabVIEW at least to the point that you can receive a simple voice stream, this is not trivial indeed. Especially since RTSP allows for various compression negotiation and what else and implementing compression in LabVIEW itself is not a very efficient idea, mostly in terms of development time, but it's also not easy to get good performance when dealing on bit level with data.
So personally I would get a good RTSP Open Source shared library and interface that to LabVIEW. This is also not the most easy approach but I would do it because it keeps the option open to reuse it on other LabVIEW platforms than Windows
Using .Net certainly will work too, finding the right component and API documentation is probably the most challenging part. Integrating it into LabVIEW if you only want to retrieve a limited chunk of data should be fairly straight forward, but for seamless streaming into LabVIEW it would certainly require some more advanced programming level, where you would have to interface with some sort of double buffered API. It's main disadvantage in my view is its strict reliance on modern Windows versions only, possibly even limiting your solution to the greatest and newest Windows platform, depending on the .Net dependencies your component has.
‎03-01-2010 01:20 PM
Corey,
Other software, such as audio Logger, let you copy the recording file before it finish recording. So you can evaluate the copy.
Don't know if VLC will let you do that.
I just started to play with VLC last week. How do you run a command line vlc to save a 5 second stream?
George
‎03-02-2010 05:36 PM - edited ‎03-02-2010 05:39 PM
good question on the 5 second stream recording.
I've spent the last hour trying to figure it out.
Basicly with the VLC plugin you do a invoke node "Add Target" then enter in url to the stream and options....this is where im at. The options are tricky and complicated. Every possible file type is available.
So you need to know what you want to output. This is what i've got but it doesn't work.
For options im creating an array of string with this in it.
--sout '#transcode{vcodec=h264, vb=800, scale=1, deinterlace=0, acodec=aac, ab=128, channels=1, samplerate=44100}:standard{access=file,mux=mp4,dst='c:\video_test.mpg'}'
I've tried several variations to this with no luck. double quotes, single quotes, different vcodec, etc... I can get it to work in VLC so for the most part so these settings should work. And this is just one option. You can add more if needed. like fps output, etc... If i figure out the save file i will report the vi 🙂
‎03-04-2010 01:26 AM
Well I've spent some time working on this with no luck....I did find a post somewhere that said VLC's activeX does not have recording support? But I could not find anything from vlc to support that. Running wireshark to watch network traffic and streaming video gave me a rough idea of what I need to send and receive using TCP calls. And after reading through the basic RTSP standards it seems simple enough. Only issue now would be how to take the streaming h.264 video and display it 🙂 Probably more work then I really want to do.
Running VLC from the command line works but there is no way to stop it or give it a seconds to record option. Maybe a workaround could be to kill the task after a couple seconds. But that would not be very stable or repeatable.
Next I need to see if there is anything else that has activex RTSP streaming. Something that will allow me to save the stream or dump it strait into labview. Seems VLC is the dominant application for this stuff.
Any help from you guys would be great. I dont care if its allot of work and tons of subvi's. I just need anything. That's my best "not sounding desperate" plea.
-Corey aka pRoFiT
‎03-04-2010 01:44 AM
Yep, RTSP itself isn't that complicated and would be quite easy to implement. It's the various stream formats that are the difficult task with all sorts of compression and what else, which is definitely not something you want to implement in LabVIEW. The development of those algorithmes is tricky, complicated and on a level where you almost certainly will run into performance troubles with LabVIEW, since it's not as ideal for complicated bit banging operations as C and sometimes even assembly is used to get the desired performance.
I still beleive that ActiveX while a promising idea at first is not the ideal solution. It would be quite quick and not to much hassle if there was a good ActiveX component with a well defined API but I haven't seen that yet. In addition I do mislike the lockin into Windows that wouldencompass.
If I had the need for that, I would probably look at the code at http://www.live555.com and incorporate that as shared library module into a LabVIEW library. Possibly you could even use their openRTSP application as standalone client and redirect its standard output somehow.
‎03-05-2010 01:10 AM
Thanks rolfk,
Yah the last couple days of looking into RTSP I keep ending back at live555. Looks like they are monopolizing on the RTSP streams 🙂 I pulled there source down to look at. Maybe if I have time to compile it I will try to make it work for me. Always good to learn something new. Specially since I work in video ip security. I might as well understand the underlying code im testing.
-Corey
‎03-05-2010 01:14 AM - edited ‎03-05-2010 01:18 AM
pRoFiT wrote:Thanks rolfk,
Yah the last couple days of looking into RTSP I keep ending back at live555. Looks like they are monopolizing on the RTSP streams 🙂 I pulled there source down to look at. Maybe if I have time to compile it I will try to make it work for me. Always good to learn something new. Specially since I work in video ip security. I might as well understand the underlying code im testing.
-Corey
No they definitely do not monopolize the RTSP market but if you look for an Open Source RT(S)P library that is still actively maintained you do end up there.
And they seem to be commited to it, as is evidenced by projects relying on it for their RTSP stream such as VLC and MPlayer.
If I had a real need for this and more importantly a useful test setup to actually test it, I would probably have done a LabVIEW library for it some time ago.
‎03-05-2010 09:40 AM
I managed to record mp3 file. I only need audio part.
It appears that VLC let you play the mp3 file while recording.
I can use WMP to play the mp3 file while recording using VLC.
Close the VLC window will make it stop recording.
lvwutil32.zip from NI can stop a running application.