Android, how to set metadata to MP4 file?

I would like to set the metadata in an MP4 file.

I am creating an MP4 file via:

new MediaMuxer(mPath, MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4) 

and the file has meta:

 Title: unknown Artist: unknown Album: unknown Comment: ... 

similar: Here

I found that for API21 + I could do metadata via: MediaMetadata.Builder , but how can I save metadata to the created MP4 file?

Without extern library.

Thanks.

+6
source share
1 answer

There is no way for the Android SDK to edit / write metadata, perhaps on copyright issues, but you can use options such as:

https://github.com/sannies/mp4parser

http://multimedia.cx/eggs/supplying-ffmpeg-with-metadata/

Maybe this is what you are looking for (using FFmpeg): https://github.com/bytedeco/javacv/blob/master/src/main/java/org/bytedeco/javacv/FFmpegFrameRecorder.java

+2
source

All Articles