[mythtv-users] Transcoding for best audio

John Pilkington J.Pilk at tesco.net
Fri Jul 5 20:05:11 UTC 2013


On 05/07/13 18:33, Brenden Conte wrote:

> Has anyone done this before?  I have some ideas on how to do #2 using
> ffmpeg, but wanted to check to see if someone has already solved this
> problem before I got too deep.
>
> Thanks!
> -B

I just remembered that I used to use a very much simpler script. I think 
it was this. It's obviously out of date and it doesn't update the Myth 
database properly but it might be adaptable.  It just didn't deal with 
imperfect recordings as well as ProjectX.

#!/bin/bash
   cd /store/myth/reca
#
echo
echo  "Output file $1_$2.mpg has video(0) and audioStream(0) copied "
echo  "from video(0) and audioStream($3) of the input file  $1_$2.mpg0 "
echo
echo  "It will inherit the metadata of the old mythtv recording $1_$2.mpg "
echo
# echo "Using Channel and Start_time parameters _may_ make mythtranscode 
update database"
if [ $# -lt 3 ]
then
    echo "Error: needs three arguments. Running  ffmpeg -i $1_$2.mpg0 
2>&1 | grep -C 4 Video "
    echo
    ffmpeg -i $1_$2.mpg0 2>&1 | grep -C 4 Video
    echo
    echo "Expected Command Line is of the form   ./mpg_csa 1234 
20070927190000  0x0ac "
    echo "                                                 chanid 
starttime       aid "
    cd ~
    exit 1
fi
echo "Command generated this time is "
echo
echo " nice nice mencoder -aid $3 -oac copy -ovc copy -of mpeg -mpegopts 
\  "
echo " format=dvd:tsaf -vf harddup  -o /mnt/sam1/tempb/$1_$2.mpgx 
$1_$2.mpg0 "
echo
# now issue command

  nice nice mencoder -aid $3 -oac copy -ovc copy -of mpeg -mpegopts \
   format=dvd:tsaf -vf harddup  -o /mnt/sam1/tempb/$1_$2.mpgx $1_$2.mpg0
#
# if using two disks link to the location that myth expects
ln -s /mnt/sam1/tempb/$1_$2.mpgx $1_$2.mpg
# and rebuild the Keyframe Index
#
  nice nice mythtranscode --mpeg2 --buildindex --showprogress --chanid 
$1 --starttime $2
#
  echo "Physical output file is /mnt/sam1/tempb/$1_$2.mpgx,"
  echo " and is linked to  /store/myth/reca/$1_$2.mpg.  Video and audio 
PID $3 streams copied"

echo
cd ~
exit 0












More information about the mythtv-users mailing list