Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SUP-43286: Kaltura Event recordings cannot be imported to Adobe Premiere Pro due to "Unsupported Compression Type" #213

Merged
merged 12 commits into from
Sep 17, 2024
45 changes: 41 additions & 4 deletions nginx-pckg-module/src/media/codec_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

#define AOT_ESCAPE (31)

#define AOT_SBR (5)

#define AOT_PS (29)

#define HVCC_HEADER_SIZE (22)


Expand Down Expand Up @@ -474,7 +478,8 @@ codec_config_mp4a_config_parse(
vod_str_t* extra_data,
mp4a_config_t* result)
{
bit_reader_state_t reader;
bit_reader_state_t reader, temp_reader;
uint8_t ext_sample_rate_index;

vod_log_buffer(VOD_LOG_DEBUG_LEVEL, log, 0, "codec_config_mp4a_config_parse: extra data ", extra_data->data, extra_data->len);

Expand All @@ -492,12 +497,44 @@ codec_config_mp4a_config_parse(

if (reader.stream.eof_reached)
{
vod_log_error(VOD_LOG_ERR, log, 0,
"codec_config_mp4a_config_parse: failed to read all required audio extra data fields");
return VOD_BAD_DATA;
goto error;
}

temp_reader = reader;
if (result->object_type == AOT_SBR || (result->object_type == AOT_PS &&
!(bit_read_stream_get(&temp_reader, 3) & 0x03 && !(bit_read_stream_get(&temp_reader, 9) & 0x3f))))
{
ext_sample_rate_index = bit_read_stream_get(&reader, 4);
if (ext_sample_rate_index == 0x0f)
{
bit_read_stream_get(&reader, 24);
igorshevach marked this conversation as resolved.
Show resolved Hide resolved
}

if (reader.stream.eof_reached)
{
goto error;
}

result->object_type = bit_read_stream_get(&reader, 5);
if (result->object_type == AOT_ESCAPE)
{
result->object_type = 32 + bit_read_stream_get(&reader, 6);
igorshevach marked this conversation as resolved.
Show resolved Hide resolved
igorshevach marked this conversation as resolved.
Show resolved Hide resolved
}

if (reader.stream.eof_reached)
{
goto error;
}
}

return VOD_OK;

error:

vod_log_error(VOD_LOG_ERR, log, 0,
"codec_config_mp4a_config_parse: failed to read all required audio extra data fields");

return VOD_BAD_DATA;
}

uint32_t
Expand Down
6 changes: 6 additions & 0 deletions nginx-pckg-module/src/media/mpegts/adts_encoder_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ adts_encoder_set_media_info(
adts_frame_header_set_channel_configuration(state->header, codec_config->channel_config);
adts_frame_header_set_adts_buffer_fullness(state->header, 0x7ff);

vod_log_debug3(VOD_LOG_DEBUG_LEVEL, context->request_context->log, 0,
"adts_encoder_set_media_info: mp4a object_type: %D sample_rate_index: %D channel_config: %D",
codec_config->object_type,
codec_config->sample_rate_index,
codec_config->channel_config);

igorshevach marked this conversation as resolved.
Show resolved Hide resolved
return VOD_OK;
}

Expand Down
Loading