Sunday, September 9, 2018

Making Movies - Video

So here we are. The HD Video System and RemVision are both capable of displaying an animated picture over several prims, from 1 to 25, allowing for long clips, much longer than what we can expect from a single prim. Think of those animated pictures as those animated GIFs you see on the internet. The best ones are smooth, have a good resolution and loop well, as in the break when we reach the end of the GIF and return to the beginning to play it again right away is barely noticeable, if at all.

This is the goal here too. Have a character play an animation (or engage two characters in a couple animation, or three characters... you get the idea), film the whole animation (or the two or three animations) with a capture software, then process the video with a special script to make it a video that the HD Video System and RemVision can display.

If this sounds complicated, that's because it is. Fortunately, I've done all the heavy lifting for you. All you have to do is point, shoot, cut, run a script then upload (and pay the price for the upload, which is L$10 per image so a single video can potentially cost you L$250 if you use 25 prims to display it, but I personally limit myself to 16 most of the time, which is enough to display a 30-second looped animation with enough resolution and smoothness).

In this tutorial, unlike the ones before it, I'm going to be very technical and explain from A to Z how to take a video, how to process it, how to check its integrity and what the result will be.

Please note that if you are not interested in taking your own videos in SL but rather in uploading existing videos from the internet to SL, there is another tutorial that is more suited for you (but parts of it link straight back here because there are some subjects it does not explain, and that are explained here instead, so you'll do a bit of back-and-forth).



Setting up the tools

First of all, you need tools to shoot more than one picture on your viewer. Before I go further, let me show you the list of tools you need and where to download them. They all are open-source, free, well-known and reliable :

- Python 2 or 3 to execute the scripts.

- VirtualDub to process videos (make sure to grab the 64-bit one).

- Xvid codec to compress the AVI files created by VirtualDub

- ImageMagick to process images. (the old link does not seem to work anymore, thanks Heidi Solo for the heads up). Make sure to tick the "Install Legacy Components" checkbox otherwise it won't install convert.exe and montage.exe, and you need those programs to process videos into textures.

- ShnTool to process sounds. (the old link does not seem to work anymore, thanks Heidi Solo for the heads up)

- AviToTextures.py to process videos into textures ready to upload to SL.

- HdTextureToSdTextures.py to cut a big picture into several smaller ones, ready to upload to SL.

- WavToSounds.py to turn a long sound or music into chunks of 10-second-long WAV files, ready to upload to SL.

- RenameWithDim.py to automatically rename all the JPG and PNG files in a folder with their dimensions. This is just for convenience so you don't have to do it all by hand.

- CreateTrack.py to automatically create a text file with a sample track from the files contained into the folder. This is just for convenience so you don't have to do it all by hand.

Don't be put off by this list of tools, I know it sounds geeky and if you don't have any technical knowledge it might sound like a difficult task but don't worry, those tools are there to help you and won't get in the way. Simply download and install them with the default parameters and you'll be fine. Just please make sure to install VirtualDub, ImageMagick and ShnTool in folders that do not have spaces in their names. You'll thank me later.

Also if you don't plan to use sounds, you won't need ShnTool at all, since it is used for cutting music into 10-second chunks in order to upload them to SL. Same thing for WavToSounds.py, and this tutorial won't cover HdTextureToSdTextures.py since it is about making videos, not HD pictures, so you don't need to use those two scripts either.

I used to use VirtualDub's built-in "Capture mode" which worked very well... until my laptop fried and I had to buy a new computer with Windows 10 and a new video card. Since then, VirtualDub stubbornly refused to let me use its capture mode again so I had to buy a License for Debut, another video capture software. It is not free (well it is for the first few days but then you have to pay) but the license is not expensive, like $30 or so. I also tried Bandicam which is good but I think its license is more expensive so I chose Debut after some debating and I'm not regretting my choice. Same thing for FRAPS.

There are other video capture software, like the free CamStudio that I used to use at work a decade ago. It works not too bad but it wants to install a lot of spyware along with it, so don't let it do that. If you really want to use it, follow this page to know how to install CamStudio in a clean way, avoiding all the shady stuff that comes with it. I did that once and was not infected with any malware, as CamStudio itself is clean.

Frankly, if VirtualDub's capture mode works for you, stick to it. It's free and easy to use and has no malware in it.

Since I'm talking about VirtualDub, this software will not only serve as the capture tool (if you can) but also as the convert tool (after you've trimmed the parts of the video you don't want) and as the process tool that will cut the video into squares that will later be processed by ImageMagick. It's there the whole time. I use VirtualDub 1.10.4 as well as the Xvid codec which is necessary for saving AVI files without eating all your hard drive space. When you have installed Xvid, run VirtualDub and go to Video > Compression..., choose "Xvid MPEG-4 Codec" and press "OK".



Once done, you want to add a filter to whatever video you will open with VirtualDub, that filter will simply trim the borders of the image so you only see what you are supposed to film.

To do this, go to Video > Filters...


Click "Add".


Then locate "Null transform" and press "OK".


Now that it is added, click on the "Null transform" filter on the previous window and press "Cropping...".


Enter the following numbers : X1=553, X2=553,   Y1=139, Y2=87 (type "553", press TAB, "553", TAB, "139, TAB, "87") and press "OK" twice.


Now you're set, any video you load into VirtualDub (until you quit it) will be trimmed the way you want. Please note that the numbers I gave you work well for a 1920x1440 monitor with a SL viewer maximized, it lets you take 800x800 videos. You may want to test with different numbers but those are the ones that work for me.

And why do they work for me ? Because they match a simple HUD I've made that hides all my view except the area that will be taken on the video :


With this HUD on, I know exactly what I will see on the video. The rest is blackened almost opaque. This HUD also hides the name tags from the view so I don't see "Marine" over my head on the video, that would be silly. This HUD is available for free in a box at my shop so you don't need to make your own.

It is important that the video is square because it will be cut into squares by the processing script further down the line. It could in fact be rectangular and I think this would work (I did not actually test that) but it would certainly stretch each frame and look bad in the final textures, where every pixel (or more exactly texel) counts.



Taking a video

Now that whatever video capture tool you'll use is ready, you can start taking a video. There can be a number of differences between your setup and mine, for example the number of monitors you use and their resolution. I move my viewer to my 1920 monitor to get more FPS (frames per second) while Debut is on my 4k monitor, and it is configured to capture a specific area on the smaller monitor (-2880, 917 ; 2880, 1620, those are the numbers that work for me and represent the full screen on monitor 2 which is the smaller one). Of course if you use another video capture tool, it may be configured differently.

In a nutshell, here is what will happen. You will start the video capture mode with a key press and the video capture tool will capture the whole screen where your SL viewer is located. Let it capture what you want to capture, then when you're done you will press another key to end the capture. Depending on the tool you use, it will either save the video directly where you want or keep it in memory until you save it manually.

Since you have captured the whole screen while wearing the video frame HUD, only the area in the middle will not be blackened and that's the part that will be part of your video after trimming it with VirtualDub.

I'll lead you through the whole process, from video capture to processing the video into textures.

First, let me take a video of me doing a silly dance. I don't exactly know how long that dance animation lasts, probably 30 seconds, and my goal is to take it in a video that will be looped as well. In other words, the video will have to be exactly as long, to the frame, as the animation.

The very first thing to do is check the background, the scene where the video will take place. In particular, you want nothing else to move or change lighting or appearance in any way. This includes choosing a fixed Windlight setting so the sun does not move while the video is shooting. Here I'll be in a bedroom with no moving parts and no change in lighting :


Zoom level is 2 because I'm taking myself full-length, but I'll move the camera later to make sure the whole dance is properly focused and I don't move out of the frame.

Next I wear the video frame HUD and start the animation to make sure I'm centered correctly in the video. I let the animation run a few times to make sure I do not go out of frame too much (some dances make you move around a lot but this one does not). I also want to shoot with the camera a bit low, lower than the crotch, to exaggerate the length of my legs. While the animation plays, I familiarize myself with its noticeable parts and for any break that would give away the moment when it ends (this one has no such break).


Don't mind how the text on my Sublimator looks, this is due to me having dragged my viewer from my 4k monitor to my other one, which resizes it and changes the font size at the same time.

I must also check that nothing crosses the dashed line of the black HUD, including whatever window is open in the viewer (I did not let them show in this snapshot but there are a few windows and menus visible as well on the video).

There's another thing I change when I take a video, I don't want to let the viewer notify me when a friend logs on or off. My inventory is so big that whenever such a notification occurs, there's a micro-freeze and I don't want that to happen in the video, so I go to the Preferences, Notification tab and turn off "When my friends log in or out" :



Now we are finally ready to take the video ! Animations in Second Life are normally no longer than 30 seconds, but I have seen some taking longer than that. Maybe we can do 60 seconds now but I haven't seen any yet. Let's assume this dance is no more than 30 seconds long. What we want is a looped video of this dance without any break so we need at least 30 seconds of footage, of course. However, to err on the safe side I usually shoot two or three times the estimated duration of an animation because the recording FPS and the rendering FPS are different so frames are not always smoothly recorded, there may be freezes and jumps which complicate the task of finding good looping points later (you'll see what I mean below).

For now, let's record.



This is the raw video (converted to FLV for the blog post but the original is in AVI format and a lot more crisp, see below for the link). It lasts 1:11 to be sure the dance animation plays at least twice, assuming it is no more than 30 seconds long. Don't mind my Winamp bar playing over the viewer window, I wanted to keep the location and L$ balance hidden. Notice there is no name tag over my head, this is due to the black video frame HUD using a RLV command to do that. It's much quicker than to turn the name tags off in the preferences every time you want to shoot a video.

For the rest of this tutorial, I will demonstrate how to cut and process this video so I recommend you download the original file from my dropbox (it is zipped but it doesn't make a big difference in size). That way you can do the same steps yourself, which is the best way to learn.

There are few things to say about this video. First, the dance makes me move around a lot and most of the time I simply tap my feet on the floor. But there are a few noticeable moments when I move my arms above my head, for example. Those landmarks are what we'll use to make sure to loop properly.

Now that the raw video is taken, let's process it.



Processing a video (step 1)

There are two steps to process a video. The first step is to cut the parts you don't want while trimming the areas of the screen that are blackened by the HUD at the same time (the trimming is done automatically by the Null Transform filter you've added earlier in VirtualDub, but the cutting is done manually by you), and the second step is to run the resulting video through the "AviToTextures" Python script. The result is a set of textures that you will upload into SL and put in your tape for the VHS player and/or RemVision to play as an animated picture.

First, you need to cut and trim the raw video. Load it into VirtualDub (it should already be open if you have already added the Null Transform filter), you should see something like this :


The left part is the current frame in the raw video in input, the right part is the same frame but gone through the filters (here there is only one filter, "Null Transform", which crops the input frame into something smaller). This is the output you'll get. Notice how all the black parts including the HUDs are not part of the output, only what's inside the video frame is kept. This is the reason for the numbers in the Null Transform filter, and the size of the video frame HUD itself.

The bottom part is the scrubber and the entire length of the video, numbered in frames.

This is where the creative part takes place. First, we need to find a noticeable frame where the movement of the body is slow, practically immobile. The best candidates are when the arms and/or the body change direction. From my experience I know that it is best to select a frame where the body is in a tense position, ready to expand. In this dance, that means when the body is the lowest and is about to spring back up. For example, this frame 62 here :


This frame is a good candidate because the arms are up (which is not the case during most of the dance so this position is easy to recognize) and the body is down, ready to change direction so it moves slowly. Let's mark it down with the "Home" key to set it to be the beginning of our selection.

Now we scrub the video until we stumble on the next moment where my arms are up like that, after having played the whole animation exactly once. Playing with the scrubber a little, watching myself dance until I finally turn around and move my arms up again like the first time, signalling that I'm close to reaching the same position as before, I find that frame 826 matches well with frame 62, so I mark it down with the "End" key to set it to be the end of the selection. Notice that there are 25.5 seconds separating the two frames, because frame 62 is 2.067 s in the video and frame 826 is 27.533 s in, meaning the animation itself is very close to taking 25.5 seconds in time. It is not far off my 30 seconds estimate.

 

To compare both frames, use the "[" and "]" keys to switch back and forth between the first and last frame of the selection. In this video, while doing that notice that both positions are very close to each other, but not exactly, there is a slight movement of the right leg. Honestly I could be satisfied with this but I prefer two exactly identical frames, so let's keep searching. But before changing frame, let's ask ourselves, why are the two frames not exactly the same ?

This is because the recording rate (30 FPS, set in Debut) and the rendering rate (which varies, the SL viewer does not have a fixed rendering rate, but in my case, on this 1920 monitor and in this skybox wearing these clothes, my rendering rate is around 80 FPS average) are different and not a multiple of each other. This means that since the recording rate is so much lower than the rendering rate, there are frames that are not recorded. This is the case here, the frame we want has not been recorded as the viewer goes too fast for the recorder. It used to be the other way around on my laptop which was less powerful, the recording rate (30 FPS there too, set in VirtualDub back then) was higher than the rendering rate which was around 20 FPS, sometimes less, so I had a lot of repeated frames in the video.

Anyway, now we know the theory, but what do we do about it ? We need to choose other frames. It just so happens that moving one frame to the right both the beginning and the end of the selection works a lot better, so we choose frames 63 and 827 instead of 62 and 826. The duration is the same but those two frames are a lot more identical so the loop will be a lot more seamless.


That's it, the creative part is done, now what's left is the straightforward, automatic processing. We're going to cut and save the video now. Go to "Edit", select "Crop to Selection"


We get this, a video with exactly 764 frames (it begins at frame 0 but frame 764 is grey, the last frame is always grey) :


Save it to AVI by pressing F7 or going to "File" > "Save as AVI..." :


If you have correctly installed and selected the Xvid codec in the Video > Compression menu, you should get a file that is a lot smaller than the original one. Firstly because it is less than half as long, and secondly because it is not the same compression. Raw AVI are big, Xvid makes AVI files that are a lot smaller. In my case, I get a 4.55 MB file, compared to the initial 36.0 MB file. You can download it here if you want to work on processing an already cut video instead of cutting it yourself. You can notice while playing that video that there is no break when it comes to its end and loops, you don't notice it unless you look at the timeline of the video in whatever player you use (Windows Video Player, VLC or anything you want).



Processing a video (step 2)

Now, all that is left is to process it, which means making textures out of it. There are a few choices that are up to you and they basically revolve around choosing between smoothness and resolution, or making a compromise to get something in-between.

First, you want to make sure that the "AviToTextures.py" file is correctly configured. Open it in a text editor like Notepad, Notepad++, SCite or whatever your favorite editor is and locate these lines, near the beginning of the file :



I have taken the habit of installing my programs in D:\Apps\ instead of C:\Program Files because I try not to put anything of value on the C: drive, should I need to reinstall Windows at some point (I'm old school, coming from a background when we had to reinstall Windows 95 and 98 often, and kept that habit ever since). Chances are you have installed VirtualDub and ImageMagick in different places than me, so you need to change the paths as well. Please install the two tools in a folder without spaces in it, it confuses Python big time. Simply modify the lines 26 and 32, replacing the "D:\Apps" part with the place you have installed your tools.

Save and close the file, you won't need to edit it anymore.

It is a good idea to copy the AviToTextures.py file where your video is, so you don't have to write the whole path to it (normally Python has added its own path to the system Path variable of your Windows upon installation so you don't need to worry about that). I'll assume that this is what you do here.

Open a command prompt (type "cmd" from the Windows Start menu) and go to the folder you have both the AviToTextures.py script and the cut video. For the sake of this tutorial, let's assume that folder is in D:\Video, so type :

D:
cd \Video

Once in the right folder, type dir to make sure you are in the right folder (aka directory) you should see both the video and the script in the list.


Now, before you run the script, you must know a few things :

- How many FPS did you set your video capture tool to. My Debut is set to 30 FPS but your setting might be different. The video I am using for this tutorial was shot at 30 FPS, so that's the number we'll use.

- What is the number of the last relevant frame in the cut video. You can find this out by opening the cut video in VirtualDub and looking at the last number on the right of the timeline. In the video we are working on right now, the last number is 764, this is the number you seek... except that this is a grey frame, an empty one. The number you want is actually one unit lower, i.e. 763.

Then, you must determine whether you want more resolution or more smoothness, or something in the middle. Before I explain that one, let's just run the script once.

For this test we are going to run the script with "naive" parameters. Let's say you only want one texture (because you know you will have to upload it afterwards and you don't want to spend too much money on this), with as much smoothness as you can, i.e. 30 FPS. Therefore you write :

python AviToTextures.py "Video 206 cut" 30 1 *

The first parameter is the name of the video, here "Video 206 cut.avi", which must be written between quotes since there are spaces in the name.

The "30" part is simply the frame rate with which you recorded your video, it doesn't change unless you change that setting in your video capture tool. You can get this information either by right-clicking on the file in your explorer and looking at the "Frame Rate" field in the "Details" tab, or by adding the "Frame Rate" column in the Details view of the explorer window.

The "1" parameter means "1x1 texture". You can set it to 2, 3, 4 or 5, generating 4, 9, 16 or 25 textures respectively, giving you much more resolution. That's what makes a video "HD".

And the "*" at the end means "reduce the number of frames to the greatest square number below 764". You could have written any number between 1 and 764 to force VirtualDub to decimate to that number, or a decimal number between 0 and 1 (both excluded) to indicate a factor, for example 0.25 to tell VirtualDub to remove 3 out of 4 frames. The smaller the number the lower the FPS, but also the bigger the output resolution. Everything is a matter of compromise.

The last two parameters are optional, if the frame rate is omitted it will take 10.0 by default (but I don't recommend you omit that parameter) and if the last parameter is omitted it will take the number of frames by default, i.e. it won't decimate at all and you won't drop any frame.

In fact, the number of columns is also optional, if you omit it, the script will determine the lowest number that allows for an acceptable output quality (around 55% average).

The output of the script on the command prompt looks like this :

File              : Video 206 cut
Screens           : 1 x 1 prims
Layout            : 27 x 27 frames per texture
Ratio             : 1.0
Video dimensions  : 814 x 814 px
Tile dimensions   : 37 x 37 px
Output quality    : 5% x 5% => Might be too blurry, consider adding screens or lowering the frame rate.
Nb frames         : 729 / 763 (All filled)
FPS               : 28.6631716907 / 30.0


All these data are very informative. First you see the file you are processing and the number of screens it will span over. Ok, not very informative there, but the rest is more interesting.

It tells you the layout, i.e. how the frames are organized in the output texture(s) -- here you get only one texture since it will span over 1x1 prim, which makes 1 prim -- it is 27x27 frames in our example. The ratio of the width over the height of the input video is 1.0, meaning it is square, but the script is perfectly able to manage non-square textures over a non-square number of frames (square videos used to be a requirement but it isn't the case anymore, the script is much more powerful now).

The initial dimensions of the video are 814x814, then you have the dimensions of each tile, here 37x37 pixels, which means a yield of 5% in both dimensions. That's very poor, hence the remark saying it "might be blurry" (well duh, you'll see how blurry it is in a moment).

The "Nb frames" line indicates the number of frames in the output texture(s) (here 729, which is the greatest square number below 764, the number of frames you specified) and the number of frames in the input video minus one (here 763). It also tells you that all the frames are filled in the output texture(s), meaning that there is no black frame at all. It is not a problem if there are some black frames at the end, the screen is able to play a video over just the correct number of frames so you don't see a black break when it loops. If it doesn't and you see black frames, it is time to update your HD Video System and/or your RemVision.

Finally the FPS after decimation is output, as well as the specified FPS. Since we asked to reduce the number of frames to 729 down from 763 (not 764 because the last frame is always removed), this makes a factor of 0.955, and 30 * 0.955 is equal to 28.663.


So you get this texture as a result :

Video 206 cut.00.814x814.27x27.729x28.1x1.png


You can download the corresponding AVI video here. This video is the copy of the "tmp.avi" video created by the Python script during its work. It does not delete the video afterwards so you can check the result before uploading anything. I recommend to always play tmp.avi after running the script so you see if there's a problem with the frame rate, the resolution (or both), or if there's a break at the end when it loops, because what you see in tmp.avi is what you'll get in-world if you upload the corresponding textures.

As you can see, the resulting texture is 27x27 frames of 37x37 pixels each, giving 729 frames that can be played at 29 FPS. The name of the texture contains all those parameters (except it specifies the original dimensions instead of the dimensions of the frames, which could have been stretched in the case of a non-square video). The video is very blurry, you can barely distinguish a thing, but at least it's smooth.

It may be a result you want, but if you want more resolution, you only have two options. Either you reduce the frame rate to get fewer frames hence more space for each frame, or you span the video over 4, 9, 16 or 25 textures. We will do the latter here and see where this gets us.

You can see the whole texture is covered by the mosaic of frames, there is not one empty texture. This is because we specified that we wanted to reduce the number of frames to the highest square number possible, and since the video itself is square, everything is solved nicely. It is not actually the case most of the time, because you may have to deal with non-square videos (for example animated GIF files) with non-square numbers of frames, so in the end, since the frames have to be organized as a mosaic inside a square 1024x1024 texture, it is bound to leave some frames empty (but the script never loses any frame unless you instruct it to).


Let's play a little challenge. You see on the raw video (and the cut one) that I am smiling while dancing. It's always better to smile when dancing. I want the resulting video to let my smile show as well. Think we can do that ? :)


This video is supposed to show a dancing animation, so we'll favor smoothness over resolution (while still showing a smile). Let's keep the frame rate factor to 1.0 and span it over 4 textures, i.e. 2x2 :

python AviToTextures.py "Video 206 cut.avi" 2 763 30 1.0

Notice that the only parameter that changes is the first one, becoming "2".

The results are these pictures and this video :





As you can see, the result is better, the resolution is 75x75 pixels per frame (there are still 729 frames in total) and the video would span over 2x2 prims, hence 4 textures to upload.

But you still can't see me smile while dancing. Do you see where this is going ?



After a couple tests, I think the following parameters are good enough for what we want :

python AviToTextures.py "Video 206 cut.avi" 814 814 4 763 30 529

With these parameters, we span the video over 4x4 = 16 textures, the frame rate becomes 21 FPS (you can change that yourself in the name of the first texture), each frame is 178x178 pixels and this time there are 529 frames in total, which is a square number but not the greatest below 764, so I chose it manually to be sure to fill all the textures.

Please note that the quality is still very poor with 22% x 22% and the script keeps telling you to increase the number of prims or lowering the frame rate, but for the sake of the example I will be content with this result.

The result video is here and the result textures are here, that's 16 textures in total. If you wanted to upload them, it would cost you L$160. Making a movie can be costly ! Since a single tape can hold around 250 textures (video textures included), you can expect to spend L$2500 per tape just for the production, if you are making a full movie.

But with this amount of data, you can see me dance clearly and smoothly enough and what's more, you can see me smile :)

Challenge completed !

Please note that in the uploaded textures, the dimensions are not 814x814 but that's not a problem. This is because they were made with an older version of the script which could only handle square videos and that meant it did not stretch the frames, which remained square as well. Now it can handle non-square videos and it even stretches the frames inside a texture to take as much space as possible and avoid black borders, but this means it can no longer rely on the dimensions of a single frame to know how to stretch the prims it displays the video on. So instead it uses the dimensions of the input video, which is 814x814 here. It really does not make a difference for you, especially not with this example since both the input video and the frames are square.



Now all you have to do, once the textures are uploaded, is to put them in the tape and to add the name in the tape's notecard (more on that in another page). For this video here, the entry would be "$Video 206 cut".

Fortunately, I have uploaded them for you and made the video in an example tape so you see the final result. You can find it in the box of free tools at my shop. Feel free to open the tape and see what's inside to get a good idea. And of course to play it, the same dance will play for an hour so you have time to see it loop and to compare it both to the tmp.avi file and to the original video.


Always check the generated "tmp.avi" video before uploading, because what you see in it is what you get in-world after uploading the generated textures. You want to check the resolution, the frame rate and the break at the end if you intend the video to loop seamlessly. If it doesn't satisfy you enough, run the script again with different parameters.

When writing your movie script, try to reserve as much time as you can to let a big video preload. Textures are preloaded by the VHS player or RemVision 16 textures in advance, but it may take time for a viewer to download all these textures, because they may take like 1 MB each. This is not a problem with still pictures which stay on screen for 8 to 10 seconds (or more if you want), but for a 4x4 video you want the 16 pictures to be displayed at the same time so you want them all to be already downloaded by the viewer by the time the video starts. This means that once the video is started, not only it should have had enough time to preload (or you get grey or blurry parts on the video), but the following textures only start to preload now. If the next entry in your movie script is another video, you must make your first video stay on screen long enough to let the next one preload itself entirely. This is why I often separate animated pictures with still pictures in my movies, to give time to preload and avoid getting grey textures.



What about sounds ?

We did not talk about how to turn long sounds (for example music) into 10-second chunks that SL can read and play. The procedure is pretty easy.

First of all you need to modify line 26 in the WavToSounds.py file to write the path to ShnTool. Once again, avoid spaces in the path because it confuses Python :



Save and close the file.

Open a command prompt like you did for the video, type

python WavToSounds.py "my looped music.wav" 77 1

Where "my looped music" is your sound or music to cut in chunks, "77" is to be replaced by the duration of your big sound in seconds and "1" indicates that it must be looped.

Once done, a certain number of WAV files are generated and you can upload them directly to SL. The first one is named in a way that the HD Video System understands how to play it (for example, how many sounds constitute your big sound).

To have it played in the movie, simply write its name after a "%" sign instead of "!" or "$". See the next tutorial to find out what this means. It is also explained more clearly in the Director's Manual.


This concludes this (very long and technical) tutorial about how to make a video for the HD Video System and RemVision, the next one is about how to write the movie itself.

Or return to the menu page.

Marine