[mythtv-users] Audio Sync problem -- need help

John Drescher drescherjm at gmail.com
Fri May 25 13:29:09 UTC 2007


> I ran the pxcut.sh script that John so kindly provided, which demultiplexes the A/V stream, uses ProjectX to cut out commercial sections, and then re-multiplexes them together again.
>
> I viewed the modified file with MythTV successfully, skipping to various locations in the program -- no audio/video sync problem in evidence.
>
> However, when I tried to use mythArchive on the modified file to make an iso image and not burn a dvd, with no re-encoding, it failed.  FWIW, I have never been successful invoking mythArchive without selecting a re-encoding option.  I was attempting to make an iso image without burning a dvd, so I could check the resulting file without consuming DVD blanks unnecessarily.
>
> Here are the last eight (8) lines output to the progress.log (between the lines of "================"):
> ===================================================
> 2007-05-23 22:17:44 Audio track 1 is in mp2 format - re-encoding to ac3
> 2007-05-23 22:17:44 Encoding audio to ac3
> 2007-05-23 22:17:45 ************************************************************
> 2007-05-23 22:17:45 ERROR: Failed while running ffmpeg to re-encode the audio to ac3
> Command was ffmpeg -v 0 -y -i '/video/temp/work/1/stream0.mp2' -f ac3 -ab 192 -ar 48000 '/video/temp/work/1/stream0.ac3'
> 2007-05-23 22:17:45 ************************************************************
> 2007-05-23 22:17:45
> 2007-05-23 22:17:45 Terminated
> ===================================================
>
>
> and here are the last seventeen (17) lines output to mythburn.log (again, between the lines of "==============="):
> ===================================================
>
> Audio track 1 is in mp2 format - re-encoding to ac3
> Encoding audio to ac3
> FFmpeg version SVN-r8743, Copyright (c) 2000-2007 Fabrice Bellard, et al.
>   configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --enable-shared --enable-gpl --enable-pp --enable-swscaler --enable-pthreads --enable-x11grab --enable-dc1394 --enable-liba52bin --enable-libdts --enable-libfaac --enable-libfaadbin --enable-libmp3lame --enable-libogg --enable-libtheora --enable-libvorbis --enable-xvid --extra-cflags=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables --disable-strip
>   libavutil version: 49.4.0
>   libavcodec version: 51.40.3
>   libavformat version: 51.12.1
>   built on Apr 23 2007 23:45:21, gcc: 4.1.1 20070105 (Red Hat 4.1.1-51)
> Stream mapping:
>   Stream #0.0 -> #0.0
> Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height
> ************************************************************
> ERROR: Failed while running ffmpeg to re-encode the audio to ac3
> Command was ffmpeg -v 0 -y -i '/video/temp/work/1/stream0.mp2' -f ac3 -ab 192 -ar 48000 '/video/temp/work/1/stream0.ac3'

Ahh. You must have a new ffmpeg. They changed the -ab param and the -b
param to mean bytes per second instead of kb/s so at 192 bytes/s your
audio will fail. You need to put a K after the number on the call in
the mythburn.py script.  There are a couple of other threads that talk
about this also I believe this is fixed in the latest mytharchive. I
have turned off the always encode to ac3 option  so I do not get this
error.

You can grab the latest svn which will fix this error or I believe
edit the following line from:

cmd += "-i '%s' -f ac3 -ab 192 -ar 48000 '%s'" % (sourcefile, destinationfile)

to

 cmd += "-i '%s' -f ac3 -ab 192k -ar 48000 '%s'" % (sourcefile, destinationfile)

This should be around line 1229.

Here is a link to the diffs in the svn code:

http://svn.mythtv.org/trac/changeset/13359/trunk/mythplugins/mytharchive/mythburn/scripts/mythburn.py


> ************************************************************
>
> Terminated
> ===================================================
>
>
> NOTES:
>     ProjectX is a java script.  The source downloads (there are two) include a build.sh script which produces a .jar file (there is another build file for windows users).  I took the ProjectX.jar file and put it in a directory I created manually, /usr/share/ProjectX/ProjectX.jar.  Then I created the following shell script and put it in /usr/bin/projectx, owned by uid root and gid root with permissions of "-rwxr-xr-x".  Here is the script:
>
> #! /bin/sh
> java -jar /usr/share/ProjectX/ProjectX.jar "$@"
>
> I modified pxcut.sh before running it to take out references to the host machine in the mysql commands and put in -p<mysql_passwd> where <mysql_passwd> is a placeholder for the appropriate value.  Notice there is NO space permitted by mysql between "-p" and "<mysql_passwd>"!
> END of NOTES.
>
> Running pxcut.sh worked fine (I ran it as root, since all the recordings are owned by root.  I ran it after cd'ing to the directory where they are put by MythTV).  However, there were a number of messages like these:
>
> 72 %-> cut-out @ GOP# 13077 (196173)
> 76 %-> cut-in @ GOP# 13681 / new vframe 143172 / new Timecode 01:19:37.177 (205233)
> !> PTS difference of 27207180 (00:05:02.302) to last exported GOP detected
> !> dropping useless B-Frames @ GOP# 13681 / new Timecode 01:19:37.177
> 83 %-> cut-out @ GOP# 14972 (224598)
> 86 %-> cut-in @ GOP# 15599 / new vframe 162535 / new Timecode 01:30:23.256 (234003)
> !> PTS difference of 28243215 (00:05:13.813) to last exported GOP detected
> !> dropping useless B-Frames @ GOP# 15599 / new Timecode 01:30:23.256
> 100 %-> cut-out @ GOP# 18082 (271248)
>
This is normal projectx output.

> This may or may not have any bearing on my problem of trying to use mytharchive to create a DVD iso file.
>
> My next attempt will be to try and create an iso file while allowing mytharchive to re-encode the file using the "SP" profile to see if that works any better.
>
If you are doing any reencoding you may have to fix other calls to
ffmpeg. I would not worry about this unless it mytharchive fails
because you probably already have the fix.

>
> In the meantime, any input from the peanut gallery is welcomed!
>
John


More information about the mythtv-users mailing list