Skip to content
Peter Gusev edited this page May 2, 2015 · 4 revisions

Overview

This project devoted for implementing a custom TouchDesigner TOP based on C++ code which allows to stream any video from Youtube (or any other video-hosting service). The task of streaming video from Youtube is comprised by two independent steps:

  1. Obtain a video URL from the given service URL.

    For example, this Youtube URL https://www.youtube.com/watch?v=C-y70ZOSzE0 (further called a service URL) points to the Youtube page of the video. Howerver, Youtube's player (Flash or HTML5) uses video ID (in this example, it's C-y70ZOSzE0) to retrieve a URL which points to the exact video file on one of Youtube's servers (further called a video URL). For the video above, video URL might look like https://r1---sn-0ja5-a5me.googlevideo.com/videoplayback?source=youtube&mime=video%2Fmp4&itag=22&key=yt5&signature=7AD9F56B0F8180750351048996CAD62029934D83.424FA8D31E1C98F6C8475BEF966DFDC33BA983A6&ratebypass=yes&upn=NxY5zXysV-c&mm=31&pl=21&id=o-APRcK9ohhkw34elhHWFu5_2RbvsQY5xCeTnbu8ursy0e&requiressl=yes&dur=636.667&mt=1425092216&mv=m&fexp=904848%2C905657%2C907263%2C910100%2C927622%2C931390%2C933236%2C934954%2C9406544%2C943917%2C947225%2C947240%2C948124%2C951703%2C952302%2C952605%2C952612%2C952620%2C952901%2C955301%2C957201%2C958501%2C959701&ms=au&ip=101.98.79.18&initcwndbps=6285000&sver=3&ipbits=0&expire=1425113908&sparams=dur%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Cmime%2Cmm%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire (one should remember that video URLs are not static - i.e. video URL for the same video may be different for two different users due to some factors). In other words, requesting a service URL gives an HTML page and requesting a video URL gives an actual video data. Therefore, a conversion service URL => video URL is needed in order to implement video streaming in TouchDesigner. This conversion is implemented by Video URL Parser TouchDesigner component.

  2. Stream video.

    After a video URL is retrieved, the video streaming can start. This task is implemented by a YoutubeTOP (CPlusPlus TOP which employs VLC library for video streaming and processing).

There are several separate TouchDesigner components which can be used independently or tied together:

There is a TouchDesigner patch sample1.toe which demonstrates the use of YouTubeTOP :

sample youtube project

Requirements

  1. TouchDesigner 32-Bit Build 31900 (Commercial or Educational License)
  2. youtube-dl
  3. libVLC (Win32 binaries and headers should be placed on the same level with the project's folder)
  4. Youtube Data API Key if you want to make Youtube Data API requests

Support

The code of this project is provided as open source with the hope that people will contribute back improvements and fixes, and make any derivative works similarly available to the community. There is no official support for this project either (installation, compiling, testing, troubleshooting, etc.). However you may freely contact the author Peter Gusev (peter-at-remap-dot-ucla-dot-edu) with any questions regarding this project.

As for now, there are at least two feature requests for this project:

  • Support 64-bit architecture
  • Audio channel output

License

See LICENSE and LICENSE.LESSER files in the repository for more details.