User Tools

Site Tools


stream_pc_chromecast

Mirror unsupported Miracast device from Windows 8.1, 10 (Should also work on Windows 7 as well)

Miracast device includes Chromecast and all similar dongles and some Smart TV models.

Read the entire guide before starting the process to be sure that it covers all your requirements.

The 1st thing you must do before continuing with this guide is to check if your PC supports Miracast mirroring. You can do this by following the tips in the below link. The 2nd method “How to Check if Your PC Supports Miracast Using DirectX Diagnostic Tool” in the link will work on any of the 3 Windows Platforms. If your system supports Miracast devices then you do not need this guide and can search for the solution on YouTube.

https://www.isumsoft.com/windows-10/2-ways-to-check-if-window-10-supports-miracast.html

All the required programs for this solution are free.

  1. Open the following link and complete all the steps until step 10 and then come back here to continue the rest. https://wiki.serviio.org/doku.php?id=stream_pc_vlc3 (The link is for the old version of Serviio and the interface is different but just by using common sense you can configure the latest version with the same tips).
  2. The PC and the Miracast device must both be connected to the same LAN network and the Miracast device needs to be set to network streaming mode.
  3. Run Serviio and the VLC script.
  4. Connect The Miracast device to the network and turn it on.
  5. Open run and use execute this command “DevicePairingWizard.exe”.
  6. Add the Miracast device and the Serviio device that has the PC name that you are connecting from in it.
  7. Go to “This PC” or “Computer” depending on the Windows platform and open the Serviio and then right click on the displayed content and “Cast to device” or “Play to” (depending on the Windows platform) and choose the Miracast device.

This was tested on Windows 8.1 64-bit and Windows 10 64-bit as well as two Miracast devices. One is version 1 of Anycast and a knock off for Chromecast. It has worked with all these options but did not give the same performance. So the System resources and the Miracast type are important to give faster performance. The best I got on one system was a 7 second delay on one and the other was a 2 second delay. You can check this by opening the clock to see the lag. The laptops that I tested on are old so it might perform much better on faster computers / Miracast devices.

——————————————————————————————————-

Issues on this solution and how to solve them.

I am adding all the issues that I faced with tips on how to solve them.

Step 7 may need to be repeated a few times until it works. It might either need to close and open the (Cast to device - [name of device] or Play to - [name of device] depending on the Windows platform a few times until it works. If the content shows with an “X” on it, then just press on pause or stop and then play try to play it again.

After rebooting Windows, the Serviio server won’t show anymore because it will be offline So to bring it back online you will need to create and run the below script as Administrator. Then the server will show again. To create a batch file script, just open a text file and paste the below in it and then save and change the extension of the file to “.bat”. The batch file can be re-edited by a mouse right click and edit. The batch file is for Windows 64 Bit running Serviio 2.1 (might require editing for 32-bit Windows). After the 2nd script is completed it will close the console, so just reopen the console.

Try the 1st short script 1st and if that does not work then try the 2nd one.


1st method

@echo Off

Timeout /T 2
CD “C:\Windows\System32”
Start “” “C:\Windows\System32\DevicePairingWizard.exe”
Timeout /T 60
taskkill /IM “DevicePairingWizard.exe” /F
Exit


2nd method

@echo Off
Timeout /T 2
taskkill /IM “ServiioConsole.exe” /F
Timeout /T 4
net stop Serviio
Timeout /T 10
net start Serviio
Timeout /T 40
CD “C:\Program Files\Serviio\console”
Start “” “C:\Program Files\Serviio\console\ServiioConsole.exe”
Timeout /T 40
CD “C:\Windows\System32”
Start “” “C:\Windows\System32\DevicePairingWizard.exe”
Timeout /T 60
taskkill /IM “DevicePairingWizard.exe” /F
Exit


Console security

The Serviio console has an option to give access only to certain IP addresses. Use this so that no one else can access your media or view your desktop.

VLC

The VLC version and script provided did not work for me. The two versions that worked well for me are 3.0.14 and 3.0.11 Vetinari 64 Bit. The below script that I found on the Serviio forum worked well for me.

VLC 32 Bit version script



@echo off

start “” /min /d “C:\Program Files (x86)\VideoLAN\VLC” “vlc.exe” -vvv dshow: –sout=#transcode{venc=ffmpeg,vcodec=mp2v,vb=8000,fps=24,acodec=mpga,ab=192,channels=2,samplerate=44100}:std{access=http,mux=ts,dst=:8085} –no-sout-rtp-sap –no-sout-standard-sap –ttl=1 –sout-keep :dshow-vdev=screen-capture-recorder :dshow-adev=virtual-audio-capturer :dshow-aspect-ratio=16\:9 :dshow-caching=0


VLC 64 Bit version script



@echo off

start “” /min /d “C:\Program Files\VideoLAN\VLC” “vlc.exe” -vvv dshow:
–sout=#transcode{venc=ffmpeg,vcodec=mp2v,vb=8000,fps=24,acodec=mpga,ab=192,channels=2,samplerate=44100}:std{access=http,mux=ts,dst=:8085} –no-sout-rtp-sap –no-sout-standard-sap –ttl=1 –sout-keep :dshow-vdev=screen-capture-recorder :dshow-adev=virtual-audio-capturer :dshow-aspect-ratio=16\:9 :dshow-caching=0


I use 24 for frames per second (FPS). 24 is the same as what is used at the cinema. I put cashing as 0 to improve the lag performance. These are the two that can be edited to enhance performance. You can consult with the Serviio forum for other tips on the performance with those scripts.

Testing can be done from any VLC installation whether it is on Windows or Android platform as long as it is open on the firewall. It can also be tested from the same PC by just removing “Allow only one instance” that is under interface in preferences.

On Windows: Go to playlist then open Universal plug and play (UPnP) and play the stream from there.
On Android: Go to Browse. If it does not open then press on one of the other options like Audio then go back to Browse. It will be at the bottom.

It may take a few moments for the content to be found.

IP addresses

It is important to maintain the same IP address for the PC. If the IP address changes then the added media server will stay offline (It will not show in “This PC” or “Computer” depending on the Windows platform) and will not come back online until the IP address is restored or the Media server is removed and re-added again like in step 5, 6. It might also be possible to keep the server and just add a new one. This would also apply for the added Miracast device(s).

IP address can be reserved from the router. This can be done by logging onto the router.
If you are on a small network then you can just assign a static IP for your PC. Ping the IP address before choosing one. The last 5 should not be in use which range from 250-254.

You will need to maintain the same Subnet Mask and Default Gateway when changing the IP address of the PC manually.

If your server is not showing anything then change the IP address from 127.0.0.1 with the same port in to the PC IP address of the PC.

Range extender can also change the IP address if the IP address is reserved from the router.

Firewall

If you face any issues while testing then disable the firewall temporarily to be sure that the issue is not related to any blocked ports.
Depending on what you will be using for testing then enable the following on the firewall for the LAN connection.
Serviio and WMPDMC.exe which is found on this path “C:\Windows\System32\WMPDMC.exe”.
VLC if you are testing from another device.

Smart TV
If you have Smart TV or Smart TV box running Android 5 or higher then you don’t need this solution. Just install Spacedesk on both Windows and the Smart TV and connect. It will work as long as both are connected to the same WIFI and there is no lag at all (Check the default setting and change as needed before you connect to the external screen). Spacedesk also supports touchscreen input. It can either duplicate the screen or extend the desktop just like any external screen connected to the PC.
If you don’t have a Miracast device then just buy a Smart TV box as it is not much more expensive than the original Chromecast.
Spacedesk only works on local networks but does not have a security option to control who can connect, any Spacedesk client app will be able to connect to the Spacedesk server program.

https://spacedesk.net/

Spacedesk can be tested from any smart device.
Unlike Miracast, Spacedesk does not send the Audio to the other screen. So the sound will be from the PC.

Alternative solution

The two below links also work for Computers that do not support Miracast connection but this will only work with supported dongles / Smart TVs with most Chromium browsers.

https://www.youtube.com/watch?v=3U1DVkNPxsA

It can also extend the desktop using the below method.

https://www.youtube.com/watch?v=miGe5u-LFYQ

Hanna Baggili (John)

stream_pc_chromecast.txt · Last modified: 2021/07/28 14:49 by johncoool