We are trying to generate a MPEG TS using H264 video and AAC audio using the following Gstreamer Pipeline:
gst-launch filesrc location= ! h264parse ! mux. filesrc location= ! aacparse ! mux. mpegtsmux name=mux ! filesink location=output.ts
The H264 video is being generated by TI’s encoder 720p H.264 Base Profile Encoder on DM6467.
The output TS generated doesn’t play in VLC. On investigating the issue we found that the output.ts doesn’t not have valid PTS and DTS values. On increasing the log-level of h264parse we see that it’s not able to generate timestamps for its output buffers giving messages “unable to compute timestamp:” on desktop and ARM board as shown in logs below.
Question is: From the H264 standard VUI information has num_units_in_tick, time_scale and fixed_frame_rate_flag fields which are used by gstreamer’s h264parse element to generate timestamps. We need to know does the TI’s H264 encoder supports this data and if not how can we make the encoder generate this information ?
Logs with GStreamer 0.10.25 (used from gst-ti-plugin-full-1.02.00) on ARM board (TI’s DM6467): 0:00:00.405728170 _[333m 890_[00m 0x84308 _[36mDEBUG _[00m _[00m h264parse gsth264parse.c:1112:gst_h264_parse_chain_forward:_[00m we have a P slice 0:00:00.406315923 _[333m 890_[00m 0x84308 _[36mDEBUG _[00m _[00m h264parse gsth264parse.c:1179:gst_h264_parse_chain_forward:_[00m unable to compute timestamp: timing info not present 0:00:00.406876634 _[333m 890_[00m 0x84308 _[36mDEBUG _[00m _[00m h264parse gsth264parse.c:1284:gst_h264_parse_chain_forward:_[00m pushing buffer 0x83708, size 318, ts 0:00:00.000000000 0:00:00.408334707 _[333m 890_[00m 0x84308 _[36mDEBUG _[00m _[00m h264parse gsth264parse.c:1085:gst_h264_parse_chain_forward:_[00m NAL type: 1, ref_idc: 3 0:00:00.408912481 _[333m 890_[00m 0x84308 _[36mDEBUG _[00m _[00m h264parse gsth264parse.c:1104:gst_h264_parse_chain_forward:_[00m first MB: 0, slice type: 5 0:00:00.409725115 _[333m 890_[00m 0x84308 _[36mDEBUG _[00m _[00m h264parse gsth264parse.c:1112:gst_h264_parse_chain_forward:_[00m we have a P slice 0:00:00.410312105 _[333m 890_[00m 0x84308 _[36mDEBUG _[00m _[00m h264parse gsth264parse.c:1179:gst_h264_parse_chain_forward:_[00m unable to compute timestamp: timing info not present 0:00:00.410867741 _[333m 890_[00m 0x84308 _[36mDEBUG _[00m _[00m h264parse gsth264parse.c:1284:gst_h264_parse_chain_forward:_[00m pushing buffer 0x83768, size 428, ts 0:00:00.000000000 0:00:00.412541410 _[333m 890_[00m 0x84308 _[36mDEBUG _[00m _[00m h264parse gsth264parse.c:1085:gst_h264_parse_chain_forward:_[00m NAL type: 1, ref_idc: 3 0:00:00.413165952 _[333m 890_[00m 0x84308 _[36mDEBUG _[00m _[00m h264parse gsth264parse.c:1104:gst_h264_parse_chain_forward:_[00m first MB: 0, slice type: 5 0:00:00.413739144 _[333m 890_[00m 0x84308 _[36mDEBUG _[00m _[00m h264parse gsth264parse.c:1112:gst_h264_parse_chain_forward:_[00m we have a P slice 0:00:00.414329132 _[333m 890_[00m 0x84308 _[36mDEBUG _[00m _[00m h264parse gsth264parse.c:1179:gst_h264_parse_chain_forward:_[00m unable to compute timestamp: timing info not present
Logs with GStreamer 1.2.0 on desktop:
0:00:02.794395868 5862 0x8fc6af0 DEBUG h264parse gsth264parse.c:639:gst_h264_parse_collect_nal: parsing collected nal 0:00:02.794416021 5862 0x8fc6af0 DEBUG h264parse gsth264parse.c:1386:gst_h264_parse_get_timestamp: unable to compute timestamp: VUI not present 0:00:02.794438692 5862 0x8fc6af0 DEBUG h264parse gsth264parse.c:166:gst_h264_parse_reset_frame: reset frame 0:00:02.794524817 5862 0x8fc6af0 DEBUG h264parse gsth264parse.c:166:gst_h264_parse_reset_frame: reset frame 0:00:02.794699444 5862 0x8fc6af0 DEBUG h264parse gsth264parse.c:814:gst_h264_parse_handle_frame: last parse position 0 0:00:02.794719583 5862 0x8fc6af0 DEBUG h264parse gsth264parse.c:846:gst_h264_parse_handle_frame: complete nal (offset, size): (4, 1930) 0:00:02.794736285 5862 0x8fc6af0 DEBUG h264parse gsth264parse.c:902:gst_h264_parse_handle_frame: 0xb5404250 complete nal found. Off: 4, Size: 1930 0:00:02.794752962 5862 0x8fc6af0 DEBUG h264parse gsth264parse.c:483:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 1930 0:00:02.794769337 5862 0x8fc6af0 DEBUG h264parse gsth264parse.c:572:gst_h264_parse_process_nal: first_mb_in_slice = 0 0:00:02.794784220 5862 0x8fc6af0 DEBUG h264parse gsth264parse.c:575:gst_h264_parse_process_nal: frame start: 1 0:00:02.794800946 5862 0x8fc6af0 DEBUG h264parse gsth264parse.c:583:gst_h264_parse_process_nal: parse result 0, first MB: 0, slice type: 5 0:00:02.794891592 5862 0x8fc6af0 DEBUG h264parse gsth264parse.c:639:gst_h264_parse_collect_nal: parsing collected nal 0:00:02.794911717 5862 0x8fc6af0 DEBUG h264parse gsth264parse.c:1386:gst_h264_parse_get_timestamp: unable to compute timestamp: VUI not present