Rotate and append videos with mp4parser
Asked Answered
P

0

4

I would like to append several video files from the camera through mp4parser. Unfortunately, in the same fragment, despite the fact that I try to change the OrientationHint of the media recorder when changing camera, only the first one seems to work (ie. if I start with the front camera, the videos with the back camera are reversed and vice versa).

To solve this problem, I tried to rotate the video that are in the wrong direction and that works (with the method of setMatrix mp4parser, the new files are in good direction). But when I want to append the files, (all in the right direction) I get the same result as if I had not rotated the videos, as if it could have only one orientation videos for my final component video.

Do you have a solution for this?

Thanks

Plumbaginaceous answered 20/5, 2014 at 16:5 Comment(4)
I tried to use two MediaRecorder for the 2 cameras, so I get 2 videos to append in the right direction, but once I try to append them with mp4parser, the second is necessarily in the wrong direction .Plumbaginaceous
HI Baptiste Pillon, I am facing same issue as you mentioned, Have you find any work around for that...then please share with me?Iiette
It was a long time since you asked me that but for future potential people with this kind of problem, to fix this I had had to rotate videos with FFmpeg to rotate them really and not only by changing their header information like mp4parser does it. FFmpeg is kind of tricky to implement to Android project so I open sourced a wrapper based on a vine project with a more recent version of FFmpeg (needed for some video manipulations) : github.com/bpillon/android-ffmpeg-wrapperPlumbaginaceous
Can you give command to rotate video by 180 degrees for front camera @BaptistePillonGarnet

© 2022 - 2024 — McMap. All rights reserved.