Plex MythTV LiveTV Channel/Plugin

That plugin works, you can download it here.
You have to modify the stream.php file, my working modified version is below.

=0) $logfile=fopen($logfilename,"w");
$hostname_string=$hostname."-".$client;
debug("Client Connected: "+$client,1);
init_cmd_connection();
send_cmd_message("MYTH_PROTO_VERSION $proto_version",1);
send_cmd_message("ANN Playback $hostname_string 0",1);
$input_info=send_cmd_message("GET_FREE_INPUT_INFO 0",1);
identify_free_tuner();
send_cmd_message('QUERY_RECORDER '.$tuner.'[]:[]SPAWN_LIVETV[]:[]'.$hostname_string.'[]:[]0[]:[]'.$mythtv_channel,1);
while(1){
        while ( $filesize == 0 ) {
		close_data_connection();
        	$recording_info=send_cmd_message('QUERY_RECORDER '.$tuner.'[]:[]GET_CURRENT_RECORDING',1);
        	identify_file_and_storage_group();
        	$file_info=send_cmd_message('QUERY_SG_FILEQUERY[]:[]'.$hostname.'[]:[]'.$storage_group.'[]:[]'.$fullfile,1);
        	get_file_info();
        	if ($filesize==0) sleep(1);
        	else init_data_connection();
		if (connection_aborted()){
                	close_data_connection();
                	close_cmd_connection();
                	exit;
                	}
        	}
	$qfiletransfer_info=send_cmd_message('QUERY_FILETRANSFER '.$mythtv_socket.'[]:[]REQUEST_BLOCK[]:[]'.$bufsize_target,2);
	get_data_size();
	get_video_data();
	}
close_data_connection();
close_cmd_connection();
function get_data_size(){
	global $qfiletransfer_info,$bufsize,$bufsize_target;
        $qfiletransfer_info_arr=explode("[]:[]",$qfiletransfer_info);
        $bufsize=$qfiletransfer_info_arr[0];
	if ($bufsize_target!=$bufsize){
        	//debug("Buffer size ($bufsize_target -> $bufsize) Changed",2);
		if ($bufsize_target>=6000) $bufsize_target-=500;
		}
        else {
		$bufsize_target+=500;
		}
	}
function get_filetransfer_info(){
        global $filetransfer_info,$mythtv_socket;
        $filetransfer_info_arr=explode("[]:[]",$filetransfer_info);
        $mythtv_socket=$filetransfer_info_arr[1];
        if ($mythtv_socket!=0) debug("MythTV Video Socket ($mythtv_socket) Found",1);
        }
function get_file_info(){
	global $file_info,$filesize;
        $file_info_arr=explode("[]:[]",$file_info);
        $filesize=$file_info_arr[2];
        if ($filesize!=0) debug("FileSize ($filesize) Found",1);
	}
function identify_file_and_storage_group(){
	global $recording_info,$file,$storage_group,$fullfile;
        $recording_info_arr=explode("[]:[]",$recording_info);
	$fullfile=$recording_info_arr[12];
	$file=basename($fullfile);
	$storage_group=$recording_info_arr[41];
	debug("Storage Group ($storage_group) and File ($file) Found",1);
	}
function identify_free_tuner(){
	global $tuner,$input_info;
	$input_info_arr=explode("[]:[]",$input_info);
	for ($i=0;$i>",$val);
	}
function mythdebugin($val){
	rawdebug("MYTH","<<",$val);
	}
function rawdebug($type,$dir,$val){
	global $logfile,$monitor;
	if ($monitor==0)
        	if ($logfile!=false) fprintf($logfile,"%20s%10s %s %s\n",date("Y-m-d H:i:s"),$type,$dir,$val);
	else
		printf("%20s%10s %s %s\n",date("Y-m-d H:i:s"),$type,$dir,$val);
        }
exit;

Works way better then the official app, or the HDHomeRun channel for Plex, third party. Apparently Mythtv is able to play it better.
If you want to change the default quality to original, go into Settings on your device, and change the internet streaming. Not really internet streaming, it's all on my local network.
It works with Manjaro, and whatever version of Mythtv it has. You have to change your Apache's root directory to /srv/http/mythweb, instead of /srv/http/. Or you can modify the plugin, to load from localhost/mythweb. I could, but I'm lazy. Also, to do it right, you need to add a setting. So people can leave it blank, or change it.
I don't use a custom name for the tuners, they are called "Input 1" and "Input 2". I just entered the ID of the tuner, then saved, then selected the right one and saved again. I wanted tuner 1 to be 0, and tuner 2 to be 1.
You can download my working stream.php file here. I doubt WordPress would let me upload a PHP file, so I put it in an archive.
If it doesn't work, run php stream.php, then look in /tmp/stream.log. It won't log if it's running in a browser. Probably need to change a setting, an Apache or PHP setting.