(I edited this post on 2007-10-22 to include new information)
It appears that "manual recordings" are indeed the
source of the re-createable problem, but I have also
experienced problems with a few normal recordings. Two things
are required to get your system to work:
First: Edit /usr/share/mythtv/mytharchive/scripts/mythburn.py
with your favorite editor and search for:
Code:
fps = video.attributes["fps"].value
I have found that this fps value can also sometimes be
too high (not just too low) which causes other issues, including
audio sync issues and refusal to use more than 3% of the
CPU while creating the DVD (it takes days instead of hours to
create a DVD). I now recommend adding this line after the
"fps = video.attributes["fps"].value" line. The line you found is
left there so all you have to do is delete what you added to
put it back the way it was:
Code:
"""Cliff added this to fix bad fps values in manual recordings"""
fps = "29.97"
I originally recommended the following to fix the low values, but
no longer recommend it because I have found cases of high
values needing to be fixed:
Code:
"""Cliff added this to fix bad fps values in manual recordings"""
"""This is no longer the recommended fix"""
if float(fps) < 10.0:
fps = "29.97"
Second: If you use the cutlist you must have a cut (at
least a very short one) at the very beginning of the video.
- This is not the perfect fix as it does not address the cause
of the issue.
- This will cause all recordings/videos to be treated as 29.97
(NTSC)
- Those outside the USA will probably need to use or "23.976"
or "25.00" or some other strange value instead of "29.97"
(Additional discussion)
I had the problem too... and same result after applying
Cecil's instructions. and same result after applying
IEnigmusIs' patch to that.
The problem may be that the calculated video duration / fps
/ bitrates are wrong. For my video, the duration should be
1:50:00 but it is 14:48:25. The video bitrate is apparently
unknown as the combined bitrate of 1411 is the same as the
audio bit rate taken alone. The video frame rate of 0.03
(and 5 fps in another place) is way off too.
Maybe some of this is causing a miscalculation resulting in
the 5 frames per second frame rate complained about in the
error message in the mythburn.log
FYI:
- I encode directly to MPEG4 and do not transcode.
- I have tweaked my encoder quality way up (0-2).
- I increased my encoder resolution to 640x480.
- I increased my encoder bit rate to 5000.
- Scale bitrate for frame size is ON
- Enable high-quality encoding is ON
- Enable 4MV encoding is ON
- Enable interlaced DCT encoding is OFF
- Enable interlaced moti(on ...) is OFF
- My MythArchive settings are completely stock as I
recall.
- This was from a manual record, but I don't have
reason to suspect that. <edit> This apparently was
exactly the problem </edit>
- I recall not having this problem with a normal recording
under R5E50 and on this hardware.
- The chmod errors at the end of the log are probably
because I created some test files in that directory
when logged in as root.
R5F1 upgraded from R5E50. I also had a problem in R5F27.
Older Intel Dual core CPU at 3.0 ghz. 512meg RAM.
Cliff
Code:
*** Here is my mythburn.log (long lines manually wrapped) ***
mythburn.py (0.1.20070428-1.fixes) starting up...
Process priority 8
script path:/usr/share/mythtv/mytharchive/scripts
myth share path:/usr/share/mythtv
passed job file: /myth/tmp/config/mydata.xml
passed progress log file: /myth/tmp/logs/progress.log
mythburn.py (0.1.20070428-1.fixes) starting up...
Found 2 CPUs
Obtaining MythTV settings from MySQL database for hostname mythtv2
temppath: /myth/tmp/work
logpath: /myth/tmp/logs
Processing Mythburn job number 1.
Options - mediatype = 1, doburn = 1, createiso = 1, erasedvdrw = 0
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 '11416_20070724190000.nuv' of type 'recording'
2007-07-27 17:48:26.749 Opening /myth/tv/11416_20070724190000.nuv
Input #0, nuv, from '/myth/tv/11416_20070724190000.nuv':
Duration: 14:48:25.5, start: 0.000000, bitrate: 1411 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 640x480, 0.03 fps(r)
Stream #0.1: Audio: mp3, 44100 Hz, stereo, 1411 kb/s
0: start_time: 0.000 duration: 53.306
1: start_time: 0.000 duration: 53.306
stream: start_time: 0.000 duration: 53305.588 bitrate=1411 kb/s
2007-07-27 17:48:26.755 duration = 53305
streaminfo.xml :-
<?xml version="1.0" ?><!DOCTYPE FILEINFO><file duration="1765" \
filename="/myth/tv/11416_20070724190000.nuv" type="nuv">
<streams count="2">
<video aspectratio="1.33333" bitrate="0" codec="mpeg4" \
ffmpegindex="0" fps="0.0333667" height="480" id="0" \
start_time="0.0" streamindex="0" width="640"/>
<audio bitrate="1411200" channels="2" codec="mp3" \
ffmpegindex="1" id="1" language="N/A" samplerate="44100" \
start_time="0.0" streamindex="1"/>
</streams>
</file>
Kiki's Delivery Service (Manual Record)
Video resolution is 640 by 480
*************************************************************
Processing file 11416_20070724190000.nuv of type recording
*************************************************************
File type is 'nuv'
Video codec is 'mpeg4'
2007-07-27 17:48:27.006 Opening /myth/tv/11416_20070724190000.nuv
Input #0, nuv, from '/myth/tv/11416_20070724190000.nuv':
Duration: 14:48:25.5, start: 0.000000, bitrate: 1411 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 640x480, 0.03 fps(r)
Stream #0.1: Audio: mp3, 44100 Hz, stereo, 1411 kb/s
0: start_time: 0.000 duration: 53.306
1: start_time: 0.000 duration: 53.306
stream: start_time: 0.000 duration: 53305.588 bitrate=1411 kb/s
2007-07-27 17:48:27.012 duration = 53305
streaminfo.xml :-
<?xml version="1.0" ?><!DOCTYPE FILEINFO><file duration="1765" \
filename="/myth/tv/11416_20070724190000.nuv" type="nuv">
<streams count="2">
<video aspectratio="1.33333" bitrate="0" codec="mpeg4" \
ffmpegindex="0" fps="0.0333667" height="480" id="0" \
start_time="0.0" streamindex="0" width="640"/>
<audio bitrate="1411200" channels="2" codec="mp3" \
ffmpegindex="1" id="1" language="N/A" samplerate="44100" \
start_time="0.0" streamindex="1"/>
</streams>
</file>
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 (HQ) found
mythtranscode started (using cut list) PID = 11508
Waiting for mythtranscode to create the fifos
2007-07-27 17:48:27.195 Using runtime prefix = /usr
2007-07-27 17:48:27.216 New DB connection, total: 1
2007-07-27 17:48:27.223 Enabled verbose msgs: important
2007-07-27 17:48:27.226 New DB connection, total: 2
2007-07-27 17:48:27.244 Using protocol version 31
Running ffmpeg
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --prefix=/usr --libdir=${prefix}/lib \
--shlibdir=${prefix}/lib --incdir=${prefix}/include/ffmpeg \
--enable-shared --enable-mp3lame --enable-gpl --enable-faad \
--mandir=${prefix}/share/man --enable-vorbis --enable-pthreads \
--enable-faac --enable-xvid --enable-dts --enable-amr_nb \
--enable-amr_wb --enable-pp --enable-libogg --enable-libgsm \
--enable-x264 --enable-a52 --extra-cflags=-Wall -g -fPIC -DPIC
libavutil version: 49.0.0
libavcodec version: 51.11.0
libavformat version: 50.5.0
built on Oct 14 2006 21:20:45, gcc: 4.1.2 20061007 (prerelease) \
(Debian 4.1.1-16)
Input #0, s16le, from '/myth/tmp/work/1/audout':
Duration: N/A, bitrate: N/A
Stream #0.0: Audio: pcm_s16le, 44100 Hz, stereo, 1411 kb/s
Input #1, rawvideo, from '/myth/tmp/work/1/vidout':
Duration: N/A, bitrate: N/A
Stream #1.0: Video: rawvideo, yuv420p, 640x480, 0.03 fps(r)
Output #0, dvd, to '/myth/tmp/work/1/newfile2.mpg':
Stream #0.0: Video: mpeg2video, yuv420p, 720x480, q=5-31, \
9000 kb/s, 5.00 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
[mpeg2video @ 0xb7eb5ee8]MPEG1/2 does not support 5/1 fps
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 video.
Command was ffmpeg -y -threads 2 -f s16le -ar 44100 -ac 2 -i \
/myth/tmp/work/1/audout -f rawvideo -pix_fmt yuv420p -s 640x480 \
-aspect 1.33333 -r 0.0333667 -i /myth/tmp/work/1/vidout -aspect \
1.33333 -r 0.0333667 -s 720x480 -b 9000k -vcodec mpeg2video \
-qmin 5 -ab 192k -ar 48000 -acodec ac3 -f dvd \
"/myth/tmp/work/1/newfile2.mpg"
************************************************************
chmod: changing permissions of `/myth/tmp/logs/tt.log': \
Operation not permitted
chmod: changing permissions of `/myth/tmp/logs/ff': \
Operation not permitted
Terminated
(The chmod errors at the end are because of some files I
left in /myth/tmp. The problem still occurs when the files
are removed.)