0

I have an iOS app which takes advantage of the camera to create and save videos, whicha re then uploaded to a web server. However, when I try to view these videos on the server using IE9, I get an audio stream, but I only see the poster. When viewed in Chrome, I do see a video, but it is rotated 90 degrees from what it should be.

The MP4 files already use the H.264 encoding. When I tried converting the MP4 to FLV and using it in a flash player, it was still rotated 90 degrees. I have tried videojs but to no avail. What is causing this and how can I fix it?

All help is greatly appreciated and I always accept an answer!

danielmhanover
  • 3,094
  • 4
  • 35
  • 51

1 Answers1

1

I don't know why the videos aren't playing on IE9.

The videos are rotated because iOS devices record in a fixed orientation and then set the rotate metadata tag as appropriate. Some players recognize and act on that tag, many do not.

See this answer for instructions on rotating the video using FFmpeg, though most any video manipulation software should be able to do this.

Community
  • 1
  • 1
blahdiblah
  • 33,069
  • 21
  • 98
  • 152
  • It seems you're right about the metadata, but the command provided in the other answer doesn't work. – danielmhanover Jul 09 '12 at 19:40
  • I got it to work, -vf "transpose=2" needs to go after input_file. See my comment in the other answer. But it still isn't clear to me who to find out the current rotation of a given video file. – danielmhanover Jul 09 '12 at 20:25
  • There isn't yet a way to do the rotation automatically, but you can look for the `rotate` tag using `ffprobe` (which is usually bundled with FFmpeg) and then use that to determine the `transpose` call. I feel like there's already a short shell script for doing that floating around SO, but I couldn't find it just now. – blahdiblah Jul 09 '12 at 20:35
  • I did that yesterday using Ruby. It's very clumsy, but I suppose it fulfills my needs for now. Thanks for your help! – danielmhanover Jul 10 '12 at 17:21