[mythtv] 3 problems with mytharchive (2 solved - patch provided)

Guillaume Laurès guillaume-laures at neuf.fr
Wed Feb 20 14:51:35 UTC 2008


Hello,

Since december I quite heavily use the mytharchive to burn on DVDs  
shows recorded with my DVB-T cards.
The mythburn.py script is really a clever thing, but I had 3 problems  
with it.

1- Some channels broadcast one 5.1 (ac3) soundtrack as well as  
various 2.0 (mp2). By setting 2 preferred languages in the DB, and  
with the magic in mytharchive, I got DVDs with french language in  
both 5.1 and 2.0 soundtracks, which is enough for me (don't need  
other languages).
However my DVD reader doesn't like mp2 soundtracks, so the 2.0 track  
was not readable. Hence the idea to use the "force ac3 re-encoding"  
setting. But this had the side effect to remove the 5.1 ac3  
soundtrack from the DVD.
It turned out that mythburn.py did extract 5.1 and 2.0 sound from the  
recording, but while re-encodig the 2.0 in ac3, it was overwriting  
the already-in-ac3 5.1 soundtrack.
The "work" directory before re-encoding contains  stream0.ac3 and  
stream0.mp2, and others.
After re-encoding only one "stream0.ac3" file stays. It's stream0.mp2  
re-encoded !

Here is a patch to prevent this (unfortunately I wasn't able to  
figure if this can be fixed at mythreplex level):
@@ -2800,6 +2800,12 @@

  def processAudio(folder):
      """encode audio to ac3 for better compression and compatability  
with NTSC players"""
+
+    # check if we have "two audio track 1"...
+    if doesFileExist(os.path.join(folder,'stream0.ac3'))==True and  
doesFileExist(os.path.join(folder,'stream0.mp2'))==True:
+        write( "Two audio tracks labelled #1 are in the way,")
+        write( "Keeping ac3 audio track as #1, moving mp2 audio  
track as #2.")
+        os.rename(os.path.join(folder, 'stream0.mp2'), os.path.join 
(folder, 'stream1.mp2'))

      # process track 1
      if not encodetoac3 and doesFileExist(os.path.join 
(folder,'stream0.mp2')):
@@ -2819,7 +2825,7 @@
      # process track 2
      if not encodetoac3 and doesFileExist(os.path.join 
(folder,'stream1.mp2')):
          #don't re-encode to ac3 if the user doesn't want it
-        write( "Audio track 1 is in mp2 format - NOT re-encoding to  
ac3")
+        write( "Audio track 2 is in mp2 format - NOT re-encoding to  
ac3")
      elif doesFileExist(os.path.join(folder,'stream1.mp2'))==True:
          write( "Audio track 2 is in mp2 format - re-encoding to ac3")
          encodeAudio("ac3",os.path.join(folder,'stream1.mp2'),  
os.path.join(folder,'stream1.ac3'),True)

I can provide a plain diff file if someone is interested.

2- When just burned, the DVDs work fine in the player. Some days  
after, it takes several minutes for the player to detect the discs,  
sometime they even get ejected. Go figure. I noticed mythburn.py used  
an unknown growisofs option: -dvd-video. I couldn't find this option  
in the growisofs man page, but I found one similar: -dvd-compat. Now  
the progress.log file often ends with "Input/output error" but the  
dvd plays fine. Even when cold ;-). May be the media I'm using is  
badly handled by my burner ?
Patch:
--- scripts/mythburn.py.orig    2008-01-26 16:57:35.000000000 +0100
+++ scripts/mythburn.py 2008-02-11 17:08:59.230964961 +0100
@@ -1520,10 +1520,10 @@

      if mediatype == DVD_RW and erasedvdrw == True:
          command = path_growisofs[0] + " -use-the-force-luke -Z " +  
dvddrivepath + \
-                  " -dvd-video -V 'MythTV BurnDVD' " + os.path.join 
(getTempPath(),'dvd')
+                  " -dvd-compat -V 'MythTV BurnDVD' " + os.path.join 
(getTempPath(),'dvd')
      else:
          command = path_growisofs[0] + " -Z " + dvddrivepath + \
-                  " -dvd-video -V 'MythTV BurnDVD' " + os.path.join 
(getTempPath(),'dvd')
+                  " -dvd-compat -V 'MythTV BurnDVD' " + os.path.join 
(getTempPath(),'dvd')

      if os.system(command) != 0:
          write("ERROR: Retrying to start growisofs after reload.")

Also, is -use-the-force-luke a joke ? I couldn't found it documented  
anywhere.

3- This is the one I couldn't fix. For a few weeks now (mean after an  
update),  I can't get 5.1 sound on the DVDs anymore. I looked at  
progress.log and tracked down this to mytharchivehelper. It sounds  
like it is buggy at checking the soundtracks from recorded files:

mytharchivehelper -i /mnt/store/tv/1001_20080219204200.mpg  
streaminfo.xml 0
2008-02-20 12:36:32.794 Opening /mnt/store/tv/1001_20080219204200.mpg
0: start_time: 0.027 duration: 451.332
1: start_time: 0.027 duration: 451.287
stream: start_time: 0.300 duration: 5014.800 bitrate=4930 kb/s
Input #0, mpeg, from '/mnt/store/tv/1001_20080219204200.mpg':
   Duration: 01:23:34.8, start: 0.300111, bitrate: 4930 kb/s
   Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x576, 15000 kb/ 
s, 25.00 fps(r)
   Stream #0.1[0x1c1]: Audio: mp2, 48000 Hz, stereo, 160 kb/s
2008-02-20 12:36:32.998 duration = 5014

Whereas the menu in mythTV show several tracks, including ac3 for  
this recording, and ffmpeg can detect all of them:

ffmpeg -i /mnt/store/tv/1001_20080219204200.mpg
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard,  
et al.
   configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/ 
lib64 --mandir=/usr/share/man --enable-static --enable-shared -- 
cc=x86_64-pc-linux-gnu-gcc --disable-altivec --disable-debug -- 
disable-audio-oss --disable-v4l --disable-v4l2 --disable-dv1394 -- 
disable-network --disable-opts --enable-libmp3lame --enable-liba52 -- 
enable-pthreads --enable-libxvid --enable-x11grab --enable-libfaad -- 
enable-libfaac --enable-gpl --enable-pp --disable-strip
   libavutil version: 49.4.0
   libavcodec version: 51.40.4
   libavformat version: 51.12.1
   built on Dec 29 2007 21:59:36, gcc: 4.1.2 (Gentoo 4.1.2 p1.0.1)
Input #0, mpeg, from '/mnt/store/tv/1001_20080219204200.mpg':
   Duration: 01:23:34.9, start: 0.300111, bitrate: 4930 kb/s
   Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x576, 15000 kb/ 
s, 25.00 fps(r)
   Stream #0.1[0x1c1]: Audio: mp2, 48000 Hz, stereo, 160 kb/s
   Stream #0.2[0x1c0]: Audio: mp2, 48000 Hz, stereo, 192 kb/s
   Stream #0.3[0x1c2]: Audio: mp2, 48000 Hz, mono, 64 kb/s
   Stream #0.4[0x80]: Audio: liba52, 48000 Hz, 5:1, 384 kb/s

4- I just realized that after encoding the recordings to remove the  
ads (I use lossless encoding) they seem to lost the language tag  
(this is another, untouched recording):
2008-02-20 15:34:12.325 Opening /mnt/store/tv/1002_20080220115200.mpg
0: start_time: 3085.920 duration: 70.135
1: start_time: 3085.883 duration: 70.127
2: start_time: 3086.052 duration: 70.159
stream: start_time: 34287.590 duration: 781.422 bitrate=3888 kb/s
Input #0, mpegts, from '/mnt/store/tv/1002_20080220115200.mpg':
   Duration: 00:13:01.4, start: 34287.590456, bitrate: 3888 kb/s
   Stream #0.0[0x78]: Video: mpeg2video, yuv420p, 720x576, 15000 kb/ 
s, 25.00 fps(r)
   Stream #0.1[0x82](fra): Audio: mp2, 48000 Hz, stereo, 192 kb/s
   Stream #0.2[0x8c](fra): Subtitle: dvbsub
2008-02-20 15:34:12.539 duration = 781

Here you can see (fra) for each soundtrack. Is it a known bug ?


Anyway, thanks for your unvaluable software !

GoM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-dev/attachments/20080220/4a42bbcf/attachment.html 


More information about the mythtv-dev mailing list