This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
#if UNITY_ANDROID | |
#else | |
// PCではopenCVSharpを利用 | |
using System.Runtime.InteropServices; | |
using OpenCvSharp; | |
#endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
command = "ffmpeg -f rawvideo -pix_fmt yuv444p -color_range 2 -s:v 160x120 -r 30 -i pipe:0 " | |
+ "-c:v libx264 -profile:v baseline -pix_fmt yuv420p -y output.mp4" | |
IO.popen(command, "r+"){|io| | |
io.close_read | |
100.times do | |
(0..255).map{|y| | |
image = ([y].pack("C")) * 160 * 120 | |
image += ([127].pack("C")) * 160 * 120 | |
image += ([127].pack("C")) * 160 * 120 | |
15.times do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ruby rawvideo.rb & | |
# ffmpeg -f rawvideo -pix_fmt yuv444p -color_range 2 -s:v 160x120 -r 30 -i tcp://127.0.0.1:8888 \ | |
# -c:v libx264 -profile:v baseline -pix_fmt yuv420p -y output.mp4 | |
require 'socket' | |
server = TCPServer.new("127.0.0.1", 8888) | |
sock = server.accept | |
(0..255).map{|y| | |
image = ([y].pack("C")) * 160 * 120 | |
image += ([127].pack("C")) * 160 * 120 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ruby mjpeg.rb & | |
# ffmpeg -f mjpeg -r 30 -i tcp://127.0.0.1:8888 \ | |
# -c:v libx264 -profile:v baseline -pix_fmt yuv420p -y output.mp4 | |
require 'socket' | |
image = File.open('image.jpg', 'rb'){|fd| fd.read} | |
server = TCPServer.new("127.0.0.1", 8888) | |
sock = server.accept | |
(30*600).times do | |
sock.write image |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <opencv2/opencv.hpp> | |
#include <opencv2/video.hpp> | |
#pragma comment(lib, "opencv_core320.lib") | |
#pragma comment(lib, "opencv_videoio320.lib") | |
int main(int argc, const char* argv[]) | |
{ | |
if (argc != 3) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu | |
WORKDIR /root | |
ENV TZ=JST-9 | |
RUN apt-get update -y | |
RUN apt-get upgrade -y | |
RUN apt-get -y install trac | |
RUN mkdir ./Main | |
RUN echo "main\n\n" |trac-admin ./Main initenv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
=begin | |
* install | |
$ yum -y install fuse fuse-devel | |
$ gem install rfusefs | |
* mount | |
$ mkdir group_name | |
$ ruby cloudwatchlogfs.rb group_name | |
#=> log-group name is 'group_name' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'grape' | |
require 'uuid' | |
require 'aws-sdk' | |
class Hello < Grape::API | |
HTTP_PROXY = ENV['HTTP_PROXY'] || ENV['HTTPS_PROXY'] | |
AWS_REGION = ENV['AWS_REGION'] || 'ap-northeast-1' | |
module Logic |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
=begin | |
sudo yum -y install gcc openssl-devel zlib-devel pcre-devel lua lua-devel | |
sudo yum -y install ruby-devel curl-devel gcc-c++ | |
wget https://openresty.org/download/ngx_openresty-1.9.3.2.tar.gz | |
tar xf ngx_openresty-1.9.3.2.tar.gz | |
gem install passenger | |
ruby build.rb | |
=end |