Author Topic: Command Line Stop / Start?  (Read 1962 times)

marcb

  • Newbie
  • *
  • Posts: 3
    • View Profile
Command Line Stop / Start?
« on: July 16, 2013, 09:25:55 AM »
Hi everyone,

I have a camera that seems to be less than reliable when used with iCamSource (details at http://skjm.com/forum/index.php?topic=916.msg17492) which requires me to click the Stop / Start button to "refresh" the connection to the camera.  While its not ideal, clicking that button in the Win7 application seems to do the trick.  What I would like to do is setup a BAT file in Windows that basically simulates the click on that button.  Is that possible?

I tried a BAT that kills the iCamSource process and then spins up a new one and it kind of worked, but rather than seeing video when the new process started the iCamSource app (on the desktop) just showed a grey box where the video should be.  That BAT looked like this:

#change directory
cd "c:\Program Files\iCamSource"

#force kill the existing process
taskkill /f /im iCamSource.exe

#this line adds a little bit of a "sleep" to make sure the previous process is killed off before the new one starts
ping 1.1.1.1 -n 3 -w 3000 > nul

#start a new process
start iCamSource.exe

#close the command line window
exit

OUAnthony

  • Hero Member
  • *****
  • Posts: 801
    • View Profile
Re: Command Line Stop / Start?
« Reply #1 on: July 16, 2013, 11:51:25 AM »
Do you have the "auto start" box checked in icamsource? If not, check that box, exit icamsource and restart it (to ensure the setting was saved). Then re-run the batch file.

marcb

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Command Line Stop / Start?
« Reply #2 on: July 17, 2013, 01:15:29 PM »
Yes, it was set.  Maybe I was just running it too often during testing and that caused the connection to the camera to get locked up somehow.  Ill try running it every 15 minutes and report back on the results.

BTW, I would prefer to not have to use the BAT file if I could get iCamSource working with my camera.  But maybe its just a junky camera and there is no way to resolve that.

OUAnthony

  • Hero Member
  • *****
  • Posts: 801
    • View Profile
Re: Command Line Stop / Start?
« Reply #3 on: July 17, 2013, 01:46:07 PM »
It's likely either a hardware or driver issue...but I'd guess driver issue. Also, I would consider changing your following line of code from:

ping 1.1.1.1 -n 3 -w 3000 > nul

to:

ping 1.1.1.1 -n 3 -w 10000 > nul

because 3000 is only 3 seconds...it might not be long enough. How often you run the batch file shouldn't affect anything. With that being said, I wouldn't think you'd need to run the batch file more than once every 30 minutes to an hour. If your camera is freezing up that much, you might consider trying another one (you can get throw-away ones for $5-$10 from dx.com or other sites, just to try your luck). I gave up on webcams because I was having driver or hardware issues with mine and didn't want to waste more money on something potentially unreliable...so I switched to IP cameras. I've been up and running for years with no issues. LOVE IT! You can get a LOFTEK CXS-2200 for $60 (Amazon) that's 100% compatible with iCam...pan/tilt, audio (low-quality), and night vision (mediocre quality)...and the picture quality is pretty good for entry-level IP cameras. Using IP cameras will also reduce the CPU load, which is nice if you have an older computer.