Android, how to set meta data to MP4 file?

女生的网名这么多〃 提交于 2020-02-21 11:10:25

问题


I would like to set meta data to MP4 file.

I create MP4 file via:

new MediaMuxer(mPath, MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4)

and file has meta:

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

similar as: Here

I found that for API21+ i could make metadata via: MediaMetadata.Builder but how could i save metadata to created MP4 file?

Without extern library please.

Thank you.


回答1:


To edit/write metadata, Android SDK doesn´t have any method, probably by copyright issues, but you can use options like:

https://github.com/sannies/mp4parser

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

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



来源:https://stackoverflow.com/questions/36769579/android-how-to-set-meta-data-to-mp4-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!