Print to file: Details of every NAL unit in raw H.264 file
You can use the trace_headers bitstream filter in ffmpeg

ffmpeg -i in.264 -c copy -bsf:v trace_headers -f null - 2&gt; NALUS.txt


The text file will have data like this,

[AVBSFContext @ 00000000027d3580] Packet: 102 bytes, no pts, dts -31999, duration 40000.
[AVBSFContext @ 00000000027d3580] Slice Header
[AVBSFContext @ 00000000027d3580] 0           forbidden_zero_bit                                          0 = 0
[AVBSFContext @ 00000000027d3580] 1           nal_ref_idc                                                10 = 2
[AVBSFContext @ 00000000027d3580] 3           nal_unit_type                                           00001 = 1
[AVBSFContext @ 00000000027d3580] 8           first_mb_in_slice                                           1 = 0
[AVBSFContext @ 00000000027d3580] 9           slice_type                                              00110 = 5
[AVBSFContext @ 00000000027d3580] 14          pic_parameter_set_id                                        1 = 0
[AVBSFContext @ 00000000027d3580] 15          frame_num                                                0001 = 1
[AVBSFContext @ 00000000027d3580] 19          pic_order_cnt_lsb                                      000100 = 4
[AVBSFContext @ 00000000027d3580] 25          num_ref_idx_active_override_flag                            1 = 1
[AVBSFContext @ 00000000027d3580] 26          num_ref_idx_l0_active_minus1                                1 = 0
[AVBSFContext @ 00000000027d3580] 27          ref_pic_list_modification_flag_l0                           0 = 0
[AVBSFContext @ 00000000027d3580] 28          luma_log2_weight_denom                                      1 = 0
[AVBSFContext @ 00000000027d3580] 29          chroma_log2_weight_denom                                    1 = 0
[AVBSFContext @ 00000000027d3580] 30          luma_weight_l0_flag[i]                                      0 = 0
[AVBSFContext @ 00000000027d3580] 31          chroma_weight_l0_flag[i]                                    0 = 0
[AVBSFContext @ 00000000027d3580] 32          adaptive_ref_pic_marking_mode_flag                          0 = 0
[AVBSFContext @ 00000000027d3580] 33          cabac_init_idc                                              1 = 0
[AVBSFContext @ 00000000027d3580] 34          slice_qp_delta                                      000010011 = -9
[AVBSFContext @ 00000000027d3580] 43          disable_deblocking_filter_idc                               1 = 0
[AVBSFContext @ 00000000027d3580] 44          slice_alpha_c0_offset_div2                                  1 = 0
[AVBSFContext @ 00000000027d3580] 45          slice_beta_offset_div2                                      1 = 0
[AVBSFContext @ 00000000027d3580] 46          cabac_alignment_one_bit                                     1 = 1
[AVBSFContext @ 00000000027d3580] 47          cabac_alignment_one_bit                                     1 = 1


You'll have to parse the file to count frames.



Alternatively, H.264 Stream Analysis appears to be a frontend for h264_bitstream. Latest source available from https://sourceforge.net/projects/h264bitstream/files/h264bitstream/0.1.9/. It can be easily compiled on Windows under MinGW/MSYS2.