Repeater Streaming

From BATC Wiki
Jump to navigation Jump to search

Introduction

The Portsdown software includes a repeater streaming mode. While this is under development here are some notes:

If you have a noise-free (digital in and out) signal, the default settings should work well for you.

If you have a digital output at least your syncs should be good. More info to come.

If you have a noisy analog signal that you want to stream, your first priority should be to clean up the syncs. Use a decent sync inserter. Options include the one described in CQ-TV 129 or a GTH Electronics Advanced Digital Converter and Video Enhancer.

Next step for a noisy analog signal is to take the colour off it. Noisy colour causes real problems with building up latency and the picture is a lot more watchable if you can cut it out. If you are unable to cut it out in hardware try the software method below.

Customising the Software

You can easily modify the Portsdown software to suit your own input signal. The critical statement is at about line 856 of the file /home/pi/rpidatv/scripts/a.sh. This defines how the ffmpeg command codes the video for streaming. The parameter that needs changing is the video filter; this is defined in the quotes after -vf.

The default code is

-vf "format=yuyv422,yadif=0:1:0"

This tells the encoder to use yuyv422 format and to reverse the interlace fields; yadif is "yet another de-interlace filter" and this command corrects for the fact that the Fushicai EasyCap outputs PAL interlaced fields bottom field first, when it should be top field first.

If you have a noisy signal, the best combination that I have found is:

-vf "format=yuyv422,hqdn3d=50:50:50:50,eq=1:0:0:1:1:1:1:1"

This takes out the interlace correction which is very processor hungry and so gives us some spare capacity. It adds the "high quality de-noising 3D" filter with heavy de-noising. Details here: http://avisynth.nl/index.php/Hqdn3d.

It also gets rid of the colour information. Details here: https://wjwoodrow.wordpress.com/2015/07/12/more-ffmpeg-hell/ To leave the colour in, just delete the "eq=1:0:0:1:1:1:1:1" part.

This (-vf "....")line can be changed and then used straight away, but you should keep an eye on the processor load by running another Putty window with htop in it. Start to worry if any of the 4 cores spends significant time above 50% or if the video develops excessive delay.

Using at a rate of 800K, G8BYI has had good results streaming GB3UT using these settings:

-vf "format=yuyv422,yadif=0:1:0, hqdn3d=15:15:15:15" -g 25

Reducing the Streaming Rate

To reduce the streaming rate, you can edit the file scripts/a.sh. Line 854 for the video rate, and the next line for the audio.

You can find details of the Hardware-switched video streaming facility introduced in software 201708150 here Streaming to batc.tv with Raspberry Pi.