Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by mrronharsh · Sep 18, 2014 at 10:28 PM · video

Video Help (MP4)

So, our company decided to port our project over to unity which everybody was all gun-ho and happy to do. However, this project requires MP4 playback (from a local file.) We have a catalouge of around 6,000+ MP4 files and it would seem that Unity cannot play them. I converted one to OGV and it played like a champ. Am I missing here or is this platform (Unity) really unable to play one of the most popular video formats in existence? Sample code below:

         try
         {
             var mov = GameObject.Find("MoviePlayer");
 
             var url = @"file:///C:/myfile.mp4";
             var www = new WWW(url);
 
             var movieTexture = www.movie;
 
             mov.renderer.material.mainTexture = movieTexture;
             movieTexture.Play();
 
         }
         catch (Exception er)
         {
             print("Fatal Exception: " + er.ToString());
         }
Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image mrronharsh · Sep 18, 2014 at 09:48 PM 0
Share

EDIT: Converting the files to OGV is not a viable option as we have other programs for mobile devices, etc that rely on the $$anonymous$$P4 files. Perhaps I am missing something, who knows.

The premise for allowing external files is so that users can switch existing videos out for new ones or custom ones (as our game allows for themeing aspects.)

avatar image mrronharsh · Sep 19, 2014 at 12:45 AM 0
Share

Does anybody know of any asset that can accomplish this? I tried searching on asset store came up with nil.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by tanoshimi · Sep 18, 2014 at 10:32 PM

My understanding is that the only video format Unity natively supports is OGG Theora. When you import a (local) MP4/MOV/AVI file into your Unity project, Unity uses Quicktime to convert it to OGV behind-the-scenes, and that's how the resource is bundled with your published game.

But, if you're trying to access a video at runtime via WWW, that offline conversion obviously isn't available, which is why "WWW.movie data must be a movie in Ogg Theora format." (http://docs.unity3d.com/ScriptReference/WWW-movie.html)

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image mrronharsh · Sep 18, 2014 at 10:41 PM 0
Share

That is an utterly nauseating to me. We have the application to where we want it, been developing it for about six months; then when it comes time for video playback we get a huge roadblock. We did our homework and Unity clearly states it supports $$anonymous$$P4 (boldy in fact), I guess this ends our project and a wast of six months of life; thanks Unity. :(

avatar image tanoshimi · Sep 19, 2014 at 06:02 AM 0
Share

I've not used video extensively so I might be wrong, but the documentation seems pretty clear on the issue (and there are several posts here and on the Forums which state the same) - all other video formats are supported, but must be encoded to OGG. Likely because of the ugly patents protecting proprietary formats like FLV and $$anonymous$$P4.

Why not do a server-side conversion using, say, FF$$anonymous$$PEG2THEORA?

avatar image
0

Answer by woorold · Apr 17, 2015 at 10:18 PM

Here is a guide to help you convert MP4 to OGV.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

videos stopped working in RAW image 0 Answers

Displaying video 0 Answers

Is it possible to utilize both native cameras of a device simultaneous 0 Answers

RenderToCubeMap with TrailRenderer or LineRenderer 0 Answers

Unity simple client server video streaming using RPC calls to send webcamTexture 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges