Difference between revisions of "Feeding Video to Portsdown from vMix"

From BATC Wiki
Jump to navigation Jump to search
Line 32: Line 32:
  
 
==H 265 file script for Nvidia GTX10xx graphics card==
 
==H 265 file script for Nvidia GTX10xx graphics card==
 +
 +
  
 
===Using the system===
 
===Using the system===

Revision as of 18:19, 8 January 2020

You can stream video over UDP from vMix from a Windows PC and then transmit it using the Portsdown transmitter.

The method outlined here will also work with other DATV tranmit systems such as the F5OEO custom firmware for the Adalm Pluto. VMix Block.jpg

Vmix

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

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:

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.

H 265 file script for Nvidia GTX10xx graphics card

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. The settings you need are here:

VMix Config.jpg

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. Double click on the file in Windows Explorer, and it should ask for the Video bitrate and FEC, then ask you to press any key. When you press a key, the window should change to one giving information about the stream being sent towards the Portsdown TX. The stream is simply squirted at the IP address that you entered earlier - it can be left running and the TX does not need to be on.

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.

Encoding Options

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 ...

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

VMix Block Exp.jpg

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:

/home/pi/rpidatv/scripts/a.sh

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/