Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android, how to set meta data to MP4 file?

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.

like image 484
t0m Avatar asked Apr 21 '16 12:04

t0m


People also ask

Do MP4 files have metadata?

MP4 files can contain metadata as defined by the format standard, and in addition, can contain Extensible Metadata Platform (XMP) metadata.

How do I change meta data of a file?

Click the File tab. Click Info to view the document properties. To add or change properties, hover your pointer over the property you want to update and enter the information. Note that for some metadata, such as Author, you'll have to right-click on the property and choose Remove or Edit.


1 Answers

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

like image 189
Jorgesys Avatar answered Oct 05 '22 01:10

Jorgesys