[mythtv-users] Slow -- and LOW CPU use! -- mythtranscoding

Rod Smith mythtv at rodsbooks.com
Tue Jan 23 00:09:19 UTC 2007


Hi,

I've got a new MythTV system, which I'm initially using mainly for DVD
playback and archiving of various material from other sources. (I've got a
DirecTiVo for DVR functions.) I've been setting things up, testing
functionality, and so on. Today I ran into an odd problem: I recorded some
material (from a laserdisc) and went to burn it to DVD+R. I've done this once
before, and have done test burns to DVD+RWs without problems. (Well, I *HAVE*
had problems, but I've been able to work around them all.) For this
recording, though, the system is being very slow about it. My mythburn.log
file is filled with lines like this:

2007-01-22 17:28:38.378 mythtranscode: 4% Completed @ 2.10521 fps.
2007-01-22 17:28:58.651 mythtranscode: 4% Completed @ 2.10449 fps.
2007-01-22 17:29:18.884 mythtranscode: 4% Completed @ 2.10407 fps.
2007-01-22 17:29:39.162 mythtranscode: 4% Completed @ 2.10469 fps.

Here's the bulk of the mythburn.log file, excluding the repetitive "%
Completed" messages from mythtranscode:

mythburn.py (0.1.20060910-1) starting up...
Process priority 8
script path:/usr/share/mythtv/mytharchive/scripts
myth share path:/usr/share/mythtv
passed job file: /var/lib/mytharchive/config/mydata.xml
passed progress log file: /var/lib/mytharchive/logs/progress.log
mythburn.py (0.1.20060910-1) starting up...
Obtaining MythTV settings from MySQL database for hostname seeker
Obtaining date and time settings from MySQL database for hostname seeker
Processing Mythburn job number 1.
Options - mediatype = 0, doburn = 1, createiso = 0, erasedvdrw = 1
          savefilename = ''
Looking for: /usr/share/mythtv/mytharchive/themes/MythCenter/theme.xml
Loading font 0, /usr/share/mythtv/FreeSans.ttf size 19
Loading font 1, /usr/share/mythtv/FreeSans.ttf size 15
Loading font 2, /usr/share/mythtv/FreeSans.ttf size 13
wantIntro: 1, wantMainMenu: 1, wantChapterMenu:1, wantDetailsPage: 0
Final DVD Video format will be ntsc
There are 1 files to process
Pre-processing file '1125_20070122110600.nuv' of type 'recording'
          Soapdish
2007-01-22 16:26:48.094 Opening /var/lib/mythtv/1125_20070122110600.nuv
Input #0, nuv, from '/var/lib/mythtv/1125_20070122110600.nuv':
  Duration: 03:33:28.5, start: 0.000000, bitrate: 1411 kb/s
  Stream #0.0: Video: mpeg4, yuv420p, 640x480, 59.50 fps(r)
  Stream #0.1: Audio: mp3, 48000 Hz, stereo, 1411 kb/s
0: start_time: 0.000 duration: 12.809
1: start_time: 0.000 duration: 12.809
stream: start_time: 0.000 duration: 12808.583 bitrate=1411 kb/s
2007-01-22 16:26:48.100 duration = 12808
Video resolution is 640 by 480
*************************************************************
Processing file 1125_20070122110600.nuv of type recording
*************************************************************
File type is 'nuv'
Video codec is 'mpeg4'
2007-01-22 16:26:48.467 Opening /var/lib/mythtv/1125_20070122110600.nuv
Input #0, nuv, from '/var/lib/mythtv/1125_20070122110600.nuv':
  Duration: 03:33:28.5, start: 0.000000, bitrate: 1411 kb/s
  Stream #0.0: Video: mpeg4, yuv420p, 640x480, 59.50 fps(r)
  Stream #0.1: Audio: mp3, 48000 Hz, stereo, 1411 kb/s
0: start_time: 0.000 duration: 12.809
1: start_time: 0.000 duration: 12.809
stream: start_time: 0.000 duration: 12808.583 bitrate=1411 kb/s
2007-01-22 16:26:48.474 duration = 12808
Preferred audio languages eng and eng
Video id: 0x0, Audio1: [1] 0x1 (MP3, N/A), Audio2: [-1] - 0x-1 (N/A, N/A)
Aspect ratio is 4:3
Re-encoding audio and video from nuv file
Encoding profile (SP) found
mythtranscode started (using cut list) PID = 4956
Waiting for mythtranscode to create the fifos
2007-01-22 16:26:48.775 Using runtime prefix = /usr
2007-01-22 16:26:48.816 New DB connection, total: 1
2007-01-22 16:26:48.825 Enabled verbose msgs: important
2007-01-22 16:26:48.829 New DB connection, total: 2
2007-01-22 16:26:48.905 Using protocol version 31
Running ffmpeg
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2004 Fabrice Bellard

configuration:  --enable-gpl --enable-pp --enable-pthreads --enable-vorbis
 --e nable-libogg --enable-a52 --enable-dts --enable-libgsm --enable-dc1394
 --disable -debug --enable-shared --prefix=/usr
  libavutil version: 0d.49.0.0
  libavcodec version: 0d.51.11.0
  libavformat version: 0d.50.5.0
  built on Sep 20 2006 00:26:15, gcc: 4.1.2 20060906 (prerelease) (Ubuntu
4.1.1-
13ubuntu2)
Input #0, s16le, from '/var/lib/mytharchive/work/1/audout':
  Duration: N/A, bitrate: N/A
  Stream #0.0: Audio: pcm_s16le, 48000 Hz, stereo, 1536 kb/s
Input #1, rawvideo, from '/var/lib/mytharchive/work/1/vidout':
  Duration: N/A, bitrate: N/A
  Stream #1.0: Video: rawvideo, yuv420p, 640x480, 59.50 fps(r)
Output #0, dvd, to '/var/lib/mytharchive/work/1/newfile2.mpg':
  Stream #0.0: Video: mpeg2video, yuv420p, 720x480, q=5-31, 4771 kb/s, 59.94
fps
(c)
  Stream #0.1: Audio: ac3, 48000 Hz, stereo, 192 kb/s
Stream mapping:
  Stream #1.0 -> #0.0
  Stream #0.0 -> #0.1
Press [q] to stop encoding

At the rate it's going, I calculate it'll take about 30 hours to process the
entire file, which is about 96 minutes long. (My previous tests have all been
close to 1:1 on processing:playback time.) What's really weird is that the
CPU use is low:

$ uptime
 17:35:33 up  1:43,  6 users,  load average: 0.09, 0.09, 0.08

The system isn't thrashing; swap use is low:

$ free
             total       used       free     shared    buffers     cached
Mem:        255644     251700       3944          0       8764      49700
-/+ buffers/cache:     193236      62408
Swap:       497972      65728     432244

The top utility reveals that ffmpeg and mythtranscode are both using tiny
amounts of CPU -- between 1% and 6% for ffmpeg and 0% and 2% for
mythtranscode. I've tried cancelling and restarting this job with no change.
When I cancel it and start a job with identical settings but using a
different source file, it behaves much more sensibly, with top showing ffmpeg
using 80-90% CPU and much higher fps rates in the mytharchive.log file. (Both
recordings were made with the same settings.) I'm using a cutlist for the
recording (and for my test recording), but telling MythArchive to ignore the
cutlist doesn't change this odd behavior. The cutlist contains mostly short
cuts (a couple of frames), my intent being simply to create chapters on the
resulting DVD.

My system uses an Intel Celeron D 347 3GHz with 256MB of RAM on a Biostar
PT880 Pro-A7C motherboard with a Hitachi SATA hard disk. I encoded the video
with a pcHDTV 3000 card's NTSC S-Video input at 640x480 using MPEG-4. The
file plays back just fine. I'm using Ubuntu 6.10 i386 with a custom-built
2.6.19.1 kernel and the precompiled Ubuntu MythTV packages.

This issue is really puzzling to me. I've Googled in an attempt to find an
answer, or even just somebody with similar problems, but to no avail. If
anybody's got any clue to what's going on or how to work around it, I'd
appreciate hearing your suggestions. (I've considered trying to transcode the
file from MP4 to MP4, but I'm reluctant to do that because of the quality hit
I'd take.)

Thanks for any suggestions!

-- 
Rod Smith
http://www.rodsbooks.com


More information about the mythtv-users mailing list