Feeding Video to Portsdown from vMix
You can stream video over UDP from vMix from a Windows PC and then transmit it using the Portsdown transmitter.
Vmix is a very flexible piece of software allowing you to mix and edit various video sources - it also has advanced facilities such as green screen and tickers. It can stream directly on to the web but also produces a directshow external output which we can use to transmit DATV.
First, install vMix on your PC and make sure that it works with your selected video source. vMix can be downloaded from here: http://www.vmix.com/ The free version handles SD video and is adequate for our needs; it works in this mode after the 60-day trial period.
FFmpeg is a free and open-source project consisting of a vast software suite of libraries and programs for handling video, audio, and other multimedia files and streams.
We use ffmpeg to take the directshow output from Vmix, encode and multiplex it in to a compliant transport stream, add the service information and send it out using the UDP protocol.
The next step is to install ffmpeg on your PC. Download it from here: https://ffmpeg.zeranoe.com/builds/
Use the release build, 32-bit, static. Unzip the downloaded file and move the files to a folder called ffmpeg on your C:\ drive so that it has the folders bin, docs, licenses and presets folders inside it.
ffmpeg script or batch file
The last installation step on the PC is to install the windows batch file which will control ffmpeg. This script will vary depending upon ypur application - here are 2 examples:
H 265 file script for Nvidia GTX10xx graphics card
An example script from Thomasz SPxxx is available for download here: File:sample 333ks 23 s2 440.zip
This script is set to use the H265 encoder onboard an Nvidia graphics card but you will need to edit the script as follows:
- Enter your own station details
- Line 11 - enter the TS rate required. This is calculated from this page http://www.satbroadcasts.com/DVB-S_Bitrate_and_Bandwidth_Calculator.html based on the parameters you have set for your transmission in Portsdown or Pluto
- Line 17 - enter the IP address of your Portsdown / Pluto etc
- Line 59 - set the video resolution to match the Vmix external output resolution.
It is suggested that you save a number of batch files with different bit rates at line 11.
Alternatively you can start the file by entering the file name followed by the TS rate required. For example "Tx.bat 440"
Original Portsdown script
You can download it from here File:VMix2Portsdown.zip Unzip the file and save the and save the vMix2Portsdown.bat file to a logical place of your choice. You will need to make some amendments to the file; do this by right-clicking and selecting edit. Near the top of the file replace the callsign G8GKQ with your callsign; then replace the IP address (192.168.2.111) with the IP address of your Portsdown TX RPi. This IP address is displayed when you change the Portsdown video source to IPTSIN (don't forget to press the space bar to change the selection!).
You may want to adjust the aspect ratio of the output. This is done by editing the line...
-pix_fmt yuv420p -r 25 -s 768x576 -aspect 4:3 -qmin 2 -qmax 35^
by changing 768x576 to whatever you want. A common setting is 720x540
Save the file.
The vMix2Portsdown batch file encodes the video stream in MPEG-2 at symbol rates of 1000, 2000 and 4000 kS/S. For other encodings and rates, try one of these experimental batch files ...
- MPEG-2 with added 333kS/S symbol rate: File:VMix2PortsdownExtendedSR.zip
- H.264 encoding: File:VMix2PortsdownH264ExtendedSR.zip
- Adding text overlays (e.g. for callsign, locator): see blog post by Chris MW0LLK for how to add text to the batch file (http://www.tannet.org.uk/using-ffmpeg-to-generate-a-transport-stream-more-details-and-how-to-add-text-overlays/)
Using the system
Make sure that your PC with vMix and your Portsdown transmitter are on the same wired network. Wireless networks might work but have not been tested.
Now start up vMix and select a video source. Then configure the output, by clicking the cogwheel next to the output label and then clicking Settings.
Note the video resolution should be set to match your ffmpeg script.
Click OK on the dialogue box and then click the Output caption. It should turn red.
Next, start the batch file that you edited earlier.
Lastly, set up your Portsdown TX with IPTSIN as the input and identical SR and FEC to that set up in the batch file. Select transmit and it should work. You can select transmit and standby on the Portsdown console (or touchscreen) without having to change any other software settings.
Using vMix with the Portsdown Software on a Raspberry Pi and DATV Express
This mode does not currently work (6 December 2017), but will be bug-fixed in the next release.
Here is the system block diagram
Initial set-up to use DATV Express is the same.
More to follow..............
Troubleshooting for Advanced Users
The video bit rates in the batch file are hard-coded based on what was found to work - a trial and error process to minimise both under-runs and over-runs of the transport stream in the Portsdown software. Both cause picture disturbances. If you want to see the effect of different settings, you can monitor the under-run or over-run by watching the text output from rpidatv. To do this, open 3 Linux terminal sessions; the first one should have the Portsdown Console Menu. Use the console for selecting the desired SR and FEC, but not selecting transmit. Go to the Linux command prompt on the second console to select transmit and watch the buffer messages. Do this by typing:
The 3rd console should also be at the Linux prompt and can be used to stop the transmitted stream by typing:
sudo killall rpidatv
You can then repeat this test having adjusted the video bit rates in the vMix2Portsdown.bat file.
Most of the information on this page was originally provided by Chris MW0LLK. For more detailed information see his blog at http://www.tannet.org.uk/