Dr D's Abode

MythTV, TV recording, and 3GP streaming

by on Sep.03, 2007, under Code, Computers

Well, I haven’t written much about it, but I do have a MythTV setup on a Gentoo box at home.

The reason its running on Gentoo is simply because KnoppMyth didn’t give me the upgrade options I wanted without a re-install, or upgrade which breaks the system, and the fedora based installs didn’t work correctly on my hardware. Needless to say, I am very pleased with MythTV, on my Gentoo box.

Recently, Ive been looking into seeing if I can set up streams from my PVR, to my PDA phone. I found this file type, .3gp, which most modern systems recognize and play without problems. I came across a few websites [Links here, here, and here] that showed you how to encode videos into the 3gp format. However, on my system, the encoding process was not working correctly. After making sure I had all the correct USE options for my gentoo setup, I decided to try the first links directions, and compile a separate install for ffmpeg, dubbed ffmpeg_3gp.

Like all directions, things change, and I had to adopt the new options and such to get things to work, which is why im writing this. I figured I spent some time on getting it to work, and wanted to share my knowledge with the rest of the world (or whoever reads this)

Starting off, I made sure my system was up to date (Gentoo, 2007.0), I ran emerge –sync, of course.

Next, I had to download the ffmpeg source, the command used in the first link did not work, so I went to the website, and found the correct command:

svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg

Then, I cd’ed into the directory, and ran the config script, again, new versions, there was a different option to run:

./configure –enable-libamr-nb

The original documentation stated that there would need to be additional files downloaded, but I saw no note of this, so I decided to download the files anyways.

wget “http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-510.zip”

I downloaded this one, because when trying to use the build in ebuild, gentoo downloaded this file as well. I followed the directions from here on out, copying the new executable from the current directory, to /usr/local/bin/ffmpeg_3gp

Then of course, the script to encode everything, I had to jazz up a bit:

mythtv@hermes ~ $ cat /usr/local/bin/myth3gp.sh
#!/bin/bash

PATH=”/bin:/usr/bin:/usr/local/bin”

NICELEVEL=”19″

OUT=”/mythtv/3gpvideo”
TMP=”/mythtv/3gpvideo/tmp”
OUTFILE=`echo $2 | sed -e ‘s/ /_/g’ -e ‘s/:/-/g’ -e ‘s/\!//g’`

TITLE=”`echo $2 | sed -e ‘s/^.*[0-9]-//g’`”
TIMESTAMP=”`date`”
COMMENT=”This video was encoded with ffmpeg on `hostname -f` at `date`”

RESOLUTION=”176×144″
# 176×144 default
# 352×288

sudo nice -n $NICELEVEL ffmpeg_3gp -y -i “$1″ -title “$TITLE” -timestamp “$TIMESTAMP” -comment “$COMMENT” -s $RESOLUTION -b 64k -r 15 -ac 1 -ar 8000 -ab 12.2k “$TMP/$OUTFILE.3gp” || exit 2

# do 3gp stuff
MP4Box -3gp -mtu 1450 -hint “$TMP/$OUTFILE.3gp” -out “$OUT/$OUTFILE.3gp” || exit 2

rm -rf $TMP/$OUTFILE.*
Install the script into the user Jobs, and the hard part should be done.

Next is the setup of the streaming server. I attempted to use the Darwin Streaming server, but ran into problems. Thats where I am now, and plan to continue on.

I hope this page helps people out if they ever run into problems with this type of setup.

EDIT:

So I just checked, and it looks like its been fixed in gentoo on a newer ebuild version, but it looks like its masked for some reason. The reason it wasn’t working is because they were using the old –enable line, instead of the new one. BLEH

oh well.


Comments are closed.

Twitter

Powered by Twitter Tools

Geek Code

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GIT d-(+) s:+ a C++ BL++++ P++>+++ L++(+++) E--- W++ N o K- w O M V-- PS
PE Y+ PGP+ t+ 5 X+ R tv b DI D+ G e+ h+ r-- y+
------END GEEK CODE BLOCK------

Linux Counter

Certifications


 

PSN Portable ID

Powered by

Hacker
 
Powered by Gentoo Linux