Transcode Video

From MythTV Official Wiki
Revision as of 06:12, 9 May 2012 by Reznor (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

How to transcode video for iPod, iPhone, PSP, PDA, or other portable devices. There are a lot of different ways to transcode video for use on portable devices, both automated and manually. Some of these methods may be out of date and no longer work.

nuvexport

nuvexport is a utility that can be run from the commandline. You select the output format, the videos you'd like to transcode, and it does it for you. It does not automatically transcode for you, however

See Nuvexport.

mythtranscode

mythTV can automatically transcode videos after recording them using mythtranscode. It can only transcode to RTJPEG and MPEG4, however, which may not be what your device requires.

See Mythtranscode.

Mythbrake

Mythbrake is a user job script that transcodes recordings to MP4 files using Handbrake. It can create multilanguage files with mutliple audio tracks. It automatically preserves any surround sound (e.g. AC3 5.1) using pass-through if available.

See Mythbrake.

mythnuv2mkv

See Mythnuv2mkv.

nuv2avi

See Nuv2avi.

3gp Video

Transcoding video to 3gp format for mobile phones

See Transcoding into a 3gp Video.

video2ipod

a perl script that can be installed as a User-Job to automatically transcode video for the iPod. May work for other portable devices as well.

http://wiki.1.jeffornot.com:8000/index.php/Video2ipod

Other iPod exporting Scripts

Here are some alternatives to video2ipod

OTA HDTV to DVD with AC3 stream copy transcode Script

#!/bin/sh

# Step 1, generate DVD resolution file from HDTV content, preserving AC3 audio streams
# produce less log output with the -quiet switch
/usr/bin/nice -19 /usr/bin/mencoder -quiet -oac copy -of mpeg \
-mpegopts format=dvd:tsaf -vf scale=720:-3,harddup -ovc lavc -lavcopts \ 
vcodec=mpeg2video:vbitrate=4000:keyint=15 /myth/tv/$1 -o /myth/tv/$1.tmp

if [ "$?" -ne "0" ]; then
   echo "mencoder died"
   /usr/bin/nice -19 rm /myth/tv/$1.tmp
   exit
fi


# Step 2, replace orig HDTV file with transcoded DVD file
/usr/bin/nice -19 mv /myth/tv/$1.tmp /myth/tv/$1

# Step 3, clean up MPEG2 sync issues and using mythtranscode.  Output is a .tmp file.
/usr/bin/nice -19 /usr/bin/mythtranscode --mpeg2 -i /myth/tv/$1 --showprogress

# Step 4, replace DVD file with cleaned DVD file
/usr/bin/nice -19 mv /myth/tv/$1.tmp /myth/tv/$1

# Step 5, update index in database
/usr/bin/nice -19 /usr/bin/mythcommflag --rebuild -f /myth/tv/$1

# OPTIONAL Step 6, Flag commercials on final file
/usr/bin/nice -19 /usr/bin/mythcommflag -f /myth/tv/$1

#Only thing to sort out is updating the MySQL DB for the new filesize after transcoding
# to reflect the new file size. Any ideas on how to do this easily??

# ANSWER:
# You can do something like this:
SIZE=`ls -l $MYTHDIR/$1 | awk '{print $5}'`

mysql --user=(your username) --password=(your password) mythconverg << EOF
update recorded set filesize = '$SIZE' where basename = '$1';
EOF



Handbrake_userjob

The Handbrake_userjob is a perl script which is intended to run as user job. It creates .mkv (matroska) files with multilanguage audio tracks. Audio tracks are selected by language, amount of channels (5.1 > 2.0) and codec (ac3, mp2, ..). Uses new (0.25) feature of season / episode info to form video filename with the scheme: TITLE - SxxExx - SUBTITLE.mkv

See Handbrake_userjob.