diff org/capture-video.org @ 0:92f8d83b5d0b

initial import: I've made hearing and vision, and am working on touch.
author Robert McIntyre <rlm@mit.edu>
date Sun, 16 Oct 2011 05:12:19 -0700
parents
children 50c92af2018e
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/org/capture-video.org	Sun Oct 16 05:12:19 2011 -0700
     1.3 @@ -0,0 +1,633 @@
     1.4 +#+title: Capture Live Video Feeds from JMonkeyEngine
     1.5 +#+author: Robert McIntyre
     1.6 +#+email: rlm@mit.edu
     1.7 +#+MATHJAX: align:"left" mathml:t path:"../aurellem/src/MathJax/MathJax.js"
     1.8 +#+STYLE: <link rel="stylesheet" type="text/css" href="../aurellem/src/css/aurellem.css"/>
     1.9 +#+OPTIONS:   H:3 num:t toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
    1.10 +#+BABEL: :exports both :noweb yes :cache no :mkdirp yes
    1.11 +#+description: Capture video from a JMonkeyEngine3 Application with Xuggle, and use gstreamer to compress the video to upload to YouTube.
    1.12 +#+keywords: JME3, video, Xuggle, JMonkeyEngine, youtube, capture video, Java
    1.13 +#+INCLUDE: ../aurellem/src/templates/level-0.org
    1.14 +:PROPERTIES:
    1.15 +:EXPORT_FILE_NAME: ../whatever.html
    1.16 +:END:
    1.17 +
    1.18 +
    1.19 +* The Problem
    1.20 +So you've made your cool new JMonkeyEngine3 game and you want to
    1.21 +create a demo video to show off your hard work. Screen capturing is
    1.22 +the most straightforward way to do this, but it can slow down your
    1.23 +game and produce low-quality video as a result. A better way is to
    1.24 +record a video feed directly from the game while it is
    1.25 +running.
    1.26 +
    1.27 +In this post, I'll explain how you can alter your JMonkeyEngine3 game
    1.28 +to output video while it is running. The main trick is to alter the
    1.29 +pace of JMonkeyEngine3's in-game time: we allow the engine as much
    1.30 +time as it needs to compute complicated in-game events and to encode
    1.31 +video frames. As a result, the game appears to speed up and slow down
    1.32 +as the computational demands shift, but the end result is perfectly
    1.33 +smooth video output at a constant framerate.
    1.34 +
    1.35 +
    1.36 +* Game-time vs. User-time vs. Video-time
    1.37 +
    1.38 +A standard JME3 application that extends =SimpleApplication= or
    1.39 +=Application= tries as hard as it can to keep in sync with
    1.40 +/user-time/.  If a ball is rolling at 1 game-mile per game-hour in the
    1.41 +game, and you wait for one user-hour as measured by the clock on your
    1.42 +wall, then the ball should have traveled exactly one game-mile. In
    1.43 +order to keep sync with the real world, the game throttles its physics
    1.44 +engine and graphics display.  If the computations involved in running
    1.45 +the game are too intense, then the game will first skip frames, then
    1.46 +sacrifice physics accuracy.  If there are particuraly demanding
    1.47 +computations, then you may only get 1 fps, and the ball may tunnel
    1.48 +through the floor or obstacles due to inaccurate physics simulation,
    1.49 +but after the end of one user-hour, that ball will have traveled one
    1.50 +game-mile.
    1.51 +
    1.52 +When we're recording video, we don't care if the game-time syncs with
    1.53 +user-time, but instead whether the time in the recorded video
    1.54 +(video-time) syncs with user-time. To continue the analogy, if we
    1.55 +recorded the ball rolling at 1 game-mile per game-hour and watched the
    1.56 +video later, we would want to see 30 fps video of the ball rolling at
    1.57 +1 video-mile per /user-hour/. It doesn't matter how much user-time it
    1.58 +took to simulate that hour of game-time to make the high-quality
    1.59 +recording.
    1.60 +
    1.61 +* COMMENT Two examples to clarify the point:
    1.62 +** Recording from a Simple Simulation
    1.63 +
    1.64 +*** Without a Special Timer
    1.65 +You have a simulation of a ball rolling on an infinite empty plane at
    1.66 +one game-mile per game-hour, and a really good computer. Normally,
    1.67 +JME3 will throttle the physics engine and graphics display to sync the
    1.68 +game-time with user-time. If it takes one-thousandth of a second
    1.69 +user-time to simulate one-sixtieth of a second game time and another
    1.70 +one-thousandth of a second to draw to the screen, then JME3 will just
    1.71 +sit around for the remainder of $\frac{1}{60} - \frac{2}{1000}$
    1.72 +user-seconds, then calculate the next frame in $\frac{2}{1000}$
    1.73 +user-seconds, then wait, and so on. For every second of user time that
    1.74 +passes, one second of game-time passes, and the game will run at 60
    1.75 +frames per user-second.
    1.76 +
    1.77 +
    1.78 +*** With a Special Timer
    1.79 +Then, you change the game's timer so that user-time will be synced to
    1.80 +video-time. Assume that encoding a single frame takes 0 seconds
    1.81 +user-time to complete.
    1.82 +
    1.83 +Now, JME3 takes advantage of all available resources. It still takes
    1.84 +one-thousandth of a second to calculate a physics tick, and another
    1.85 +one-thousandth to render to the screen. Then it takes 0 seconds to
    1.86 +write the video frame to disk and encode the video. In only one second
    1.87 +of user time, JME3 will complete 500 physics-tick/render/encode-video
    1.88 +cycles, and $\frac{500}{60}=8\frac{1}{3}$ seconds of game-time will
    1.89 +have passed.  Game-time appears to dilate $8\frac{1}{3}\times$ with
    1.90 +respect to user-time, and in only 7.2 minutes user-time, one hour of
    1.91 +video will have been recorded. The game itself will run at 500 fps.
    1.92 +When someone watches the video, they will see 60 frames per
    1.93 +user-second, and $\frac{1}{60}$ video-seconds will pass each frame. It
    1.94 +will take exactly one hour user-time (and one hour video-time) for the
    1.95 +ball in the video to travel one video-mile.
    1.96 +
    1.97 +** Recording from a Complex Simulation 
    1.98 +
    1.99 +*** Without a Special Timer
   1.100 +You have a simulation of a ball rolling on an infinite empty plane at
   1.101 +one game-mile per game-hour accompanied by multiple explosions
   1.102 +involving thousands of nodes, particle effects, and complicated shadow
   1.103 +shaders to create realistic shadows. You also have a slow
   1.104 +laptop. Normally, JME3 must sacrifice rendering and physics simulation
   1.105 +to try to keep up.  If it takes $\frac{1}{120}$ of a user-second to
   1.106 +calculate $\frac{1}{60}$ game-seconds, and an additional
   1.107 +$\frac{1}{60}$ of a user-second to render to screen, then JME3 has
   1.108 +it's work cut out for it.  In order to render to the screen, it will
   1.109 +first step the game forward by up to four physics ticks before
   1.110 +rendering to the screen. If it still isn't fast enough then it will
   1.111 +decrease the accuracy of the physics engine until game-time and user
   1.112 +time are synched or a certain threshold is reached, at which point the
   1.113 +game visibly slows down. In this case, JME3 continuously repeat a
   1.114 +cycle of two physics ticks, and one screen render. For every
   1.115 +user-second that passes, one game-second will pass, but the game will
   1.116 +run at 30 fps instead of 60 fps like before.
   1.117 +
   1.118 +*** With a Special Timer
   1.119 +Then, you change the game's timer so that user-time will be synced to
   1.120 +video-time. Once again, assume video encoding takes $\frac{1}{60}$ of
   1.121 +a user-second.
   1.122 +
   1.123 +Now, JME3 will spend $\frac{1}{120}$ of a user-second to step the
   1.124 +physics tick $\frac{1}{60}$ game-seconds, $\frac{1}{60}$ to draw to
   1.125 +the screen, and an additional $\frac{1}{60}$ to encode the video and
   1.126 +write the frame to disk. This is a total of $\frac{1}{24}$
   1.127 +user-seconds for each $\frac{1}{60}$ game-seconds. It will take
   1.128 +$(\frac{60}{24} = 2.5)$ user-hours to record one game-hour and game-time
   1.129 +will appear to flow two-fifths as fast as user time while the game is
   1.130 +running. However, just as in example one, when all is said and done we
   1.131 +will have an hour long video at 60 fps.
   1.132 +
   1.133 +
   1.134 +* COMMENT proposed names for the new timer
   1.135 +# METRONOME
   1.136 +# IsoTimer
   1.137 +# EvenTimer
   1.138 +# PulseTimer
   1.139 +# FixedTimer
   1.140 +# RigidTimer
   1.141 +# FixedTempo
   1.142 +# RegularTimer
   1.143 +# MetronomeTimer
   1.144 +# ConstantTimer
   1.145 +# SteadyTimer
   1.146 +
   1.147 +
   1.148 +* =IsoTimer= records time like a metronome
   1.149 +
   1.150 +The easiest way to achieve this special timing is to create a new
   1.151 +timer that always reports the same framerate to JME3 every time it is
   1.152 +called.
   1.153 +
   1.154 +
   1.155 +=./jme3/src/core/com/jme3/system/IsoTimer.java=
   1.156 +#+include ./jme3/src/core/com/jme3/system/IsoTimer.java src java
   1.157 +
   1.158 +If an Application uses this =IsoTimer= instead of the normal one, we
   1.159 +can be sure that every call to =simpleUpdate=, for example, corresponds
   1.160 +to exactly $(\frac{1}{fps})$ seconds of game-time.
   1.161 +
   1.162 +In order to facilitate setting the =Timer= in user code, I added
   1.163 +getter and setter methods to =Application.java=.
   1.164 +
   1.165 +In =./jme3/src/core/com/jme3/app/Application.java= I added:
   1.166 +#+include ./jme3/src/core/com/jme3/app/Application.java src java :lines "340-356"
   1.167 +
   1.168 +* Encoding to Video
   1.169 +
   1.170 +Now that the issue of time is solved, we just need a function that
   1.171 +writes each frame to a video.  We can put this function somewhere
   1.172 +where it will be called exactly one per frame.
   1.173 +
   1.174 +JME3 already provides exactly the class we need: the =SceneProcessor=
   1.175 +class can be attached to any viewport and the methods defined therein
   1.176 +will be called at the appropriate points in the rendering process.
   1.177 +
   1.178 +If you want to generate video from Java, a great option is [[http://www.xuggle.com/][Xuggle]]. It
   1.179 +takes care of everything related to video encoding and decoding and
   1.180 +runs on Windows, Linux and Mac.  Out of all the video frameworks for
   1.181 +Java I personally like this one the best.
   1.182 +
   1.183 +Here is a =SceneProcessor= that uses [[http://www.xuggle.com/][Xuggle]] to write each frame to a
   1.184 +video file.
   1.185 +
   1.186 +=./jme3/src/core/com/jme3/app/VideoProcessor.java=
   1.187 +#+include ./jme3/src/core/com/jme3/app/VideoProcessor.java src java
   1.188 +
   1.189 +With this, we are able to record video!
   1.190 +
   1.191 +* Hello Video!
   1.192 +
   1.193 +I've taken [[http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/helloworld/HelloLoop.java][=./jme3/src/test/jme3test/helloworld/HelloLoop.java=]] and
   1.194 +augmented it with video output as follows:
   1.195 +
   1.196 +=./jme3/src/test/jme3test/helloworld/HelloVideo.java=
   1.197 +#+include ./jme3/src/test/jme3test/helloworld/HelloVideo.java src java
   1.198 +
   1.199 +The videos are created in the =hello-video= directory
   1.200 +
   1.201 +#+begin_src sh :results verbatim
   1.202 +du -h hello-video/*
   1.203 +#+end_src
   1.204 +
   1.205 +#+results:
   1.206 +: 932K	hello-video/hello-video-moving.flv
   1.207 +: 640K	hello-video/hello-video-static.flv
   1.208 +
   1.209 +And can be immediately uploaded to youtube
   1.210 +
   1.211 +- [[http://www.youtube.com/watch?v=C8gxVAySaPg][hello-video-moving.flv]]
   1.212 +#+BEGIN_HTML
   1.213 +<iframe width="425" height="349" 
   1.214 +	src="http://www.youtube.com/embed/C8gxVAySaPg" 
   1.215 +	frameborder="0" allowfullscreen>
   1.216 +</iframe>
   1.217 +#+END_HTML
   1.218 +- [[http://www.youtube.com/watch?v=pHcFOtIS07Q][hello-video-static.flv]]
   1.219 +#+BEGIN_HTML
   1.220 +<iframe width="425" height="349" 
   1.221 +	src="http://www.youtube.com/embed/pHcFOtIS07Q" 
   1.222 +	frameborder="0" allowfullscreen>
   1.223 +</iframe>
   1.224 +
   1.225 +#+END_HTML
   1.226 +
   1.227 +  
   1.228 +
   1.229 +* Summary 
   1.230 +It's quite easy to augment your own application to record video,
   1.231 +almost regardless of how complicated the actual application is.  You
   1.232 +can also record from multiple ViewPorts as the above example shows.
   1.233 +
   1.234 +The process for adding video recording to your application is as
   1.235 +follows:
   1.236 +
   1.237 +Assuming you want to record at 30 fps, add:
   1.238 +
   1.239 +#+begin_src java :exports code
   1.240 +this.setTimer(new IsoTimer(30));
   1.241 +#+end_src
   1.242 +
   1.243 +Somewhere in the initialization of your Application.  Right now, you
   1.244 +will have to add the =setTimer= method to =Application=, but hopefully
   1.245 +this method will be included soon by the JMonkeyEngine3 team.
   1.246 +
   1.247 +Then, you create a =VideoProcessor= object and attach it to the
   1.248 +=ViewPort= from which you want to record.
   1.249 +
   1.250 +If you want to record from the game's main =ViewPort= to a file called
   1.251 +=/home/r/record.flv=, then add:
   1.252 +
   1.253 +#+begin_src java :exports code
   1.254 +viewPort.addProcessor(new VideoProcessor(new File("/home/r/record.flv")));
   1.255 +#+end_src
   1.256 +
   1.257 +Do this for each =ViewPort= from which you want to record.  The more
   1.258 +ViewPorts from which you record, the slower the game will run, but
   1.259 +this slowness will not affect the final video output.
   1.260 +
   1.261 +* More Examples
   1.262 +** Hello Physics
   1.263 +=HelloVideo= is boring. Let's add some video capturing to =HelloPhysics=
   1.264 +and create something fun!
   1.265 +
   1.266 +This example is a modified version of =HelloPhysics= that creates four
   1.267 +simultaneous views of the same scene of cannonballs careening into a
   1.268 +brick wall.
   1.269 +
   1.270 +=./jme3/src/test/jme3test/helloworld/HelloPhysicsWithVideo.java=
   1.271 +#+include ./jme3/src/test/jme3test/helloworld/HelloPhysicsWithVideo.java src java
   1.272 +
   1.273 +Running the program outputs four videos into the =./physics-videos=
   1.274 +directory.
   1.275 +
   1.276 +#+begin_src sh :exports both :results verbatim
   1.277 +ls ./physics-videos | grep -
   1.278 +#+end_src
   1.279 +
   1.280 +#+results:
   1.281 +: lower-left.flv
   1.282 +: lower-right.flv
   1.283 +: upper-left.flv
   1.284 +: upper-right.flv
   1.285 +
   1.286 +The videos are fused together with the following =gstreamer= commands:
   1.287 +
   1.288 +#+begin_src sh :results silent
   1.289 +cd physics-videos
   1.290 +
   1.291 +gst-launch-0.10 \
   1.292 + filesrc location=./upper-right.flv ! decodebin ! \
   1.293 + videoscale ! ffmpegcolorspace ! \
   1.294 + video/x-raw-yuv, width=640, height=480, framerate=25/1 ! \
   1.295 + videobox border-alpha=0 left=-640 ! \
   1.296 + videomixer name=mix ! ffmpegcolorspace ! videorate ! \
   1.297 + video/x-raw-yuv, width=1280, height=480, framerate=25/1 ! \
   1.298 + jpegenc ! avimux  ! filesink location=upper.flv \
   1.299 + \
   1.300 + filesrc location=./upper-left.flv ! decodebin ! \
   1.301 + videoscale ! ffmpegcolorspace ! \
   1.302 + video/x-raw-yuv, width=640, height=480, framerate=25/1 ! \
   1.303 + videobox right=-640 ! mix.
   1.304 +#+end_src
   1.305 +
   1.306 +#+begin_src sh :results silent
   1.307 +cd physics-videos
   1.308 +
   1.309 +gst-launch-0.10 \
   1.310 + filesrc location=./lower-left.flv ! decodebin ! \
   1.311 + videoscale ! ffmpegcolorspace ! \
   1.312 + video/x-raw-yuv, width=640, height=480, framerate=25/1 ! \
   1.313 + videobox border-alpha=0 left=-640 ! \
   1.314 + videomixer name=mix ! ffmpegcolorspace ! videorate ! \
   1.315 + video/x-raw-yuv, width=1280, height=480, framerate=25/1 ! \
   1.316 + jpegenc ! avimux  ! filesink location=lower.flv \
   1.317 + \
   1.318 + filesrc location=./lower-right.flv ! decodebin ! \
   1.319 + videoscale ! ffmpegcolorspace ! \
   1.320 + video/x-raw-yuv, width=640, height=480, framerate=25/1 ! \
   1.321 + videobox right=-640 ! mix.
   1.322 +#+end_src
   1.323 +
   1.324 +#+begin_src sh :results silent
   1.325 +cd physics-videos
   1.326 +
   1.327 +gst-launch-0.10 \
   1.328 + filesrc location=./upper.flv ! decodebin ! \
   1.329 + videoscale ! ffmpegcolorspace ! \
   1.330 + video/x-raw-yuv, width=1280, height=480, framerate=25/1 ! \
   1.331 + videobox border-alpha=0 bottom=-480 ! \
   1.332 + videomixer name=mix ! ffmpegcolorspace ! videorate ! \
   1.333 + video/x-raw-yuv, width=1280, height=960, framerate=25/1 ! \
   1.334 + jpegenc ! avimux  ! filesink location=../youtube/helloPhysics.flv \
   1.335 + \
   1.336 + filesrc location=./lower.flv ! decodebin ! \
   1.337 + videoscale ! ffmpegcolorspace ! \
   1.338 + video/x-raw-yuv, width=1280, height=480, framerate=25/1 ! \
   1.339 + videobox top=-480 ! mix.
   1.340 +#+end_src
   1.341 +
   1.342 +#+begin_src sh :results verbatim
   1.343 +du -h youtube/helloPhysics.flv
   1.344 +#+end_src
   1.345 +
   1.346 +#+results:
   1.347 +: 180M	physics-videos/helloPhysics.flv
   1.348 +
   1.349 +
   1.350 +Thats a terribly large size!
   1.351 +Let's compress it:
   1.352 +
   1.353 +** Compressing the HelloPhysics Video
   1.354 +First, we'll scale the video, then, we'll decrease it's bitrate. The
   1.355 +end result will be perfect for upload to YouTube.
   1.356 +
   1.357 +#+begin_src sh :results silent
   1.358 +cd youtube
   1.359 +
   1.360 +gst-launch-0.10 \
   1.361 + filesrc location=./helloPhysics.flv ! decodebin ! \
   1.362 + videoscale ! ffmpegcolorspace ! \
   1.363 + `: # the original size is 1280 by 960` \
   1.364 + video/x-raw-yuv, width=1280, height=960, framerate=25/1 ! \
   1.365 + videoscale ! \
   1.366 + `: # here we scale the video down` \
   1.367 + video/x-raw-yuv, width=640, height=480, framerate=25/1 ! \
   1.368 + `: # and here we limit the bitrate` \
   1.369 + theoraenc bitrate=1024 quality=30 ! \
   1.370 + oggmux ! progressreport update-freq=1 ! \
   1.371 + filesink location=./helloPhysics.ogg 
   1.372 +#+end_src
   1.373 +
   1.374 +#+begin_src sh :results verbatim
   1.375 +du -h youtube/helloPhysics.ogg
   1.376 +#+end_src
   1.377 +
   1.378 +#+results:
   1.379 +: 13M	youtube/helloPhysics.ogg
   1.380 +
   1.381 +[[http://www.youtube.com/watch?v=WIJt9aRGusc][helloPhysics.ogg]]
   1.382 +
   1.383 +#+begin_html
   1.384 +<iframe width="425" height="349" 
   1.385 +	src="http://www.youtube.com/embed/WIJt9aRGusc?hl=en&fs=1" 
   1.386 +	frameborder="0" allowfullscreen>
   1.387 +</iframe>
   1.388 +#+end_html
   1.389 +
   1.390 +
   1.391 +** COMMENT failed attempts
   1.392 +Let's try the [[http://diracvideo.org/][Dirac]] video encoder.
   1.393 +
   1.394 +#+begin_src sh :results verbatim
   1.395 +cd youtube
   1.396 +START=$(date +%s) 
   1.397 +gst-launch-0.10 \
   1.398 + filesrc location=./helloPhysics.flv ! decodebin ! \
   1.399 + videoscale ! ffmpegcolorspace ! \
   1.400 + video/x-raw-yuv, width=1280, height=960, framerate=25/1 ! \
   1.401 + schroenc ! filesink location=./helloPhysics.drc > /dev/null
   1.402 +echo `expr $(( $(date +%s) - $START))`
   1.403 +#+end_src
   1.404 +
   1.405 +
   1.406 +#+results:
   1.407 +: 142
   1.408 +
   1.409 +That took 142 seconds. Let's see how it does compression-wise:
   1.410 +
   1.411 +#+begin_src sh :results verbatim
   1.412 +du -h ./youtube/helloPhysics.drc
   1.413 +#+end_src
   1.414 +
   1.415 +#+results:
   1.416 +: 22M	./physics-videos/helloPhysics.drc
   1.417 +
   1.418 +
   1.419 +#+begin_src sh :results verbatim
   1.420 +cd youtube
   1.421 +START=$(date +%s) 
   1.422 +gst-launch-0.10 \
   1.423 + filesrc location=./helloPhysics.flv ! decodebin ! \
   1.424 + videoscale ! ffmpegcolorspace ! \
   1.425 + video/x-raw-yuv, width=1280, height=960, framerate=25/1 ! \
   1.426 + theoraenc ! oggmux ! filesink location=./helloPhysics.ogg \
   1.427 + > /dev/null
   1.428 +echo `expr $(( $(date +%s) - $START))`
   1.429 +#+end_src
   1.430 +
   1.431 +#+results:
   1.432 +: 123
   1.433 +
   1.434 +#+begin_src sh :results verbatim
   1.435 +du -h youtube/helloPhysics.ogg
   1.436 +#+end_src
   1.437 +
   1.438 +#+results:
   1.439 +: 59M	physics-videos/helloPhysics.ogg
   1.440 +
   1.441 +
   1.442 +=*.drc= files can not be uploaded to YouTube, so I'll go for the
   1.443 +avi file.
   1.444 +
   1.445 +
   1.446 +** COMMENT text for videos
   1.447 +Video output from JMonkeyEngine3 (www.jmonkeyengine.org/) using Xuggle
   1.448 +(www.xuggle.com/).  Everything is explained at
   1.449 +http://aurellem.org/cortex/capture-video.html.
   1.450 +
   1.451 +
   1.452 +Video output from JMonkeyEngine3 (www.jmonkeyengine.org/) HelloPhysics
   1.453 +demo application using Xuggle (www.xuggle.com/).  Everything is
   1.454 +explained at http://aurellem.org/cortex/capture-video.html.  Here,
   1.455 +four points of view are simultaneously recorded and then glued
   1.456 +together later.
   1.457 +
   1.458 + JME3 Xuggle Aurellem video capture
   1.459 + 
   1.460 + 
   1.461 +* Sample Videos
   1.462 +I encoded most of the original JME3 Hello demos for your viewing
   1.463 +pleasure, all using the =VideoProcessor= and =IsoTimer= classes.
   1.464 +
   1.465 +** HelloTerrain
   1.466 +[[http://youtu.be/5_4wyDFwrVQ][HelloTerrain.avi]]
   1.467 +
   1.468 +#+begin_html
   1.469 +<iframe width="425" height="349" 
   1.470 +	src="http://www.youtube.com/embed/5_4wyDFwrVQ" 
   1.471 +	frameborder="0" allowfullscreen>
   1.472 +</iframe>
   1.473 +#+end_html
   1.474 +
   1.475 +** HelloAssets
   1.476 +[[http://www.youtube.com/watch?v=oGg-Q6k1BM4][HelloAssets.avi]]
   1.477 +
   1.478 +#+begin_html
   1.479 +<iframe width="425" height="349" 
   1.480 +	src="http://www.youtube.com/embed/oGg-Q6k1BM4?hl=en&fs=1" 
   1.481 +	frameborder="0" allowfullscreen>
   1.482 +</iframe>
   1.483 +#+end_html
   1.484 +
   1.485 +** HelloEffects
   1.486 +[[http://www.youtube.com/watch?v=TuxlLMe53hA][HelloEffects]]
   1.487 +
   1.488 +#+begin_html
   1.489 +<iframe width="425" height="349" 
   1.490 +	src="http://www.youtube.com/embed/TuxlLMe53hA?hl=en&fs=1" 
   1.491 +	frameborder="0" allowfullscreen>
   1.492 +</iframe>
   1.493 +#+end_html
   1.494 +
   1.495 +** HelloCollision
   1.496 +[[http://www.youtube.com/watch?v=GPlvJkiZfFw][HelloCollision.avi]]
   1.497 +
   1.498 +#+begin_html
   1.499 +<iframe width="425" height="349" 
   1.500 +	src="http://www.youtube.com/embed/GPlvJkiZfFw?hl=en&fs=1" 
   1.501 +	frameborder="0" allowfullscreen>
   1.502 +</iframe>
   1.503 +#+end_html
   1.504 +
   1.505 +** HelloAnimation
   1.506 +[[http://www.youtube.com/watch?v=SDCfOSPYUkg][HelloAnimation.avi]]
   1.507 +
   1.508 +#+begin_html
   1.509 +<iframe width="425" height="349" 
   1.510 +	src="http://www.youtube.com/embed/SDCfOSPYUkg?hl=en&fs=1" 
   1.511 +	frameborder="0" allowfullscreen>
   1.512 +</iframe>
   1.513 +#+end_html
   1.514 +
   1.515 +** HelloNode
   1.516 +[[http://www.youtube.com/watch?v=pL-0fR0-ilQ][HelloNode.avi]]
   1.517 +
   1.518 +#+begin_html
   1.519 +<iframe width="425" height="349" 
   1.520 +	src="http://www.youtube.com/embed/pL-0fR0-ilQ?hl=en&fs=1" 
   1.521 +	frameborder="0" allowfullscreen>
   1.522 +</iframe>
   1.523 +#+end_html
   1.524 +
   1.525 +** HelloLoop
   1.526 +[[http://www.youtube.com/watch?v=mosZzzcdE5w][HelloLoop.avi]]
   1.527 +
   1.528 +#+begin_html
   1.529 +<iframe width="425" height="349" 
   1.530 +	src="http://www.youtube.com/embed/mosZzzcdE5w?hl=en&fs=1" 
   1.531 +	frameborder="0" allowfullscreen>
   1.532 +</iframe>
   1.533 +#+end_html
   1.534 +
   1.535 +
   1.536 +*** COMMENT x-form the other stupid 
   1.537 +progressreport update-freq=1 
   1.538 +
   1.539 +gst-launch-0.10 \
   1.540 + filesrc location=./helloPhy ! decodebin ! \
   1.541 + videoscale ! ffmpegcolorspace ! \
   1.542 + video/x-raw-yuv, width=1280, height=960, framerate=25/1 ! \
   1.543 + x264enc ! avimux ! filesink location=helloPhysics.avi \
   1.544 +
   1.545 +
   1.546 +gst-launch-0.10 \
   1.547 + filesrc location=./HelloAnimationStatic.flv ! decodebin ! \
   1.548 + videoscale ! ffmpegcolorspace ! \
   1.549 + video/x-raw-yuv, width=640, height=480, framerate=25/1 ! \
   1.550 + videobox border-alpha=0 left=-640 ! \
   1.551 + videomixer name=mix ! ffmpegcolorspace ! videorate ! \
   1.552 + video/x-raw-yuv, width=1280, height=480, framerate=25/1 ! \
   1.553 +  x264enc ! avimux ! progressreport update-freq=1 ! \
   1.554 +  filesink location=../youtube/HelloAnimation.avi \
   1.555 + \
   1.556 + filesrc location=./HelloAnimationMotion.flv ! decodebin ! \
   1.557 + videoscale ! ffmpegcolorspace ! \
   1.558 + video/x-raw-yuv, width=640, height=480, framerate=25/1 ! \
   1.559 + videobox right=-640 ! mix.
   1.560 +
   1.561 +gst-launch-0.10 \
   1.562 + filesrc location=./HelloCollisionMotion.flv ! decodebin ! \
   1.563 + videoscale ! ffmpegcolorspace ! \
   1.564 + video/x-raw-yuv, width=800, height=600, framerate=25/1 ! \
   1.565 + x264enc bitrate=1024 ! avimux ! \
   1.566 + filesink location=../youtube/HelloCollision.avi 
   1.567 +
   1.568 +gst-launch-0.10 \
   1.569 + filesrc location=./HelloEffectsStatic.flv ! decodebin ! \
   1.570 + videoscale ! ffmpegcolorspace ! \
   1.571 + video/x-raw-yuv, width=640, height=480, framerate=25/1 ! \
   1.572 + videobox border-alpha=0 left=-640 ! \
   1.573 + videomixer name=mix ! ffmpegcolorspace ! videorate ! \
   1.574 + video/x-raw-yuv, width=1280, height=480, framerate=25/1 ! \
   1.575 +  x264enc bitrate=1024 ! avimux ! progressreport update-freq=1 ! \
   1.576 +  filesink location=../youtube/HelloEffects.avi \
   1.577 + \
   1.578 + filesrc location=./HelloEffectsMotion.flv ! decodebin ! \
   1.579 + videoscale ! ffmpegcolorspace ! \
   1.580 + video/x-raw-yuv, width=640, height=480, framerate=25/1 ! \
   1.581 + videobox right=-640 ! mix.
   1.582 +
   1.583 +gst-launch-0.10 \
   1.584 + filesrc location=./HelloTerrainMotion.flv ! decodebin ! \
   1.585 + videoscale ! ffmpegcolorspace ! \
   1.586 + video/x-raw-yuv, width=800, height=600, framerate=25/1 ! \
   1.587 + x264enc bitrate=1024 ! avimux ! \
   1.588 + filesink location=../youtube/HelloTerrain.avi 
   1.589 +
   1.590 +
   1.591 +gst-launch-0.10 \
   1.592 + filesrc location=./HelloAssetsStatic.flv ! decodebin ! \
   1.593 + videoscale ! ffmpegcolorspace ! \
   1.594 + video/x-raw-yuv, width=640, height=480, framerate=25/1 ! \
   1.595 + videobox border-alpha=0 left=-640 ! \
   1.596 + videomixer name=mix ! ffmpegcolorspace ! videorate ! \
   1.597 + video/x-raw-yuv, width=1280, height=480, framerate=25/1 ! \
   1.598 +  x264enc bitrate=1024 ! avimux ! progressreport update-freq=1 ! \
   1.599 +  filesink location=../youtube/HelloAssets.avi \
   1.600 + \
   1.601 + filesrc location=./HelloAssetsMotion.flv ! decodebin ! \
   1.602 + videoscale ! ffmpegcolorspace ! \
   1.603 + video/x-raw-yuv, width=640, height=480, framerate=25/1 ! \
   1.604 + videobox right=-640 ! mix.
   1.605 +
   1.606 +
   1.607 +gst-launch-0.10 \
   1.608 + filesrc location=./HelloNodeStatic.flv ! decodebin ! \
   1.609 + videoscale ! ffmpegcolorspace ! \
   1.610 + video/x-raw-yuv, width=640, height=480, framerate=25/1 ! \
   1.611 + videobox border-alpha=0 left=-640 ! \
   1.612 + videomixer name=mix ! ffmpegcolorspace ! videorate ! \
   1.613 + video/x-raw-yuv, width=1280, height=480, framerate=25/1 ! \
   1.614 +  x264enc bitrate=1024 ! avimux ! progressreport update-freq=1 ! \
   1.615 +  filesink location=../youtube/HelloNode.avi \
   1.616 + \
   1.617 + filesrc location=./HelloNodeMotion.flv ! decodebin ! \
   1.618 + videoscale ! ffmpegcolorspace ! \
   1.619 + video/x-raw-yuv, width=640, height=480, framerate=25/1 ! \
   1.620 + videobox right=-640 ! mix.
   1.621 +
   1.622 +gst-launch-0.10 \
   1.623 + filesrc location=./HelloLoopStatic.flv ! decodebin ! \
   1.624 + videoscale ! ffmpegcolorspace ! \
   1.625 + video/x-raw-yuv, width=640, height=480, framerate=25/1 ! \
   1.626 + videobox border-alpha=0 left=-640 ! \
   1.627 + videomixer name=mix ! ffmpegcolorspace ! videorate ! \
   1.628 + video/x-raw-yuv, width=1280, height=480, framerate=25/1 ! \
   1.629 +  x264enc bitrate=1024 ! avimux ! progressreport update-freq=1 ! \
   1.630 +  filesink location=../youtube/HelloLoop.avi \
   1.631 + \
   1.632 + filesrc location=./HelloLoopMotion.flv ! decodebin ! \
   1.633 + videoscale ! ffmpegcolorspace ! \
   1.634 + video/x-raw-yuv, width=640, height=480, framerate=25/1 ! \
   1.635 + videobox right=-640 ! mix.
   1.636 +