<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, May 24, 2016 at 3:48 PM, James Miller <span dir="ltr"><<a href="mailto:gajs-f0el@dea.spamcon.org" target="_blank">gajs-f0el@dea.spamcon.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Preparing for a trip overseas and would like to have the ability to view a particular recording that my Myth machine is set to auto-record. Mythweb is correctly configured for this, so that part of the equation is in place. But how to set up the more crucial part--auto-transcoding the recording so that it is substantially smaller and thus quicker to download--is escaping me. The recording winds up as an mpg file, one recorded from an unencrypted NTSC cable connection. I don't care whether commercials get cut out, btw.<br>
<br>
I was able to set up just this sort of auto-transcoding on my old Myth system by just ferreting around through the menu system. This time, either my memory and technical acumen have become seriously degraded, thus preventing me from accomplishing what I previously had done, or some changes to how auto-transcoding is done have been introduced--changes that are proving much more difficult for me to grasp.<br>
<br>
As to what I'm trying to do more specifically, I would like for that mpg file that gets recorded each weekday to, once recording has been completed, be transcoded into a file roughly one-tenth the size of the original. Replacing the original with the lower-quality transcoded version is what I'm after. I realize, based on past experience, that the video quality will be pretty terrible at the specified file size--I will be viewing it on a netbook, btw. But I can live with the quality degradation for the short period during which I will be needing to do this. Format of the re-encoded file is not terribly important as I will be using mplayer on the netbook end to view it, and mplayer seems to handle just about any format I've ever tried with it.<br>
<br>
As I said, I've ferreted through the Myth menus and have not thus far discovered a way to accomplish what I'm aiming for. I also took a look at the wiki and tried and experiment or two, but without success so far. Finally, I am trying to set this up at the last minute, as departure is slated for tomorrow. So it may be asking too much--given my pretty modest technical acumen--to try and set this up on such notice.<br>
<br>
Any tips on how to accomplish my aims will be appreciated.<br>
<br>
PS This is MythTV 27 running under Gentoo.<br></blockquote></div><br>I have a script that I use that I found somewhere. It just uses mythffmpeg so no extra dependencies. I use it on SD source material so it starts out pretty rough, but the result is viewable. You can set it up as a user job and then select it to run for a given recording rule. Give this a shot:<br><br>#!/bin/bash<br><br>#Call with $0 "%DIR%/%FILE%" "%TITLE%" "%SUBTITLE%" "%STARTTIMEUTC%" %CHANID% "%ORIGINALAIRDATE%"<br><br>file="$1"<br>title=$(echo "$2" | sed -e s/[^\]\[A-Za-z0-9~.,_\ {}\(\)\'\+\-]/_/g )<br>subtitle=$(echo "$3" | sed -e s/[^\]\[A-Za-z0-9~.,_\ {}\(\)\'\+\-]/_/g )<br>date=$6<br>nice_title="$title"<br>if [ -n "$date" ]<br>then<br>    nice_title="$nice_title-$date"<br>fi<br>if [ -n "$subtitle" ]<br>then<br>    nice_title="$nice_title-$subtitle"<br>fi<br><br>WORKING="/tmp/transcode_work"<br>mkdir -p $WORKING<br>cd $WORKING<br><br>#DEST="/var/lib/mythtv/recordings/phone"<br>DEST="/home/shared/export/"<br>mkdir -p $DEST<br><br>if [ -f "$DEST/$nice_title.mp4" ]; then<br>  echo "$DEST/$nice_title.mp4 already exists. Exiting"<br>  exit<br>fi<br><br>#mythtranscode --mpeg2 --chanid $5 --starttime $4 --honorcutlist<br>#if [ ! "$?" == "0" ]; then<br># echo "Transcode failed. Attempting to fix with stream copy"<br># $HOME/bin/ffmpeg -i $1 -acodec copy -vcodec copy $1.fixed.mpg<br># mv $1 $1.backup<br># mv $1.fixed.mpg $1<br># mythtranscode --mpeg2 --chanid $5 --starttime $4 --honorcutlist<br>#fi;<br><br>/usr/bin/mythffmpeg -y -i "$file" \<br> -c:v libx264 -preset slower -profile:v baseline \<br> -strict experimental -c:a libfaac -b:a 96k \<br> -vf yadif,scale="trunc(oh*a/2)*2:480" -crf 23 -r 25 \<br> "$nice_title.mp4"<br><br>#Alternate, from <a href="https://www.mythtv.org/wiki/Transcode_Mpeg2_to_H264">https://www.mythtv.org/wiki/Transcode_Mpeg2_to_H264</a>.<br>#Key feature is automatic deinterlacing (yadif filter)<br>#        output = task('-i "%s"' % tmpfile,<br>#                      '-filter:v yadif=0:-1:1',<br>#                      '-c:v libx264',<br>#                      '-preset:v slow',<br>#                      '-crf:v 18',<br>#                      '-strict -2',<br>#                      '-metadata:s:a:0',<br>#                      'language="eng"',<br>#                      '"%s"' % outfile,<br>#                      '2> /dev/null')<br><br>mv -f "$nice_title.mp4" $DEST<br><br><br></div></div>