Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Saturday, January 19, 2013

A foray into video recording and editing

I'm fully aware it's been a very long while since I discussed anything technical on this site, and that makes me feel a little sad as that was the original point.  I had been somewhat hindered by the fact that there was very little I was doing outside of work that seemed interesting, and a lot of what I was doing in work was too difficult to make generic enough to not get me in trouble.  However, since I had started doing YouTube Let's Play videos (as mentioned previously) I've got something that's pretty interesting and somewhat technical, so here we are.

Let's Drink to Gaming is a Let's Play show with themed cocktails.  I wanted this to be a little more interesting than just playing a game and narrating what's going on, so I decided that I would play with a rotating cast of guest hosts over the internet.  This leads to a somewhat interesting challenge of broadcasting the game video to the other person while simultaneously recording it.  It also raised the question of how to record multiple audio sources, and broadcast multiple sources.  I needed to hear and record their voice, they needed to hear me and the game.

I did some wandering around Google and tried: XSplit, FFSplit, Fraps, Taksi, Bandicam, and I think "GameCam"?  Eventually I settled on Dxtory.  It's paid software but it has a lot of features that were really important in my situation that only really XSplit also mirrored, and since XSplit uses a subscription pay model Dxtory is technically cheaper.  The most important features Dxtory has are:
  • The ability to record an arbitrary number of audio streams.
  • The ability to stream the video it's recording to several DirectShow contexts.
Almost every other program only recorded 2 audio streams, if that.  They're really well setup for traditional commentary recording where you want the game and a microphone, but I was obviously biting off a bit more.  Since starting I've recorded up to 4 tracks at once: Game audio, my friend Tim and his fiancĂ©e over Teamspeak, myself on a headset mic, and my girlfriend on another local mic.  Being able to isolate all these lets me mix everything independently while I'm editing the final video so I can do some EQ and noise removal, basically make a run through and try to clean up the audio as much as possible.

Streaming via DirectShow is the way most webcams work, so since Dxtory can do that, I have a lot of options for video conferencing or streaming software.  I tried Skype first since it's super-easy, but the video quality is awful.  Skype uses 640x480 streams.  We've been trying to get RTSP with VLC working for some time can't quite get it over the internet.  I have a sneaking suspicion Verizon may be blocking RTSP.  I had also briefly toyed with the idea of using a game streaming site like Twitch and maybe making the channel private, if that's possible, but the lag on my stream was unbelievable.  I just recently found out this was because one of the utilities which came with my motherboard, a bandwidth prioritization utility, was devoting almost all my network resources to a Synergy server.  So maybe this is an option again.  I should also revisit the VLC tests in case bandwidth was an issue.

Audio mixing for the live feed was still unanswered.  This market is unfortunately less varied and most of it is paid software.  I tried without success using PulseAudio for windows, Jack for windows.  Eventually I bought Virtual Audio Cable.  VAC lets you create virtual audio devices on your PC and also arbitrarily route real and virtual devices.  This has been really important when we've played non-co-op games and had my girlfriend in the room with me.  I can use VAC to combine both of our microphones, and the game audio into a single device and make Teamspeak use that as its microphone while not affecting my ability to record all 3 of those sources alone.

So once I recorded everything I end up with a few gigs of x264 encoded AVI files with separate audio streams.  All the post-production work is done in Linux.  The software for windows I bought to record and stream was pretty cheap, and they were the only programs I saw with the featuresets I wanted.  Video editing software, however, is really freaking expensive.  I tried some free programs for windows, but they were all terrible.  Nothing could even match the feature set of of Adobe Premier Elements or Windows Movie Maker.  So I went to Linux where there were at least a few programs for me to choose from: Cinelerra, KDEnlive, and OpenShot.

I made my first video in Cinelerra but it was clunky, old looking, unstable, and couldn't export quickly or easily.  I wound up rendering the audio separately, and the video into a ludicrously large MOV, 80 gigs or something, then muxing the two together and reencoding on the command line.  Since then I've been using KDEnlive and it is much much better.  It still crashes and it has some clunkiness around certain tasks or filters.  I'd love some project templates and previewing animated title cards has some problems.  Also, it had this super-strange audio glitch that made creating the clip show utter madness.  I may try OpenShot soon, since it looks really good but I have nothing on it now.

I have a shell script that invokes ffmpeg to extract all the audio streams from the video file so I can work with them in Audacity.  Audacity seems like the go-to cross platform audio program, so I use that to import all the tracks, then run noise removal and run a pre-amp on anyone who seems too quiet.  Then I basically listen to the entire project covering up bits of keyboard noise or other unwanted sounds and if anyone talked over anyone else, bring out whoever said something better.

Anyway, that's the basic setup:
VAC to setup the audio so everyone can hear what they need.
Dxtory to record all the audio to independent data streams and output video in a usable format.
Google Hangouts to stream video to the remote commentators.
Audacity to clean and mix the audio into a single track.
KDEnlive to put everything together into the final video.

Yeah, this is long winded, but at least I'm talking about software again.  Maybe I'll post the bash script next time I boot linux to do some work.

Tuesday, July 29, 2008

How-to: Full read/write access to ReiserFS in Windows Server 2008 x64

Yes, I am fully aware of the ReiserFS IFSD project. However due to the somewhat draconic driver signing requirements of 64 Bit Server 2008 this driver doesn't load. I have heard you can convince it to in 32 bit versions of the OS. There's something about the image hash integrity that prevents it from working. I may try to recompile this in 64 bit but that is a project for another week.

However, it's still possible to gain access to your ReiserFS (and any other linux filesystem you'd like) using free tools in Windows Server 2008. All it takes is some time and a rather twisted hack.

You will need:
  • An installation image file (ISO) for your favorite linux distribution. If you don't know linux that well I'd recommend Ubuntu or Fedora. I used Gentoo, since I knew I could make it a very small installation.
  • VMware Server 1.0.6. VMware Server is free, you need to fill out a web form to request pretty much any number of license keys.

At the end of this article I've provided the kernel configuration file I used for Gentoo as well as my smb.conf.

Start VMware Server, before you install you should reboot. Press F8 before windows loads, and make sure to select "Disable driver signature enforcement". Before some recent patches, this could be set permenantly using bcdedit, but no longer works. It is recommended you suspend your windows installation instead of shutting down to avoid having to do this every time you boot your system.

Connect to localhost and create a new VM, use typical settings. Selecting the type of OS you'll be running is only really useful for VMware tools, which I won't discuss here. Feel free to comment on this. Call it whatever you want.
At the networking screen, for security's sake it's advisable to use NAT or host-only networking. I used NAT.
The next screen is for the size of the virtual hard disk. This doesn't really matter, and should only be as large as absolutely needed for your linux of choice, but really shouldn't need to be much bigger than 6 or 7 gigabytes. My Gentoo installation is about 1.3GB, and could probably be made smaller.
For the CD-ROM drive, if you've burned your installation disk use the physical drive, otherwise select the image file you downloaded earlier.
Finish setting up your VM and start it. With no data on the virtual hard drive, it will boot off the CD. For the sake of the length and scope of this article, I will assume you know how to setup the distribution you selected. When you get to a point where you can, make sure to install the most recent version of Samba you can.

Once your linux VM is installed and working, shut it down.
In the VMware console select the VM and click "Edit virtual machine settings", then click "Add" to add hardware. The 3rd option when adding a drive should be to directly access a physical hard disk, for experts only. Click 'ok'.
The names VMware gives the disks in your system are probably not the most descriptive things in the world, but you select to use Invidual Partitions and click next you can see the partitions and their types that are available on the selected disk. Select your Linux partition(s).
Start your VM again.
Once you are up and running, fdisk -l or the system browser should recognize the new disk.

Open the file /etc/fstab as root in your editor of choice and add a line similar to this:
/dev/sdb1 /mnt/reiser reiserfs user,defaults 0 0
Where /dev/sdb1 is the name of the partion as shown in fdisk -l. Also make sure the directory /mnt/reiser actually exists. If it doesn't, create it (you will likely need to be root).

Now mount /mnt/reiser.

The final piece of this convoluted puzzle is samba, the smb.conf file.
[global]
workgroup = WORKGROUP
netbios name = vmlinux
server string = Samba Server %v
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
dns proxy = no
[reiser]
path = /mnt/reiser/
public = yes
writable = yes
browsable = yes
guest ok = yes

Make sure samba is configured to run on startup...in Gentoo this is
rc-update add samba default
in Ubuntu or Fedora you can configure this in the GUI. If your desktop is GNOME, this will be in System>Administration>Services

Either reboot here or start the service /etc/init.d/samba start

Now back in Windows, open the explorer and go to Network. If you are using Aero you will need to hit the 'Alt' key to see the 'Tools' menu. Select 'Tools' and 'Map Network Drive'.
Select whatever drive letter you want, and as a folder use:
\\vmlinux\reiser
Click 'Finish' and you are done! Yay! You can now open your linux partition under windows and have full access to it.

If you left 'Reconnect on logon' checked when you mapped the drive you should edit the virtual machine. In the options tab of the edit dialog, select the Startup/Shutdown setting and from the dropdown box under "On host startup:" select "Power on virtual machine"


Click here for the Gentoo kernel .config file


As a note I wrote this while incredibly hungry, so it might but hard to understand some things. I might be rewriting sections of it to word things better later...if it looks like anyone's coming here and reading this.

--PXA

Saturday, July 26, 2008

How-to: VLC/Windows Full Screen Video trick.

Once upon a time, nVidia cared about us. The nVidia control panel was hard to use but pretty slick and it had one feature that I thought was absolutely great: There was a video overlay feature that would automatically clone any video output from either screen in full screen on a screen you specify.
In Linux I can simulate this by selecting a screen for full screen output, and VLC will comply without hesitation every time I go to fullscreen mode and every time I add a file to the playlist...it opens in full screen ON THAT SCREEN no matter where the VLC window is.

Windows has befuddled my every attempt to do this. In Direct X output mode video uses the wrong aspect ratio in XP and forces Vista to change from Aero to Vista Basic, and displays on a portion of the video. (Your milage may vary). And OpenGL requires me to move 51% of my window to the other screen, but then if the next video on the playlist starts and I have moved the window to a different screen, it full screens there. Usually on top of my work.

After some experimenation using VLC 0.8.6i on Windows Server 2008 I have managed to get an affect that is close to my Linux experience.

The final result is this: A VLC player with controls, but no video in the main window and video automatically playing in full screen, on the same screen each time (even after the next video in the playlist.)

First enable full screen off the bat so you don't need to force the video into full screen when you start VLC the first time:

1. Go into the settings menu and open preferences, check the box that says "Advanced Options"
2. Select the "Video" section from the box on the left.
3. Check the box that says "Fullscreen Video Output"
4. Scroll the main settings area down to place where you can see "Window Properties"

"Video Height" and "Video Width" should be set to the height and width of the screen you will be viewing your full screen video on. (In this iteration of the technique this is not strictly necessary, but is a leftover from experimentation with the "clone" video filter which would allow video in both the main window and the extra screen)

In my case this is 1024x768 screen.

5. The next 2 options will be Video X and Video Y. In my case, my 1024x768 screen is to the right of a 1280x1024 screen. So I set Video Y to 0, so it's at the top of the screen, and Video X to 1280 so that it will be in the left corner.

6. Further down the window will be another box for "Window decorations". Uncheck it.

7. The very last option on the left should be "Interface", expand this, and then expand "Main interface". Select "wxWidgets" from this list. Unceck the options for "Embed video in interface" and "Size to video"


While this is incredibly involved and rather inflexible, it does get me video the way I'd generally watch it and could hopefully be of use to someone else.

As a note I already tried getting Windows Media Play, MPlayer, and Media Play Classic to behave the way I want them to (like VLC/Linux) but had no luck. MPlayer wouldn't even play ANY video on my other screen.

--PXA