GB3NQ & H264/H265 Encoder Boxes and other stuff!
Posted: Mon Jan 16, 2023 7:41 pm
I have seen a lot of concerns about the usability of these low cost boxes from eBay/Amazon and I hope to put some of these fears to rest below.
Let me start by announcing our repeater here in St Austell Cornwall GB3NQ uses one of the encoders and produces a stream which is fed directly to a Pluto for transmission. We did initially use a Portsdown between them but soon discovered it was unnecessary and it got re-purposed to producing 15-minute ident test cards.
Additionally despite rumours to the contrary the repeater Pluto also can run at 2msyms/s continuously for 12 hours day. It must be noted however the Adalm Pluto website clearly states its temperature operating range is 10C – 40C so ensure the covers are removed and the PCB is placed under a good fan to keep it cool.
Before I get into the Encoder one final point on the Pluto is despite the manufacturers specifications the best operating voltage from our experience at GB3NQ was to run it just under 5v and certainly not at a voltage level a Raspberry Pi needs.
So I have set the groundwork we have a Pluto configured via its LAN interface by a web browser on a Raspberry Pi waiting for a suitably encoded IP stream into it’s LAN port.
It was decided NQ was to be digital in and out, so we have an automatic HDMI switch selecting from 3 Ryde Receivers, Ident Test Cards and a 30 minute video running on the hour to help new users get tuned in and setup.
First lesson learnt is to set all these devices to the proposed output resolution. For the hardware video player that was done in it’s on screen menu. The Raspberry Pi’s needed the following lines in their boot up configuration file that can be found in the \boot folder. Enter the line below to start the editor to make the changes required.
pi@raspberrypi:~ $ sudo nano /boot/config.txt
These lines must be present to ensure the Pi outputs 1080p and is not upset if the HDMI lead is not connected to anything at boot time.
If the lines below already are in the file then change them to match below.
hdmi_force_hotplug=1
hdmi_drive=2
hdmi_group=1
hdmi_mode=16
If you want to run other resolutions a quick Google search will provide up to date Tables of these commands and which to select.
The HDMI signal from each device is now fed through a HDMI switch (cheap Chinese units are not up to the job!) use good quality HDMI leads throughout. The output of the HDMI switch then is fed to a HDMI EDID Emulator. This keeps the encoder in sync with the HDMI switch output. Without this device when the input changes on the HDMI switch the encoder looses sync and the transmission stops. It then takes some time before transmission restarts.
So finally we have an encoder with a valid HDMI signal on its input.
Apart from configuring the LAN interface of your encoder that it is presumed you have done correctly, there are now three items to setup. Audio, Video and network stream.
It has taken some months to perfect this in terms of robustness and to provide the best picture quality from this low cost Encoder.
In order to provide the inclusion of DVBS-2 set top boxes it was decided we would use H264 encoding. Maybe when these set top boxes can decode H265 that may change.
Audio configuration was set to 64k Stereo and due to lip sync issues we opted to use the analogue audio inputs and use another HDMI device to strip the audio from the HDMI lead. This device is readily available from eBay at a low cost and sits just before the EDID unit plugged into the encoder. It is understood this is a hardware issue within the Encoder that at the time of writing has no fix available. So it’s not strictly all digital but nobody will ever know!
Video setup is not what you would expect to configure, and this is where a lot of trial and error and help was needed.
The software running in a Pluto, and for that matter a Lime that deals with the incoming IP stream was written by Evariste Courjaud F5OEO. Whatever is sent into the transmitter if it is under the data rate expected by the transmit specifications (Symbol Rate FEC modulation Type etc) his software will pad the data with nulls to ensure it is sent at a constant bit rate.
So the encoder Main Stream is set to H264 Codec 1920x1280 resolution and Audio on. The group of Pictures is set to 10, Bit Rate mode to VBR with a bit rate of 2100 and quality of 5 and finally a frame rate of 25 fps.
These are not random numbers but build on experience and a desire to get the best out of the Encoder. The transmitter at GB3NQ runs at 2Msyms/s with a FEC of 4/5 using DVBS-2, using the calculator at :-https://www.satbroadcasts.com/DVB-S_Bit ... lator.html
This informs us a nett transport bit rate of 3.1 Mbps for these settings.
It is generally accepted 70% of this bandwidth can be used for video which is 2.17Mbps. This figure is shown above as 2100Kbps the remaining space in the stream will be occupied by audio and other overheads plus some headroom to expand into for noisy or fast moving pictures.
The group of pictures (or GOP structure) value of 10 means every 10th frame a full picture is sent and in-between these are inter frame and predicted frames. At this rate and 25 frames per second fast movement such as waving looks fairly smooth on the receiver.
A setting of 3 for quality was selected as it was the value to produce smooth video with least blocking.
Last but not least the Encoder has to be told where to send its output for the Pluto it is required that this be a multicast stream - option under the Network Tab. In here select the Main Stream (as before) select True for the option to Enable enter the IP address of your Pluto and port 8282.
A lot of the testing to get the best out of the Encoder was done, by changing the output IP address from the Pluto to a local PC on the network. Then using VLC (Video LAN) on that PC to play the incoming stream on the corresponding port and observing the picture and bitrate in Tools option helps find the sweet spot.
Take a look at our HD stream at https://batc.org.uk/live/gb3nq to see the results.
73 Paul G6MNJ
Let me start by announcing our repeater here in St Austell Cornwall GB3NQ uses one of the encoders and produces a stream which is fed directly to a Pluto for transmission. We did initially use a Portsdown between them but soon discovered it was unnecessary and it got re-purposed to producing 15-minute ident test cards.
Additionally despite rumours to the contrary the repeater Pluto also can run at 2msyms/s continuously for 12 hours day. It must be noted however the Adalm Pluto website clearly states its temperature operating range is 10C – 40C so ensure the covers are removed and the PCB is placed under a good fan to keep it cool.
Before I get into the Encoder one final point on the Pluto is despite the manufacturers specifications the best operating voltage from our experience at GB3NQ was to run it just under 5v and certainly not at a voltage level a Raspberry Pi needs.
So I have set the groundwork we have a Pluto configured via its LAN interface by a web browser on a Raspberry Pi waiting for a suitably encoded IP stream into it’s LAN port.
It was decided NQ was to be digital in and out, so we have an automatic HDMI switch selecting from 3 Ryde Receivers, Ident Test Cards and a 30 minute video running on the hour to help new users get tuned in and setup.
First lesson learnt is to set all these devices to the proposed output resolution. For the hardware video player that was done in it’s on screen menu. The Raspberry Pi’s needed the following lines in their boot up configuration file that can be found in the \boot folder. Enter the line below to start the editor to make the changes required.
pi@raspberrypi:~ $ sudo nano /boot/config.txt
These lines must be present to ensure the Pi outputs 1080p and is not upset if the HDMI lead is not connected to anything at boot time.
If the lines below already are in the file then change them to match below.
hdmi_force_hotplug=1
hdmi_drive=2
hdmi_group=1
hdmi_mode=16
If you want to run other resolutions a quick Google search will provide up to date Tables of these commands and which to select.
The HDMI signal from each device is now fed through a HDMI switch (cheap Chinese units are not up to the job!) use good quality HDMI leads throughout. The output of the HDMI switch then is fed to a HDMI EDID Emulator. This keeps the encoder in sync with the HDMI switch output. Without this device when the input changes on the HDMI switch the encoder looses sync and the transmission stops. It then takes some time before transmission restarts.
So finally we have an encoder with a valid HDMI signal on its input.
Apart from configuring the LAN interface of your encoder that it is presumed you have done correctly, there are now three items to setup. Audio, Video and network stream.
It has taken some months to perfect this in terms of robustness and to provide the best picture quality from this low cost Encoder.
In order to provide the inclusion of DVBS-2 set top boxes it was decided we would use H264 encoding. Maybe when these set top boxes can decode H265 that may change.
Audio configuration was set to 64k Stereo and due to lip sync issues we opted to use the analogue audio inputs and use another HDMI device to strip the audio from the HDMI lead. This device is readily available from eBay at a low cost and sits just before the EDID unit plugged into the encoder. It is understood this is a hardware issue within the Encoder that at the time of writing has no fix available. So it’s not strictly all digital but nobody will ever know!
Video setup is not what you would expect to configure, and this is where a lot of trial and error and help was needed.
The software running in a Pluto, and for that matter a Lime that deals with the incoming IP stream was written by Evariste Courjaud F5OEO. Whatever is sent into the transmitter if it is under the data rate expected by the transmit specifications (Symbol Rate FEC modulation Type etc) his software will pad the data with nulls to ensure it is sent at a constant bit rate.
So the encoder Main Stream is set to H264 Codec 1920x1280 resolution and Audio on. The group of Pictures is set to 10, Bit Rate mode to VBR with a bit rate of 2100 and quality of 5 and finally a frame rate of 25 fps.
These are not random numbers but build on experience and a desire to get the best out of the Encoder. The transmitter at GB3NQ runs at 2Msyms/s with a FEC of 4/5 using DVBS-2, using the calculator at :-https://www.satbroadcasts.com/DVB-S_Bit ... lator.html
This informs us a nett transport bit rate of 3.1 Mbps for these settings.
It is generally accepted 70% of this bandwidth can be used for video which is 2.17Mbps. This figure is shown above as 2100Kbps the remaining space in the stream will be occupied by audio and other overheads plus some headroom to expand into for noisy or fast moving pictures.
The group of pictures (or GOP structure) value of 10 means every 10th frame a full picture is sent and in-between these are inter frame and predicted frames. At this rate and 25 frames per second fast movement such as waving looks fairly smooth on the receiver.
A setting of 3 for quality was selected as it was the value to produce smooth video with least blocking.
Last but not least the Encoder has to be told where to send its output for the Pluto it is required that this be a multicast stream - option under the Network Tab. In here select the Main Stream (as before) select True for the option to Enable enter the IP address of your Pluto and port 8282.
A lot of the testing to get the best out of the Encoder was done, by changing the output IP address from the Pluto to a local PC on the network. Then using VLC (Video LAN) on that PC to play the incoming stream on the corresponding port and observing the picture and bitrate in Tools option helps find the sweet spot.
Take a look at our HD stream at https://batc.org.uk/live/gb3nq to see the results.
73 Paul G6MNJ