You are not logged in.

#1 2012-12-23 17:18:38

Registered: 2012-12-12
Posts: 20

libavcodec access to vorbis comments


could it be that libavcodec does not read vorbis comments? Not even mplayer seems to show them, but ffplay displays some.

Thus I tried my own program but it had the same issue. The relevant part:

	bool Song_File::load()
		if (file_path.empty())
			return false;
		// Use ffmpeg to determine basic information
		AVFormatContext* avc = nullptr;
		if (avformat_open_input(&avc, file_path.c_str(), nullptr, nullptr) < 0)
			return false; // further error handling?
		duration = avc->duration;
		// read metadata and add it to tags
		AVDictionaryEntry* entry;
		while (entry = av_dict_get(avc->metadata, "", entry, AV_DICT_IGNORE_SUFFIX))
		return true;

How does ffplay handle vorbis comments and how can I enable it for my program?

Another important question: How can I save the metadata again to the file? I have not found a suitable function for that yet.

Merry Christmas!


Board footer

Powered by FluxBB