I tried "Audio/Video Conferencing with Janus WebRTC Gateway" page. I left everything as default except I set the "Watch live audio & video from other participants" to "Yes". Then I joined the Janus video Room page at "https://janus.conf.meetecho.com/videoroomtest.html" from a Chrome browser (my laptop). I could see the streaming from my laptop camera on the page but no streaming from the RPi. Although it shows the streaming baud rate from RPI camera which is changing every second but it doesn't show the video. Also when I talk, I hear my voice from the RPi speakers, so the RPi is definitely connected but it cannot transfer the video properly. Any idea? Thanks in advance.
Also this is my raspicam.conf:
# This file contains the default values of SOME of all the available
# options for the UV4L core module, the raspicam driver, and the
# streaming server front-end.
#
# This file is referenced by the 'uv4l_raspicam' init script.
# Alternatively, it can be passed as argument to
# the '--driver-config-file' driver option and/or to the
# '--config-file' option of uv4l.
#
# Please refer to the 'uv4l', 'uv4l-raspicam' and 'uv4l-server' manual
# pages for all the valid options and values or for more informations
# about their meaning.
# NOTE: for multi argument options you must specify one arg per line,
# e.g --min-object-size 80 120 becomes:
# min-object-size = 80
# min-object-size = 120
##################################
# uv4l core options
##################################
driver = raspicam
# video_nr = 0
auto-video_nr = yes
# verbosity = 6
# syslog-host = localhost
# syslog-port = 514
# frame-timeout = 5000
frame-buffers = 4
# drop-bad-frames = yes
# relaxed-ownership = yes
##################################
# raspicam driver options
##################################
encoding = mjpeg
# width = 640
# height = 480
framerate = 30
#custom-sensor-config = 2
### dual camera options:
# stereoscopic-mode = side_by_side
# camera-number = 1
# decimate = yes
# swap-eyes = yes
### still and/or video options:
# quality = 85
# stills-denoise = yes
video-denoise = no
# raw = no
### h264 options:
# profile = high
# level = 4.2
# bitrate = 8000000
# intra-refresh-mode = dummy
# intra-period = #arg
# inline-headers = yes
# quantisation-parameter #arg
### video overlay options:
nopreview = no
fullscreen = no
# osd-layer = 2
# opacity = 255
### preview window <x, y, w, h>:
preview = 480
preview = 240
preview = 320
preview = 240
### post-processing options:
# text-overlay = yes
# text-filename = /usr/share/uv4l/raspicam/text.json
# object-detection = yes
# object-detection-mode = accurate_tracking
# min-object-size = 80
# min-object-size = 80
# main-classifier = /usr/share/uv4l/raspicam/lbpcascade_frontalface.xml
# secondary-classifier =/usr/share/uv4l/raspicam/lbpcascade_frontalface.xml
### image settings options:
# sharpness = 0
# contrast = 0
# brightness = 50
# saturation = 0
# iso = 400
# vstab = yes
# ev = 0
# exposure = auto
# awb = auto
# imgfx = none
# metering = average
# rotation = 0
# hflip = no
# vflip = no
# shutter-speed = 0
# drc = off
# red-gain = 100
# blue-gain = 100
# text-annotation = HelloWorld!
# text-annotation-background = yes
### ROI <x, y, w, h> normalized to [0, 1]
# roi = 0
# roi = 0
# roi = 1
# roi = 1
### ISP blocks
# black-level-compensation = yes
# lens-shading = yes
# automatic-defective-pixel-correlation = yes
# white-balance-gain = yes
# crosstalk = yes
# gamma = yes
# sharpening = yes
### TC358743 HDMI to MIPI converter options:
# tc358743 = no
# tc358743-i2c-dev = /dev/i2c-1
# tc358743-init-command = /usr/share/uv4l/raspicam/tc358743_init.sh
# tc358743-no-signal-fallthrough = no
### advanced options:
# statistics = yes
# output-buffers = 3
### serial Number & License Key:
# serial-number = #arg
# license-key = #arg
#################################
# streaming server options
#################################
### path to a separate config file that will be parsed by the streaming server
### module directly when it's loaded,
### in which you are allowed to specify all the streaming server options
### listed below in the short form "option=value" instead of the longer
### "--server-option = --option=value" form that you must use
### in this configuration file.
#server-config-file = #path
# server-option = --port=8080
# server-option = --bind-host-address=localhost
# server-option = --md5-passwords=no
# server-option = --user-password=myp4ssw0rd
# server-option = --admin-password=myp4ssw0rd
### To enable 'config' user authentication
# server-option = --config-password=myp4ssw0rd
### HTTPS options:
server-option = --use-ssl=yes
server-option = --ssl-private-key-file=/home/pi/selfsign.key
server-option = --ssl-certificate-file=/home/pi/selfsign.crt
### WebRTC options:
server-option = --enable-webrtc=yes
# server-option = --enable-webrtc-datachannels=yes
# server-option = --webrtc-datachannel-label=uv4l
# server-option = --webrtc-datachannel-socket=/tmp/uv4l.socket
server-option = --enable-webrtc-video=yes
server-option = --enable-webrtc-audio=yes
# server-option = --webrtc-receive-video=yes
# server-option = --webrtc-receive-datachannels=no
# server-option = --webrtc-received-datachannel-socket=/tmp/uv4l.socket
server-option = --webrtc-receive-audio=yes
server-option = --webrtc-received-audio-volume=10.0
# server-option = --webrtc-prerenderer-smoothing=yes
# server-option = --webrtc-recdevice-index=0
# server-option = --webrtc-vad=yes
# server-option = --webrtc-echo-cancellation=no
# server-option = --webrtc-preferred-vcodec=0
# server-option = --webrtc-enable-hw-codec=yes
# server-option = --webrtc-hw-vcodec-minbitrate=256
# server-option = --webrtc-hw-vcodec-maxbitrate=4000
# server-option = --webrtc-hw-vcodec-startbitrate=1200
server-option = --webrtc-max-playout-delay=34
# server-option = --webrtc-cpu-overuse-detection=no
# server-option = --webrtc-combined-audiovideo-bwe=no
# server-option = --webrtc-stun-urls=stun:stun.l.google.com:19302
# server-option = --webrtc-ice-servers=[{"urls": "stun:stun1.example.net"}, {"urls": "turn:turn.example.org", "username": "user", "credential": "myPassword"}]
# server-option = --webrtc-stun-server=yes
# server-option = --webrtc-tcp-candidate-policy=1
# server-option = --webrtc-rtcp-mux-policy=0
# server-option = --webrtc-enable-dscp=no
# server-option = --webrtc-ignore-loopback=yes
### video rendering window positions and sizes on the display.
### for each window, default values can be optionally overridden, but if you
### do this you must specify one line for each of the four x, y, width, height
### window properties (in that order).
### If fullscreen is set the image is stretched to the maximum available display
### resolution from the specified size.
### window 1
# server-option = --webrtc-renderer-window=0
# server-option = --webrtc-renderer-window=0
# server-option = --webrtc-renderer-window=480
# server-option = --webrtc-renderer-window=352
# server-option = --webrtc-renderer-fullscreen=no
# server-option = --webrtc-renderer-rotation=180
# server-option = --webrtc-renderer-opacity=255
### window 2
# server-option = --webrtc-renderer2-window=480
# server-option = --webrtc-renderer2-window=0
# server-option = --webrtc-renderer2-window=320
# server-option = --webrtc-renderer2-window=240
### window 3
# server-option = --webrtc-renderer3-window=0
# server-option = --webrtc-renderer3-window=352
# server-option = --webrtc-renderer3-window=176
# server-option = --webrtc-renderer3-window=128
### XMPP options:
# server-option = --xmpp-server=lambada.jitsi.net
# server-option = --xmpp-port=5222
# server-option = --xmpp-muc-domain=meet.jit.si
# server-option = --xmpp-room=room
# server-option = --xmpp-room-password=room_password
# server-option = --xmpp-username=me
# server-option = --xmpp-password=mypassword
# server-option = --xmpp-reconnect=yes
# server-option = --xmpp-bosh-enable
# server-option = --xmpp-bosh-tls
# server-option = --xmpp-bosh-server
# server-option = --xmpp-bosh-port
# server-option = --xmpp-bosh-hostname
# server-option = --xmpp-bosh-path
# server-option = --xmpp-bridge-host=localhost
# server-option = --xmpp-bridge-port=7999
### Janus WebRTC Gateway options:
# server-option = --janus-gateway-url=http://janus.conf.meetecho.com:8088
# server-option = --janus-gateway-root=/janus
# server-option = --janus-room=1234
# server-option = --janus-room-pin=#pin
# server-option = --janus-username=test
# server-option = --janus-token=#token
# server-option = --janus-proxy-host=#host
# server-option = --janus-proxy-port=80
# server-option = --janus-proxy-username=#user
# server-option = --janus-proxy-password=#password
# server-option = --janus-proxy-bypass=#regex
# server-option = --janus-force-hw-vcodec=no
# server-option = --janus-video-format=#code
# server-option = --janus-publish=yes
# server-option = --janus-subscribe=no
# server-option = --janus-reconnect=yes
### Fine-tuning options:
# server-option = --connection-timeout=15
# server-option = --enable-keepalive=yes
# server-option = --max-keepalive-requests=0
# server-option = --keepalive-timeout=7
# server-option = --max-queued-connections=8
# server-option = --max-streams=3
# server-option = --max-threads=5
# server-option = --thread-idle-time=10
# server-option = --chuncked-transfer-encoding=yes
### Advanced options:
# server-option = --frame-timeout=5000
# server-option = --frame-buffers=auto
### These options are specific to the HTTP/HTTPS Server
### serving custom Web pages only:
server-option = --enable-www-server=yes
server-option = --www-root-path=/usr/share/uv4l/demos/facedetection/
server-option = --www-index-file=index.html
server-option = --www-port=443
# server-option = --www-bind-host-address=#host
# server-option = --www-password=#password
server-option = --www-use-ssl=yes
server-option = --www-ssl-private-key-file=/home/pi/selfsign.key
server-option = --www-ssl-certificate-file=/home/pi/selfsign.crt
# server-option = --www-connection-timeout=15
# server-option = --www-enable-keepalive=no
# server-option = --www-max-keepalive-requests=0
# server-option = --www-keepalive-timeout=7
# server-option = --www-max-queued-connections=8
# server-option = --www-max-threads=4
# server-option = --www-thread-idle-time=10
# server-option = --www-chuncked-transfer-encoding=no
# server-option = --www-set-etag-header=yes
server-option = --www-webrtc-signaling-path=/webrtc
### Other options:
# server-option = --editable-config-file=#path
# server-option = --enable-control-panel=yes
# server-option = --enable-rest-api=yes
Related
I have a text File with data such that:
#alstrong textert tcp $EXTERNAL_NET $HTTP_PORTS -> $HOME_NET any (msg:"ET ACTIVEX Microsoft Whale Intelligent Application Gateway ActiveX Buffer Overflow-1"; flow:established,to_client; file_data; **content:"8D9563A9-8D5F-459B-87F2-BA842255CB9A"**; nocase; **content:"CheckForUpdates"**; nocase; distance:0; pcre:"/<OBJECT\s+[^>]*classid\s*=\s*[\x22\x27]?\s*clsid\s*\x3a\s*\x7B?\s*8D9563A9-8D5F-459B-87F2-BA842255CB9A/si";reference:url,dev.metasploit.com/redmine/projects/framework/repository/entry/modules/exploits/windows/browser/mswhale_checkforupdates.rb; reference:url,www.kb.cert.org/vuls/id/789121; reference:url,doc.emergingthreats.net/2010562; classtype:web-application-attack; sid:2010562; rev:6; metadata:affected_product Windows_XP_Vista_7_8_10_Server_32_64_Bit, attack_target Client_Endpoint, created_at 2010_07_30, deployment Perimeter, signature_severity Major, tag ActiveX, updated_at 2016_07_01;)
I need to extract all words in the fields named "Content" and store them in another text file. I found this code in Perl (I have no experience with it), Is it extract all fields or only the first one?
#!/local/bin/perl5 -w
# Description:
# Extract bit-pattern from content-part of Snort-rules.
# Choose rules that have only one content-part.
# Store distinct patterns only.
# Choose length of shortest and longest pattern to store.
$rulesdir = "/hom/geirni/www_docs/research/snort202_win32/Snort/rules";
#rulefiles = `ls $rulesdir/*.rules`;
$camfile = "camdata.txt";
#
$minLength = 4; # Bytes
$maxLength = 32;
#
# Find content-part of rules
for $rulefile(#rulefiles){
#
open(INFILE, "<".$rulefile) or die
"Can't open ".$rulefile."\n";
#rules = <INFILE>;
close(INFILE);
#
for $rule(#rules){
#
$contentParts = 0;
#
if($rule =~ /content:/){
#parts = split(/;/, $rule);
for $part(#parts){
if($part =~ /content:/){
$content = $part;
$contentParts++;
# Remove anything before content-part
$content =~ s/^.*content:.*?\"//i;
# Remove anything after content-part
$content =~ s/\"$.*//g;
}
}
}
#
# Store content-part
if ($contentParts == 1){
push(#contents, $content);
}
}
}
#
#
#
# Convert content-strings to hex. Store only distinct patterns
for $content(#contents){
#
$pipe = 0; # hex patterns are limited by pipes; |00 bc 55|
$char = ""; # Current character in content; ASCII or hex
$pattern = ""; # Content converted to hex
#
# Loop through current content-string
for ($i=0; $i<=length($content)-1; $i++){ # -1 for newline
#
$char = substr($content, $i, 1);
#
# Control over pipes
if($char =~ /\|/){
if(!$pipe){
$pipe = 1;
}
else {
$pipe = 0;
}
next; # Skip to next character
}
#
# Convert to lowcase hex
if(!$pipe){ # ASCII-value
$pattern .= sprintf("%x", ord($char));
}
else { # hex-value
$char =~ s/ //; # Remove blanks
$pattern .= "\l$char";
}
}
#
# Store converted pattern
if((length($pattern) >= $minLength*2) &&
(length($pattern) <= $maxLength*2)){
$hexPatterns{$pattern} = "dummyValue"; # Keys will be distinct
}
}
#
#
#
# Print patterns, that have no subsets, to file
open(OUTFILE, ">".$camfile) or die
"Can't open ".$camfile."\n";
#
#patterns = keys %hexPatterns;
$count = 0; # Count patterns that are written to file
#
HEXLOOP:
for($i=0; $i<=$#patterns; $i++){
for($j=0; $j<=$#patterns; $j++){ # Search for subsets
#
next if($i==$j); # Do not compare a pattern with itself
#
next HEXLOOP if # Skip if subset is found
((length($patterns[$i]) <= length($patterns[$j])) &&
($patterns[$j] =~ /$patterns[$i]/));
}
print OUTFILE $patterns[$i]."\n";
$count++;
}
#
close(OUTFILE);
#
#
#
# msg
print
"\n".
" Wrote ".$count." patterns to file: \"".$camfile."\"\n".
"\n";
The following perl script extracts "content" data to screen (on line by line basis). To store data, redirect output into a file.
#!/usr/bin/env perl
#
# vim: ai ts=4 sw=4
use strict;
use warnings;
use feature 'say';
while( my $line = <> ) {
my #array = $line =~ /content:"(.*?)"/g;
say join "\t", #array;
}
Run the script as script.pl filename
Output
8D9563A9-8D5F-459B-87F2-BA842255CB9A CheckForUpdates
I found this code in Perl (I have no experience with it)
Rather than a Perl script you dare not even read the comments of which, consider just to use:
grep -Po 'content:".*?"' <text >another_text
To remove content:, the quotes and the dashes, you can use:
grep -Po '(?<=content:").*?(?=")' <text | tr -d - >another_text
#Armali
I want to edit this part in the code so that it can check again in the same line if there are other content Parts and also extract them and print them in different lines:
#
if($rule =~ /content:/){
#parts = split(/;/, $rule);
for $part(#parts){
if($part =~ /content:/){
$content = $part;
$contentParts++;
# Remove anything before content-part
$content =~ s/^.*content:.*?\"//i;
# Remove anything after content-part
$content =~ s/\"$.*//g;
}
}
}
#
# Store content-part
if ($contentParts == 1){
push(#contents, $content);
}
}
}
Basically I have Cisco and Dell switches that I am trying to access using Net::SSH2::Cisco but I am getting a weird timeout error. Here is the code that is running:
$swConn = Net::SSH2::Cisco->new(Host => "$switchname.something", Prompt => '/' . $switch .'#/') or push(#skipFailedSwitches, $switch);
##############################################################################
# Changes for Cisco Nexus 5020 Switch start here
#
# Included the code for varying the password depending on switch
##############################################################################
$password = #mypassword;
print "logging into $switchname.something with username $username and password $password \n"; #SBW
if (not $swConn->login($username, $password)){
push(#skipFailedSwitches, $switch);
next;
}
#$swConn->login(Password => #mypassword);
#$fh = $swConn->input_log();
##############################################################################
# Changes for Cisco Nexus 5020 Switch end here
#
##############################################################################
$swConn->cmd('terminal length 0') or push(#skipFailedSwitches, $switch);
my #statusOut = $swConn->cmd('show interface status') or push(#skipFailedSwitches, $switch);
This gives me
timed-out during read at ./etherShine.pl line 172
Line 172 is
$swConn->cmd('terminal length 0') or push(#skipFailedSwitches, $switch);
I'm trying to create a script which will work assign different IP ranges depending on the choice, currently I've done something like this:
# Get DHCP Scope Start - first IP to check - End Last IP to check
$X = 0
$Y = 0
$Z = 0
$End = 0
$DHCPServer = "DHCP"
$ScopeID = "10.0.0.0"
switch (Read-Host "Choose device to add: 1 PS3,2 PS4,3 PS4Pro,4 XboxOne,") {
1 {$z = 1 $End = 20}
2 {$z = 30 $End = 50}
3 {$z = 100 $End = 255}
4 {$y = 1 $z = 1 $end = 100}
}
But no matter how I type arguments, PowerShell always return the errors like
Unexpected token $end in expression or statement
Is there a way to fix it?
Adding some semicolons should do the trick. Alternatively, you could use new lines.
# Get DHCP Scope Start - first IP to check - End Last IP to check
$X = 0
$Y = 0
$Z = 0
$End = 0
$DHCPServer = "DHCP"
$ScopeID = "10.0.0.0"
switch (Read-Host "Choose device to add: 1 PS3,2 PS4,3 PS4Pro,4 XboxOne,") {
1 {$z = 1; $End = 20}
2 {$z = 30; $End = 50}
3 {$z = 100; $End = 255}
4 {$y = 1; $z = 1; $end = 100}
}
I just write this script however the script only print one result not the results from all devices. I belive my error is on print section but I couldn't figure out.
Note :- the host file has 30 devices list but the script print the result of the last device only.
#!/usr/bin/perl
$host_file = "/usr/local/bin/test/host2";
open (PACKETLOSS,"$host_file") or die "Cannot Open Extracted host file";
# Put Extracted data into an array
#extracted_array=<PACKETLOSS>;
chomp(#extracted_array);
foreach(#extracted_array) {
#words = split;
$host = $words[0];
}
$extracted_array[$ping_idx] = `/usr/sbin/ping -s -t 10 $host 56 2 2>&1`;
$ping_idx++;
($packet_loss) = ($ping =~ m/packets received, (\d+)% packet loss/);
($round_trip) = ($ping =~ m/round-trip.*\(ms\).*min\/avg\/max\/stddev = \d+\.\d+\/(\d+\.\d+)\/.*/);
print " $host $round_trip ms Average Latency and $packet_loss Packet loss\n";
Make your foreach loop close at the very bottom of the code.
foreach(#extracted_array) {
#words = split;
$host = $words[0];
$extracted_array[$ping_idx] = `/usr/sbin/ping -s -t 10 $host 56 2 2>&1`;
$ping_idx++;
($packet_loss) = ($ping =~ m/packets received, (\d+)% packet loss/);
($round_trip) = ($ping =~ m/round-trip.*\(ms\).*min\/avg\/max\/stddev = \d+\.\d+\/(\d+\.\d+)\/.*/);
print " $host $round_trip ms Average Latency and $packet_loss Packet loss\n";
}
Cause you are closing foreach and then performing the operation. IT should be
foreach(#extracted_array)
{
#words = split;
$host = $words[0];
$extracted_array[$ping_idx] = `/usr/sbin/ping -s -t 10 $host 56 2 2>&1`;
$ping_idx++;
($packet_loss) = ($ping =~ m/packets received, (\d+)% packet loss/);
($round_trip) = ($ping =~ m/round-trip.*\(ms\).*min\/avg\/max\/stddev = \d+\.\d+\/(\d+\.\d+)\/.*/);
print " $host $round_trip ms Average Latency and $packet_loss Packet loss\n";
}
I am making a websit in which client want to show video gallery like u tube . on internet i found use of ffmpeg. i have download ffmpeg adn pest it in root directry. and create class
<?php
class media_handler
{
function convert_media($filename, $rootpath, $inputpath,$outputpath,$width, $height, $bitrate, $samplingrate)
{
$outfile = "";
$rPath = $rootpath."\ffmpeg";
$size = $width."x".$height;
$outfile =$filename;
$size = Width & "x" & Height;
$outfile = 'out_file.flv';
$ffmpegcmd1 = "ffmpeg -i '".$inputpath."'\'".$filename. "' -acodec mp3 -ar '" .$samplingrate."' -ab '".$bitrate."'
-f flv -s '".$size."' '".$outputpath."'\'".$outfile;
$ret = shell_exec($ffmpegcmd1);
return $outfile;
}
function set_buffering($filename,$rootpath,$path)
{
$_rootPath = $rootpath."\flvtool";
$ffmpegcmd1 = "flvtool2 -U '".$Path."'\'".$filename;
$ret = shell_exec($ffmpegcmd1);
}
function grab_image($filename, $rootpath, $inputpath,$outputpath, $no_of_thumbs, $frame_number, $image_format, $width, $height)
{
$_rootpath ="ffmpeg";
$size = $width. "x".$height;
$outfile = "sample.png";
$ffmpegcmd1 = "ffmpeg -i '".$inputpath."'\'".$filename."' -vframes '".$no_of_thumbs."' -ss 00:00:03 -an -vcodec '". $image_format."' -frawvideo -s '".$size. "''". $outputpath."'\'".$outfile ;
$ret = shell_exec($ffmpegcmd1);
return $outfile;
}
}
and where i have used this the code is
$outfile=$_FILES['videofile']['name'];
$rootpath =$videoPath;
$outputpath=$videoPath;
$thumbpath=$videoPath;
**$image_name = $_mediahandler->grab_image($outfile, $rootpath, $outputpath, $thumbpath, 1, 2, "png", 110, 90);**
but it is not working .