Home  >  Q&A  >  body text

media - Android 如何获取视频文件的方向信息?

MediaMetadataRetriever retr = new MediaMetadataRetriever();
retr.setDataSource(mVideoPath);
String rotation = retr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_ROTATION);
只找到上述代码在API 17 之后可以使用,那API 17之前该如何获取视频的方向?
黄舟黄舟2764 days ago338

reply all(1)I'll reply

  • 大家讲道理

    大家讲道理2017-04-17 15:49:20

    API 14 can get the length and width. If you need a lower version, you can only implement it yourself. However, the source code contains native code, so you can only consider using some third-party players. For example, Vitamio also has MediaMetadataRetriever that supports up to 2.1. Version

    reply
    0
  • Cancelreply