2012年9月22日土曜日

flazrで自作プログラムをとりあえず動作させる。

前回のflazrインストールの続きです。
こちらでは、自作プログラムをとりあえず動作させてエラーがでなくなることを目指します。(あたらしいプログラムは作りかけなので、まだきちんと動作しないですが、xuggleの動作をちょっとだけ実行するので、全体の組み合わせに問題ないか確認くらいにはなるかとおもいます。)

で、やったこと。
1:必要なライブラリをいれる。
jarファイルの追加です。
・xuggle-xuggler.jar(以前gitからコンパイルしたxuggleのやつです。コンパイルしたxuggleのrootから参照するとdist/lib/xuggle-xuggler.jarにあります。)
・streaming.jar(https://github.com/taktod/streaming/tree/streamingここのブランチから落としてきたデータからつくったjarファイル)

2:起動スクリプトをつくっておく。
内容はclient.shを参考に日本語を使えるようにしておくのと、設定を日本語にしておく。

java -Duser.language=ja -Duser.region=JP -Dfile.encoding=UTF-8 -Duser.timezone=Asia/Tokyo -Xmx512m -cp conf:lib/xuggle-xuggler.jar:lib/streaming.jar:lib/commons-cli-1.2.jar:lib/commons-codec-1.2.jar:lib/commons-httpclient-3.1.jar:lib/flazr.jar:lib/jcl104-over-slf4j-1.4.2.jar:lib/log4j-1.2.14.jar:lib/netty-3.1.5.GA.jar:lib/slf4j-api-1.4.2.jar:lib/slf4j-log4j12-1.4.2.jar -Dflazr.log.suffix=-client com.ttProject.flazr.ex.RtmpClient $*

長いけど・・・
あとは動作にencode.xmlが必要なのでそれをコピーしておく。
flazr/confにでもいれておけばいいと思う。

で、起動
$ ./test.sh -host localhost -app live test test.flv

プログラム上の出力で出力用のストリームデータがきちんと表示されていれば、とりあえずOKとなります。
19:07:16,417 [New I/O client worker #1-1] INFO [ClientHandlerEx] - 視聴開始
19:07:16,485 [New I/O client worker #1-1] INFO [EncodeXmlAnalizer] - tak
19:07:16,865 [New I/O client worker #1-1] INFO [EncodeXmlAnalizer] - tak
19:07:16,866 [New I/O client worker #1-1] INFO [EncodeXmlAnalizer] - tak
19:07:16,866 [New I/O client worker #1-1] INFO [EncodeXmlAnalizer] - tak
19:07:16,866 [New I/O client worker #1-1] INFO [EncodeXmlAnalizer] - tak
19:07:16,867 [New I/O client worker #1-1] INFO [EncodeXmlAnalizer] - tak
19:07:16,867 [New I/O client worker #1-1] INFO [EncodeXmlAnalizer] - hls
19:07:16,868 [New I/O client worker #1-1] INFO [EncodeXmlAnalizer] - hls
19:07:16,868 [New I/O client worker #1-1] INFO [EncodeXmlAnalizer] - hls
19:07:16,868 [New I/O client worker #1-1] INFO [EncodeXmlAnalizer] - webm
19:07:16,869 [New I/O client worker #1-1] INFO [EncodeXmlAnalizer] - webm
19:07:16,870 [New I/O client worker #1-1] INFO [MediaManager] -   video
19:07:16,870 [New I/O client worker #1-1] INFO [MediaManager] - hasVideo:true
19:07:16,871 [New I/O client worker #1-1] INFO [MediaManager] - videoCodec:h264
19:07:16,872 [New I/O client worker #1-1] INFO [MediaManager] - videoWidth:1024
19:07:16,872 [New I/O client worker #1-1] INFO [MediaManager] - videoHeight:768
19:07:16,872 [New I/O client worker #1-1] INFO [MediaManager] - videoBitRate:1200000
19:07:16,872 [New I/O client worker #1-1] INFO [MediaManager] - videoGlobalQuality:0
19:07:16,873 [New I/O client worker #1-1] INFO [MediaManager] - properties
19:07:16,874 [New I/O client worker #1-1] INFO [MediaManager] - {qmax=30, directpred=1, g=25, qdiff=4, cqp=0, i_qfactor=0.71, partitions=-parti8x8+parti4x4+partp8x8+partp4x4-partb8x8, b_strategy=1, keyint_min=25, cmp=+chroma, qmin=10, async=4, wprefp=0, me_method=hex, level=30, qcomp=0.6, subq=5, me_range=16, bf=0, coder=0, sc_threshold=40}
19:07:16,874 [New I/O client worker #1-1] INFO [MediaManager] - flags
19:07:16,877 [New I/O client worker #1-1] INFO [MediaManager] - {FLAG2_FAST=true, FLAG_CLOSED_GOP=true, FLAG_LOOP_FILTER=true}
19:07:16,877 [New I/O client worker #1-1] INFO [MediaManager] -   audio
19:07:16,877 [New I/O client worker #1-1] INFO [MediaManager] - hasAudio:true
19:07:16,878 [New I/O client worker #1-1] INFO [MediaManager] - audioCodec:mp3
19:07:16,878 [New I/O client worker #1-1] INFO [MediaManager] - AudioBitRate:64000
19:07:16,878 [New I/O client worker #1-1] INFO [MediaManager] - audioChannels:2
19:07:16,878 [New I/O client worker #1-1] INFO [MediaManager] - audioSampleRate:44100
19:07:16,879 [New I/O client worker #1-1] INFO [MediaManager] -   video
19:07:16,879 [New I/O client worker #1-1] INFO [MediaManager] - hasVideo:true
19:07:16,879 [New I/O client worker #1-1] INFO [MediaManager] - videoCodec:h264
19:07:16,879 [New I/O client worker #1-1] INFO [MediaManager] - videoWidth:800
19:07:16,880 [New I/O client worker #1-1] INFO [MediaManager] - videoHeight:600
19:07:16,880 [New I/O client worker #1-1] INFO [MediaManager] - videoBitRate:1000000
19:07:16,880 [New I/O client worker #1-1] INFO [MediaManager] - videoGlobalQuality:0
19:07:16,880 [New I/O client worker #1-1] INFO [MediaManager] - properties
19:07:16,881 [New I/O client worker #1-1] INFO [MediaManager] - {qmax=30, directpred=1, g=25, qdiff=4, cqp=0, i_qfactor=0.71, partitions=-parti8x8+parti4x4+partp8x8+partp4x4-partb8x8, b_strategy=1, keyint_min=25, cmp=+chroma, qmin=10, async=4, wprefp=0, me_method=hex, level=30, qcomp=0.6, subq=5, me_range=16, bf=0, coder=0, sc_threshold=40}
19:07:16,881 [New I/O client worker #1-1] INFO [MediaManager] - flags
19:07:16,881 [New I/O client worker #1-1] INFO [MediaManager] - {FLAG2_FAST=true, FLAG_CLOSED_GOP=true, FLAG_LOOP_FILTER=true}
19:07:16,881 [New I/O client worker #1-1] INFO [MediaManager] -   audio
19:07:16,882 [New I/O client worker #1-1] INFO [MediaManager] - hasAudio:true
19:07:16,882 [New I/O client worker #1-1] INFO [MediaManager] - audioCodec:mp3
19:07:16,882 [New I/O client worker #1-1] INFO [MediaManager] - AudioBitRate:64000
19:07:16,882 [New I/O client worker #1-1] INFO [MediaManager] - audioChannels:2
19:07:16,883 [New I/O client worker #1-1] INFO [MediaManager] - audioSampleRate:44100
19:07:16,883 [New I/O client worker #1-1] INFO [MediaManager] -   video
19:07:16,883 [New I/O client worker #1-1] INFO [MediaManager] - hasVideo:true
19:07:16,883 [New I/O client worker #1-1] INFO [MediaManager] - videoCodec:h264
19:07:16,884 [New I/O client worker #1-1] INFO [MediaManager] - videoWidth:640
19:07:16,884 [New I/O client worker #1-1] INFO [MediaManager] - videoHeight:480
19:07:16,884 [New I/O client worker #1-1] INFO [MediaManager] - videoBitRate:800000
19:07:16,884 [New I/O client worker #1-1] INFO [MediaManager] - videoGlobalQuality:0
19:07:16,884 [New I/O client worker #1-1] INFO [MediaManager] - properties
19:07:16,885 [New I/O client worker #1-1] INFO [MediaManager] - {qmax=30, directpred=1, g=25, qdiff=4, cqp=0, i_qfactor=0.71, partitions=-parti8x8+parti4x4+partp8x8+partp4x4-partb8x8, b_strategy=1, keyint_min=25, cmp=+chroma, qmin=10, async=4, wprefp=0, me_method=hex, level=30, qcomp=0.6, subq=5, me_range=16, bf=0, coder=0, sc_threshold=40}
19:07:16,885 [New I/O client worker #1-1] INFO [MediaManager] - flags
19:07:16,885 [New I/O client worker #1-1] INFO [MediaManager] - {FLAG2_FAST=true, FLAG_CLOSED_GOP=true, FLAG_LOOP_FILTER=true}
19:07:16,886 [New I/O client worker #1-1] INFO [MediaManager] -   audio
19:07:16,886 [New I/O client worker #1-1] INFO [MediaManager] - hasAudio:true
19:07:16,886 [New I/O client worker #1-1] INFO [MediaManager] - audioCodec:mp3
19:07:16,886 [New I/O client worker #1-1] INFO [MediaManager] - AudioBitRate:64000
19:07:16,887 [New I/O client worker #1-1] INFO [MediaManager] - audioChannels:2
19:07:16,887 [New I/O client worker #1-1] INFO [MediaManager] - audioSampleRate:44100
19:07:16,887 [New I/O client worker #1-1] INFO [MediaManager] -   video
19:07:16,887 [New I/O client worker #1-1] INFO [MediaManager] - hasVideo:true
19:07:16,888 [New I/O client worker #1-1] INFO [MediaManager] - videoCodec:h264
19:07:16,888 [New I/O client worker #1-1] INFO [MediaManager] - videoWidth:320
19:07:16,888 [New I/O client worker #1-1] INFO [MediaManager] - videoHeight:240
19:07:16,888 [New I/O client worker #1-1] INFO [MediaManager] - videoBitRate:300000
19:07:16,889 [New I/O client worker #1-1] INFO [MediaManager] - videoGlobalQuality:0
19:07:16,889 [New I/O client worker #1-1] INFO [MediaManager] - properties
19:07:16,889 [New I/O client worker #1-1] INFO [MediaManager] - {qmax=30, directpred=1, g=25, qdiff=4, cqp=0, i_qfactor=0.71, partitions=-parti8x8+parti4x4+partp8x8+partp4x4-partb8x8, b_strategy=1, keyint_min=25, cmp=+chroma, qmin=10, async=4, wprefp=0, me_method=hex, level=30, qcomp=0.6, subq=5, me_range=16, bf=0, coder=0, sc_threshold=40}
19:07:16,890 [New I/O client worker #1-1] INFO [MediaManager] - flags
19:07:16,890 [New I/O client worker #1-1] INFO [MediaManager] - {FLAG2_FAST=true, FLAG_CLOSED_GOP=true, FLAG_LOOP_FILTER=true}
19:07:16,890 [New I/O client worker #1-1] INFO [MediaManager] -   audio
19:07:16,890 [New I/O client worker #1-1] INFO [MediaManager] - hasAudio:true
19:07:16,890 [New I/O client worker #1-1] INFO [MediaManager] - audioCodec:mp3
19:07:16,891 [New I/O client worker #1-1] INFO [MediaManager] - AudioBitRate:64000
19:07:16,891 [New I/O client worker #1-1] INFO [MediaManager] - audioChannels:2
19:07:16,891 [New I/O client worker #1-1] INFO [MediaManager] - audioSampleRate:44100
19:07:16,891 [New I/O client worker #1-1] INFO [MediaManager] -   video
19:07:16,891 [New I/O client worker #1-1] INFO [MediaManager] - hasVideo:true
19:07:16,892 [New I/O client worker #1-1] INFO [MediaManager] - videoCodec:h264
19:07:16,893 [New I/O client worker #1-1] INFO [MediaManager] - videoWidth:160
19:07:16,893 [New I/O client worker #1-1] INFO [MediaManager] - videoHeight:120
19:07:16,893 [New I/O client worker #1-1] INFO [MediaManager] - videoBitRate:64000
19:07:16,893 [New I/O client worker #1-1] INFO [MediaManager] - videoGlobalQuality:0
19:07:16,893 [New I/O client worker #1-1] INFO [MediaManager] - properties
19:07:16,898 [New I/O client worker #1-1] INFO [MediaManager] - {qmax=30, directpred=1, g=25, qdiff=4, cqp=0, i_qfactor=0.71, partitions=-parti8x8+parti4x4+partp8x8+partp4x4-partb8x8, b_strategy=1, keyint_min=25, cmp=+chroma, qmin=10, async=4, wprefp=0, me_method=hex, level=30, qcomp=0.6, subq=5, me_range=16, bf=0, coder=0, sc_threshold=40}
19:07:16,899 [New I/O client worker #1-1] INFO [MediaManager] - flags
19:07:16,899 [New I/O client worker #1-1] INFO [MediaManager] - {FLAG2_FAST=true, FLAG_CLOSED_GOP=true, FLAG_LOOP_FILTER=true}
19:07:16,899 [New I/O client worker #1-1] INFO [MediaManager] -   audio
19:07:16,899 [New I/O client worker #1-1] INFO [MediaManager] - hasAudio:true
19:07:16,899 [New I/O client worker #1-1] INFO [MediaManager] - audioCodec:mp3
19:07:16,899 [New I/O client worker #1-1] INFO [MediaManager] - AudioBitRate:64000
19:07:16,900 [New I/O client worker #1-1] INFO [MediaManager] - audioChannels:2
19:07:16,900 [New I/O client worker #1-1] INFO [MediaManager] - audioSampleRate:44100
19:07:16,900 [New I/O client worker #1-1] INFO [MediaManager] -   video
19:07:16,900 [New I/O client worker #1-1] INFO [MediaManager] - hasVideo:true
19:07:16,900 [New I/O client worker #1-1] INFO [MediaManager] - videoCodec:h264
19:07:16,900 [New I/O client worker #1-1] INFO [MediaManager] - videoWidth:640
19:07:16,901 [New I/O client worker #1-1] INFO [MediaManager] - videoHeight:480
19:07:16,901 [New I/O client worker #1-1] INFO [MediaManager] - videoBitRate:800000
19:07:16,901 [New I/O client worker #1-1] INFO [MediaManager] - videoGlobalQuality:0
19:07:16,901 [New I/O client worker #1-1] INFO [MediaManager] - properties
19:07:16,902 [New I/O client worker #1-1] INFO [MediaManager] - {qmax=30, directpred=1, g=25, qdiff=4, cqp=0, i_qfactor=0.71, partitions=-parti8x8+parti4x4+partp8x8+partp4x4-partb8x8, b_strategy=1, keyint_min=25, cmp=+chroma, qmin=10, async=4, wprefp=0, me_method=hex, level=30, qcomp=0.6, subq=5, me_range=16, bf=0, coder=0, sc_threshold=40}
19:07:16,902 [New I/O client worker #1-1] INFO [MediaManager] - flags
19:07:16,902 [New I/O client worker #1-1] INFO [MediaManager] - {FLAG2_FAST=true, FLAG_CLOSED_GOP=true, FLAG_LOOP_FILTER=true}
19:07:16,902 [New I/O client worker #1-1] INFO [MediaManager] -   audio
19:07:16,902 [New I/O client worker #1-1] INFO [MediaManager] - hasAudio:true
19:07:16,902 [New I/O client worker #1-1] INFO [MediaManager] - audioCodec:mp3
19:07:16,902 [New I/O client worker #1-1] INFO [MediaManager] - AudioBitRate:64000
19:07:16,902 [New I/O client worker #1-1] INFO [MediaManager] - audioChannels:2
19:07:16,903 [New I/O client worker #1-1] INFO [MediaManager] - audioSampleRate:44100
19:07:16,903 [New I/O client worker #1-1] INFO [MediaManager] -   video
19:07:16,903 [New I/O client worker #1-1] INFO [MediaManager] - hasVideo:true
19:07:16,903 [New I/O client worker #1-1] INFO [MediaManager] - videoCodec:h264
19:07:16,903 [New I/O client worker #1-1] INFO [MediaManager] - videoWidth:320
19:07:16,903 [New I/O client worker #1-1] INFO [MediaManager] - videoHeight:240
19:07:16,903 [New I/O client worker #1-1] INFO [MediaManager] - videoBitRate:300000
19:07:16,904 [New I/O client worker #1-1] INFO [MediaManager] - videoGlobalQuality:0
19:07:16,904 [New I/O client worker #1-1] INFO [MediaManager] - properties
19:07:16,904 [New I/O client worker #1-1] INFO [MediaManager] - {qmax=30, directpred=1, g=25, qdiff=4, cqp=0, i_qfactor=0.71, partitions=-parti8x8+parti4x4+partp8x8+partp4x4-partb8x8, b_strategy=1, keyint_min=25, cmp=+chroma, qmin=10, async=4, wprefp=0, me_method=hex, level=30, qcomp=0.6, subq=5, me_range=16, bf=0, coder=0, sc_threshold=40}
19:07:16,904 [New I/O client worker #1-1] INFO [MediaManager] - flags
19:07:16,904 [New I/O client worker #1-1] INFO [MediaManager] - {FLAG2_FAST=true, FLAG_CLOSED_GOP=true, FLAG_LOOP_FILTER=true}
19:07:16,905 [New I/O client worker #1-1] INFO [MediaManager] -   audio
19:07:16,905 [New I/O client worker #1-1] INFO [MediaManager] - hasAudio:true
19:07:16,905 [New I/O client worker #1-1] INFO [MediaManager] - audioCodec:mp3
19:07:16,905 [New I/O client worker #1-1] INFO [MediaManager] - AudioBitRate:64000
19:07:16,905 [New I/O client worker #1-1] INFO [MediaManager] - audioChannels:2
19:07:16,905 [New I/O client worker #1-1] INFO [MediaManager] - audioSampleRate:44100
19:07:16,905 [New I/O client worker #1-1] INFO [MediaManager] -   video
19:07:16,905 [New I/O client worker #1-1] INFO [MediaManager] - hasVideo:true
19:07:16,906 [New I/O client worker #1-1] INFO [MediaManager] - videoCodec:h264
19:07:16,906 [New I/O client worker #1-1] INFO [MediaManager] - videoWidth:160
19:07:16,906 [New I/O client worker #1-1] INFO [MediaManager] - videoHeight:120
19:07:16,906 [New I/O client worker #1-1] INFO [MediaManager] - videoBitRate:64000
19:07:16,906 [New I/O client worker #1-1] INFO [MediaManager] - videoGlobalQuality:0
19:07:16,906 [New I/O client worker #1-1] INFO [MediaManager] - properties
19:07:16,907 [New I/O client worker #1-1] INFO [MediaManager] - {qmax=30, directpred=1, g=25, qdiff=4, cqp=0, i_qfactor=0.71, partitions=-parti8x8+parti4x4+partp8x8+partp4x4-partb8x8, b_strategy=1, keyint_min=25, cmp=+chroma, qmin=10, async=4, wprefp=0, me_method=hex, level=30, qcomp=0.6, subq=5, me_range=16, bf=0, coder=0, sc_threshold=40}
19:07:16,907 [New I/O client worker #1-1] INFO [MediaManager] - flags
19:07:16,907 [New I/O client worker #1-1] INFO [MediaManager] - {FLAG2_FAST=true, FLAG_CLOSED_GOP=true, FLAG_LOOP_FILTER=true}
19:07:16,907 [New I/O client worker #1-1] INFO [MediaManager] -   audio
19:07:16,907 [New I/O client worker #1-1] INFO [MediaManager] - hasAudio:true
19:07:16,907 [New I/O client worker #1-1] INFO [MediaManager] - audioCodec:mp3
19:07:16,908 [New I/O client worker #1-1] INFO [MediaManager] - AudioBitRate:64000
19:07:16,908 [New I/O client worker #1-1] INFO [MediaManager] - audioChannels:2
19:07:16,908 [New I/O client worker #1-1] INFO [MediaManager] - audioSampleRate:44100
19:07:16,908 [New I/O client worker #1-1] INFO [MediaManager] -   video
19:07:16,908 [New I/O client worker #1-1] INFO [MediaManager] - hasVideo:true
19:07:16,908 [New I/O client worker #1-1] INFO [MediaManager] - videoCodec:vp8
19:07:16,908 [New I/O client worker #1-1] INFO [MediaManager] - videoWidth:640
19:07:16,909 [New I/O client worker #1-1] INFO [MediaManager] - videoHeight:480
19:07:16,909 [New I/O client worker #1-1] INFO [MediaManager] - videoBitRate:300000
19:07:16,909 [New I/O client worker #1-1] INFO [MediaManager] -   audio
19:07:16,909 [New I/O client worker #1-1] INFO [MediaManager] - hasAudio:true
19:07:16,909 [New I/O client worker #1-1] INFO [MediaManager] - audioCodec:vorbis
19:07:16,909 [New I/O client worker #1-1] INFO [MediaManager] - AudioBitRate:64000
19:07:16,909 [New I/O client worker #1-1] INFO [MediaManager] - audioChannels:2
19:07:16,909 [New I/O client worker #1-1] INFO [MediaManager] - audioSampleRate:44100
19:07:16,910 [New I/O client worker #1-1] INFO [MediaManager] -   video
19:07:16,910 [New I/O client worker #1-1] INFO [MediaManager] - hasVideo:true
19:07:16,910 [New I/O client worker #1-1] INFO [MediaManager] - videoCodec:vp8
19:07:16,910 [New I/O client worker #1-1] INFO [MediaManager] - videoWidth:320
19:07:16,910 [New I/O client worker #1-1] INFO [MediaManager] - videoHeight:240
19:07:16,910 [New I/O client worker #1-1] INFO [MediaManager] - videoBitRate:300000
19:07:16,910 [New I/O client worker #1-1] INFO [MediaManager] -   audio
19:07:16,911 [New I/O client worker #1-1] INFO [MediaManager] - hasAudio:true
19:07:16,911 [New I/O client worker #1-1] INFO [MediaManager] - audioCodec:vorbis
19:07:16,911 [New I/O client worker #1-1] INFO [MediaManager] - AudioBitRate:64000
19:07:16,911 [New I/O client worker #1-1] INFO [MediaManager] - audioChannels:2
19:07:16,911 [New I/O client worker #1-1] INFO [MediaManager] - audioSampleRate:44100
19:07:16,911 [New I/O client worker #1-1] INFO [ClientHandler] - onStatus code: NetStream.Play.Start

実際にダウンロードもコンバートもしてませんが、h.264 vp8 vorbis mp3きちんと認識できているみたいですね。

余談ですが、https://github.com/taktod/streaming/tree/mediastreaming
こちらのブランチのデータはxuggleのバージョンがあわずに動作しないみたいです。


さて、次はメインとなるコンバート部分の再構築ですね。
とりあえずの目標は、rtmp→flv mpegts webmの出力をつくるところかな。

0 件のコメント:

コメントを投稿