2

Just like ExifInterface.TAG_ORIENTATION's working for JPEG, how can I retrieve orientation info for video ?

For example I record a video in portrait mode, the orientation of video should be 90 or 270.

And when I record a video in landscape mode, the value should be 0 or 180.

When playing video, MediaPlayer in SDK always works correctly, but I don't find any way to retrieve this info.

Finally, if I cannot get orientation of video using android SDK, can I get this info using FFMPEG ?

Thanks very much for your help~

Praveenkumar
  • 24,084
  • 23
  • 95
  • 173
C Young
  • 21
  • 1
  • 2

2 Answers2

0

You can do this using FFmpeg:

$ ffprobe -show_streams input.avi | grep rotate
TAG:rotate=90
$
blahdiblah
  • 33,069
  • 21
  • 98
  • 152
0

I found the following blog post that shows how to get the metadata of a media file. All functionality requires API level >= 10 though.

Joris
  • 1,437
  • 1
  • 15
  • 22