Dynamic Adaptive Streaming over HTTP (DASH), also known as MPEG-DASH, is an adaptive bitrate streaming technique that enables high-quality streaming of media content over the Internet delivered from conventional HTTP web servers. Like Apple's HTTP Live Streaming (HLS) solution, MPEG-DASH works by breaking the content into a sequence of small segments, which are served over HTTP. Each segment contains a short interval of playback time of content that is potentially many hours in duration, such as a movie or the live broadcast of a sports event. The content is made available at a variety of different bit rates, i.e., alternative segments encoded at different bit rates covering aligned short intervals of playback time ref. Now, we will move forward towards the steps followed in the process:
Microsoft provides Internet Information Services (IIS) that can be used as a webserver. To configure, follow the below steps.
- Select and open Windows features (WindowsKey+S (Search box) then type Turn Windows features on or off).
- Find Internet Information Services and Tick the box (Wait for the process to configure and then Close).
- Test it by opening Chrome and navigating to your local internet address, 127.0.0.1.
- The default page should appear (If not reboot your system).
If you don't want to change the default path, you can skip this step. All the files can be located at the default path C:\inetpub\wwwroot\
Open IIS Manager (WindowsKey+S then type IIS). The Default Site stores its files in a particular directory. To expose this information, right-click on it, choose Manage Website then Advanced Settings. This will open a pop-up window with all of the Default Sites information such as files or Document Root as it is normally known, enabled protocols, and even bindings. If you click on Physical Path a button appears on its extreme right where you can choose a different document root.
To test streams, you need to allow other websites to access files on your web server. However, due to security concerns, not all modern browsers allow this by default. To allow this, you need to explicitly tell the browser that you agree to a website to read data from your server. This is called cross-source resource sharing (CORS). To enable CORS to follow the below steps:
- Open the webserver (WindowsKey+S then type IIS).
- Select Default Web Site and Right Click or Double click HTTP Response Headers.
- Select Open Feature from the Action. Then, click Add and Type in Access-Control-Allow-Origin for Name and type "*" for Value.
- Click OK to add the header to add another value: type in Access-Control-Allow-Headers for Name; type in Range for Value.
DASH requires statements to learn how to analyze video and audio files. DASH manifest file ends in .mpd. Windows IIS does not know about this extension. So, for IIS to correctly send the file to the player, you need to add this extension to IIS. In contrast to MPEG-TS, there are different ways to prepare media for MPEG-DASH transmission. .m4s files are one option MPEG-TS is another one ref. Under connections click your server and double Click MIME Types
- Type .mpd for File name extension; type application/dash+xml for MIME-type.
- Press okay.
- Type .m4s for File name extension; type video/mp4 for MIME-type.
- Press okay.
- Download FFmpeg from here.
- Extract the downloaded FFmpeg zip file to C:\ffmpeg.
- Navigate to the bin folder under C:\ffmpeg and copy the address using Ctrl+C.
- Open up the System information window and click on Advanced System Settings. Then click on Environment Variables.
- Select the Path variable under System variables.
- Click Edit. then click New.
- Type Ctrl+V to paste in the address where you extracted FFmpeg earlier. Then press OK,
Open cmd and type ffmpeg in the command prompt. If you see a lot of text in the cmd, your FFmpeg is installed successfully.
- Download sample video BigBuckBunny.
- Rename the downloaded file to input.mp4
- Run the following command in the cmd in the same directory.
ffmpeg -re -i input.mp4 -map 0 -map 0 -c:a copy -c:v libx264 -b:v:0 800k -b:v:1 300k -s:v:1 320x170 -profile:v:1 baseline -profile:v:0 main -bf 1 -keyint_min 120 -g 120 -sc_threshold 0 -b_strategy 0 -ar:a:1 22050 -use_timeline 1 -use_template 1 -window_size 5 -adaptation_sets "id=0,streams=v id=1,streams=a" -f dash out.mpd
- Once the process is completed, copy all the files excluding input.mp4 into the default IIS physical path (i.e., C:\inetpub\wwwroot) or the modified path.
To generate segments from multiple videos, run the following script.
python .\main.py -i .\input\ -o .\output\
Open cmd and type ipconfig. Get IPv4 Address. It would be 192.XXX.XXX.XXX.
Install VLC. Open Network Stream by using Ctrl+N. Type the URL like this http://192.XXX.XXX.XXX/bbb_dash/out.mpd. bbb_dash is the directory of the processed BigBuckBunny video and out.mpd is the DASH text file we created using the above script. Finally, press play. If you can watch the video, it means you have configured DASH on your window machine.
If you want to use a native DASH web player, clone dash.js from GitHub and follow the installation instructions.
Raise an issue if you are facing any problem :)