rtmp to webrtc

Success Can RTMP to WebRTC On iOS 11 up can play.

2018-08-21 · 1 min · 11 words · Me

Struct to Map by Tag

telegram Gopher 台灣 @winampmaker https://play.golang.org/p/RObzlfjZSRi ` func struct2Map(model interface{}, tagName string) map[string]interface{} { m := make(map[string]interface{}) r := reflect.ValueOf(model) total := r.NumField() for i := 0; i < total; i++ { m[r.Type().Field(i).Tag.Get(tagName)] = r.Field(i).Interface() } return m } ` ============================ ` "github.com/fatih/structs" func StructtoMapbyTag(tr interface{}, tag string) map[string]interface{} { t := make(map[string]interface{}) //儲存處理過的m s := structs.New(tr) m := s.Map() //先轉成map[string]interface{} for key, value := range m { t[s.Field(key).Tag(tag)] = value.(string) } return t } `

2018-08-20 · 1 min · 75 words · Me

font size conversion px em

https://websemantics.uk/tools/convert-pixel-point-em-rem-percent/ https://websemantics.uk/articles/font-size-conversion/ Point Pixel Em Percent Keyword Default sans-serif 6pt 8px 0.5em 50% Sample 7pt 9px 0.55em 55% Sample 7.5pt 10px 0.625em 62.5% x-small Sample 8pt 11px 0.7em 70% Sample 9pt 12px 0.75em 75% Sample 10pt 13px 0.8em 80% small Sample 10.5pt 14px 0.875em 87.5% Sample 11pt 15px 0.95em 95% Sample 12pt 16px 1em 100% medium Sample 13pt 17px 1.05em 105% Sample 13.5pt 18px 1.125em 112.5% large Sample 14pt 19px 1.2em 120% Sample 14.5pt 20px 1.25em 125% Sample 15pt 21px 1.3em 130% Sample 16pt 22px 1.4em 140% Sample 17pt 23px 1.45em 145% Sample 18pt 24px 1.5em 150% x-large Sample 20pt 26px 1.6em 160% Sample 22pt 29px 1.8em 180% Sample 24pt 32px 2em 200% xx-large Sample 26pt 35px 2.2em 220% Sample 27pt 36px 2.25em 225% Sample 28pt 37px 2.3em 230% Sample 29pt 38px 2.35em 235% Sample 30pt 40px 2.45em 245% Sample 32pt 42px 2.55em 255% Sample 34pt 45px 2.75em 275% Sample 36pt 48px 3em 300% Sample ...

2018-08-16 · 1 min · 155 words · Me

Header golang client get

Usually how to tech is ` req, err := http.NewRequest("GET", "http://example.com", nil) req.Header.Add("Authorize", "dswxswsxw") resp, err := client.Do(req) ` BUT Have problem inside. So…. use this ` headers := http.Header{ "Accept-Encoding": []string{"gzip, deflate"}, } req, err := http.NewRequest("GET", url, nil) req.Header = headers client := &http.Client{} resp, err = client.Do(req) ` More Safe.

2018-08-10 · 1 min · 53 words · Me

ffmpeg hls 2~3秒 rtmp

.2秒 ffmpeg -i rtmp://xxx/live/A1 -tune zerolatency -preset faster -vcodec libx264 -b:v 400k -s 720x450 -r 15 -acodec mp3 -g 2 -f ssegment -segment_format mpegts -segment_time 2 -segment_list playlist.m3u8 out%03d.ts -r 15 帧速率 -s 720x450 分辨率 -b 500k 比特率 -gop 2 -segment_time 2 压缩快慢 -preset ultrafast,superfast, veryfast, faster, fast, medium, slow, slower, veryslow .3秒 ffmpeg -i rtmp://xxxx/live/A1 -tune zerolatency -preset faster -vcodec libx264 -b:v 400k -s 720x450 -r 15 -acodec mp3 -g 1.5 -f hls -hls_list_size 2 -hls_time 1.5 -hls_wrap 4 playlist.m3u8 ...

2018-08-02 · 1 min · 87 words · Me