Search code examples
androidffmpegmetadatavideo-processing

Android MediaMetadataRetriever.METADATA_KEY_DATE gives only date of video on galaxy S7


I am writing a code to get video creation date and time from metadata, i am using following code to get creation date

MediaMetadataRetriever retriever = new MediaMetadataRetriever();
retriever.setDataSource(path_to_video);
String date = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DATE);

it works perfect on all devices except Samsung Galaxy S7, it returns only date in "YYYY MM DD" format, no time stamp i need both date and timestamp.

any help in this regard is much appreciated.


Solution

  • For printing metadata information of video FFMPEG is best option to use,

    ffmpeg -i input_video -f ffmetadata metadata.txt
    

    this command help me to get required info.