my experience with nfs & smbfs

Josh Harding theamigo42 at y...
Fri, 08 Jun 2001 19:21:36 -0000


I played around with ExtractStream a big last night. I thought I 
share what I learned in the hopes of helping others.

Assuming you've already got your TiVoNet card installed and a method 
of getting files to it, you'll want to setup a method of transferring 
the (rather large) video streams to another machine.

A few methods come to mind:
-nfs
-smb
-net cat
-mounting another ext2fs partition

I tried the first three and got two of them to work.

Both nfs.o and smbfs.o for 2.0.1 (compiled by cworley) complain about 
mismatched kernel versions. But since it's only a minor revision, 
yoiu can force the module to load with the -f option:
insmod -f nfs.o
(I renamed nfs-2.0.1.o to nfs.o on my TiVo)
There isn't a lsmod command, but you can view the list of loaded 
modules by:
cat /proc/modules
You can read some of cworley's tips on nfs & smbfs here: 
http://www.avsforum.com/ubbtivo/Forum6/HTML/004631.html

nfs
~~~
After exporting a directory from another unix box (mine is RH Linux), 
you need an empty directory on your TiVo to mount it:
mount -o remount,rw /
mkdir /hack/nfsshare
mount -o remount,ro /
mount 192.168.0.1:/shareddir /hack/nfsshare

Some people use /var/tmp since it's already mounted read-write, but
to 
me it looks like /var/tmp gets cleared out on a reboot. Instead I 
created a dir on the root partition so it will stay there. You can 
still mount something on top of that even when / is readonly. Since 
all your files are going to the network, it doesn't need to write to 
the local partition.


smbfs
~~~~~
I couldn't get this to work right. I got as far as mounting the
share 
(it showed up in a df), but when I tried to ls the dir, ls hung (^C 
worked) and then df showed the mount as 0 size. Since NFS worked for 
me, I didn't persue this any further.

net cat
~~~~~~~
As per the instructions, I tried nc as well. After creating the
named 
pipes (via mkfifo), I set the env vars and started the nc processes. 
Since I didn't have a version of nc for linux, I ran the receiving
end 
on my Win2K box.

With both net cat and nfs, I was able to use ExtractStream to get a 
pair of mpeg files. I tried two different shows (before I was too 
tired and wished I could blow off work the next day). Both streams 
generated a video files around 480M when ExtractStream errored out. 
Is this how big a 30m block is? Do some shows have multiple stream 
numbers because it's a diff stream for each 30m segment?

Re-encoding
~~~~~~~~~~~
On Win2K, I used TMPGEnc to merge the audio and video streams. The 
supplied .mcf template didn't seem to load the settings for clipping 
so I had the green bar on the left. I manually selected to remove
the 
top 2 rows and the left 12 columns and saved a new template. It must 
be a bug in TMPGEnc because my newly saved template didn't remember 
that I wanted clipping on after I quit and re-ran the app.

The first show I tried (the Witchblade pilot rebroadcast) caused 
TMPGEnc to bomb about 2m into the stream. The part it did process 
looked good though!

Multiplexing
~~~~~~~~~~~~
Lacking any form of instruction for mplex, I extracted the files to a 
dir on my linux box and ran:
gcc -o mplex *.cpp
I then had an executable and tried the suggested command line:
./mplex -f 2 -m 2 program.mpeg program.m1[av]
which didn't work. Instead, it wanted env vars of VIDEO_OUT and 
AUDIO_OUT to be the names of the *input* files to read (strange that 
they are _OUT, not _IN). Also, it didn't take the output on the 
command line, it just wrote to stdout so I ran:
export AUDIO_OUT=program.m1a
export VIDEO_OUT=program.m1v
./mplex -f 2 -m 2 > program.mpg
I still don't know what the -f 2 and -m 2 are for, but I'll look that 
up later.

I'm guessing that it's because mplex isn't re-encoding, but rather 
just multiplexing that the streams aren't playable by windows media 
player. Does TiVo save things as MPEG2 streams? So I fired up 
PowerDVD to play the resulting file. About 30 seconds into the 
stream, the framerate dropped to about 2fps. The audio kept playing, 
but about 2 minutes into the video, the audio was 30 seconds ahead of 
the video.

The future
~~~~~~~~~~
What I'd really like to be able to do is this:
-Sit down at PC (currently a Windows box), fire up web browser.
-Browse to TiVo's Now Showing list on web server.
-Click on a show name and have it start playing on my PC.

How do I think this will work? When I browse to the now-showing
list, 
I'm really looking at a page generated by my Linux box running
Apache. 
It's running a Perl CGI script that connect to the web server on the 
TiVo. When I click, it tells the TiVo to run ExtractStream which 
writes to an NFS mounted partition on my Linux box. My Linux box 
(which has a faster CPU than the TiVo) takes the two streams and 
either multiplexes or re-encodes them into a single stream. As soon 
as it starts, it sends the path to the output file to my web browser. 
My browser sees that it's an mpeg file and launches the video player.

Is this realistic? Sure! I don't think we're that far away from 
it... we've got all the hard parts taken care of, just some polishing 
up so things run a bit smoother and some scripting to tie the pieces 
together.