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 Gael51 · May 16, 2012 at 11:54 AM · streamingmovielive

Live streaming with rtsp

Hello,

I have a problem, I want to display a live video in a window but I have no video with the code below. I tried with the example of Unity: http://www.unity3d.com/webplayers/Movie/sample.ogg that works very well.

Have an idea or it is not possible? I have to use another way to use the live streaming?

// My code

//the GUI texture

 private GUITexture videoGUItex;
 
 //the Movie texture
 private MovieTexture mTex;
 //the AudioSource
 private AudioSource movieAS;
 //the movie name inside the resources folder
 public string movieName;

 private string url= "rtsp://my_AdresseIp";
 
 //WWW
 private WWW myWWW;
 
 void Awake()
 {
     
 }

 //On Script Start
 void Start()
 {
     //get the attached GUITexture
     videoGUItex = this.GetComponent<GUITexture>();
     //get the attached AudioSource
     movieAS = this.GetComponent<AudioSource>();

     myWWW = new WWW(url);

     //load the movie texture from the resources folder
     mTex = myWWW.movie; //(MovieTexture)Resources.Load(movieName);
     //set the AudioSource clip to be the same as the movie texture audio clip
     movieAS.clip = mTex.audioClip;
     //anamorphic fullscreen
     videoGUItex.pixelInset = new Rect(Screen.width / 2, -Screen.height / 2, 0, 0);

     //set the videoGUItex.texture to be the same as mTex
     videoGUItex.texture = mTex;
     //Plays the movie
     mTex.Play();
     //plays the audio from the movie
     movieAS.Play(); 
 }
Comment
Add comment · Show 3
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 allen_wyma · Sep 29, 2014 at 05:42 AM 0
Share

Can someone verify this works?

avatar image cornicione · Apr 06, 2016 at 05:14 AM 0
Share

Does www class receive data from RTSP? Have somebody tried that?

avatar image cemozer · Mar 06, 2017 at 10:27 PM 0
Share

Hi @Gael51

I am trying to achieve something very similar. Were you able to solve your problem?

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by nasry05 · Dec 08, 2014 at 05:23 AM

I thought WWW class doesn't receive data from RTSP, only from HTP and HTTP correct me if i am wrong. You can try change the url to some source that uses http://

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
avatar image
0

Answer by Wajdi-azar · Dec 14, 2013 at 03:08 PM

try this one

rtsp://r5---sn-cg07lues.c.youtube.com/CiILENy73wIaGQn57h6aVHewzBMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp

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
avatar image
0

Answer by sholistudios · Sep 22, 2014 at 08:38 AM

Hi, If you are able to hear the audio, but not able to see the video, then, the problem is in this line of your code

 videoGUItex.pixelInset = new Rect(Screen.width / 2, -Screen.height / 2, 0, 0);

The Rect values are set wrongly. It should be

 videoGUItex.pixelInset = new Rect(-Screen.width / 2, -Screen.height / 2, Screen.width, Screen.height);

I hope it helps.

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

10 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

Related Questions

Decode H.264 stream and display in Unity 0 Answers

I am using Ricoh Theta 360 camera with Unity. I want to build an Android app where I can live stream a video from the camera. 0 Answers

Can you stream audio from the web through Unity? 0 Answers

How to display a live streaming video in Unity? 0 Answers

360 cam live streaming questions 0 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