include "./inc/includas.inc"; $hex = 3; echo $hex . "\n"; $places = 1; $shiftas = $hex << $places; printf("%012b\n", $hex <<= 6); printf("%012b\n", $shiftas); echo pack("H*", "4D"); echo pack("H*", 137) . "\n"; $bin = sprintf('%4X', 13); echo str_replace(" ", "0", $bin) . "\n"; echo $bin . "\n"; echo tohex('DB2f011500', 5) . "\n"; $eit = "4EF0500104C5000003EA000000000001D95618000001000080154D136C6974044E616D650A4576656E7420746578740002D95619000001000000144D126C6974065661726461730741707261736173"; echo crc32mpeg($eit) . " crc \n"; $i = 2; if ($i < 256) { $tbid = 50; } elseif ($i >= 256 and $i < 512) { $tbid = 51; } elseif ($i >= 512 and $i < 768) { $tbid = "52"; } elseif ($i >= 768 and $i < 1024) { $tbid = "53"; } elseif ($i >= 1024 and $i < 1280) { $tbid = "54"; } elseif ($i >= 1280 and $i < 1536) { $tbid = "55"; } elseif ($i >= 1536 and $i < 1792) { $tbid = "56";
//Transport stream ID $eit .= pack("H*", "0457"); //Originalus tinklo ID $eit .= tohex($pasksecnr, 2); //Segmeno paskutines sekcijos numeris !!!!!!!!!!kolkas nera, ideta sekcijos numeris $eit .= pack("H*", "4E"); //Paskutines lentos ID $sekilg = strlen($eit . $eventall . $descall); //Sekcijos ilgis $sekilg = $sekilg + 61444; // 61444 reikalingas bitu prastumimui $sekilg = tohex($sekilg, 4); $tabid = pack("H*", "4E"); // Lentos ID $creit = $tabid . $sekilg . $eit . $eventall . $descall; $creit = bin2hex($creit); $crc = pack("H*", crc32mpeg($creit)); //CRC mpeg2 $eit = $tabid . $sekilg . $eit; fwrite($fp1, pack("H*", "00")); // prieki sekcijos du 00 fwrite($fp1, $eit); fwrite($fp1, $eventall); fwrite($fp1, $descall); fwrite($fp1, $crc); } fclose($fp1); mysqli_free_result($result1); mysqli_free_result($nowres1); mysqli_free_result($result_now); mysqli_close($conn);