Skip to content
This repository has been archived by the owner on Jul 12, 2019. It is now read-only.

kencyke/dash-streaming-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dash-streaming-example

Preprocessing

ffmpeg

docker pull jrottenberg/ffmpeg
docker run -it --rm -v `pwd`/server/data:/tmp -w /tmp jrottenberg/ffmpeg \
        -i ./${input}.mp4 \
        -vcodec libx264 \
        -vb 500k \
        -r 30 \
        -x264opts no-scenecut \
        -g 15 \
        -acodec aac \
        -ac 2 \
        -ab 128k \
        -frag_duration 5000000 \
        -movflags frag_keyframe+empty_moov \
        ./${encoded}.mp4

MP4Box

docker build -t mp4box:0.1 ./server/mp4box
docker run -it --rm -v `pwd`/server/data:/tmp -w /tmp mp4box:0.1 \
        -frag 4000 \
        -dash 4000 \
        -rap \
        -segment-name sample \
        -out ./${output}.mp4 \
        ./${encoded}.mp4

npm

npm init -y
npm install --save-dev typescript ts-loader webpack webpack-cli
npx webpack --display-error-details

Usage

make build
./bin/server // go to http://localhost:8000