Sunday, February 28, 2016

Unity MovieTexture


Using QuickTime to convert mp4 video files to MovieTexture has some problems in Unity, some times Unity could not detect QuickTime also if you have bunch of videos all team members need to install QuickTime and wait for a long import time but converting videos manually to OGV will resolve these issues.

Using FFmpeg and a simple batch file you can convert files easily:



for %%f in (*.mp4) do  ffmpeg -i %%f -vcodec libtheora -q:v 7 
-acodec libvorbis -ac 2 -y %%~nf.ogv



It loops through all mp4 files and execute ffmpeg, with these paramerters:

-vcodec libtheora  means the video codec is Theora
-q:v 7 means the video quality is 7 from [0-10] range
-acodec libvorbis  means audio codec is Vorbis
-ac 2 means audio channels is 2
-y means overwrite existing ogv file

No comments:

Post a Comment