mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-27 10:40:34 +00:00
avvid/audenc: Set some tags in the output for downstream's info
Add the codec name and bitrate into the output for informational purposes. Bitrate in particular is now used by flvmux to set videodatarate and audiodatarate in the resulting stream
This commit is contained in:
parent
6e590fe498
commit
30a406591a
2 changed files with 34 additions and 0 deletions
|
@ -386,6 +386,23 @@ gst_ffmpegaudenc_set_format (GstAudioEncoder * encoder, GstAudioInfo * info)
|
|||
gst_audio_encoder_set_frame_max (GST_AUDIO_ENCODER (ffmpegaudenc), 0);
|
||||
}
|
||||
|
||||
/* Store some tags */
|
||||
{
|
||||
GstTagList *tags = gst_tag_list_new_empty ();
|
||||
const gchar *codec;
|
||||
|
||||
gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE, GST_TAG_NOMINAL_BITRATE,
|
||||
ffmpegaudenc->context->bit_rate, NULL);
|
||||
|
||||
if ((codec =
|
||||
gst_ffmpeg_get_codecid_longname (ffmpegaudenc->context->codec_id)))
|
||||
gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE, GST_TAG_AUDIO_CODEC, codec,
|
||||
NULL);
|
||||
|
||||
gst_audio_encoder_merge_tags (encoder, tags, GST_TAG_MERGE_REPLACE);
|
||||
gst_tag_list_unref (tags);
|
||||
}
|
||||
|
||||
/* success! */
|
||||
ffmpegaudenc->opened = TRUE;
|
||||
|
||||
|
|
|
@ -476,6 +476,23 @@ gst_ffmpegvidenc_set_format (GstVideoEncoder * encoder,
|
|||
output_format = gst_video_encoder_set_output_state (encoder, icaps, state);
|
||||
gst_video_codec_state_unref (output_format);
|
||||
|
||||
/* Store some tags */
|
||||
{
|
||||
GstTagList *tags = gst_tag_list_new_empty ();
|
||||
const gchar *codec;
|
||||
|
||||
gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE, GST_TAG_NOMINAL_BITRATE,
|
||||
ffmpegenc->context->bit_rate, NULL);
|
||||
|
||||
if ((codec =
|
||||
gst_ffmpeg_get_codecid_longname (ffmpegenc->context->codec_id)))
|
||||
gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE, GST_TAG_VIDEO_CODEC, codec,
|
||||
NULL);
|
||||
|
||||
gst_video_encoder_merge_tags (encoder, tags, GST_TAG_MERGE_REPLACE);
|
||||
gst_tag_list_unref (tags);
|
||||
}
|
||||
|
||||
/* success! */
|
||||
ffmpegenc->opened = TRUE;
|
||||
|
||||
|
|
Loading…
Reference in a new issue