What is transcoding?

A Blu-ray disk contains video chapters and their corresponding audio tracks. the video is generally in h.264 format (think of that as a word document in .docx format). the audio is generally in Dolby digital or DTS formats (think of that as .flac or .mp3).

To get that data off of the disk, you need a way for shit to play it back and a way for those 2 files (the chapter and its audio) to be held together. This is where formats like .mp4 and .mkv come in. Think of those as .7z or .zip or .rar.

Now, if you dump the Blu-ray disk’s audio/video track into .mkv without touching it (ie without attempting to make it any smaller) you’ll have a very large .mkv file (20-40gb in size, depending on if it came from a single or dual layer blu ray disk).

That’s the basic setup we’re working with to answer question on transcoding.

So now there are a number of scenarios. maybe you have a computer in the same house on the same network and that computer can play back anything and everything, because its a computer and the software was designed for it. Plex will simply send the raw file over the network and the player will decode it and play it back.

lets say you’re using something special on your home network like a mobile phone or appleTV or chromecast or something. Those devices are only built to play back certain file formats (the .docx and .flac we spoke of earlier) and they can only read those formats from certain containers (.mkv and .mp4).

In this scenario, plex will do its best to not touch anything possible. but it might need to change it from .mkv to .mp4 or vice versa. it might be forced to do this if you enable subtitles. this takes practically 0 processing power and it will not affect the quality in any way.

lets say you took your video and wanted to make it smaller so you used HEVC (h.265) to re-encode it. This is a lossy encode and is very difficult to encode/decode quickly so a lot of hardware currently doesnt support it. but the resulting file size is tiny in comparison (half or less). but now your appleTV and mobile phone wont play it back because it doesnt know what the heck h.265 is. Now plex will convert on-the-fly to h.264 (this is transcoding) and also change the contianer (also transcoding) in order for the file to be of the appropriate file type for you to be able to play back.

Lets say you have friends and family on varying internet connections/speeds, with varying devices, and you yourself only have limited upload speeds available to you because fuck telecom industry and fuck the FCC.

Now plex can be told to limit bandwidth usage and limit CPU usage for transcoding tasks and limit transcode quality so that you are able to send that file to many people at the same time without completely locking down your computer or your network.

You can also tell plex to store multiple copies of 1 file in different formats so that you dont have to transcode on-the-fly. This would be especially useful for massive files that you can convert slowly to very high quality and keep laying around, so that when a user asks for the file, they are simply sent the file without your CPU and GPU going crazy.

In laymans terms for the most part you dont really need to worry about it. But realistically, you’ll run into weird boundary cases in which some people are not able to play things back properly (stuttering/buffering/freezing) and then you’ll need to understand what is happening under the hood in order to take steps to fix the underlying issue or make smart decisions about when/where to invest money into the setup.

You can read more here.

Difference between 802.3af, 802.3at and 802.3bt PoE?

IEEE has a few standards for PoE to help keep everything working properly. There are three main PoE standards, all varying in the amount of power they supply. There are 802.3af, 802.3at and 802.3bt.

All three of these are referred to as ‘auto-sensing’ PoE, which means if you plug a laptop in to a port with PoE turned on, it won’t blow the device up as a level of auto-negotiation happens between the PoE switch and device, when it asks for power.

802.3af

802.3af is also known as just ‘PoE’ on most switches, it provides up to 15.4W and is most used for less powerful wireless access points and IP cameras. VoIP phones also tend to use 802.3af to as they don’t need a massive amount of power.

802.3at

802.3at is basically the same as 802.3af, but it just provides more power, up to 30W and is generally referred to as ‘PoE+’ on most switches. The higher amount of power allows better quality cameras to be used, such as 4K cameras and PoE switches which are powered up by PoE and provide power down stream, such as the UniFi Switch Flex from Ubiquiti, it is powered by 802.3at on the uplink and can provide 802.3af PoE on four other ports.

802.3bt

802.3bt is one of the newest standards and provides up to 60W to each device it is referred to as PoE++ usually. This is used for really demanding devices, notably lighting products and screens. Ubiquiti has LED light panels for office ceilings which are powered by 802.3bt.

create virtual machine from existing windows 10 pc

Recently my ages old laptop started acting funny. I am assuming it might die soon. Before getting a new laptop I needed to crate a VHD of my old laptop for any reference.

The native tool from Microsoft to create VHD is Disk2vhd. This will create virtual machine and disk that can be attached in Hyper-V running in a separate machine. Here is the link;

https://docs.microsoft.com/en-us/sysinternals/downloads/disk2vhd

Here is the installation instruction of this VHD inside Hyper-V.

First of all create a new generation 2 VM that we’ll use with our new VHDX we created using Disk2VHD. Don’t create a new vdhx but select to use an existing one and point it to the one we just created with Disk2VHD. Rename it if needed to something more suitable.

Don’t boot the VM but add a DVD and attach the Windows Server ISO of the version your vhdx contains to the DVD.

Move the DVD to the top of the boot order I firmware.

he VM will boot to the DVD when you hit a key.

Select your language and keyboard layoout when asked and the don’t install or upgrade the OS but boot

Type diskpart and  list the disks. Select the disk we need (the OS disk, the only one here) and list the volumes. You can see that volume 3 off 99MB is RAW. That’s not supposed to be that way. So let’s fix this by creating boot loader directory structure, repair the boot record by creating the boot sector & copy the needed boot files into it.

Type:

select volume 3

assign drive letter L:

FORMAT FS=FAT32 LABEL=”BOOT”

That’s it we can now us that 99MB volume to make our disk bootable to windows again.  Type Exit to leave diskpart.

So now we have a formatted boot partition we can create the need folder structure and fix the boot record and configure our UEFI bootloader

Switch to the L: volume

create efi\microsoft\boot folder structure for the bootloader as show below with the md command(make directory)

Type: bootrec /fixboot to create the bootrecord

Type: bcdboot C:\Windows  /l en-us /s l: /f ALL

This creates the BCD store & copies the boot files from the windows system directory

Just click Continue to exit and continue to Windows Server 2019. Remember to eject DVD drive.

.. and voila, your new VM has now booted.

Read more here;

Disk2VHD on a Generation 2 VM

Here is the troubleshooting tips while using disk2vhd tool;

https://social.technet.microsoft.com/Forums/en-US/7262c702-ce37-4853-9a12-5cafcf10342e/disk2vhd-efi-vhdx-vm-fails-to-boot-solved?forum=winserverhyperv

Another free tool is VMWare VCenter Converter. Here is the guide;

A Brief Introduction to Cat6 vs Cat6a vs Cat7

To put it simple, the twisted pair specifications: Cat6 (Class E), Cat6a (Class EA), and Cat7 (Class F) all support 10GBASE-T applications with differentiated performances.

Check the below chart to get a full understanding of the specifications and typical applications of Cat6 vs Cat6a vs Cat7.

ALL backward compatible – you can plug a newer twisted pair cable into a device that is designed for a slower cable.

The fastest Ethernet cable yet is Cat8, which can support data rate up to 40Gbps, four times of Cat6a cable. If you are looking for high-speed data center and server room cabling, check out Cat8 Cable for 25GBASE-T and 40GBASE-T Network.

The minimum grade of cabling to be deployed in a 10GBASE-T network should be Cat6a cable.

Reference

https://community.fs.com/blog/should-we-use-cat6-or-cat6a-for-10gbase-t.html

UDM Pro commands

List of commands to troubleshoot UDM Pro;

The best command for packet related issues is tcpdump

tcpdump <interface> -w <filename.pcap>

Most of the commands are just Linux commands. However some are unique to the UDM/UDM-P.

Cisco/EdgeOS/VyOs Command/Best descriptionUDM/UDM-P SSH Command
show versioninfo
show system hardware and installed softwareubnt-device-info summary
show cpu tempetureubnt-systool cputemp
show fan speedubnt-fan-speed
show uptimeuptime
show ip routenetstat -rt -n
show tech-support (dump a file for tech support)ubnt-make-support-file <file.tar.gz>
show ppp summerypppstats
show current userwhoami
show logcat /var/log/messages
show interface summaryifstat
show interfacesifconfig
show other Ubiquiti devices on local LAN segment (ubnt-discovery)ubnt-tools ubnt-discover
show config (wireless)cat /mnt/data/udapi-config/unifi
show DHCP leases (to NSname)cat /mnt/data/udapi-config/dnsmasq.lease
packet capturetcpdump
shutdownpoweroff
reloadreboot
show ipsec saipsec statusall
factory resetfactory-reset.sh
show system burnt in MAC addressubnt-tools hwaddr
Unifi Server commands (logs files)
show unifi server logscat /mnt/data/unifi-os/unifi/logs/server.log
show unifi server setttingscat /mnt/data/unifi-os/unifi-core/config/settings.yaml
show unifi server http logscat /mnt/data/unifi-os/unifi-core/logs/http.log
show unifi server http logs (errors)cat /mnt/data/unifi-os/unifi-core/logs/errors.log
show unifi server discovery logcat /mnt/data/unifi-os/unifi-core/logs/discovery.log
show unifi system logscat /mnt/data/unifi-os/unifi-core/logs/system.log

Tested with 1.8.3-5

To restart UDM Pro to release memory pressure without restarting, SSH and enter this;

unifi-os restart

To update udm pro software;

Start unifi shell = “unifi-os shell” and then apt update && upgrade

Resource

Click this link to see the reference.