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
13
Question by h4wkeye · Mar 31, 2011 at 01:45 PM · videomovietexturefree

Any possibility to play a video in unity free?

^ This.

Thanks in advance

h4wkeye

Comment
Add comment · Show 1
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 yoyo · Dec 09, 2012 at 02:57 AM 0
Share

(Seems like a reasonable question to me, up-voting out of negative land ...)

7 Replies

· Add your reply
  • Sort: 
avatar image
14

Answer by arky25 · Dec 28, 2012 at 01:28 PM

I wrote a script wich reads out all pictures out of a folder. You can use Virtualdub to make your clip to pictures, load the folder into unity 3d and then type in the name of the folder in the script. The script looks like this.

 #pragma strict
 var imageFolderName = "";
 var MakeTexture = false;
 var pictures = new Array();
 var loop = false;
 var counter = 0;
 var Film = true;
 var PictureRateInSeconds:float = 1;
 private var nextPic:float = 0;
 
 function Start () {
     if(Film == true){
         PictureRateInSeconds = 0.04166666666666666666;
     }
 
     var textures : Object[] = Resources.LoadAll(imageFolderName);
     for(var i = 0; i < textures.Length; i++){
         Debug.Log("found");
         pictures.Add(textures[i]);
     }
 }
 
 function Update () {
     if(Time.time > nextPic){
         nextPic = Time.time + PictureRateInSeconds;
         counter += 1;
         if(MakeTexture){
             renderer.material.mainTexture = pictures[counter];
         }
     }
     if(counter >= pictures.length){
         Debug.Log("fertig");
         if(loop){
             counter = 0;
         }
     }
 }


you have to create a Resources folder and put the folder with the pictures into that folder. But it works great!

Comment
Add comment · Show 9 · 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 brae · Jan 18, 2013 at 12:12 AM 0
Share

thank you very much it wont let me thumbs up dont know why worked like a charm 100% credit to you AR$$anonymous$$Y25 saved the day for my project

avatar image yoyo · Jun 08, 2013 at 04:22 PM 0
Share

Not sure why this answer got down-voted, but since it helped @brae out I thought it deserved to be voted back up. I also reformatted the code to be more readable -- @arky25, when posting code you can select the code block and hit the little 101 button to reformat it (basically it all needs to be indented).

avatar image Kishlaya Sharma · Oct 01, 2013 at 06:25 AM 0
Share

If you have Photoshop cs6 then you can use it to create picture sequence from clips. Just go to File > Export > Render Video. Hope it help...

avatar image jorgeavila · Feb 25, 2014 at 01:40 AM 0
Share

i can't make work ! i get this error ArgumentOutOfRangeException: Index is less than 0 or more than or equal to the list count. Parameter name: index 3 System.Collections.ArrayList.ThrowNewArgumentOutOfRangeException (System.String name, System.Object actual, System.String message) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Collections/ArrayList.cs:3261)

Thanks!

avatar image azurewai · Oct 14, 2014 at 07:03 AM 0
Share

try to add counter after the if(makeTexture) statement

if($$anonymous$$akeTexture){ renderer.material.mainTexture = pictures[counter]; }

nextPic = Time.time + PictureRateInSeconds;

counter += 1;

Show more comments
avatar image
7

Answer by kahalany · Jul 06, 2012 at 01:49 PM

Hi, h4wkeye.

I wrote a script that does just that and more. You can find it in the asset store under the name "Universal Video Texture". Also with my script you're not limited to just a short video clip. Works perfectly with Unity free, web, ios and and Android.

Here's the link: http://u3d.as/content/royie-kahalany/universal-video-texture/35M

Have fun!

Royie

Comment
Add comment · Show 18 · 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 sharpshot124 · Dec 02, 2012 at 01:50 AM 7
Share

i hate spam as much as the next person but to be fair, it was relevant to the question

avatar image gardian06 · Dec 28, 2012 at 05:30 PM 2
Share

actually all of @kahalany 's posts have been on topic to the question being asked, and for the most part is offering a free option, so in reality it just it so happens/coincidence that he is able to copy and paste his answer with slight modification.

it seems more that you are spam$$anonymous$$g a comment to his answers then he is spam$$anonymous$$g answers.

avatar image Bunny83 · Dec 28, 2012 at 08:31 PM 2
Share

@Tseng: It's not really unsolicited since that's exactly the topic of the question. He only posted his solution on questions with that specific topic. It's not spam if you post a link to a solution. The solution doesn't need to be free of charge, that's not a requirement for this site. A lot people developed middleware and put it on the AssetStore. I posed a lot links to assets on the store if it fits the question.

This site is a knowledge base all around unity. If someone needs to view a video with unity free, he will find a solution. If you have an open source solution feel free to post it here. The voting system should take care of what is a good and what's a bad solution.

avatar image gardian06 · Dec 28, 2012 at 10:08 PM 2
Share

@Tseng actually @Bunny83 was talking about my comment where I was directly stating the the solution being given was free.

and on the "he did help not a single person with a different problem" to which "so...?"

if a person feels that they are knowledgeable about a specific topic like AI for instance, and they only answered questions based on AI then by your logic that person would be unwanted. which just seems snobbish "you have to be able to help everybody with any kind of problem" then there would be no such thing as a specialist.

not to mention if this package does what it claims, and is related to the topic then that is not spam, and your viagra example is flawed for the same reason (once is a mention/answer to the problem 2 on the same page might start to be spam, and 3+ I would be messaging a mod myself).

now if he was going into a question about AI, and posting about his video asset package then I would be right beside you to the best of my ability, but he didn't he posted a solution to the problem of "Any possibility to play a video in unity free?" with "yes, and here is one of them" so like I said before. you purposefully going to each post he has made (which have all been on topic to the question being asked) and proclai$$anonymous$$g with some all-mighty statement "this is spam" is unfounded, and either spam itself, or trolling/harassing the user.

if you really feel that his answers are spam then flag them as such, and let a moderator decide otherwise just move on.

avatar image AyeJayCee · Jan 15, 2013 at 11:17 AM 2
Share

@Tseng It's relevant to the topic, it helps people and he's not selling anything. It's not spam, he just so happens to have something that helps in the context. So what that he's done it before. He's helped the poster way more than you have so please kindly shut the f. up unless you have something actually constructive to say. Thank you.

Show more comments
avatar image
4

Answer by shuichi_saitoh · Mar 10, 2015 at 04:43 PM

With Unity 5 (free, personal edition), MoviewTexture seems working, although online manual denoted that MovieTexture is "Pro/Advanced only feature" yet, and it seems work only with .ogv (OGG Theora) format file (not working with .mp4, .mov file in my env).

I'm not sure it is defect of the Unity 5 editor, or is spec. but with the following steps the MovieTexture worked in my environment: 1. import .ogv file into unity project 2. drag&drop the .ogv file to a Plane, to assign the movie as the texture. 3. write a script using MovieTexture.Play() method as described in script reference, to play the movie

Comment
Add comment · Show 1 · 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 clunk47 · Mar 10, 2015 at 05:02 PM 1
Share

^Unity 5 ships w/ all the pro features that Unity 4 had, but for free.

avatar image
3

Answer by Jason-H · Mar 31, 2011 at 03:29 PM

If it's a short video, you can render out each frame to an individual texture and cycle through the textures through code at whatever frame rate you need.

Comment
Add comment · Show 3 · 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 DaveA · Mar 31, 2011 at 03:42 PM 1
Share

Sound would need to be handled separately of course

avatar image Jason-H · Mar 31, 2011 at 06:13 PM 0
Share

Yes, good point.

avatar image grojguy · Feb 22, 2013 at 03:26 AM 0
Share

@jasonh - sorry for reply to old thread here, but I was thinking the same thing. Is there a way to use Unity's native Theora video decoder at runtime, grab each frame, and apply to a texture?

avatar image
2

Answer by jonas-echterhoff · Mar 31, 2011 at 03:12 PM

Video support is limited to Unity Pro. If you are targeting the web player, you can show video using other plugins (QuickTime, Flash), and switch between them using JavaScript, though.

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
  • 1
  • 2
  • ›

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

20 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

how can i put button to stop this movie? 2 Answers

how can i play a video from a specific playback position? 0 Answers

MovieTexture will not play in Build - Black Screen 1 Answer

MovieTexture cutscene - performance issues (stuttering) in Unity5 0 Answers

WebGL - Video 6 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