I have a stream for a flash player that comes from H.264 Chunks - SPS, PPS, IDR and non-IDR. So far the FLV stucture is generated from the bytearray. The only problem left for me is to understand how I can get those Timestamp UI24 that FLVTag need.
Asked
Active
Viewed 491 times
0

Stanislav Stankov
- 65
- 1
- 11
1 Answers
1
To get the time for each FLVTag you do:
- First get the frame rate from SPS file, you need to check for timing_info_present_flag to be 1;
timing_info_present_flag : 1
num_units_in_tick : 1000
time_scale :120000
fixed_frame_rate_flag : 1
So you count it like:
time_scale / (2 * num_units_in_tick) = frame_rate fps;
120000 /
2 * 1000 = 60 fps
After that you get the miliseconds per frame -> 1 / 60 = 0.01666(6) So you count the frames (IDR and NDR) and you increase the timestamp accordingly. For SPS and PPS frame I drop the current timestamp to where we are currently.

Community
- 1
- 1

Stanislav Stankov
- 65
- 1
- 11