This is a fun one. I’ve tried to figure it out, not entirely sure how.
Problem: When a member uploads an iPad or an iPhone video, and they filmed it up/down not sideways, creating the wrong rotation, ffmpeg seems to rotate it automatically because of the meta data in the MOV file.
Since the meta data in the MOV file is of a fixed rotation, ffmpeg is rotating it when it shouldn’t. This means that when I encode with:
var command = 'ffmpeg -y -i ' + queued_folder + current_file.filename + ' -acodec libfaac -b:a 96k -s 1280x720 -vcodec libx264 -movflags faststart -profile:v baseline -pix_fmt yuv420p -level:v 30 -crf 31 -threads 8 "' + temp_folder + filename + '"';
…the resulting video is flipped into 720x1280, not 1280x720. This causes huge problems on the single media display and makes the video flow half way down the page well into the comments.
It took a while to figure out that the video’s metadata is causing this problem, because the metadata is telling ffmpeg to rotate the video. I cant add a rotation command, because then all videos get rotated and then only iPad/iPhone videos look good and the rest are messed up.
Here is a StackOverflow article from other people who have had this problem: http://goo.gl/FSrO3b and it also shows some solutions.
The solution would probably come within ffmpeg_server.js in adding a command before the file is encoded to simply strip it of its metadata.
If you need the sample MOV file in order to test this, please let me know how to send the original un-converted video to you. It would not be appropriate to post the video here.