Sign in to follow this  
Followers 0
ulmstefan

Graphic activeX

11 posts in this topic

I'm working on implementation of IP Cam video into my little application. I've tried with flash activex (v10.1), but since in my Endless loop I'm proofing always a bound UDP-Port with UDPRecv, the video shown by the flash activeX component in a window of the GUI slows down; it is not fluid. The used flash file does nothing else then parsing a jpg-file upon the IP Cam and actualize it, so that from the single jpgs it results a video stream. My problem is, that I need the "UDPRecv" function and now I'm searching for an activeX component who doesn't slow down, when the UDPRecv function is called.

Perhaps someone maked the same experiences or have some advice?

Share this post


Link to post
Share on other sites



UDPRecv shouldn't be slowing it down at all.

You problem is more likely either network slowdowns or slowdowns in trying to render new jpg images every frame.

Share this post


Link to post
Share on other sites

UDPRecv shouldn't be slowing it down at all.

You problem is more likely either network slowdowns or slowdowns in trying to render new jpg images every frame.

I don't think that the problem is the rendering, because when I disable the "UDPRecv" function, the video shown by the flas activex component is very fluid, also when I use it to show a video from youtube. When I reactivate the "UDPRecv" function the video shown by the flash activex slow down. It seems that every time the "UDPRecv" function is called, the video freezes for about 150-200 ms. It seems that the "UDPRecv" function occupies all the network traffic and stops the connection from the flash activeX as long as the function reads the UDP-Stack. I tried with a simple gdi example of autoit and there the same thing happened: by inserting the "UDPRecv" function the gdi-video slows down freezing about 200ms every time the "UDPRecv" function is called. Has anyone an idea how solve the problem? Shall I use an external component for UDP-communication or does anyone know an external component to show the video from a actualized jpg from an IP camera?

Share this post


Link to post
Share on other sites

Well that 150-200 ms could be network latency. There's nothing you can do about that.

Share this post


Link to post
Share on other sites

Have you any advice for me how I can get the video fast again, some activeX component or workaround?

Share this post


Link to post
Share on other sites

I don't believe there is a way to make it better besides reading more data at once.

Share this post


Link to post
Share on other sites

Any Ideas how to handle UDP-Messages in another way, with an activeX object or a dll, which doesn't cause such delays.

Share this post


Link to post
Share on other sites

It's going to be slow regardless. AutoIt is interpreted so it will always run slower than a real compiled program.

Share this post


Link to post
Share on other sites

So I tried to use winsock for the UDP communication. Sending out UDP Telegramms is no problem and it doesn't slow down the Application at all.

Incoming UDP-Telegramms are catched, the "DataArrival" function is launched, I can retrieve how many bytes I got receiced, but I can't retrieve the Data of this received bytes with GetData.

Any suggestions? Have someone experience with winsock activeX, can there arise problems, also with licensing?

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

I ran over the same problem, and shown by the example below, its likely that UDPRecv freezes the script for exactly 100ms if there is nothing to recieve.
If data is in the buffer, UDPRecv returns immediately with the data.
 

;;This is the UDP Server
;;Start this first

; Start The UDP Services
;==============================================
UDPStartup()

; Register the cleanup function.
OnAutoItExitRegister("Cleanup")

; Bind to a SOCKET
;==============================================
$socket = UDPBind("127.0.0.1", 65532)
If @error <> 0 Then Exit

While 1
;~  sleep(10)
    $ti = TimerInit()
    $data = UDPRecv($socket, 50)
    ConsoleWrite(Round(TimerDiff($ti))&"ms" & @CRLF) 
    If $data <> "" Then
        ConsoleWrite("UDP DATA: "& $data& @CRLF)
    EndIf
WEnd

Func Cleanup()
    UDPCloseSocket($socket)
    UDPShutdown()
EndFunc

I created a ticket to see if this is a bug or not.

It also seems that UDPRecv only recieves one sent packet when its called even if there are more in the buffer. So if the Client (or more clients) sends more frequent than the server does his UDPRecv, the recieving will be delayed and the buffer will overflow eventually.

Edited by qsek

Teamspeak 3 User Viewer - Quick and functional TS3 Query script, which shows online users.Cached Screenshot Deleter - Deletes older Fraps Screenshots if they exceed a specified limit.Unresolved Topics:Intercept and modify dragdrop text behaviour in scite

Share this post


Link to post
Share on other sites

Hi,

I'm trying now to create a activeX file for managing UDP-Communication. Unfortunately the activeX file I created on VS 2005 in C++ (MFC-activeX Object) doesn't work with Autoit, while it works with the activeX Test-Container of VIsual Studio. I tested a lot of properties, but without result. Is there something to take care of it on programming activeX for use in Autoit? Anyone can help me here?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0