You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Operating System: Oracle Linux 9 Shaka Packager Version: 3.2.0
I would like to change the FinalizeSegment method of the segmenter.c class to save all key frames in key_frame_infos_ .
Ex:
FROM:
`
bool first_key_frame = true;
for (const std::unique_ptr<Fragmenter>& fragmenter : fragmenters_) {
// https://goo.gl/xcFus6 6. Trick play requirements
// 6.10. If using fMP4, I-frame segments must include the 'moof' header
// associated with the I-frame. It also implies that only the first key
// frame can be included.
if (!fragmenter->key_frame_infos().empty() && first_key_frame) {
const KeyFrameInfo& key_frame_info =
fragmenter->key_frame_infos().front();
first_key_frame = false;
key_frame_infos_.push_back(
{key_frame_info.timestamp, moof_start_offset,
fragment_buffer_->Size() - moof_start_offset + key_frame_info.size});
}
fragment_buffer_->AppendBuffer(*fragmenter->data());
}`
My intention is that in the WriteSegment method of the multi_segment_segmenter.c class I save these values in a list as per the example below.
Ex:
FROM:
`
if (muxer_listener()) {
for (const KeyFrameInfo& key_frame_info : key_frame_infos()) {
muxer_listener()->OnKeyFrame(
key_frame_info.timestamp,
segment_header_size + key_frame_info.start_byte_offset,
key_frame_info.size);
}`
TO:
`
std::vector<std::pair<int, int>> iframe_list;
if (muxer_listener()) {
int current_offset = segment_header_size;
for (const KeyFrameInfo& key_frame_info : key_frame_infos()) {
int key_frame_offset = current_offset + key_frame_info.start_byte_offset;
muxer_listener()->OnKeyFrame(
key_frame_info.timestamp,
key_frame_offset,
key_frame_info.size);
iframe_list.emplace_back(key_frame_offset, key_frame_info.size);
}
} `
With this, I intend to perform a search on the final segment, extracting the key frames to a separate file.
The first key frame is extracted successfully, but I can't get the position of the second one right.
Can you see what I'm doing wrong?
The text was updated successfully, but these errors were encountered:
System info
Operating System: Oracle Linux 9
Shaka Packager Version: 3.2.0
I would like to change the FinalizeSegment method of the segmenter.c class to save all key frames in key_frame_infos_ .
Ex:
FROM:
`
TO:
`
My intention is that in the WriteSegment method of the multi_segment_segmenter.c class I save these values in a list as per the example below.
Ex:
FROM:
`
TO:
`
With this, I intend to perform a search on the final segment, extracting the key frames to a separate file.
The first key frame is extracted successfully, but I can't get the position of the second one right.
Can you see what I'm doing wrong?
The text was updated successfully, but these errors were encountered: