[mythtv-users] Intermittent playback skips and log errors

Mark Lord mythtv at rtr.ca
Tue Nov 29 16:06:28 UTC 2011

On 11-11-29 10:36 AM, Steve wrote:
> On Nov 28, 2011, at 7:56 AM, Mark Lord <mythtv at rtr.ca> wrote:
>> Easy fix:  run ffmpeg to convert the audio tracks to AC3.
>> I wrote a shell script to do this last evening, and the results
>> are just fine -- everything I tried it on was instantly cured.
>> Here's the script.  Requires the "mediainfo" command.
>> Feed it a list of video path/filenames as input.
>> Output is to same_name.avi, or same_name-new.avi if old file was a .avi:
>> #!/bin/bash
>> # Fix stuttering audio:
>> while [ "$1" != "" ]; do
>>        f="$1"
>>        shift
>>        aformat=$(mediainfo --inform="Audio;%Format%" "$f")
>>        if [ "$aformat" = "AAC" ]; then
>>                fname="${f%%.???}"
>>                out="$fname.avi"
>>                [ "$f" = "$out" ] && out="$fname-new.avi"
>>                ffmpeg -i "$f" -vcodec copy -acodec ac3 -ab 384k "$out"
>>        else
>>                echo "$f: not AAC, skipped ($aformat)"
>>        fi
>> done
> Do you run that manually or is it automatically triggered somehow?

I use it only for downloads that have the issue.
You probably are thinking of using it for our HD-PVR recordings,
in which case you should first just try it manually and see if
the resulting file works better than the original or not.

If it does work better, then it could be arranged to run
as a "user job" after each new recording completes.

You'd still have to run it manually (once) to treat your existing recordings.
But first, just try it on one, and see if the result is better or not for you.

Note that the script above does NOT overwrite or delete the original file,
so there's no real risk.  If you do end up wanting to use it on everything,
you'll also probably want to modify that behaviour, to replace the original files.


More information about the mythtv-users mailing list