fmt->audio_codec = context->audio_codec->id;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "specified audio codec %s %s [%s]\n",
tmp, context->audio_codec->name, context->audio_codec->long_name);
+
+ if (!strcasecmp(tmp, "pcm_mulaw")) {
+ handle->mm.samplerate = 8000;
+ handle->mm.ab = 64;
+ }
+ }
+ }
+
+ if (handle->params && (tmp = switch_event_get_header(handle->params, "av_video_codec"))) {
+ if ((context->video_codec = avcodec_find_encoder_by_name(tmp))) {
+ fmt->video_codec = context->video_codec->id;
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "specified video codec %s %s [%s]\n",
+ tmp, context->video_codec->name, context->video_codec->long_name);
}
}
}
if (handle->mm.samplerate) {
+ handle->samplerate = handle->mm.samplerate;
+ } else {
handle->mm.samplerate = handle->samplerate;
}
+ if (handle->mm.channels) {
+ handle->channels = handle->mm.channels;
+ } else {
+ handle->mm.channels = handle->channels;
+ }
+
if (!handle->mm.ab) {
handle->mm.ab = 128;
}
handle->mm.vb = switch_calc_bitrate(handle->mm.vw, handle->mm.vh, 1, handle->mm.fps);
}
- if (fmt->video_codec != AV_CODEC_ID_NONE) {
+ if (switch_test_flag(handle, SWITCH_FILE_FLAG_VIDEO) && fmt->video_codec != AV_CODEC_ID_NONE) {
const AVCodecDescriptor *desc;
- if ((handle->stream_name && (!strcasecmp(handle->stream_name, "rtmp") || !strcasecmp(handle->stream_name, "rtsp") || !strcasecmp(handle->stream_name, "youtube")))) {
+ if ((handle->stream_name && (!strcasecmp(handle->stream_name, "rtmp") || !strcasecmp(handle->stream_name, "youtube")))) {
if (fmt->video_codec != AV_CODEC_ID_H264 ) {
fmt->video_codec = AV_CODEC_ID_H264; // force H264
if (!e) {
switch_event_create_plain(&e, SWITCH_EVENT_CHANNEL_DATA);
+ e->flags |= EF_UNIQ_HEADERS;
}
if ((inner_var_count = switch_separate_string(var_array[x], '=',
inner_var_array, (sizeof(inner_var_array) / sizeof(inner_var_array[0])))) == 2) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, "Parsing variable [%s]=[%s]\n", inner_var_array[0], inner_var_array[1]);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "Parsing variable [%s]=[%s]\n", inner_var_array[0], inner_var_array[1]);
switch_event_add_header_string(e, SWITCH_STACK_BOTTOM, inner_var_array[0], inner_var_array[1]);
}
}