App-EventStreamr

 view release on metacpan or  search on metacpan

LICENSE  view on Meta::CPAN

requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately

bin/station-mgr.pl  view on Meta::CPAN


sub stream_command {
  my ($id,$type) = @_;
  my $command = $self->{commands}{stream};
  my %cmd_vars =  ( 
                    host      => $self->{config}{mixer}{host},
                    port      => $self->{config}{mixer}{port},
                    id        => $id,
                    shost     => $self->{config}{stream}{host},
                    sport     => $self->{config}{stream}{port},
                    spassword => $self->{config}{stream}{password},
                    stream    => $self->{config}{stream}{stream},
                  );

  $command =~ s/\$(\w+)/$cmd_vars{$1}/g;

  return $command;
} 

sub set_path {
  my ($path) = @_;

bin/station-mgr.pl  view on Meta::CPAN

    },
  "devices" : "all",
  "device_control" :
    {
    },
  "run" : "0",
  "stream" :
    {
      "host" : "",
      "port" : "",
      "password" : "",
      "stream" : ""
    }
}
CONFIG

  my $config = from_json($json);
  return $config;
}

sub blank_settings {

bin/station-mgr.pl  view on Meta::CPAN

leon     20724  8.0  0.1 130680 24884 ?        S    12:27   0:01 ffmpeg -f video4linux2 -s vga -r 25 -i /dev/video0 -target pal-dv -
leon     20725  0.1  0.0  10796   860 ?        S    12:27   0:00 dvsource-file /dev/stdin -h localhost -p 1234
leon     20735  0.0  0.0   9396   920 pts/16   S+   12:28   0:00 grep --color=auto dv

$VAR1 = {
          'commands' => {
                          'alsa' => 'dvsource-alsa -h $host -p $port hw:$device',
                          'dv' => 'dvsource-firewire -h $host -p $port -c $device',
                          'record' => 'dvsink-files $device',
                          'v4l' => 'ffmpeg -f video4linux2 -s vga -r 25 -i $device -target pal-dv - | dvsource-file /dev/stdin -h $host -p $port',
                          'stream' => 'dvsink-command -- ffmpeg2theora - -f dv -F 25:2 --speedlevel 0 -v 4  --optimize -V 420 --soft-target -a 4 -c 1 -H 44100 -o - | oggfwd $host $port 8000 $password /$stream',
                          'file' => 'dvsource-file -l $device',
                          'dvswitch' => 'dvswitch -h 0.0.0.0 -p $port'
                        },
          'config' => {
                        'roles' => [
                                     {
                                       'role' => 'ingest'
                                     },
                                     {
                                       'role' => 'mixer'

commands.json  view on Meta::CPAN

# config-file-type: JSON -1

{ 
  "dv" : "$bin/dvsource_fw_tally.sh $host $port $device", 
  "v4l" : "ffmpeg -f video4linux2 -s vga -r 25 -i $device -target pal-dv - | dvsource-file /dev/stdin -h $host -p $port",
  "alsa" : "dvsource-alsa -h $host -p $port hw:$device",
  "file" :  "dvsource-file -h $host -p $port -l $device",
  "dvswitch" : "dvswitch -h 0.0.0.0 -p $port",
  "record" : "dvsink-files -h $host -p $port $path/$room_%Y-%m-%d_%H-%M-%S.dv",
  "stream" : "dvsink-command -h $host -p $port -- ffmpeg2theora - -f dv -F 25:2 --speedlevel 0 -v 4  --optimize -V 420 --soft-target -a 4 -c 1 -H 44100 --title $id -o - | oggfwd $shost $sport $spassword /$stream"
}

examples/station.json.dv-ingest-example  view on Meta::CPAN

    },
    "nickname" : "CHANGEME",
    "record_path" : "/localbackup/$room/$date",
    "roles" : [
        "ingest"
    ],
    "room" : "CHANGEME",
    "run" : "1",
    "stream" : {
        "host" : "",
        "password" : "",
        "port" : "",
        "stream" : ""
    }
}

examples/station.json.example  view on Meta::CPAN

  "devices" : "all", 
  "device_control" : 
    {
      "video0" : {"run":"0"},
    },
  "run" : "0",
  "stream" :
    {
      "host" : "",
      "port" : "",
      "password" : "",
      "stream" : ""
    }
}

examples/station.json.switch-example  view on Meta::CPAN

    "record_path" : "/localbackup/$room/$date",
    "roles" : [
        "mixer",
        "record",
        "ingest"
    ],
    "room" : "CHANGEME",
    "run" : "1",
    "stream" : {
        "host" : "",
        "password" : "",
        "port" : "",
        "stream" : ""
    }
}

lib/App/EventStreamr/DVswitch/Stream.pm  view on Meta::CPAN



extends 'App::EventStreamr::Process';

has 'cmd'         => ( is => 'ro', lazy => 1, builder => 1 );
has 'cmd_regex'   => ( is => 'ro', lazy => 1, builder => 1 );
has 'id'          => ( is => 'ro', default => sub { 'icecast' } );
has 'type'        => ( is => 'ro', default => sub { 'stream' } );

method _build_cmd() {
  my $command = $self->{config}{commands}{stream} ? $self->{config}{commands}{stream} : 'dvsink-command -h $host -p $port -- ffmpeg2theora - -f dv -F 25:2 --speedlevel 0 -v 4  --optimize -V 420 --soft-target -a 4 -c 1 -H 44100 --title $id -o - | oggf...
  
  my %cmd_vars = (
                  host      => $self->{config}{mixer}{host},
                  port      => $self->{config}{mixer}{port},
                  id        => $self->{config}{stream}{stream},
                  shost     => $self->{config}{stream}{host},
                  sport     => $self->{config}{stream}{port},
                  spassword => $self->{config}{stream}{password},
                  stream    => $self->{config}{stream}{stream},
  );

  $command =~ s/\$(\w+)/$cmd_vars{$1}/g;
  return $command;
}

method _build_cmd_regex() {
    return qr:ffmpeg2theora.+--title.$self->{config}{stream}{stream}.+:;
}

share/status/app/css/bootstrap.css  view on Meta::CPAN

}

label {
  display: block;
  margin-bottom: 5px;
}

select,
textarea,
input[type="text"],
input[type="password"],
input[type="datetime"],
input[type="datetime-local"],
input[type="date"],
input[type="month"],
input[type="time"],
input[type="week"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="search"],

share/status/app/css/bootstrap.css  view on Meta::CPAN

.uneditable-input {
  width: 206px;
}

textarea {
  height: auto;
}

textarea,
input[type="text"],
input[type="password"],
input[type="datetime"],
input[type="datetime-local"],
input[type="date"],
input[type="month"],
input[type="time"],
input[type="week"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="search"],

share/status/app/css/bootstrap.css  view on Meta::CPAN

     -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  -webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
     -moz-transition: border linear 0.2s, box-shadow linear 0.2s;
       -o-transition: border linear 0.2s, box-shadow linear 0.2s;
          transition: border linear 0.2s, box-shadow linear 0.2s;
}

textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="datetime"]:focus,
input[type="datetime-local"]:focus,
input[type="date"]:focus,
input[type="month"]:focus,
input[type="time"]:focus,
input[type="week"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,

share/status/app/css/bootstrap.min.css  view on Meta::CPAN

/*!
 * Bootstrap v2.3.2
 *
 * Copyright 2013 Twitter, Inc
 * Licensed under the Apache License v2.0
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Designed and built with all the love in the world by @mdo and @fat.
 */.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;wi...

share/status/app/lib/bootstrap/jquery.js  view on Meta::CPAN

				matchIndexes.push( i );
			}
			return matchIndexes;
		})
	}
};

Expr.pseudos["nth"] = Expr.pseudos["eq"];

// Add button/input type pseudos
for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
	Expr.pseudos[ i ] = createInputPseudo( i );
}
for ( i in { submit: true, reset: true } ) {
	Expr.pseudos[ i ] = createButtonPseudo( i );
}

// Easy API for creating new setFilters
function setFilters() {}
setFilters.prototype = Expr.filters = Expr.pseudos;
Expr.setFilters = new setFilters();

share/status/app/lib/bootstrap/jquery.js  view on Meta::CPAN

		isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
		global: true,
		processData: true,
		async: true,
		contentType: "application/x-www-form-urlencoded; charset=UTF-8",
		/*
		timeout: 0,
		data: null,
		dataType: null,
		username: null,
		password: null,
		cache: null,
		throws: false,
		traditional: false,
		headers: {},
		*/

		accepts: {
			"*": allTypes,
			text: "text/plain",
			html: "text/html",

share/status/app/lib/bootstrap/jquery.js  view on Meta::CPAN

			return {
				send: function( headers, complete ) {

					// Get a new xhr
					var handle, i,
						xhr = s.xhr();

					// Open the socket
					// Passing null username, generates a login popup on Opera (#2865)
					if ( s.username ) {
						xhr.open( s.type, s.url, s.async, s.username, s.password );
					} else {
						xhr.open( s.type, s.url, s.async );
					}

					// Apply custom fields if provided
					if ( s.xhrFields ) {
						for ( i in s.xhrFields ) {
							xhr[ i ] = s.xhrFields[ i ];
						}
					}

t/App/EventStreamr/DVswitch/Stream.t  view on Meta::CPAN

use App::EventStreamr::Status;
use App::EventStreamr::Config;
use Test::App::EventStreamr::ProcessTest;

# Added 'no_end_test' due to Double END Block issue
use Test::Warnings ':no_end_test';

my $status = App::EventStreamr::Status->new();

open(my $fh, '>', '/tmp/config.json');
print $fh '{"run" : "1", "control" : { "dvswitch" : { "run" : "1" } }, "mixer" : { "host" : "127.0.0.1", "port" : "1234" }, "stream" : { "host" : "127.0.0.1", "port" : "1111", "password" : "password++", "stream" : "TestStream" }}';
close $fh;

my $config = App::EventStreamr::Config->new(
  config_path => '/tmp',
);

my $proc = App::EventStreamr::DVswitch::Stream->new(
  config => $config,
  status => $status,
);

is($proc->cmd, 'dvsink-command -h 127.0.0.1 -p 1234 -- ffmpeg2theora - -f dv -F 25:2 --speedlevel 0 -v 4  --optimize -V 420 --soft-target -a 4 -c 1 -H 44100 --title TestStream -o - | oggfwd 127.0.0.1 1111 password++ /TestStream', "Stream Command buil...

# TODO: Implement Process Testing
#SKIP: {
#  skip "DVswitch not installed", 5, unless ( -e "/usr/bin/dvswitch" );
#  Test::App::EventStreamr::ProcessTest->new(
#    process => $proc,
#    config => $config,
#    id => 'dvswitch',
#  )->run_tests();
#}



( run in 1.014 second using v1.01-cache-2.11-cpan-49f99fa48dc )