Chatty介紹及教學 Streamlink+VLC 同時觀看數個Twitch實況

我改的Chatty
個人需求修改,想用的就拿去,想用官方版下面也有
用最新的JDK build的 (比官方新),效能也許稍微有提高? (檔案有比較小)

程式下載
source code https://github.com/craftwar/chatty

基本上只跟作者的release版更新,除非他有加什麼我想馬上用的功能或修正
因為他的程式比較沒人review,出錯率比較大,求穩

官方版 https://github.com/chatty/chatty
下載 https://github.com/chatty/chatty/releases


不建議下載包jre的版本 windows_standalone.zip (檔案較大,jre更新要等Chatty更新)
檔名有hotkey的是有熱鍵功能
基本上下載檔名長像這樣的 Chatty_0.8.7.zip
點Chatty.jar執行程式,無法執行的需要安裝/設定 JRE/JDK

一般情況去Oracle下載Java安裝就行了,比較方便
會自動設定好,缺點是只有64bit,較吃記憶體
http://www.oracle.com/technetwork/java/javase/downloads/index.html

如果你有興趣自己動手安裝設定,可以使用OpenJDK 32bit
OpenJDK9 32bit安裝法

Oracle Java11後要錢,我改用OpenJDK
https://craftwarblog.blogspot.com/2018/10/java-11-jdkjre.html


加快Chatty啟動速度
可攜版使用法 (portable, 網咖用)
Chatty screenshot 使用範例圖

Chatty教學by Append@ptt (完全沒用過先看這個,教學不是我寫的,部分內容我不認同)

為什麼要用第三方聊天室軟體Chatty?

twitch常聽說有連線問題,聊天室運作不正常 (收發訊息有問題)
聊天室/實況管理功能比twitch好用,ex: 修改實況資訊不用開網頁比較方便
同時看多台很方便,可自訂指令送出常用文字
有人講話及有人tag你,都有提醒,不容易漏掉訊息 (非常推薦實況主用,才能留住觀眾)

如果你只需要純文字功能,可以用IRC連twitch (Chatty有點肥,資源用得多)


看實況建議用Chatty + Streamlink 配合VLC (可隨意調畫面大小)
VLC用 alt+o/ alt+shit+o 調zoom 改變畫面大小


Streamlink (Livestreamer被遺棄後,接手的人改的名字)
官網 https://streamlink.github.io/
可用喜歡的播放器觀看實況平台 (不只有twitch)

下載 https://github.com/streamlink/streamlink/releases

推薦原因:
  1. 換player可做出各種調整,大小,亮度(實況主遊戲很暗靠螢幕調亮修正,觀眾就會太暗),always on top ...etc
  2. 比瀏覽器省資源,可自動重連,網頁是不是要手動按F5? 很久沒用不熟
  3. Twitch可用audio only mode,省流量/資源 (Twitch手機app才有,網頁不提供)
  4. 跨平台,Windows/Linux/Mac都可以用
  5. 沒有廣告
如果你沒有圖形介面就不會用,可以考慮 streamlink-twitch-gui (比streamlink吃資源)
https://github.com/streamlink/streamlink-twitch-gui

GitHub上有installer,這裡寫另外教用python pip的安裝方法 (就跟我用Chatty喜歡令外裝jre一樣)
更新較方便,如果用到很多python程式,都用pip安裝可節省空間 (如果用相同版本python)

如果你不會使用python,可用官方的安裝檔來安裝 (檔名長這樣streamlink-x.y.z.exe),下面pip那段就不用看

其他python implementaion還未確認可以使用,用下面連結下載官方的CPython就好
IronPython確定不行,因為會用到cffi
 
先去安裝python 32/64bit都可以 (通常裝最新版效能比較好 ex: 3.6 > 3.5 > 3.4)
如果沒有pip的話,要先安裝
    python -m ensurepip
更新pip
    python -m pip install -U pip
安裝 streamlink
    pip install streamlink
pip另一種source安裝 (不用binary package)
    pip install --no-binary streamlink streamlink
https://github.com/streamlink/streamlink/issues/2287
安裝完的檔案會在Scripts下
streamlink.exe 或 streamlink-script.py (source script)
更新 streamlink
    pip install --upgrade streamlink
移除 streamlink
    pip uninstall streamlink


Streamlink整合在Chatty內設定範例 (使用VLC做播放程式)
在Extra選單下的Livestreamer (我建議過作者要改Streamlink了,他不鳥我)


Chatty選單
extra->Livestreamer->base command填入 (路徑要改成你的安裝位置)

D:\Python\Python35-32\Scripts\streamlink.exe -p "C:\Program
Files\VideoLAN\VLC\vlc.exe --mmdevice-volume=0.5 --no-plugins-scan" --player-continuous-http --hls-segment-threads 2 --hls-live-edge 2

1.4.0 似乎可以加這個參數  --twitch-low-latency
https://github.com/streamlink/streamlink/pull/2513

如果要斷線自動重連播放程式(VLC)中要設repeat/loop

另一種參數下法,讓player直接連twitch,延遲較慢,似乎無法自動重連
這個下法是streamlink用pip安裝的方法
C:\Python\Python37-32\python -OO C:\Python\Python37-32\Scripts\streamlink-script.py -p "C:\Program Files\VideoLAN\VLC\vlc.exe --no-plugins-scan --mmdevice-volume=0.5" --player-passthrough hls

從原始檔的執行方法 (存成 streamlink.cmd 在Chatty內設定為command)
cd /D C:\git\streamlink\src
C:\Python38-32\python.exe -OO -m streamlink -p "C:\Program Files\VideoLAN\VLC\vlc.exe --no-plugins-scan --mmdevice-volume=0.9" --player-passthrough hls --twitch-low-latency --hls-segment-threads 2 %*



參數
streamlink
--hls-live-edge 2 (預設3,減少會減少latency,增加buffer可能)

--twitch-disable-hosting 如果不想要被host自動轉台
--player-continuous-http  用這個模式才可以讓player自動重連
VLC參數
--mmdevice-volume=0.5 設定開始音量,避免音量太大
"C:\ProgramFiles\VideoLAN\VLC\vlc.exe --mmdevice-volume=0.5"
--no-plugins-scan 不掃描新plugin
--network-caching=<integer [0 .. 60000]>
                           Network caching (ms)
    Caching value for network resources, in milliseconds.

記錄用,用-a 或 --player-args,player參數似乎吃不到,直接丟進player可以用
streamlink.exe -p "C:\Program Files\VideoLAN\VLC\vlc.exe" --player-args "--no-plugins-scan --mmdevice-volume=0.5" --player-continuous-http --hls-segment-threads 2 --hls-live-edge 2



menu那邊填
Best, {720p,720alt,720p60,best}, Select, {Audio,audio_only}

↑這個功能要比較新版的Chatty才有,回報作者反應都滿慢的,某次我就自己改了

--no-version-check 不檢查新版,較快開始看實況 (我在github有watch也沒必要重複檢查0.4.0後不用加)





k-lite的mpc-hc某次改版後,都要第三次才能連上,比較慢開始,所以我推薦用VLC


想同時看多台Twitch或是有更多控制的播放器

才推薦用 Chatty + streamlink

否則還是用網頁吧,html5 player已經很不錯了  或是 Streamlink Twitch GUI

不像flash player時代,效能完全不能和streamlink比

現在html5/streamlink兩者效能其實差不多

第三方程式,會有些twitch的功能不能用 ex: extension


留言

這個網誌中的熱門文章

OBS 抓不到畫面, 視窗, 遊戲擷取, 黑或白畫面, 當掉 ,卡住, black/white screen, window game capture, crash, freeze

優化實況(一) OBS設定 streaming settings

OBS plugin obs-text 顯示播放中音樂, display playing music