-
Notifications
You must be signed in to change notification settings - Fork 12
Lab Setup
- Windows 10/11 Eval Virtual Machine
- At least 2 MP4 file to test the streams (Try for a minimum length of 30mins - just duplicate 1 file)
Install this to the default directory:
C:\ffmpeg\bin\ffmpeg.exe
This simple tool allows us to run a RTSP stream on a specified port (Default: 554) with no authentication. I Installed this to the users desktop
C:\Users\cctv\Desktop\CamEmu
If following along with the readme from the IpCameraEmulator GitHub page, you will need the following to run the executable, as such you might as well install VLC.
Note you will need to make a copy of the following files from the (32-bit) VLC application folder and place them in the same folder as the IpCameraEmulatorStd binaries,
- libvlc.dll
- libvlccore.dll
- the entire "plugins" folder
- The ones from VLC version 2.2.6 and 1.1.9 seem to work well.
This is a highly customizable tool that allows us to set up a server and use fmmpeg to stream an MP4 file via RTSP.
This tool is used as it allows another stream on another port (We will use: 8554) with either Basic or Digest authentication types, along with allowing us to use custom credentials.
Again, this went on the desktop
C:\Users\cctv\Desktop\MediaMTX
In this instance we will only be using the rstp filter to see all of the packets if required.
Install using the default settings.
The first RTSP stream on this lab will be on the default port of 554, with no authentication.
Run the IpCameraEmulatorStd.exe binary and press Add to start creating the first stream.

- Name the Channel (Whatever you want)
- Select your first MP4 video file
- Use RTSP Port 554
- Ensure Stream is set to
Enabled - Add
Once this is added, select the stream and press start
This will start streaming the MP4 file on port 554 with no authentication, you can test the stream from your host machine in VLC.
From VLC on your host machine open the media menu and connect to a network stream using the following:
rtsp://<ip>:554/
Ensure the trailing
/is included.
Download the latest release of MediaMTX from the GitHub Releases page, ensuring to select the windows zip file. Ensure ffmpeg is intalled as previously directed, and that the exe is located in:
C:\ffmpeg\bin\ffmpeg.exe
Extract the contents into a new folder on the Virtual machine, i used the desktop.
There is a copy of the mediamtx.yml file I used in Lab/mediamtx.yml
Open your local copy of mediamtx.yml and check the following lines for the main configuration:
- Line 64: "user: service" - Change the Username here (Set if blank)
- Line 66: "pass: service" - Change the Password Here (Set if blank)
- Line 167: "rtspAddress: :8554" - Set this as 8554 if not already
- Line 189: "rtspAuthMethods: [digest]" - This can be set to [basic] or [digest]
Line numbers here reflect the lines found in
Lab/mediamtx.ymlyours may differ.
Copy MiiStream.ps1 to the same folder and open it in your chosen editor, I used notepad++ for this.
On line 26, ensure that it points to the location of your mediamtx.exe binary, mine is as follows:
C:\Users\cctv\Desktop\MediaMTX\mediamtx.exe
On lines 30 and 32 we will find the connection settings these are the lines that need to match the mediamtx.yml
start-process powershell -ArgumentList "-noexit -command ""C:\ffmpeg\bin\ffmpeg.exe -re -stream_loop -1 -i ""C:\CCTV-Stream\videostream.mp4"" -c copy -f rtsp ""rtsp://${Creds}@localhost:8554/$Path"""""
} else {
start-process powershell -ArgumentList "-noexit -command ""C:\ffmpeg\bin\ffmpeg.exe -re -stream_loop -1 -i ""C:\CCTV-Stream\videostream.mp4"" -c copy -f rtsp ""rtsp://${Creds}@localhost:8554/"""""
}Ensure that the ffmpeg binary location is correct on these lines, and that a MP4 file that is different from the first camera is targeted.
The port here can also be changed but it will need to be reflected in the mediamtx.yml also. for now we are leaving it at 8554
Run Powershell as an Administrator Bypass script filtering policy:
powershell -ep bypassChange to the mediamtx directory:
cd C:\Users\cctv\Desktop\MediaMTXImport MiiStream:
. .\MiiStream.ps1From here we can run the second camera, when executing MiiStream you will need to specify the Username and Password you have set in the mediamtx.yml file in my case service:service
MiiStream -User "service" -Pass "service" -Path "1"Notice there is no leading / in the -Path.
I recommend using a path that already exists in EyeSpy for testing, or if using a custom path, make sure to specify it when running EyeSpy with the -Path switch.

From here, you should test the settings with VLC from your host machine again, use the following to test our settings:
rtsp://service:service@<ip>:8554/1
With these 2 cameras set up, one with no auth and one with digest auth it is a good idea to expand this further and have another camera with basic auth, and another machine on a different IP address.
To do this smoothly, i used the Linked bases feature in VirutalBox to spin up a second machine at this exact point in the setup.
When the second machine is running edit the mediamtx.yml file as we did before but change the credentials to be different from the first machine, and change the authentication type to basic.
When running MiiStream on this second device, ensure your credentials match the changes made to mediamtx.yml and use a different path for testing.
This should allow you to test other areas of the tool such as:
- IP Ranges
- Multiple Auth Types
- Alternating Paths
- Multiple Successes
- Forced Failures for testing
This should leave you with 4 potential streams, 2 with no authentication, One with basic authentication, and one with digest authentication.
The VM's can act weird at time, Close the MediaMTX and ffmpeg PowerShell windows, and run the MiiStream command again to restart the server.
Check the credentials in the mediamtx.yml file and make sure you typed them correctly in the MiiStream command.