Skip to content

Instantly share code, notes, and snippets.

@h2oota
h2oota / tsslice.c
Created November 16, 2012 11:32
Select a program stream in a Transport Stream.
/*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
@h2oota
h2oota / gist:4086959
Created November 16, 2012 12:32
apacheの設定
DocumentRoot "/docroot/DTV"
ScriptAlias /cgi /docroot/DTV/cgi
<Directory "/docroot/DTV/cgi">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-st\
rict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>ワンセグ</title>
<link rel="stylesheet" href="styles.css" type="text/css" />
</head>
@h2oota
h2oota / start_watch
Created November 16, 2012 12:42
プレイリスト、tsファイルを生成し続ける bin/start_watch
#!/usr/local/bin/perl -w
our $segment_duration = 10;
our $window_size = 3;
sub is_active
{
return 0 unless (open (TS, "$_[0]/stream.m3u8.last") );
my $last = <TS>;
close(TS);
return $segment_duration * $window_size + $last > time;
@h2oota
h2oota / watch
Created November 16, 2012 13:02
CGI TS生成プロセスの起動、プレイリストのアクセストラック cgi/watch
#!/usr/local/bin/perl -w
use strict;
use CGI::Lite;
use File::Temp qw/ tempdir /;
use Digest::MD5 qw(md5 md5_hex md5_base64);
our $cgi = new CGI::Lite;
our %form = $cgi->parse_form_data('POST');
our %cookies = $cgi->parse_cookies;
our %channels;
@h2oota
h2oota / cscope-indexer.bat
Created November 18, 2012 23:00
cscope-indexer for cscope-win32
@if (0==1) never execute
@echo off & setlocal enableextensions
REM bat + CScript
REM for JSCript, '@ if' is a conditional compile statement. then JScript discards @ if/ ~~ @ end.
REM for cmd.exe, '@ if' is a IF-STATEMENT. @ means no echo. the condition is never satisfied, because "(0" is not equal "1)". 'never execute' is dummy command for syntax checking.
REM http://emacswiki.org/emacs/CScopeAndEmacs
REM ******************************************************************
REM Not responsible for any loss resulting from the use of this script
REM ******************************************************************
REM sed and grep should be installed and in PATH
@h2oota
h2oota / ffmpeg-1.0-one_seg-hls-patch
Created November 24, 2012 06:33
ffmpegでワンセグTSをライブストリーミングするためのパッチ
--- ./libavformat/mpegts.c.orig 2012-09-28 10:37:35.000000000 +0900
+++ ./libavformat/mpegts.c 2012-11-24 14:46:00.500221806 +0900
@@ -615,6 +615,8 @@
st->codec->codec_tag = pes->stream_type;
mpegts_find_stream_type(st, pes->stream_type, ISO_types);
+ if (pes->stream_type == 0x06 || pes->stream_type == 0x0d)
+ st->discard = AVDISCARD_ALL;
if ((prog_reg_desc == AV_RL32("HDMV") ||
prog_reg_desc == AV_RL32("HDPR")) &&
@h2oota
h2oota / ARIB-B24-SI.src
Created December 2, 2012 03:56
Citrus iconvにARIB-B24デコーダーを組み込む
NAME "ARIB-B24-SI"
ENCODING "ISO2022"
# ARIB TR-B14
# G0 KANJI
# G1 EISU
# G2 HIRAKANA
# G3 KATAKANA
# VARIABLE "8BIT MAX3 INIT0=94$9 0=94B 0=94J 0=940 0=941 0=94I 0=94$B 0=94$9 0=94$: 0=94$; INIT1=94I 1=94B 1=94J 1=940 1=941 1=94I 1=94$B 1=94$9 1=94$: 1=94$; INIT2=940 2=94B 2=94J 2=940 2=941 2=94I 2=94$B 2=94$9 2=94$: 2=94$; INIT3=941 3=94B 3=94J 3=940 3=941 3=94I 3=94$B 3=94$9 3=94$: 3=94$; NOOLD LS0 LS1 LS2 LS2 LS1R LS2R LS3R SS2 SS3"
VARIABLE "8BIT MAX3 INIT0=94$9 INIT1=94J INIT2=940 INIT3=941 NOOLD LS0 LS1 LS2 LS2 LS1R LS2R LS3R SS2 SS3 ARIB-B24"
DEFCSID "ISO646-US" 0
@h2oota
h2oota / openssl-1.0.0j.diff
Created January 3, 2013 12:43
s_client(OpenSSL)をWindows版Emacsの非同期プロセスから利用するためのパッチ。 s_clientは標準入出力がコンソールでないと動作しませんが、このパッチを適用する事で標準入出力がパイプの場合にも動作するようになります。
--- ./apps/app_rand.c.orig 2001-02-20 17:13:19.000000000 +0900
+++ ./apps/app_rand.c 2013-01-03 12:55:09.000000000 +0900
@@ -129,6 +129,7 @@ int app_RAND_load_file(const char *file,
BIO_flush(bio_e);
RAND_screen();
BIO_printf(bio_e," done\n");
+ BIO_flush(bio_e);
#endif
if (file == NULL)
@h2oota
h2oota / OpenDylan-FreeBSD-amd64-README.txt
Last active December 11, 2015 02:59
Building OpenDylan on FreeBSD-amd64
Building OpenDylan on FreeBSD amd64
===================================
Install tools
-------------
devel/autoconf, devel/gmake
Install Boehm-GC
----------------
+ put the patch into ports/devel/boehm-gc-threaded/files/patch-~~~__dyn_load.c
+ install ports