超快切片机

bitslicer9k的Python项目详细描述


钻头切片机9k

  • 超快速位切片。在
  • 无位复杂度的位移速度。在

安装
pipinstallbitslicer9k

帮助(Slicer9k)

^{pr2}$

我以前经常这样做

fromstructimportunpacksync,two_bytes,one_byte=unpack('>BHB',packet[:4])tei=two_bytes>>15pusi=two_bytes>>14&0x1ts_priority=two_bytes>>13&0x1pid=two_bytes&0x1fffscramble=one_byte>>6afc=(one_byte&48)>>4count=one_byte&15

现在我使用bitslicer9k并执行此操作

frombitslicer9kimportSlicer9kheader=Slicer9k(packet[:4])sync=header.asint(8)tei=header.asflag(1)pusi=header.asflag(1)ts_priority=header.asflag(1)pid=header.asint(13)scramble=header.asint(2)afc=header.asint(2)count=header.asint(4)

示例用法

  • 从十六进制编码字符串解析SCTE 35拼接信息部分
>>>frombitslicer9kimportSlicer9k>>>bites=bytes.fromhex('FC302F000000000000FFFFF00506FEAEF17C4C0019021743554549480000077F9F0808000000002CA56C97110000C4876A2E')>>>classSplice_Info_Section:def__init__(self,bs):self.table_id=bs.ashex(8)self.section_syntax_indicator=bs.asflag(1)self.private=bs.asflag(1)self.reserved=bs.asint(2)self.section_length=bs.asint(12)self.protocol_version=bs.asint(8)self.encrypted_packet=bs.asflag(1)self.encryption_algorithm=bs.asint(6)self.pts_adjustment=bs.as90k(33)self.cw_index=bs.ashex(8)self.tier=bs.ashex(12)self.splice_command_length=bs.asint(12)self.splice_command_type=bs.asint(8)>>>bs=Slicer9k(bites)>>>sps=Splice_Info_Section(bs)>>>vars(sps){'table_id':'0xfc','section_syntax_indicator':False,'private':False,'reserved':3,'section_length':47,'protocol_version':0,'encrypted_packet':False,'encryption_algorithm':0,'pts_adjustment':'0.000000','cw_index':'0xff','tier':'0xfff','splice_command_length':5,'splice_command_type':6,'descriptor_loop_length':25}>>>

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
来自Oozie Java Jobs的电子邮件   泛型Java映射。具有有界通配符的getOrDefault   java如何制作定制的Swing容器?   java断言使用正则表达式重新启动响应体   安卓 java正则表达式查找字符串中的所有空格   java循环语法不起作用   使用spring4@Transactional时,java事务不起作用   java三桨乒乓球命中检测   java Camera 2 Api错误不拍照的错误   java使用ServletContext从war外部读取Hibernate属性   性能如何禁用Java垃圾回收器?   如何通过MySQL触发器执行外部java函数?   使用Ecfbittorent下载torrent时出现java NegativeArraySizeException   java Android arraylist因迭代而崩溃   MyBatis中的java Delete查询没有删除任何内容