Este es mi codigo a ver si me pueden ayudar
#!/usr/bin/env python
import os
from dvbobjects.PSI.PAT import *
from dvbobjects.PSI.NIT import *
from dvbobjects.PSI.SDT import *
from dvbobjects.PSI.PMT import *
from dvbobjects.SBTVD.Descriptors import *
tvd_ts_id = 0x073b
tvd_orig_network_id = 0x073b
ts_freq = 533
ts_remote_control_key = 0x05
tvd_service_id_sd = 0xe760 # ID de servicio de TV Digital.
tvd_pmt_pid_sd = 1031 # PID de la PMT del servicio.
nit = network_information_section (
network_id = tvd_orig_network_id,
network_descriptor_loop = [
network_descriptor(network_name = "LIFIATV",),
system_management_descriptor(
broadcasting_flag = 0,
broadcasting_identifier = 3,
additional_broadcasting_identification = 0x01,
additional_identification_bytes = [],
)
],
transport_stream_loop = [
transport_stream_loop_item(
transport_stream_id = tvd_ts_id,
original_network_id = tvd_orig_network_id,
transport_descriptor_loop = [
service_list_descriptor(
dvb_service_descriptor_loop = [
service_descriptor_loop_item (
service_ID = tvd_service_id_sd,
service_type = 1,
),
],
),
terrestrial_delivery_system_descriptor(
area_code = 1341,
guard_interval = 0x01,
transmission_mode = 0x02,
frequencies = [
tds_frequency_item( freq=ts_freq )
],
),
partial_reception_descriptor (
service_ids = []
),
transport_stream_information_descriptor (
remote_control_key_id = ts_remote_control_key,
ts_name = "LIFIATV",
transmission_type_loop = [
transmission_type_loop_item(
transmission_type_info = 0x0F,
service_id_loop = [
service_id_loop_item(
service_id=tvd_service_id_sd
),
]
),
transmission_type_loop_item(
transmission_type_info = 0xAF,
service_id_loop = [],
),
],
)
],
),
],
version_number = 0,
section_number = 0,
last_section_number = 0,
)
sdt = service_description_section(
transport_stream_id = tvd_ts_id,
original_network_id = tvd_orig_network_id,
service_loop = [
service_loop_item(
service_ID = tvd_service_id_sd,
EIT_schedule_flag = 0,
EIT_present_following_flag = 0,
running_status = 4,
free_CA_mode = 0,
service_descriptor_loop = [
service_descriptor(
service_type = 1,
service_provider_name = "",
service_name = "LFASD",
),
],
),
],
version_number = 0,
section_number = 0,
last_section_number = 0,
)
pat = program_association_section(
transport_stream_id = tvd_ts_id,
program_loop = [
program_loop_item(
# Programa especial para la tabla NIT
program_number = 0,
PID = 16,
),
program_loop_item(
program_number = tvd_service_id_sd,
PID = tvd_pmt_pid_sd,
),
],
version_number = 0,
section_number = 0,
last_section_number = 0,
)
pmt_sd = program_map_section(
program_number = tvd_service_id_sd,
PCR_PID = 2064,
program_info_descriptor_loop = [],
stream_loop = [
stream_loop_item(
stream_type = 2, # mpeg2 video
elementary_PID = 2064,
element_info_descriptor_loop =
]
),
stream_loop_item(
stream_type = 3, # mpeg2 audio
elementary_PID = 2068,
element_info_descriptor_loop =
),
],
version_number = 0,
section_number = 0,
last_section_number = 0,
)
out = open("./nit.sec", "wb")
out.write(nit.pack())
out.close()
os.system("sec2ts 16 < ./nit.sec > ./nit.ts")
out = open("./pat.sec", "wb")
out.write(pat.pack())
out.close()
os.system("sec2ts 0 < ./pat.sec > ./pat.ts")
out = open("./sdt.sec", "wb")
out.write(sdt.pack())
out.close()
os.system("sec2ts 17 < ./sdt.sec > ./sdt.ts")
out = open("./pmt_sd.sec", "wb")
out.write(pmt_sd.pack())
out.close()
os.system("sec2ts " + str(tvd_pmt_pid_sd) +
" < ./pmt_sd.sec > ./pmt_sd.ts"
#!/usr/bin/env python
import os
from dvbobjects.PSI.PAT import *
from dvbobjects.PSI.NIT import *
from dvbobjects.PSI.SDT import *
from dvbobjects.PSI.PMT import *
from dvbobjects.SBTVD.Descriptors import *
tvd_ts_id = 0x073b
tvd_orig_network_id = 0x073b
ts_freq = 533
ts_remote_control_key = 0x05
tvd_service_id_sd = 0xe760 # ID de servicio de TV Digital.
tvd_pmt_pid_sd = 1031 # PID de la PMT del servicio.
nit = network_information_section (
network_id = tvd_orig_network_id,
network_descriptor_loop = [
network_descriptor(network_name = "LIFIATV",),
system_management_descriptor(
broadcasting_flag = 0,
broadcasting_identifier = 3,
additional_broadcasting_identification = 0x01,
additional_identification_bytes = [],
)
],
transport_stream_loop = [
transport_stream_loop_item(
transport_stream_id = tvd_ts_id,
original_network_id = tvd_orig_network_id,
transport_descriptor_loop = [
service_list_descriptor(
dvb_service_descriptor_loop = [
service_descriptor_loop_item (
service_ID = tvd_service_id_sd,
service_type = 1,
),
],
),
terrestrial_delivery_system_descriptor(
area_code = 1341,
guard_interval = 0x01,
transmission_mode = 0x02,
frequencies = [
tds_frequency_item( freq=ts_freq )
],
),
partial_reception_descriptor (
service_ids = []
),
transport_stream_information_descriptor (
remote_control_key_id = ts_remote_control_key,
ts_name = "LIFIATV",
transmission_type_loop = [
transmission_type_loop_item(
transmission_type_info = 0x0F,
service_id_loop = [
service_id_loop_item(
service_id=tvd_service_id_sd
),
]
),
transmission_type_loop_item(
transmission_type_info = 0xAF,
service_id_loop = [],
),
],
)
],
),
],
version_number = 0,
section_number = 0,
last_section_number = 0,
)
sdt = service_description_section(
transport_stream_id = tvd_ts_id,
original_network_id = tvd_orig_network_id,
service_loop = [
service_loop_item(
service_ID = tvd_service_id_sd,
EIT_schedule_flag = 0,
EIT_present_following_flag = 0,
running_status = 4,
free_CA_mode = 0,
service_descriptor_loop = [
service_descriptor(
service_type = 1,
service_provider_name = "",
service_name = "LFASD",
),
],
),
],
version_number = 0,
section_number = 0,
last_section_number = 0,
)
pat = program_association_section(
transport_stream_id = tvd_ts_id,
program_loop = [
program_loop_item(
# Programa especial para la tabla NIT
program_number = 0,
PID = 16,
),
program_loop_item(
program_number = tvd_service_id_sd,
PID = tvd_pmt_pid_sd,
),
],
version_number = 0,
section_number = 0,
last_section_number = 0,
)
pmt_sd = program_map_section(
program_number = tvd_service_id_sd,
PCR_PID = 2064,
program_info_descriptor_loop = [],
stream_loop = [
stream_loop_item(
stream_type = 2, # mpeg2 video
elementary_PID = 2064,
element_info_descriptor_loop =
]
),
stream_loop_item(
stream_type = 3, # mpeg2 audio
elementary_PID = 2068,
element_info_descriptor_loop =
),
],
version_number = 0,
section_number = 0,
last_section_number = 0,
)
out = open("./nit.sec", "wb")
out.write(nit.pack())
out.close()
os.system("sec2ts 16 < ./nit.sec > ./nit.ts")
out = open("./pat.sec", "wb")
out.write(pat.pack())
out.close()
os.system("sec2ts 0 < ./pat.sec > ./pat.ts")
out = open("./sdt.sec", "wb")
out.write(sdt.pack())
out.close()
os.system("sec2ts 17 < ./sdt.sec > ./sdt.ts")
out = open("./pmt_sd.sec", "wb")
out.write(pmt_sd.pack())
out.close()
os.system("sec2ts " + str(tvd_pmt_pid_sd) +
" < ./pmt_sd.sec > ./pmt_sd.ts"