<div dir="ltr"> <br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Aug 26, 2017 at 5:00 PM, Jacobo Luis Mejías Albertos <span dir="ltr"><<a href="mailto:jalumeal@gmail.com" target="_blank">jalumeal@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I try to registry some custom tags with 'gst_tag_register()' for using it with flacenc, but when I do the merge the final output file only show the predefined tags.<br>
<br>
This is and excerpt of the code related with the problem:<br>
<br>
GstElement* encoder = gst_element_factory_make("flac<wbr>enc", "encoder");<br>
...<br>
for (auto& tag : mytags) // mytags are a std::multimap<const char*, constchar*><br>
   gst_tag_register(tag.first, GST_TAG_FLAG_META, G_TYPE_STRING, tag.first, tag.second, gst_tag_merge_strings_with_com<wbr>ma);<br>
...<br>
GstTagSetter* tagger = GST_TAG_SETTER(encoder);<br>
if (tagger) {<br>
  gst_tag_setter_set_tag_merge_m<wbr>ode(tagger, GST_TAG_MERGE_APPEND);<br>
  GstTagList* list = gst_tag_list_new_empty();<br>
  for (auto& tag : meta)<br>
     gst_tag_list_add_values(list, GST_TAG_MERGE_APPEND, tag.first, tag.second);<br>
  gst_tag_setter_merge_tags(tagg<wbr>er, list, GST_TAG_MERGE_APPEND);<br>
  gst_tag_list_unref(list);<br>
}<br>
<br>
gst_element_set_state(pipeline<wbr>, GST_STATE_PLAYING);<br>
...<br>
<br>
I do something bad or flacenc don't support custom tags ?<span class="gmail-HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br></div><div>From a quick look at gstflacenc.c, check add_one_tag function. It will use the gst-plugins-base tag library to convert the tags to vorbis tags. The gstvorbistag.c in gst-plugins-base is where this is one, check gst_tag_to_vorbis_comments which uses gst_tag_to_vorbis_tag to match gstreamer tags to vorbis tags. The likely reason it is not working is because your custom tags are not part of the list it knows how to map.<br><br></div><div>You could also add your tags there, make it dynamically extensible and provide functions to register custom tags or make it handle (somehow) tags it doesn't know. Depends on your overall use case and how generic you want this solution to be.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-HOEnZb"><font color="#888888">
<br>
-- <br>
Jacobo Luis Mejías Albertos<br>
______________________________<wbr>_________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesk<wbr>top.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/gstreamer-dev<wbr>el</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Thiago Sousa Santos</div>
</div></div>