0

I'm having a problem which I have spent the past few days trying to resolve regarding MP4 file rotation on Android. I'm currently working on application which will send the MP4 file across from an android device as a byte stream to be played on another device.

The problem I'm having is that videos recorded in portrait mode on the android device are being displayed rotated 90 degrees on the player receiving the stream.

I have tried creating a new MP4 from the original with rotation changed using MP4Parser. I have also tried changing the rotation by creating a new MP4 changing the key-rotation in the media format and have also tried changing orientation hint when creating a new Muxer.

All of these methods work but only seem to change the rotation metadata. In some players this metadata is being read and a rotation is being applied. However, the player used in the target player used for our application is not capable of reading this metadata.

my only solution would be to create a temporary MP4 which has had the video data rotated then send that across instead. I've found resources to rotate individual YUV image frames within an MP4 but my question is how can I retrieve these frames from an inputted MP4 and write the modified one to a new file?


NOTE: I'm building the application with Xamarin and I've tried using FFMPEG but adding the binaries would make the project too large and I also have concerns about licensing.

Community
  • 1
  • 1
Amir
  • 1
  • 5

1 Answers1

0

We ended up going with an FFMPEG implementation sending the files elsewhere to be converted.

Amir
  • 1
  • 5