
1. 
mkdir nginx-rtmp; cd nginx-rtmp

git clone https://github.com/git-mirror/nginx.git
cd nginx
git checkout release-1.3.0

2. 
cd nginx-rtmp
git clone https://github.com/arut/nginx-rtmp-module.git
cd nginx-rtmp-module 
git checkout v1.2.0

3.
cd ../nginx
./auto/configure --prefix=/home/test/nginx-build --add-module=../nginx-rtmp-module --with-debug
make -j32;
make install

4. configure ffmpeg env and exec script as attached.
  a) Run "./compile_ffmpeg_with_libfdkaac.sh" to install ffmpeg
  b) Set the variable "my_path" to your rigth path of the ffmpeg.sh file.
  c) Run "source ffmpeg.sh"

5. configure nginx config as attachmend
  a) Modify the "/home/jdai12/jdai12/jdai12/nginx-rtmp/ffmpeg.sh" to your_absolute_path/nginx-rtmp/ffmpeg.sh
  b) cp nginx.conf to /home/test/nginx-build/conf/ or you can update your nginx.conf according to  nginx.conf.patch(The green part is what you need to update )

6. start nginx server
sudo /home/test/nginx-build/sbin/nginx

7. push to rtmp server
ffmpeg -re -i yourMp4TestFile.mp4 -vcodec copy -acodec copy -f flv rtmp://localhost/rtmptest/testStreamName

8. play hls
ffplay http://localhost/hls/testStreamName.m3u8 or play the url in VLC player(Works on windows).

9. push webrtc stream to rtmp server.
  a)Pass the url "rtmp://ip_address:1935/rtmptest/streamName" to ConferenceClient.addExternalOutput method.
  b)Play the url "rtmp://ip_address:1935/rtmptest/streamName" in VLC or ffplay player.
