[mythtv-users] Automatic converting HDTV to MPEG2

casey dunn casey.dunn at gmail.com
Tue Dec 12 17:02:44 UTC 2006


On 12/12/06, Trampas <tstern at nc.rr.com> wrote:
>
>
>
>
> Casey,
>
> My original question was how to enable automatic transcoding of the HDTV to 720x480 MPEG2, I do run the Myth Frontend on the box that is the backend. My question was how do I make the automatic transcoding work.


http://www.mythtv.org/wiki/index.php/Stream_mythtv_recordings_from_mythweb_using_flash_video#Transcode_recordings
http://www.mythtv.org/wiki/index.php/Stream_mythtv_recordings_to_mobile_devices#Add_user_job_in_mythtv

Quick howto's for adding a user job.

Your job is going to be a bit different than the examples above,
luckily simpler.  What I think you want is the same thing I do,
replace the existing HDTV.nuv with SVCD/DVD.mpg.  This is a cleaned up
version of my script. (for reference I'm targeting XBMC over a poor
802.11g connection and SMB)

####################### START ######################################
#!/bin/sh
# script to shrink the size of mpeg2 recordings, & make them human readable.

cd /media/video

#setup varaibles
input_file=$1
output_dir=$PWD

#strip extension
name=`echo ${input_file} | sed -e "s/[.].*$//"`
extension=`echo ${input_file} | sed -e "s/^[^.]*[.]//"`

 transcode_options="-target ntsc-svcd -deinterlace"

#run transcoder
ffmpeg -i "${input_file}" ${transcode_options} "${name}.mpeg"

#replace original
 rm "${input_file}"
mv "${name}.mpeg" "${input_file}"

# update file names
#~/mythrename.pl --link /home/Shared/Video
~/mythrename.pl --underscores
######################### END ##################################



Looking at the examples in the wiki it should probably look like
this... (untested)
############################## START ##############################
directory=$1;
file=$2;

# Transcode the HDTV stream to DVD quality mpeg

ffmpeg -i $directory/$file -target ntsc-dvd -deinterlace $directory/$file.mpeg

rm $directory/$file
mv $directory/$file.mpeg $directory/$file
############################### END ###############################

I would put echo's in-front of the rm and mv for testing it a few
times from the command line and in myth before letting it delete my
originals (just in case).  Or change it to create copies and manually
delete the originals.


More information about the mythtv-users mailing list