hoseungme / express-hls-example

A simple example about HTTP Live Streaming using Node.js and Express

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

express-hls-example

Express와 HLS로 동영상을 스트리밍하는 예제입니다.

This is an example that stream video using HLS and Node.js

참조

예제에 대해 설명한 블로그 글 입니다. 한국어와 영어 중 하나로 보실 수 있습니다.

The links below are my blog posts that explain about this example. You can choose between Korean and English.

Node.js, Express, HLS로 동영상 스트리밍하기 (한국어)

Video Streaming with Node.js / HLS (English)

시작하기

저장소를 클론해주세요.

Clone this repository.

git clone https://github.com/HoseungJang/express-hls-example.git

의존성을 설치해주세요.

Install dependencies.

cd express-hls-example
npm install

src 디렉토리로 이동해주세요.

Go to 'src' directory.

cd src

videos 디렉토리를 생성한 후 mp4 형식의 동영상을 넣어주세요.

동영상 파일의 이름은 video로 해주세요.

여기까지 오셨다면 src 디렉토리 내부가 아래와 같을 것입니다.

After making 'videos' directory, Put 'video.mp4' file into there.

If you complete this step, 'videos' directory is composed of:

/src
	/videos
		video.mp4
	app.js
	client.html
	ffmpeg.js

ffmpeg.js를 실행해주세요.

Run ffmpeg.js.

node ffmpeg.js

end가 출력되면 ffmpeg.js를 종료하고 app.js를 실행해주세요.

Terminate ffmpeg.js and Run app.js when 'end' is logged.

node app.js

localhost:3000으로 접속하고, 동영상을 재생해보세요.

F12를 누르고 Network 탭도 확인해보세요.

Now go to localhost:3000 and play your video.

Press F12 key and check the Network tab.

About

A simple example about HTTP Live Streaming using Node.js and Express


Languages

Language:JavaScript 62.9%Language:HTML 37.1%