Applies to Models: Hanwha Cameras
Summary:
This article will walk you through setting up a basic RTMP stream to YouTube. This will allow a user to stream, on demand, based on the service's status.
Step By Step Guide for Camera Profile Creation:
1. Open your browser
2. Log in to your YouTube Studio account
Note: http://studio.youtube.com
3. Collect your stream key and stream URL (Figure 1)
Figure 1
4. Open another tab in your browser
5. Enter the IP address of the camera
6. Press Enter
7. Log in to the camera
8. Click on the gear at the top of the screen
9. Select Basic (Figure 2)
10. Select Video Profile (Figure 2)
11. Click on the add button on the bottom left of the profile list (Figure 2)
12. Give your Profile a name (Figure 2)
13. Create an H.264 codec for use with your stream (Figure 2)
14. Click Apply on the bottom of the page to save the changes to your new profile (Figure 2)
Figure 2
15. Your new profile will appear in the profile list (Figure 3)
Figure 3
NOTE: The number of your profile is determined by how mny lines down from the top it is.
In Figure 3 the YouTube profile is the fourth down from the top, making it Profile4
in the RTSP URL
16. Click on User (Figure 4)
17. Create a User Account to connect to the stream (Figure 4)
Note: Do not give the user account admin level rights
18 Click Apply to save the changes (Figure 4)
Figure 4
Note: You can use Video Lan Client to test the RTSP URL from the camera. Use our article
"What are the RTSP URLs of Hanwha Devices?"
Click >Here< for the steps to enter an RTSP URL into VLC
Step By Step Guide to ug FFMPEG:
1. Download FFMPEG from >Here<
2. Install FFMPEG onto your PC
3. Download NSSM for the service creation >Here<
4. Once both are installed, document the location of the FFMPEG.exe and NSSM.exe
5. Click on the Windows Start button
6. Type Power Shell
7. Right-click on the application
8. Select Run as Admin
9. Use the Change Directory (cd) command in Powershell to navigate to the NSSM directory
10. Input the following command: “./nssm.exe install YOUTUBESTREAM" (Figure 1)
NOTE: The Text at the end of this command will be the name of the Service. Which
for this example will be YOUTUBESTREAM
Figure 1
12 Press Enter
13. This will launch the NSSM service installer (Figure 2)
Figure 2
14. Click on the “3 dots button” and navigate to the FFMPEG.EXE (Figure 3)
Figure 3
15. Modify the string below with your proper stream information
-f lavfi -i anullsrc -rtsp_transport udp -i rtsp://stream:password1@192.168.0.100:554/profile6/media.smp -tune zerolatency -vcodec libx264 -pix_fmt + -c:v copy -map 1:v:0 -map 1:a:0 -c:a aac -strict experimental -f flv rtmp://a.rtmp.youtube.com/live2/STREAMKEYHERE
16. Add your modified arguments string to NSSM (Figure 4)
Figure 4
17. Go to the Details Tab (Figure 5)
18. Add in your information about the stream (Figure 5)
19. Click the “Install Service” button
Figure 5
20. You should see this prompt "Service YoutubeStream Installed Successfully" (Figure 6)
Figure 6
21. The service "YOUTUBESTREAM" should now be listed in Windows Services
22. Select the service
23. Click the play button to start the service
24. Once the stream starts, you should see the stream on your YouTube Studio Streaming Page
(Figure 7)
Figure 7
NOTE: Note: To Uninstall the Service, from the command line, do the following command
from the NSSM Win64 directory:
./nssm.exe remove_YOUTUBESTREAM