推送rtsp流摄像头到直播平台
ffmpeg -re -rtsp_transport tcp -i "rtsp://[username]:[password]@[host]:[port]" -c:v libx264 -vprofile baseline -s 712x400 -c:a aac -ar 44100 -strict -2 -ac 1 -f flv "rtmp://example.local"
package main | |
import ( | |
"os/exec" | |
"runtime" | |
"time" | |
"log" | |
) | |
const ( |
pub fn convert_path(path_str: &str) -> String { | |
if cfg!(target_os = "windows") { | |
String::from(path_str.replace("\\", "/")) | |
} else { | |
String::from(path_str) | |
} | |
} | |
fn main() { | |
println!("hello world!"); |
package main | |
import ( | |
"bufio" | |
"bytes" | |
"flag" | |
"github.com/gogs/chardet" | |
"golang.org/x/text/encoding/japanese" | |
"golang.org/x/text/encoding/korean" | |
"golang.org/x/text/encoding/simplifiedchinese" |
ffmpeg -re -rtsp_transport tcp -i "rtsp://[username]:[password]@[host]:[port]" -c:v libx264 -vprofile baseline -s 712x400 -c:a aac -ar 44100 -strict -2 -ac 1 -f flv "rtmp://example.local"
const arr = [] | |
Array(5).fill(0).forEach((value, index) => { | |
arr.push(promiseFunc(index)) | |
}) | |
// queue(arr) | |
//船新解法 | |
arr.reduce((pro,next)=> pro.then(next), Promise.resolve()) |
//枚举的使用 | |
enum OSName { | |
windows, | |
darwin, | |
linux, | |
centos, | |
fedora, | |
debian, | |
ubuntu, | |
suse, |
package main | |
import ( | |
"encoding/json" | |
"io/ioutil" | |
"log" | |
"os" | |
"sync" | |
"time" | |
) |
package main | |
import ( | |
"bytes" | |
"io/ioutil" | |
"log" | |
"os" | |
"os/exec" | |
"strconv" | |
"regexp" |
! function (e) { | |
var r, | |
u, | |
t = [ | |
'Object', | |
'Array', | |
'String', | |
'Number', | |
'Boolean', | |
'Function', |
/* | |
* Tween.js | |
* t: current time(当前时间) | |
* b: beginning value(初始值) | |
* c: change in value(变化量) | |
* d: duration(持续时间) | |
*/ | |
var Tween = { | |
Linear: function(t, b, c, d) { return c*t/d + b; }, | |
Quad: { |