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
  • 25,445
  • 23
  • 94
  • 171
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
  • 32,000
  • 21
  • 97
  • 150
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,367
  • 1
  • 14
  • 22