EDIT1: Changed -bufsize from 1854k to 1835k for better tcrequant compatibility.
EDIT2 (final): Added "-strict 2" to get the tcrequant'ed set of video files to fit the dvd. Changed -bufsize to the exact value 1835008
The problem: You are trying to burn a DVD from a series of recordings. You are using the cutlist to skip the commercials in the DVD. The DVD creation fails with the following errors...
Errors are:
Quote:
ERROR: Failed while running dvdauthor. Result: 1
in the log viewer (/myth/tmp/logs/progress.log)
and these errors:
Quote:
++ WARN: [mplex] Stream e0: data will arrive too late sent(SCR)=156583497 required(DTS)=156583433
(SCR and DTS numbers vary)
...
**ERROR: [mplex] Too many frame drops -exiting
...
ERR: Cannot jump to chapter 8 of title 1, only 7 exist
(generally "Cannot jump to chapter X of title Y, only X-1 exist")
in /myth/tmp/logs/mythburn.log
I have fought this problem for years, it only happens on some recordings, and seems to only happen if you use the cutlist?
The reason: ffmpeg spikes the data rate too high for DVD during VBR encoding. This is due to glitches in the recording or lots of video motion.
The fix: Edit the python script to fix the way ffmpeg is called.
How:
Become superuser:
Code:
sudo su
(enter admin password)
Go to the directory where the python script resides and back it up for a fallback
Code:
cd /usr/share/mythtv/mytharchive/scripts
cp -a mythburn.py mythburn.py.original
Edit the python script (use whatever editor you like, I show nano here for ease of use):
Code:
nano mythburn.py
use Ctrl-W to search for
Code:
command += "-qmin
The full line you are looking for is
Code:
command += "-qmin %s -qmax %s -qdiff %s " % (qmin, qmax, qdiff)
Add this new line after the line you found
Code:
command += "-maxrate 9200000 -bufsize 1835008 -strict 2 "
Use spaces, not tabs, to space out and exactly match the indentation of the
command += "-qmin line. Note there is a space after the 2 and before the "
Exit and save from nano.
Done.
A final hint:
I have found that adding a small cut (cut list entry) at the very beginning of a recording will help sometimes if you are burning with cutlists and have problems.
Technical details for the curious or programming inclined:
1 - mythtranscode reads the recording, strips the commercials, pipes the data to ffmpeg which creates the normal file newfile2.mpg at the recording profile compression ratio you wanted (SP, LP, etc.)
2 - mythreplex -demux reads newfile2.mpg and writes stream.mv2 and stream0.ac3 in case the audio needs to be converted (like to ac3) or the video further compressed (won't fit on DVD at the recording profile you asked for). A different set of these files exists for each recording to be put on the DVD.
3 - audio is converted to ac3 if needed?
4 - menus are created
5 - tcrequant is called to further compress stream.mv2 if calculation shows it won't fit on the DVD
6 - mplex is called to convert the stream.mv2 and stream0.ac3 into final.mpg. It also adds a sync offset if the video and audio are out of sync.
7 - dvdauthor is called to read the multiple final.mpg's and create a video DVD directory structure
8 - an ISO file is created from the DVD directory structure if you have this enabled. I am guessing it uses mkisofs.
9 - growisofs is used to burn the DVD from the DVD directory structure if you have this enabled.
The problem happens when there is a glitch or very high motion in the original recording. ffmpeg creates a newfile2.mpg with a very high data rate in just a few isolated places. Later, mplex starts dropping frames (one of the error messagtes) in these places because it knows the DVD can't keep up with the high data rate. When mplex hits 10 dropped frames, it gives up and exits (one of the error messages). If the final.mpg is less than 7/8ths complete, dvdauthor will not be able to generate a chapter picture from it and dvdauthor will fail, aborting the whole process. If more than 7/8ths done I will guess that the process completes without error, but you are missing the tail of that recording on the DVD. The 7/8ths discussed above comes from the 8 chapters. If you are using a simpler DVD menu style that has say 4 chapters it will be 3/4ths. If your DVD menu style does not have chapters, I am guessing that no matter how bad mplex fails, dvdauthor will succeed and you will get a DVD burned, but the recordings will be chopped off.
Please reply to this post if you are having this problem. Thanks.
Whew!!!
Cliff