5K mp4 with ffmpeg for VR videos

Short memo to overcome the 4K .mp4 format limits using ffmpeg command line tool for VR video purpose:
Install ffmpeg tool > download ffmpeg for win, in this case the -static x64 version: https://ffmpeg.org/download.html
Extract the .zip file to a new ffmpeg folder on C:\ffmpeg
Point the environmental variables to it – in order to access from anywhere:
ffmpeg_install_env

1. with cmd.exe cd to the actual directory/folder for the imgs sequence to convert.
(change drive on windows with the cd command – use the /d switch:
example: C:\Users\User> cd /d E:\
E:\>
or
C:\Users\User> cd E:\
C:\Users\User> E:
E:\>
then cd to the actual directory for your sequence.

2. run the ffmpeg with the appropriate flags like:

ffmpeg -r 25 -f image2 -s 5120x2560 -i img_seq_%04d.jpg -i audio.mp3 -vcodec libx264 -b:v 10M -crf 10 -pix_fmt yuv420p -acodec copy dometest.mp4

-r > frame rate
-s > frame size
%04d > sequence numbering (4 digits)
-vcodec – in this case we use libx264
-b:v 10M > video bitrate normal
-crf 10 – video compression quality (usually 15-25 is a good ratio – here we use 10
-pix_fmt yuv420 – pixel format type – in order to be quicktime player compatible (4:4:4, 4:4:2 or nothing won’t play correctly with quicktime player, use VLC instead)
-acodec copy > Copy the audio from the input stream to the output stream

before uploading your video to YouTube – inject with the 3D metadata by YouTube:

https://github.com/google/spatial-media/releases/download/v2.0/360.Video.Metadata.Tool.win.zip

Finally YouTube will recognize our video as a 5K 3D video:)