82 | | {{{ |
83 | | dvswitch -h localhost -p 2000 |
| 83 | |
| 84 | You would need two parameters: the port and the host. As for port you can use whatever you want but 2000 is recomended and >1024 is mandatory. |
| 85 | If you want to use cameras connected to other computers you would need to use the ip of the computer running dvswitch, which you can get running this command and look for a number different to 127.0.0.1 and likely to start with 192. |
| 86 | |
| 87 | {{{ |
| 88 | /sbin/ifconfig|grep inet |
| 89 | }}} |
| 90 | |
| 91 | outpt exmple: |
| 92 | |
| 93 | {{{ |
| 94 | ~$ /sbin/ifconfig |grep inet |
| 95 | inet addr:127.0.0.1 Mask:255.0.0.0 |
| 96 | inet6 addr: ::1/128 Scope:Host |
| 97 | inet addr:192.168.1.73 Bcast:192.168.1.255 Mask:255.255.255.0 |
| 98 | inet6 addr: fe80::aabb:cfff:fe18:349e/64 Scope:Link |
| 99 | }}} |
| 100 | |
| 101 | If you are not planning to send video streams from other computers, you can use 'localhost' insted of the ip address. |
| 102 | |
| 103 | From now on you should use 'localhost' or the ip number, depending of what you have choosen, instead of DVSWITCHHOST. |
| 104 | |
| 105 | So run this command to start dvswitch: |
| 106 | |
| 107 | {{{ |
| 108 | dvswitch -h DVSWITCHHOST -p 2000 |
98 | | === On the DVsink machine === |
| 124 | |
| 125 | === if using an USB cam === |
| 126 | |
| 127 | * Connect the usb cam to the computer if you want to use a wires cam insted of the built in most laptops come with. |
| 128 | * look for the video input divece you are going to use with this command |
| 129 | {{{ |
| 130 | ls /dev/video* |
| 131 | }}} |
| 132 | |
| 133 | it should return someting like: |
| 134 | |
| 135 | {{{ |
| 136 | /dev/videoX |
| 137 | }}} |
| 138 | |
| 139 | being X a number depending of the number of cameras connected to the computer. This would show up if you have 2 usb cameras connected to the computer: |
| 140 | |
| 141 | {{{ |
| 142 | ls /dev/video* |
| 143 | /dev/video0 |
| 144 | /dev/video1 |
| 145 | }}} |
| 146 | |
| 147 | Run the next command to grab the video comming from the usb cam and pipe it to the dvsource-file command to send it to dvswitch. |
| 148 | |
| 149 | {{{ |
| 150 | avconv -f video4linux2 -i /dev/videoX -target ntsc-dv - | dvsource-file /dev/stdin -p 2000 -h DVSWITCHHOST |
| 151 | }}} |
| 152 | |
| 153 | Notice using the number of the cam insted of the X in the command line above. |
| 154 | Also note that we are sending an ntsc-dv video format but it could be pal-dv. This matters if you are using more than 1 camera, as the first video stream sent to dvswitch will set the 'default' format and the other sources would need to stick with it. |
| 155 | |
| 156 | Finally, note you can run this command on different computers at the same time to feed dvswitch with several video streams if you use the ip of the computer running dvswitch insted of using 'localhost' |
| 157 | |
| 158 | === if you want to stream you desktop === |
| 159 | |
| 160 | First of you would need to get the size of your screen. You can use this command to get it and store it in a variable called 'PANTALLA' |
| 161 | |
| 162 | {{{ |
| 163 | export PANTALLA=$(xdpyinfo | awk '/dimensions:/ { print $2; exit }') |
| 164 | }}} |
| 165 | |
| 166 | and verify the size echoing that variable with the following command: |
| 167 | |
| 168 | {{{echo $PANTALLA}}} |
| 169 | |
| 170 | Now you can stream you desktop to dvswitch running this: |
| 171 | |
| 172 | {{{ |
| 173 | avconv -f x11grab -s $PANTALLA -r 29 -i :0.0 -target ntsc-dv -y - | dvsource-file /dev/stdin -p 2000 -h DVSWITCHHOST |
| 174 | }}} |
| 175 | |
| 176 | Note that you would create and infinite (funny) loop if you run this command on the same computer running dvswitch but it won't harm. =) |
| 177 | |
| 178 | |
| 179 | == On the DVsink machine == |
| 211 | == Recording your stream == |
| 212 | |
| 213 | You can record your stream on two different ways and qualities. |
| 214 | |
| 215 | === Higher stream quality === |
| 216 | |
| 217 | The first way would get the highest quality avaliable from the video sources, and would save it as a .dv file. This might be awesome but it also might consume a huge ammount of disk space. If you have enough room to store yout recording, you can run this command to start recording directly from dvsiwtch: |
| 218 | |
| 219 | {{{ |
| 220 | dvsink-files -h DVSWITCHHOST -p 2000 FILENAME-OF-THE-RECORDING |
| 221 | }}} |
| 222 | |
| 223 | Now press the 'record' button at the dvswitch interface to start/stop recording, and the 'cut' one to create a new file with the same name but a highet number |
| 224 | |
| 225 | === Lower stream quality === |
| 226 | |
| 227 | You can also record the stream locally at the same quality you are streaming through the ffmpg2theora command we used above to send the stream to the Icecast2 server. In this case you would only need to add {{{-o recording-file-name.ogv -}}} to the same command you used before. Like this: |
| 228 | |
| 229 | |
| 230 | {{{ |
| 231 | dvsink-command -h DVSWITCHHOST -p 2000 tee out.dv | ffmpeg2theora - -f dv -F 25:5 --speedlevel 0 -v 4 -a 1 -c 1 -H 9600 -o recording-file-name.ogv -o - | oggfwd ICECASTHOST ICECASTPORT ICECASTPASS /mountpoint.ogg |
| 232 | }}} |
| 233 | |
| 234 | Please note that you would overwrite the first recording if you run that command twice, ase you ae using the same filename. You could is a $date variable to prevent this from happening. Like this: |
| 235 | |
| 236 | {{{ |
| 237 | dvsink-command -h DVSWITCHHOST -p 2000 tee out.dv | ffmpeg2theora - -f dv -F 25:5 --speedlevel 0 -v 4 -a 1 -c 1 -H 9600 -o recording-file-name-$(date +"%T_%d-%m-%Y").ogv -o - | oggfwd ICECASTHOST ICECASTPORT ICECASTPASS /mountpoint.ogg |
| 238 | }}} |
| 239 | |