posts - 34, comments - 90, trackbacks - 0, articles - 0

ES 流分析程序

Posted on 2008-08-27 12:27 猫头鹰 阅读(2609) 评论(0)  编辑 收藏 引用 所属分类: 视频学习之路

这是用VC编写的一个ES流分析程序,可以把ES流文件按MPEG标准进行分析。
MPEG标准为iso13818-2
ES流文当时是由FFMPEG写的一个小程序从一个MPEG2 MPG文件中导出来的,后来才发现网上也有现成的提取工具。
写这个程序是为了能更好的理解ES流的语法,以为日后的RTP发送作准备
程序的原码:http://www.cnitblog.com/Files/tinnal/ES流解释程序.rar
解释程序的测试文件名为test.mpv(在debug目录下),用暴风影音就能播(ES流文件也能播,强),输出文件为output.txt

格式如下:

输出文件节选

Match: sequence_header_code
    horizontal_size_value: 0x240(576)
    vertical_size_value: 0x1e0(480)
    aspect_ratio_information: 0x2(2)
    frame_rate_code    : 0x1(1)
    bit_rate_value: 0x5bcc(23500)
    Match: marker_bit
    vbv_buffer_size_value: 0x70(112)
    constrained_parameters_flag: 0x0(0)
    load_intra_quantiser_matrix: 0x0(0)
    load_non_intra_quantiser_matrix: 0x0(0)
Match: extension_start_code
    Match: sequence_extension
        profile_and_level_indication: 0x48(72)
        progressive_sequence: 0x1(1)
        chroma_format: 0x1(1)
        horizontal_size_extension: 0x0(0)
        vertical_size_extension: 0x0(0)
        bit_rate_extension: 0x0(0)
        Match: marker_bit
        vbv_buffer_size_extension: 0x0(0)
        low_delay: 0x0(0)
        frame_rate_extension_n: 0x0(0)
        frame_rate_extension_d: 0x0(0)
Match: group_start_code
    time_code: 0x1000(4096)
    closed_gop: 0x0(0)
    broken_link: 0x0(0)
Match: picture_start_code
    temporal_reference: 0x0(0)
    picture_coding_type: 0x1(1)
    vbv_delay: 0xffff(65535)
    extra_bit_picture: 0x0(0)
Match: extension_start_code
    Match: picture_coding_extension
        f_code[0][0]: 0xf(15)
        f_code[0][1]: 0xf(15)
        f_code[1][0]: 0xf(15)
        f_code[1][1]: 0xf(15)
        intra_dc_precision: 0x0(0)
        picture_structure: 0x3(3)
        top_field_first: 0x0(0)
        frame_pred_frame_dct: 0x1(1)
        concealment_motion_vectors: 0x0(0)
        q_scale_type: 0x0(0)
        intra_vlc_format: 0x0(0)
        alternate_scan: 0x0(0)
        repeat_first_field    : 0x0(0)
        chroma_420_type: 0x1(1)
        progressive_frame: 0x1(1)
        composite_display_flag: 0x0(0)
Match: picture_start_code
    temporal_reference: 0x1(1)
    picture_coding_type: 0x2(2)
    vbv_delay: 0xffff(65535)
    full_pel_forward_vector: 0x0(0)
    forward_f_code: 0x7(7)
    extra_bit_picture: 0x0(0)
Match: extension_start_code
    Match: picture_coding_extension
        f_code[0][0]: 0x1(1)
        f_code[0][1]: 0x1(1)
        f_code[1][0]: 0xf(15)
        f_code[1][1]: 0xf(15)
        intra_dc_precision: 0x0(0)
        picture_structure: 0x3(3)
        top_field_first: 0x0(0)
        frame_pred_frame_dct: 0x1(1)
        concealment_motion_vectors: 0x0(0)
        q_scale_type: 0x0(0)
        intra_vlc_format: 0x0(0)
        alternate_scan: 0x0(0)
        repeat_first_field    : 0x0(0)
        chroma_420_type: 0x1(1)
        progressive_frame: 0x1(1)
        composite_display_flag: 0x0(0)
Match: picture_start_code

...

只有注册用户登录后才能发表评论。