Skip to content

Commit

Permalink
Merge pull request #213 from kaltura/master-SUP-43286
Browse files Browse the repository at this point in the history
SUP-43286: Kaltura Event recordings cannot be imported to Adobe Premiere Pro due to "Unsupported Compression Type"
  • Loading branch information
igorshevach authored Sep 17, 2024
2 parents a6d9e7b + 8f7b45e commit b30ff82
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 4 deletions.
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);
}

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);
}

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);

return VOD_OK;
}

Expand Down

0 comments on commit b30ff82

Please sign in to comment.