• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisão61dd9835f0a99ff4fe3dc2b5a61f8bbae516387a (tree)
Hora2017-03-06 21:57:02
Autordyknon <dyknon@user...>
Commiterdyknon

Mensagem de Log

Javascript:配信待追加, server:引数で動画指定, socket:home以下に

Mudança Sumário

Diff

--- a/live.pl
+++ b/live.pl
@@ -31,10 +31,13 @@ use utf8;
3131 use IO::Socket::UNIX;
3232 use JSON;
3333 use Encode;
34+use Cwd;
3435
3536 $| = 1;
3637
37-my $sockpath = "/tmp/media_server.sock";
38+my $home = Cwd::getcwd();
39+$home =~ s!/public_html/.*!/!;
40+my $sockpath = $home."socks/media_server.sock";
3841
3942 if(!$ENV{QUERY_STRING}){
4043 binmode(STDOUT, ":utf8");
@@ -90,8 +93,12 @@ if(!$ENV{QUERY_STRING}){
9093 this.cont.appendChild(this.fs_button);
9194 }
9295 live_streamer.prototype.keycb = function(resp){
93- if(resp === null || resp.status == "nostreams"){
96+ if(resp === null){
97+ this.statbox.textContent = "通信エラー(再読込してね)";
98+ return;
99+ }else if(resp.status == "nostreams"){
94100 this.statbox.textContent = "配信なしだよ。";
101+ window.setTimeout(function(t){t.keyretrycb()}, 300, this);
95102 return;
96103 }
97104 this.sindex = resp.key;
@@ -101,10 +108,17 @@ if(!$ENV{QUERY_STRING}){
101108 this.statbox.textContent = "loading video header";
102109 //this.cindex++;
103110 };
111+ live_streamer.prototype.keyretrycb = function(){
112+ this.nexcb = this.keycb;
113+ this.request("key", null);
114+ };
104115 live_streamer.prototype.datacb = function(resp){
105116 if(resp === null){
106117 this.statbox.textContent = "放送終了かな。";
107118 this.ms.endOfStream();
119+ window.setTimeout(function(t){
120+ new live_streamer(t.velm, t.cont, t.statbox, t.serv);
121+ }, (1000*this.bufremain()+1)|0, this);
108122 return;
109123 }else if(resp.status == "nostreams"){
110124 this.statbox.textContent = "配信なしだよ。";
@@ -113,7 +127,6 @@ if(!$ENV{QUERY_STRING}){
113127 this.nexcb = this.updatecb;
114128 this.sb.addEventListener("updateend", this);
115129 this.sb.appendBuffer(resp);
116- this.statbox.textContent = "video data appended";
117130 };
118131 live_streamer.prototype.updatecb = function(ev){
119132 this.nexcb = this.datacb;
--- a/unixsock_mediaserver.pl
+++ b/unixsock_mediaserver.pl
@@ -32,7 +32,7 @@ use IO::Pipe;
3232 use IO::Socket::UNIX;
3333 use IO::Select;
3434
35-my $sockpath = "/tmp/media_server.sock";
35+my $sockpath = $ENV{HOME}."/socks/media_server.sock";
3636
3737 $| = 1;
3838 $SIG{PIPE} = "IGNORE";
@@ -658,9 +658,11 @@ $readsel = IO::Select->new();
658658 $writesel = IO::Select->new();
659659
660660 my $in_handle = new IO::Pipe;
661-$in_handle->reader(qw{ffmpeg -loglevel panic -i video2stream -map 0:v -map 0:a -c:v vp8 -deadline:v realtime -cpu-used:v 8 -g:v 20 -q:v 24 -qmax:v 28 -live 1 -vf realtime -c:a libvorbis -b:a 64k -cluster_size_limit 10000000 -cluster_time_limit 1000000 -s hd720 -f webm -});
661+#$in_handle->reader(qw{ffmpeg -loglevel panic -i video2stream -map 0:v:0 -map 0:a:0 -c:v vp8 -deadline:v realtime -cpu-used:v 8 -g:v 20 -q:v 30 -qmax:v 32 -live 1 -vf realtime -c:a libvorbis -b:a 64k -cluster_size_limit 10000000 -cluster_time_limit 1000000 -s wvga -f webm -});
662662 #$in_handle->reader(qw{ffmpeg -loglevel panic -f video4linux2 -r:v 10 -s vga -i /dev/video0 -map 0:v -c:v vp8 -deadline:v good -cpu-used:v 16 -g:v 10 -q:v 25 -qmax:v 28 -pix_fmt yuv420p -live 1 -vf realtime -cluster_size_limit 10000000 -cluster_time_limit 1000000 -f webm -});
663663 #$in_handle->reader(qw{ffmpeg -loglevel panic -s 1366x768 -r:v 20 -f x11grab -i :0+1080,880 -map 0:v -c:v vp8 -deadline:v good -cpu-used:v 8 -g:v 10 -q:v 25 -qmax:v 28 -pix_fmt yuv420p -live 1 -cluster_size_limit 10000000 -cluster_time_limit 1000000 -s wvga -vf realtime -f webm -});
664+defined($ARGV[0]) || die;
665+$in_handle->reader(qw{ffmpeg -loglevel panic -i}, $ARGV[0], qw{-map 0:v:0 -map 0:a:0 -c:v vp8 -deadline:v realtime -cpu-used:v 8 -g:v 20 -q:v 28 -qmax:v 30 -live 1 -vf realtime -c:a libvorbis -b:a 64k -cluster_size_limit 10000000 -cluster_time_limit 1000000 -s hd720 -f webm -});
664666 binmode($in_handle, ":raw");
665667 StreamInHandler->new($in_handle);
666668