Results 1 to 2 of 2

Thread: Setting Mythtv user job variables according to file extension and type

  1. #1
    Join Date
    Sep 2011
    Beans
    8

    Setting Mythtv user job variables according to file extension and type

    I want to set the variable COMMAND to behave in one of two ways depending on the file extension and type. The reason behind this is some origin video files have been transcoded from *.mpg MPEG-4 video files to NuppelVideo *.nuv files, and some have not yet been. While I tweak the settings, I still want the script to call out a different command if necessary. Something like:
    Code:
    if
    {INDIR}/${CHANID}_${STARTTIME}.* == {INDIR}/${CHANID}_${STARTTIME}.mpg && {INDIR}/${CHANID}_${STARTTIME}.* is really an MPEG-4 file
    then
    COMMAND == MPGCOMMAND && PARAMS == MPGPARAMS
    or if
    {INDIR}/${CHANID}_${STARTTIME}.* == {INDIR}/${CHANID}_${STARTTIME}.nuv && {INDIR}/${CHANID}_${STARTTIME}.* is really an NuppelVideo file
    then
    COMMAND == NUVCOMMAND && PARAMS ++ NUVPARAMS
    but if
    {INDIR}/${CHANID}_${STARTTIME}.* == {INDIR}/${CHANID}_${STARTTIME}.neither mpg nor nuv && the file is something else
    then
    error out and send the error to the log file.
    fi
    Here is my script:
    Code:
    #! /bin/bash
    scriptstarttime=$(date +%F-%H%M%S)
    
    CHANID=$1
    STARTTIME=$2
    
    INDIR="/var/lib/mythtv/recordings"
    OUTDIR="/home/username/Dropbox"
    PROG="/home/username/bin/ffmpeg"
    
    NUVPARAMS="-y -stats -deinterlace -vcodec libx264 -vprofile baseline -level 13 -maxrate 76800 -bufsize 3000000 -acodec libfdk_aac -ac 2 -ab 128k -ar 44100 -sn"
    MPGPARAMS="-y -stats -deinterlace -vcodec libx264 -vprofile baseline -level 30 -maxrate 100000-bufsize 10000000 -acodec libfdk_aac -ac 2 -ab 128k -ar 44100 -sn"
     
    LOGFILE="/home/username/Dropbox/DropboxTranscode.log"
    OUTFILE="${OUTDIR}/${CHANID}_${STARTTIME}"
    
    touch $LOGFILE
    echo "$scriptstarttime Dropbox Transcode" >> $LOGFILE 
    
    #IF TEST
    
    COMMAND="${PROG} -i ${INDIR}/${CHANID}_${STARTTIME}.* ${PARAMS} ${OUTFILE}.mp4"
    
    echo "${COMMAND}" >> $LOGFILE
    
    Thanks,
    Iago6776

  2. #2
    Join Date
    Jan 2014
    Beans
    224
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Setting Mythtv user job variables according to file extension and type

    AFAIK nuv is deprecated and implies you have transcoded into MJPEG or MPEG-ASP?
    Mythtv can not transcode mpeg4 layer 10 H264 except by piping into external prog (ffmpeg).

    You are trying to use mythtv's job queue to launch scripts on files.
    You can find the full filename path with mysql DB operations.

    You could get mythtv to output the recording filename into your script %FILENAME%.

    In your script can then work out extension from:
    extension=${myfilename##*[/|.\\]}

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •