JavaCV Audio and Video Development Guide: How to use JavaCV to read mp3 files, display ID3V2 album cover images and save them into jpg images and png images while retaining png transparency.

"JavaCV Audio and Video Development Guide" Column Directory Navigation
"JavaCV Audio and Video Development Guide" Column Introduction and Table of Contents

JavaCV audio and video development guide

Preface

Before this, we have used the open source library "MP3AGIC" to operate mp3 and read the cover image. So can it be done using JavaCV?
sure.
Of course, there are two situations for cover images. One is to use a jpg image as the cover. This is relatively simple because jpg itself is compressed by yuv. What needs to be emphasized is the use of png pictures as covers. Because png is in rgba pixel format, it has one more transparent channel than ordinary pictures. If it is not compatible, the transparent channel will be lost and the color of the png will be wrong. Therefore, in order to be compatible with png images, you need to Additional configuration to accommodate this situation.

Additional knowledge about the ID3V2 cover image tag of mp3

Most of the MP3s we download do not come with mp3 cover images, so we need to add covers manually.
So how to add it?
The blogger recommends using the open source software foobar2000 to manually select the ID3V2 tag type and manually add pictures to the mp3 cover image. Of course, foobar200

Guess you like

Origin blog.csdn.net/eguid_1/article/details/131767240