Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- beanstalk
- swift
- S3
- fanzeel
- react
- cors
- 안드로이드
- https
- 페이스북
- 카카오톡
- 웹뷰
- nextjs
- 네이티브
- php
- TypeScript
- angular4
- AWS
- 감사일기
- Elastic Beanstalk
- node
- Android
- 알려줌
- ios
- 도메인
- angular
- JavaScript
- Route53
- hybrid
- NeXT
- node.js
Archives
- Today
- Total
쪼렙 as! 풀스택
Node.js - spawn - ffmpeg 이용하여, facebook, Instagram LIVE 에 영상 송출하기. 본문
개발 일지/Web & Server
Node.js - spawn - ffmpeg 이용하여, facebook, Instagram LIVE 에 영상 송출하기.
코코앱 2021. 1. 31. 14:32function start(streamUrl, streamKey, opt, SOURCE_URL) {
if (!opt) {
opt = '-ar 44100 -vcodec libx264 -b:v 3200k -f flv'; //ffmpeg 송출 option
}
const target = streamUrl + (streamUrl.charAt(streamUrl.length - 1) === '/' ? '' : '/') + streamKey;
const argStr = `-re -i ${SOURCE_URL} ${opt} ${target}`
const command = `ffmpeg ${argStr}`
const args = argStr.split(' ');
console.log(command)
// spawn 을 시작한다.
const proc = spawn('ffmpeg', args);
// 이벤트 핸들링
proc.on('error', function (error) {
console.error(error)
})
proc.stdout.on('data', function (data) {
console.log(data)
})
proc.stderr.on('data', function (data) {
console.log(data)
})
proc.on('exit', function (code) {
console.log('Exit code : ', code)
})
}
'개발 일지 > Web & Server' 카테고리의 다른 글
React에서 Socket 연결을 Custom Hook 이용하여 구성해 보았다. (0) | 2021.01.31 |
---|---|
PHP 코드 수정이 바로 적용되지 않을 때, opcache disable 시키기. (0) | 2020.11.19 |
React - localhost 에서 cookie samesite 이슈 해결하기. (0) | 2020.09.06 |
안드로이드 하이브리드앱 웹뷰 WebView 에서 카카오톡 로그인 (앱) 사용하기 (2) | 2019.11.23 |
MySQL, 정렬한 기준으로 1:1로 Join 해서 데이터 가져오기. group by 안쓰고 해결;; (0) | 2019.09.03 |
Comments