View Single Post
Old 23rd November 2008, 18:12   #7102  |  Link
bigotti5
Spielberger
 
bigotti5's Avatar
 
Join Date: Feb 2005
Posts: 838
Can you correct delay calculation in the next build?
Closed GOPs at the beginning of a stream are misinterpreted in eac3to.
eac3to calculates delay from first I-frame, but this I-frame is third in presentation order, so -66 ms for NTSC and -80 ms for PAL is calculated.
Quote:
TS, 1 video track, 1 audio track, 0:00:03
1: MPEG2, 480p30 /1.001 (4:3)
2: AC3, 5.1 channels, 448kbps, 48khz, dialnorm: -27dB, -66ms

----
File Name: closed_gop.ts
File Size: 3 533 272
Stream Type: Transport
Packets Count: 19332

.....
.....
0x00002400 PES Packet { stream_id = 0xE0 (video stream)}
packet_length = 0
PES_scrambling_control = 0
PES_priority = 0
data_alignment_indicator = 1
copyright = 0
original_or_copy = 0
PTS_DTS_flags = 3
ESCR_flag = 0
ES_rate_flag = 0
DSM_trick_mode_flag = 0
additional_copy_info_flag = 0
PES_CRC_flag = 0
PES_extension_flag = 0
PES_header_data_length = 10
PTS = 0: 10: 0: 066 (54 006 006)
DTS = 0: 9: 59: 966 (53 996 997)

0x00002413 Sequence Header
horizontal_size_value = 720
vertical_size_value = 480
aspect_ratio_information = 2 (0.673500)
frame_rate_code = 4 (29.970000)
bit_rate_value = 22500 (9000000)
marker_bit = 1
vbv_buffer_size = 112
constrained_parameters_flag = 0
load_intra_quantiser_matrix = 0
load_non_intra_quantiser_matrix = 0

0x0000241F Sequence Extention
profile_and_level_indication = 72 (Main@Main)
progressive_sequence = 1
chroma_format = 1 (4:2:0)
horizontal_size_extension = 0
vertical_size_extension = 0
bit_rate_extension = 0
marker_bit = 1
vbv_buffer_size_extension = 0
low_delay = 0
frame_rate_extension_n = 0
frame_rate_extension_d = 0

0x00002429 Sequence Display Extention
video_format = 2
colour_description = 1
colour_primaries = 6
transfer_characteristics = 6
matrix_coefficients = 6
display_horizontal_size = 720
marker_bit = 1
display_vertical_size = 480

0x00002435 User Data {}

0x00002487 Group of Picture Header #0
time = 0:0:0:0 closed_gop = 1
broken_link = 0

0x0000248F Picture Header - I Frame #0
temporal_reference = 2
picture_coding_type = 1
vbv_delay = 65535

0x00002497 Picture Coding Extention
f_code[0][0] = 15
f_code[0][1] = 15
f_code[1][0] = 15
f_code[1][1] = 15
intra_dc_precision = 2
picture_structure = 3 (Frame picture)
top_field_first = 1
frame_pred_frame_dct = 1
concealment_motion_vectors = 0
q_scale_type = 0
intra_vlc_format = 1
alternate_scan = 0
repeat_first_field = 0
chroma_420_type = 1
progressive_frame = 1
composite_display_flag = 0

.......
.......

0x00013BC8 Transport Packet { PID = 0x1011, Payload = Yes (184), Counter = 14, Start indicator }

0x00013BCC PES Packet { stream_id = 0xE0 (video stream)}
packet_length = 26939
PES_scrambling_control = 0
PES_priority = 0
data_alignment_indicator = 1
copyright = 0
original_or_copy = 0
PTS_DTS_flags = 2
ESCR_flag = 0
ES_rate_flag = 0
DSM_trick_mode_flag = 0
additional_copy_info_flag = 0
PES_CRC_flag = 0
PES_extension_flag = 0
PES_header_data_length = 5
PTS = 0: 10: 0: 000 (54 000 000)
0x00013BDA Picture Header - B Frame #1
temporal_reference = 0picture_coding_type = 3
vbv_delay = 65535
full_pel_forward_vector = 0
forward_f_code = 7
full_pel_backward_vector = 0
backward_f_code = 7

0x00013BE3 Picture Coding Extention
f_code[0][0] = 1
f_code[0][1] = 1
f_code[1][0] = 1
f_code[1][1] = 1
intra_dc_precision = 2
picture_structure = 3 (Frame picture)
top_field_first = 1
frame_pred_frame_dct = 1
concealment_motion_vectors = 0
q_scale_type = 0
intra_vlc_format = 0
alternate_scan = 0
repeat_first_field = 0
chroma_420_type = 1
progressive_frame = 1
composite_display_flag = 0
.....
.....
0x0001A7C0 PES Packet { stream_id = 0xFD (extended_stream_id)}
packet_length = 1803
PES_scrambling_control = 0
PES_priority = 0
data_alignment_indicator = 1
copyright = 0
original_or_copy = 0
PTS_DTS_flags = 2
ESCR_flag = 0
ES_rate_flag = 0
DSM_trick_mode_flag = 0
additional_copy_info_flag = 0
PES_CRC_flag = 0
PES_extension_flag = 1
PES_header_data_length = 8
PTS = 0: 10: 0: 000 (54 000 000)

0x0001A7D1 AC3 Frame
SyncInfo():
CRC1 = 22870
fscod = 0
frmsizecod = 30
SamplingRate = 48000
FrameSize = 1792
BitRate = 448000
Duration = 0.032000
BSI():
bsid = 8
bsmod = 0
acmod = 7
cmixlev = 0
surmixlev = 0
lfeon = 1
dialnorm = 27
compre = 1
compr = 4
langcode = 0
Channels = 6
Here is the above examble

eac3to should calculate either from GOP header or PTS from b-picture with temporal_reference = 0

Same in h264 files. My Sony AVCHD Cam e.g. creates h264 streams with 2 b-frames at the beginnung of the stream.
bigotti5 is offline