7

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.

Jorgesys
  • 124,308
  • 23
  • 334
  • 268
t0m
  • 3,004
  • 31
  • 53

1 Answers1

2

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

Jorgesys
  • 124,308
  • 23
  • 334
  • 268
  • What about this: https://developer.android.com/reference/android/media/MediaMuxer#metadata-track ? Isn't it for writing and reading the metadata? Sadly I've failed to understand how to use it, but it seems promising... Could you please check it out and publish about it here: https://stackoverflow.com/q/36473337/878126 ? – android developer Apr 01 '19 at 08:10
  • You told that SDK doesn't allow this probably by copyright issues, but what if I would like to save `.mp4` file that I got as video from my camera on Android phone? There is should not be any copyright issues... – Sirop4ik Dec 29 '19 at 05:27