Uncategorized

Preserving Closed Captions

Extract closed captions from your edited video:
$ ccextractor -srt edited-video.mpg
This will create a text file called edited-video_1.srt that contains the captions.

Create the spumux configuration file (in this case called spumux.xml):

<subpictures>
<stream>
<textsub filename="edited-video_1.srt" characterset="ISO8859-1"
fontsize="24.0" font="arial.ttf" horizontal-alignment="left"
vertical-alignment="bottom" left-margin="60" right-margin="60"
top-margin="20" bottom-margin="30" subtitle-fps="29.97"
movie-fps="29.97" movie-width="720" movie-height="472"
force="yes"
/>
</stream>
</subpictures>

This file is for NTSC. The defaults in the spumux man page are for PAL.

Convert edited-video.mpg to DVD format (See my other posts) called edited-video.vob.

Insert closed captions as subtitles:
$ spumux spumux.xml < edited-video.vob > edited-video-with-subs.vob

Test with mplayer dvd:// -dvd-device dvd -sid 0

Uncategorized

Comments (0)

Permalink

Dealing with Video Too Long for DVD

One of the movies I wanted to transfer from TiVo to DVD was too long to fit. In order to reduce its size, the bitrate must be reduced (see section 2b):

maximum-bitrate (bits/second) = 4,500,000,000 (bytes) * 8 (bits/byte) / video-length (seconds)

You can get the duration from the output of ffmpeg:

ffmpeg -i movie.mpg delete-me.vob -fs 1

This maximum bitrate gets split between audio and video. Use 256,000 for the audio and the rest for video. The new ffmpeg command is:

ffmpeg -i movie.mpg -target ntsc-dvd -b <video bitrate> -ab <audio bitrate> movie.vob

Uncategorized

Comments (0)

Permalink

TiVo to DVD: Summary

Here’s the full procedure for making a DVD from something on your TiVo:

  1. Browse to https://your TiVo’s IP address
  2. Log in with user=tivo and password=Your TiVo’s MAK

  3. Download the show. We’ll call it tvshow.TiVo
  4. Convert to MPEG
  5. tivodecode -m MAK -o tvshow-orig.mpg tvshow.TiVo

  6. Optional: Edit with Gopdit
  7. gopdit tvshow-orig.mpg

    Save to tvshow.mpg

  8. Transcode for NTSC DVD
  9. ffmpeg -i tvshow.mpg -target ntsc-dvd tvshow.vob

  10. Create DVD Author file
  11. Make a file called tvshow-dvdauthor.xml that contains this:

    <dvdauthor>
    <vmgm />
    <titleset>
    <titles>
    <pgc>
    <vob file="tvshow.vob" chapters="0,10:00,20:00,30:00,40:00,50:00" />
    </pgc>
    </titles>
    </titleset>
    </dvdauthor>

    (This chapters list assumes a 1-hour show with chapters every ten minutes.)

  12. Create the DVD structure
  13. dvdauthor -o dvd -x tvshow-dvdauthor.xml

  14. Check the DVD
  15. mplayer dvd:// -dvd-device ./dvd

  16. Burn the DVD
  17. growisofs -dvd-compat -Z /dev/dvdrw -dvd-video ./dvd

Uncategorized

Comments (0)

Permalink

EXIF Data

JPG files from cameras contain EXIF data. This describes the picture, the camera, when the shot was taken, etc.

In order to read the EXIF data you need libexif. This is probably already installed. Another thing you need is exif. This doesn’t seem to be available in an RPM. You have to build it yourself with the usual, download, tar zxf (for tar.gz), ./configure, make, make install. There’s also a graphical version. You need to use the same incantation for libexif-gtk and gexif in that order.

Uncategorized

Comments (0)

Permalink

Editing MPEG Video from TiVo

Once the video is downloaded from the TiVo and converted to from TiVo to MPEG format, you can edit out parts you don’t want with a simple MPEG-2 video editor called GOPDIT. Also see gopchop (on which GOPDIT is based) if GOPDIT makes poor transitions between video cuts.

This will leave you with a 480×480 MPEG, which isn’t usable for DVDs; they need 720×480 (for NTSC in the US). To convert the MPEG for NTSC DVD output, I tried avidemux using their
documentation on how to create a DVD with avidemux, but the picture was a little choppy and the sound was out of sync. My wife thought this was funny. (I wasn’t so amused.)

I got some instructions from a videohelp.com forum that worked better:

ffmpeg -i tivoshow.mpg -target ntsc-dvd tivoshow.vob

You can make a DVD with the output .vob file using
any2dvd (requires soundstretch) or use dvdauthor directly. See “Creating the DVD structure” in this Linux.com article

Uncategorized

Comments (0)

Permalink

Downloading Video from TiVo

From XML.com:
From your web browser, go to https://<tivo IP>. The username is “tivo”, and the password is the Media Access Key from the TiVo’s System Information screen.

Download the video. It’ll be in a .TiVo format, which can be converted to MPEG with Tivo File Decoder. Instructions to build it are here. To run it on a downloaded video from TiVo called sitcom.TiVo:
$ tivodecode -m <media_access_key> -o sitcom.mpg sitcom.TiVo

Uncategorized

Comments (0)

Permalink

Undefined color: "black"

Recently, I started having a problem with remote X sessions over VNC. This is using TightVNC version 3.3.tight1.2.9. One day emacs refused to load. It said only Undefined color: "black". This was odd because I had black in the window manager. So, I tried vi instead, except there was black on black text in some places I couldn’t read. Then I installed XEmacs to see if that was any better. It complained Warning: Color name "Black" is not defined as well as a handful of other colors before spouting a fatal error message and seg faulting.

A little digging turned up posts about rgb.txt being in the wrong place. Fedora Core 6 has it in /usr/share/X11. Some people fixed this problem by putting a soft link to it in /usr/lib/X11. I wasn’t so lucky. Another post mentioned looking for errors in the X log: grep -i rgbpath /var/log/Xorg.0.log. Since I’m having trouble with VNC, for me the log is ~/.vnc/hoover.faber-net:2.log. I got nothin’, so I looked at the file and right at the top was Couldn't open RGB_DB '/usr/X11R6/lib/X11/rgb'. I put a soft link in /usr/X11R6/lib/X11 to /usr/share/X11/rgb.txt and restarted the VNC server. Then it was happy. How did this happen? Could be because I’m running a locally compiled version of TightVNC from 2003 :-p Time to upgrade…

Uncategorized

Comments (0)

Permalink

Authoring a DVD

I’m using DVDStyler to create a DVD of video I shot in Florida on vacation with the kids. DVDStyler (or any authoring software) needs a temporary directory:

# qtparted
Create 50 GB partition (/dev/hdb2)
# mkfs.ext3 -c -L temp /dev/hdb2
Add this line to /etc/fstab:
/dev/hdb2 /mnt/temp ext3 defaults 0 0
# mkdir /mnt/temp
# mount /mnt/temp

I edited the videos in Kino and output individual MPEG files for each chapter. I grabbed frames to use in the menus in DVDStyler. I have four sub-menus under the “scenes” menu. On the main scenes menu, I took one frame from each of the submenus as a button. On each submenu, that same frame was used as a background. So it didn’t get in the way of the buttons, I edited the frame in Gimp, set a grey (R=G=B=128) background and put the frame in a foreground layer with 25% opacity.

Each button is a rectangle with the image in it. The border is set to be normally transparent, but yellow when selected.

DVDStyler will either generate the DVD structure, an ISO or burn the DVD. I used the first while checking my menus, then the second when checking the DVD in a standalone player. I had trouble with the DVD player using a DVD+RW disk. My Sony DVD/VCR combo said:

This disc cannot be played.

Playback prohibit by area limitations.

DVD_ERRLOG5 00DF5108000000000007
05040728000800000100A7

That made me think the disk was generated with a non-US region code. Here’s a page on how to check the region code. I took the dvd.iso file and did this:

# mount dvd.iso /mnt/loop -t udf -o loop=/dev/loop3
$ cd /mnt/loop/VIDEO_TS
$ emacs VIDEO_TS.IFO

In Emacs, switch to hex mode with M-x hexl-mode RET. At offset 0x23, if the value is 0, there’s no region set. That’s what I saw.

$ cd /
# umount /mnt/loop

Thinking it must be the DVD+RW disk, I burned a DVD+R:

# growisofs -dvd-compat -Z /dev/dvd=dvd.iso

That failed too. The standalone player showed the same error. I found a bug in DVDStyler 1.5b6 and earlier that causes this on NTSC players. The workaround notes a page that doesn’t exist anymore, but there are files attached at the end of the bug report.

Then I got this error:

**ERROR: [mplex] Can't find next AC3 frame: @ 72192 we have 0a20 - broken bit-stream?
Error executing of command: mplex -f 8 -S 0 -M -V -o "/mnt/temp/florida-2007/dvd/menu1-0.mpg_bg.mpg" "/mnt/temp/florida-2007/dvd/menu1-0.mpg_bg.m2v" "/usr/share/dvdstyler/data/silence.mp2"

I found a page with instructions to generate silence.mp2:

$ arecord -f dat -twav -d 1 silence.wav
$ mp2enc -r 48000 -o silence.mp2 < silence.wav

That fixed the problem.

Uncategorized

Comments (0)

Permalink

Camcorder to DVD update

It’s been a while since I uploaded video from my camcorder. Of course, Kino didn’t work any more. This was because the files were hand-built in 2003. Since then, the project has mainstreamed and everything is available in RPM’s. So to make it work again, all I had to do is this:

# yum install dvgrab
# yum install --disablerepo=livna transcode
# yum install --disablerepo=livna kino

All was fine except there was no audio from Kino. To fix that, on the menu, choose edit/preferences. Under the Audio tab, change the audio device from default to /dev/dsp.

Uncategorized

Comments (0)

Permalink

T60 Volume under openSUSE

Run KControl (Menu->Favorites->Configure Desktop (personal settings))
Select System Administration/IBM ThinkPad laptop
Says /dev/nvram not readable. To fix, edit /etc/udev/rules.d/50-udev-default.rules
and change
KERNEL=="nvram", GROUP="kmem", MODE="600"
to
KERNEL=="nvram", GROUP="kmem", MODE="644"

Either reboot or as root chmod 666 /dev/nvram.
Restart KControl.

Uncategorized

Comments (0)

Permalink