Converting Ogg’s COVERART tag

Marcus Habermehl bmh1980de at gmail.com
Sun Dec 15 19:46:28 PST 2013


Sorry, for the late answer. I was very busy the last week.

Am 07.12.2013 11:31, schrieb Sebastian Dröge:
> On Fr, 2013-12-06 at 15:37 +0100, Marcus Habermehl wrote:
>> Hi.
>>
>> I have some Ogg files with the deprecated COVERART tag that I would like
>> to convert to the METADATA_BLOCK_PICTURE tag.
>>
>> For this I have written a small Python script to automatically do this
>> with GStreamer.
>>
>> How I can read tags, modify and write back I have already found out.
>>
>> Unfortunately, the GST_TAG_IMAGE is not written as I expected. But I do
>> not know if this is due to my code, or due to the GIR bindings.
>>
>> I get the original tags from the bus with a first pipeline (urisrc !
>> oggdemux ! oggmux ! fakesink). With these tags I create a modified
>> GstTagList.
>>
>> The COVERART tag is here changed from GST_TAG_PREVIEW_IMAGE to
>> GST_TAG_IMAGE and for the value I create a new GstSample. (‘value’ is
>> the value of the original tag.)
>>
>> buffer = value.get_buffer()
>> mime_struct = value.get_caps().get_structure(0)
>> mime_type = mime_struct.get_name()
>>
>> structure = Gst.Structure.new_empty(mime_type)
>> structure.set_value("height", mime_struct.get_value("height"))
>> structure.set_value("image-type", GstTag.TagImageType.FRONT_COVER)
>> structure.set_value("width", mime_struct.get_value("width"))
>>
>> caps = Gst.Caps.new_empty()
>> caps.append_structure(structure)
>>
>> sample = Gst.Sample.new(value.get_buffer(), caps, value.get_segment(), None)
>>
>> The modified GstTagList is written with a second pipeline (urisrc
>> oggdemux ! vorbistag ! oggmux ! urisink) correctly. But in GST_TAG_IMAGE
>> the ‘image-type’ field is removed from the GstSample. At least it is
>> when I reading the written tags no longer present.
> 
> The code is writing the image type, or at least tries to. Does it show
> up in other software that does not use GStreamer? Can you provide a file
> that was created this way?

I have installed an application that doesn’t use GStreamer and it shows
the image type as expected.

Here is an Ogg file that I have created this way:
http://ubuntuone.com/6LfawrpRf20KQHO4ZeGZTd

>> I also found no hint in the documentation, how can I set a description
>> for the image.
> 
> Setting a description is currently not supported, could you file a
> feature request bug about that at http://bugzilla.gnome.org against
> GStreamer? Should be easy to add in
> gst-plugins-base/gst-libs/gst/tag/gstvorbistag.c

Does this affect vorbistag, only? Or is it generally not supported?

Greetings
Marcus


More information about the gstreamer-devel mailing list