LinHES Forums
http://forums.linhes.org/

Rip audio of TV?
http://forums.linhes.org/viewtopic.php?f=17&t=14392
Page 3 of 3

Author:  mythman13 [ Mon Sep 29, 2008 2:58 am ]
Post subject: 

Hi,
I also think mythtv isn't running the job because nothing appears in the myth2mp3.log file no matter how long you reasonably wait for the job to run.

However myth2ipod and commerical flagging and transcode to Xvid all seem to work fine when you select to run them as jobs.

It is as though myth dosen't want to run this as a job?

Thanks,
Mythman

Author:  brfransen [ Mon Sep 29, 2008 11:30 am ]
Post subject: 

mythman,
I expect that the UserJob is enabled in the Backend setup because you can trigger the job, but I don't remember how that works exactly. Check you backend settings to confirm the User Job is enabled.

The other thing is you could look in the database at the jobqueue table and see if there is a job that has a status other than 272. 272 means it completed successfully. Look at the type. UserJob1 is 256, UserJob2 is 512, UserJob3 is 1024, UserJob4 is 2048. If you have jobs with your UserJob type listed that show other than 272 you should be safe to delete them. That may be hanging up the job.

Britney

Author:  mythman13 [ Tue Sep 30, 2008 9:59 am ]
Post subject:  oooops

Hi,

Thanks for that, I was just being an idot with the mythtv-setup pages actually :oops: sorry!

The screen before the one where you enter the commands for a job has all the buttons to enable jobs and I hadn't noticed this on my tv when I was looking through it. However I've got X11forwarding working now on my computer and I noticed it on there when I ran it using SSH!

Sorry about that - I didn't realise the job had to be enabled as well as created!

Thanks anyway and it seems to be working fine now with the cutlist. However one other thing, the file names seem a little weird when I ran it on a file it came back with TPHR7A~C.MP3 instead of the title - subtitle I was expecting. I've ensured the job command is as you specified so I'm sure about this one?

Thanks,
Mythman

Author:  mythman13 [ Tue Sep 30, 2008 10:27 am ]
Post subject: 

Two things....it would be good to get this to do an RSS feed like /usr/local/bin/myth2ipod and then I could access my mp3s much easier as a podcast! Secondly, any idea how to encode the mp3 at a higher volume as atm its seems a little quieter to what I'm used to? Just a few little ideas...
Thanks very much anyway for this...its great!

Mythman

Author:  brfransen [ Tue Sep 30, 2008 11:55 am ]
Post subject: 

The file name thing seems to be samba messing up the file name. ls /myth/music shows the correct file name on my machine.

The rss thing shouldn't be too hard to do as most of the code is already in myth2ipod. Have at it.

I haven't noticed the volume issue at all. There may be an ffmpeg option that would help with that.

Britney

Author:  Verbetex [ Wed Nov 05, 2008 6:08 am ]
Post subject: 

Hey

I used to have this working nicely under a previous version but am having problems under 5.5.

I'm using your updated version of the script... but the resulting MP3 just has noise on the left channel, has the proper sound on the right, but is played at half speed!!

I've not had much time to play with it yet, but looking for any ideas??

Cheers
Paul

Author:  brfransen [ Wed Nov 05, 2008 10:17 am ]
Post subject: 

Paul,

I haven't seen any of the issues you are describing. Is this happening on every video file? What format is it? DTV or analog?

Britney

Author:  Verbetex [ Wed Nov 05, 2008 10:37 am ]
Post subject: 

I've tried it on 2 DTV recordings (Radio 1) and had the same result with each.

I'll give it a go with some others tonight and see what happens...

Author:  mihanson [ Fri Dec 19, 2008 3:46 pm ]
Post subject: 

I have modified bfransen's script to output a 16-bit PCM wav file (for uncompressed audio that I can burn to CD-R). It's worked really well for me, but I recently ran into an issue that has me stumped. I was trying to dump the audio for an episode of Sesame Street so I could make an audio CD of a song my son likes. However, I'm getting a mix of the program audio plus a descriptive narration for the "visually impaired." I've tried adding audio bitstream filters (-absf) "dump_extra" and "remove_extra" as well as mapping (-map) different audio tracks to the output to wav, but I can't seem to shake the narration. I do not hear the narration as I watch the program in mythfrontend. Any ideas anyone?

[EDIT] I figured it out. I was not using the correct syntax for the -map option. When I ran the ffmpeg command by hand, I saw the error of my ways. If anyone needs to know, you should use -map like this -map 0.1:0 where 0.1 is the 1st audio track in the program and 0 is the audio track on the output file. If you run the ffmpeg command by hand, it will become more apparent. How can we make the logging more verbose so I would not need to run the command by hand?[/EDIT]

Code:
#!/bin/sh
# convert recordings to wav audio only
# version 0.6

# usage:
# first parameter must be %DIR%/%FILE% of the recording
# second parameter must be the desired base name of the output
# third parameter must be %CHANID% if you set USECUTLIST=Y
# fourth parameter must be %STARTTIME% if you set USECUTLIST=Y
# In the mythtv setup screen invoke this script like this:
# MYTHTV User Job Command:
# /usr/local/bin/myth2wav "%DIR%/%FILE%" "%TITLE% - %SUBTITLE%" "%CHANID%" "%STARTTIME%"

# options:
USECUTLIST=Y            #Y or N

# where the converted audio is stored
OUT_DIR=/myth/music

# create temp filename so multiple instances won't conflict
TMPNAME=toWAV-$$
TMPFILE=/myth/tmp/$TMPNAME.wav
TMPCUTFILE=/myth/tmp/$TMPNAME.mpg
FFINPUTFILE=$1

# log file location
LOGFILE=/var/log/mythtv/myth2wav.log
CDate="`date`"
echo "" >> $LOGFILE
echo $CDate >> $LOGFILE
echo "File to encode: $1     Name: $2" >> $LOGFILE

# start timer
beforetime="$(date +%s)"

# check if using cutlist
if [ $USECUTLIST = Y ];then
    MYTHCOMMFRAMES=`mythcommflag --getcutlist -f $FFINPUTFILE | grep 'Cutlist:' | cut -d \  -f 2`
    if [ -n "$MYTHCOMMFRAMES" ]; then
        echo "Extracting Cutlist..." >> $LOGFILE
        /usr/bin/nice -n19 /usr/bin/mythtranscode --chanid "$3" --starttime "$4" --outfile "$TMPCUTFILE" --mpeg2 --honorcutlist
        FFINPUTFILE=$TMPCUTFILE
    fi
fi

# run ffmpeg to do conversion
echo "Encoding..." >> $LOGFILE
/usr/bin/nice -n19 /usr/bin/ffmpeg -i $FFINPUTFILE -vn -acodec pcm_s16le -ar 44100 -ac 2 $TMPFILE
ERROR=$?

# make output filename unique
OUTPUTFILE=$OUT_DIR/$2.wav
i=1
while [ -e "$OUTPUTFILE" ]
do
    OUTPUTFILE=$OUT_DIR/$2-$i.wav
    i=`expr $i + 1`
done

# move temp file to output location
chown mythtv "$TMPFILE" && mv "$TMPFILE" "$OUTPUTFILE"

# stop timer
aftertime="$(date +%s)"
seconds="$(expr $aftertime - $beforetime)"

if [ $ERROR -eq 0 ]; then
    echo "File Encoded Sucessfully: $OUTPUTFILE" >> $LOGFILE
    hours=$((seconds / 3600))
    seconds=$((seconds % 3600))
    minutes=$((seconds / 60))
    seconds=$((seconds % 60))
    echo "Encoding Time: $hours hour(s) $minutes minute(s) $seconds second(s)" >> $LOGFILE
else
    echo "ERROR: $ERROR" >> $LOGFILE
fi

# clean up left over files
unlink $TMPFILE 2> /dev/null
unlink $TMPCUTFILE 2> /dev/null
unlink $TMPCUTFILE.map 2> /dev/null

Page 3 of 3 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/