DVD cuts out early

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

Post Reply
busbee
Junior
Posts: 15
Joined: Sun Oct 14, 2018 12:07 pm
United States of America

DVD cuts out early

Post by busbee » Fri Nov 02, 2018 4:01 pm

I've been trying to burn a DVD of my recordings, so the kids can watch it in the car. I'm using mytharchive (really nice - overcome a few bugs).
The problem is that I am on the outer range of TV stations on my antenna. So, there is a little digital gargle (tech term?) every now and then - not bad really. So when I view the dvd, it seems to cut off entirely, like goes back to the menu, at those spots. The recording is good up to that point.

I've traced the code as best I can. It gets past: cutting commercials and separating video and audio. It seems to be happening when you make the DVD. I've checked audio and video separated files and they include the entire video/audio. But, once it goes into the VOB file it cuts short.

I believe the error is here (mythburn.log):
**ERROR: [mplex] Can't find next AC3 frame: @ 6899712 we have 1186 - broken bit-stream?

Any ideas on how i can clean up / automatically cut out the gargle parts?


here is the end of my progress.log:

Code: Select all

2018-10-28 07:37:16 Finished processing '/home/mythtv/recs/1492_20181007180000.ts'
2018-10-28 07:37:16 *************************************************************
2018-10-28 07:37:16 Creating DVD XML file for dvd author (No Menus)
2018-10-28 07:37:16 Adding item 1
2018-10-28 07:37:16 aspect ratio is: 1.33333
2018-10-28 07:37:16 Fixed length chapters: 00:00:00,00:05:00,00:10:00,00:15:00,00:20:00
2018-10-28 07:37:16 Total video  738.58 Mb, audio 19.91 Mb, menus 0.00 Mb.
2018-10-28 07:37:16 Unpackaged total 758.49 Mb. About 3551 Mb will be unused.
2018-10-28 07:37:16 Multiplexing MPEG stream to /var/lib/mytharchive/temp/work/1/final.vob
2018-10-28 07:37:16 Adding sync offset of -8ms
2018-10-28 07:37:16 Available streams - video and one audio stream
2018-10-28 07:37:16 Multiplex started PID=4275
2018-10-28 07:37:16 Starting dvdauthor
2018-10-28 07:37:21 Finished  dvdauthor
2018-10-28 07:37:21 Creating ISO image
2018-10-28 07:37:21 Finished creating ISO image
2018-10-28 07:37:21 Removing all archive items from the archiveitems DB table
2018-10-28 07:37:21 Finished processing jobs!!!
And the end of my mythburn.log file:

Code: Select all

STAT: Processing /var/lib/mytharchive/temp/work/1/final.vob...
STAT: VOBU 16 at 5MB, 1 PGCs^MSTAT: VOBU 32 at 11MB, 1 PGCs^MSTAT: VOBU 48 at 16MB, 1 PGCs^MSTAT: VOBU 64 at 20MB, 1 PGCs^MSTAT: VOBU 80 at 26MB, 1 PGCs^MSTAT: VOBU 96 at 32MB, 1 PGCs^MSTAT: VOBU 112 at 36MB, 1 PGCs^MSTAT: VOBU 128 at 42MB, 1 PGCs^MSTAT: VOBU 144 at 48MB, 1 PGCs^MSTAT: VOBU 160 at 54MB, 1 PGCs^MSTAT: VOBU 176 at 59MB, 1 PGCs^MSTAT: VOBU 192 at 64MB, 1 PGCs^MSTAT: VOBU 208 at 69MB, 1 PGCs^MSTAT: VOBU 224 at 77MB, 1 PGCs^MSTAT: VOBU 240 at 82MB, 1 PGCs^MSTAT: VOBU 256 at 86MB, 1 PGCs^MSTAT: VOBU 272 at 92MB, 1 PGCs^MSTAT: VOBU 288 at 98MB, 1 PGCs^MSTAT: VOBU 304 at 103MB, 1 PGCs^MSTAT: VOBU 320 at 110MB, 1 PGCs^MSTAT: VOBU 336 at 115MB, 1 PGCs^MSTAT: VOBU 352 at 121MB, 1 PGCs^MSTAT: VOBU 368 at 127MB, 1 PGCs^MSTAT: VOBU 384 at 133MB, 1 PGCs^MSTAT: VOBU 400 at 137MB, 1 PGCs^MSTAT: VOBU 416 at 143MB, 1 PGCs^MSTAT: VOBU 432 at 148MB, 1 PGCs^MSTAT: VOBU 448 at 155MB, 1 PGCs^MSTAT: VOBU 464 at 160MB, 1 PGCs^MSTAT: VOBU 480 at 164MB, 1 PGCs^MSTAT: VOBU 496 at 171MB, 1 PGCs^MSTAT: VOBU 512 at 177MB, 1 PGCs^MSTAT: VOBU 528 at 184MB, 1 PGCs^MSTAT: VOBU 544 at 190MB, 1 PGCs^MSTAT: VOBU 560 at 193MB, 1 PGCs^MSTAT: VOBU 576 at 199MB, 1 PGCs^MSTAT: VOBU 592 at 204MB, 1 PGCs^MSTAT: VOBU 608 at 211MB, 1 PGCs^MSTAT: VOBU 624 at 216MB, 1 PGCs^MSTAT: VOBU 640 at 225MB, 1 PGCs^MSTAT: VOBU 656 at 230MB, 1 PGCs^MSTAT: VOBU 672 at 236MB, 1 PGCs^MSTAT: VOBU 688 at 241MB, 1 PGCs^MSTAT: VOBU 704 at 246MB, 1 PGCs^MSTAT: VOBU 720 at 253MB, 1 PGCs^M**ERROR: [mplex] Can't find next AC3 frame: @ 6899712 we have 1186 - broken bit-stream?

INFO: Video pts = 0.133 .. 430.430
INFO: Audio[0] pts = 0.141 .. 430.957
STAT: VOBU 727 at 255MB, 1 PGCs^M
CHAPTERS: VTS[1/1] 0.000
CHAPTERS: VTS[1/1] 299.832
INFO: Generating VTS with the following video attributes:
INFO: MPEG version: mpeg2
INFO: TV standard: ntsc
INFO: Aspect ratio: 4:3
INFO: Resolution: 720x480
INFO: Audio ch 0 format: ac3/2ch,  48khz drc

STAT: fixed 1 VOBUs
STAT: fixing VOBU at 5MB (17/727, 2%)^MSTAT: fixing VOBU at 11MB (33/727, 4%)^MSTAT: fixing VOBU at 16MB (49/727, 6%)^MSTAT: fixing VOBU at 20MB (65/727, 8%)^MSTAT: fixing VOBU at 26MB (81/727, 11%)^MSTAT: fixing VOBU at 32MB (97/727, 13%)^MSTAT: fixing VOBU at 36MB (113/727, 15%)^MSTAT: fixing VOBU at 42MB (129/727, 17%)^MSTAT: fixing VOBU at 48MB (145/727, 19%)^MSTAT: fixing VOBU at 54MB (161/727, 22%)^MSTAT: fixing VOBU at 59MB (177/727, 24%)^MSTAT: fixing VOBU at 64MB (193/727, 26%)^MSTAT: fixing VOBU at 69MB (209/727, 28%)^MSTAT: fixing VOBU at 77MB (225/727, 30%)^MSTAT: fixing VOBU at 82MB (241/727, 33%)^MSTAT: fixing VOBU at 86MB (257/727, 35%)^MSTAT: fixing VOBU at 92MB (273/727, 37%)^MSTAT: fixing VOBU at 98MB (289/727, 39%)^MSTAT: fixing VOBU at 103MB (305/727, 41%)^MSTAT: fixing VOBU at 110MB (321/727, 44%)^MSTAT: fixing VOBU at 115MB (337/727, 46%)^MSTAT: fixing VOBU at 121MB (353/727, 48%)^MSTAT: fixing VOBU at 127MB (369/727, 50%)^MSTAT: fixing VOBU at 133MB (385/727, 52%)^MSTAT: fixing VOBU at 137MB (401/727, 55%)^MSTAT: fixing VOBU at 143MB (417/727, 57%)^MSTAT: fixing VOBU at 148MB (433/727, 59%)^MSTAT: fixing VOBU at 155MB (449/727, 61%)^MSTAT: fixing VOBU at 160MB (465/727, 63%)^MSTAT: fixing VOBU at 164MB (481/727, 66%)^MSTAT: fixing VOBU at 171MB (497/727, 68%)^MSTAT: fixing VOBU at 177MB (513/727, 70%)^MSTAT: fixing VOBU at 184MB (529/727, 72%)^MSTAT: fixing VOBU at 190MB (545/727, 74%)^MSTAT: fixing VOBU at 193MB (561/727, 77%)^MSTAT: fixing VOBU at 199MB (577/727, 79%)^MSTAT: fixing VOBU at 204MB (593/727, 81%)^MSTAT: fixing VOBU at 211MB (609/727, 83%)^MSTAT: fixing VOBU at 216MB (625/727, 85%)^MSTAT: fixing VOBU at 225MB (641/727, 88%)^MSTAT: fixing VOBU at 230MB (657/727, 90%)^MSTAT: fixing VOBU at 236MB (673/727, 92%)^MSTAT: fixing VOBU at 241MB (689/727, 94%)^MSTAT: fixing VOBU at 246MB (705/727, 96%)^MSTAT: fixing VOBU at 253MB (721/727, 99%)^MSTAT: fixed 727 VOBUs
INFO: dvdauthor creating table of contents
INFO: Scanning /var/lib/mytharchive/temp/work/dvd/VIDEO_TS/VTS_01_0.IFO
INFO: Creating menu for TOC

STAT: Processing /usr/share/mythtv/mytharchive/intro/ntsc_blank.mpg...

INFO: Video pts = 0.178 .. 1.179
INFO: Audio[0] pts = 0.178 .. 1.170
STAT: VOBU 1 at 0MB, 2 PGCs^M
CHAPTERS: VTS[1/1] 0.000
CHAPTERS: VTS[2/1] 0.000
INFO: Generating VMGM with the following video attributes:
INFO: MPEG version: mpeg2
INFO: TV standard: ntsc
INFO: Aspect ratio: 4:3
INFO: Resolution: 720x480
INFO: Audio ch 0 format: ac3/2ch,  48khz drc

STAT: fixed 1 VOBUs
Finished  dvdauthor
Creating ISO image
I: -input-charset not specified, using utf-8 (detected in locale settings)
  3.81% done, estimate finish Sun Oct 28 07:37:21 2018
  7.61% done, estimate finish Sun Oct 28 07:37:21 2018
 11.42% done, estimate finish Sun Oct 28 07:37:21 2018
 15.22% done, estimate finish Sun Oct 28 07:37:21 2018
 19.04% done, estimate finish Sun Oct 28 07:37:21 2018
 22.83% done, estimate finish Sun Oct 28 07:37:21 2018
 26.65% done, estimate finish Sun Oct 28 07:37:21 2018
 30.45% done, estimate finish Sun Oct 28 07:37:21 2018
 34.26% done, estimate finish Sun Oct 28 07:37:21 2018
 38.06% done, estimate finish Sun Oct 28 07:37:21 2018
 41.87% done, estimate finish Sun Oct 28 07:37:21 2018
 45.67% done, estimate finish Sun Oct 28 07:37:21 2018
 49.48% done, estimate finish Sun Oct 28 07:37:21 2018
 53.28% done, estimate finish Sun Oct 28 07:37:21 2018
 57.09% done, estimate finish Sun Oct 28 07:37:21 2018
 60.89% done, estimate finish Sun Oct 28 07:37:21 2018
 64.70% done, estimate finish Sun Oct 28 07:37:21 2018
 68.50% done, estimate finish Sun Oct 28 07:37:21 2018
 72.31% done, estimate finish Sun Oct 28 07:37:21 2018
 76.11% done, estimate finish Sun Oct 28 07:37:21 2018
 79.93% done, estimate finish Sun Oct 28 07:37:21 2018
 83.73% done, estimate finish Sun Oct 28 07:37:21 2018
 87.54% done, estimate finish Sun Oct 28 07:37:21 2018
 91.34% done, estimate finish Sun Oct 28 07:37:21 2018
 95.15% done, estimate finish Sun Oct 28 07:37:21 2018
 98.95% done, estimate finish Sun Oct 28 07:37:21 2018
Total translation table size: 0
Total rockridge attributes bytes: 0
Total directory bytes: 4096
Path table size(bytes): 42
Max brk space used 1b000
131383 extents written (256 MB)
Finished creating ISO image
Removing all archive items from the archiveitems DB table
Finished processing jobs!!!
chmod: changing permissions of '/var/lib/mytharchive/temp/': Operation not permitted
sorry for the long post. :mrgreen:

Not sure why I have a chmod error on the end, but I don't think that's the prob.
:/var/lib/mytharchive$ ls -l
total 4
drwxrwsr-x 5 mythtv mythtv 4096 Oct 17 11:10 temp

and I am a member of mythtv group.

mythbuntubox
Senior
Posts: 128
Joined: Tue Apr 28, 2015 1:17 pm
Great Britain

Re: DVD cuts out early

Post by mythbuntubox » Fri Nov 02, 2018 4:45 pm

I think this may be down to the recording being slightly damaged. Here in the UK, ProjectX can be used quite successfully to clean up damaged DVBT transmissions in a lot of cases, but I think you may need to find an alternative tool for US broadcasts.

Also double-check for any potential permission problems for the user to create the DVD just in case.

busbee
Junior
Posts: 15
Joined: Sun Oct 14, 2018 12:07 pm
United States of America

Re: DVD cuts out early

Post by busbee » Sun Nov 04, 2018 2:28 pm

NOT... GIVING... UP! :oops: That's what make be a good computer engineer! :ugeek:

BTW, running without cutting the commercials does not seem to help. It just may speed up the process a bit.

So, I've narrowed it down to the last stage, the actual command:
(first step to fixing the problem is repeating the problem: check)
mplex -M -f 8 -v 0 --sync-offset 0 -o final.vob stream.mv2 stream0.ac3
and the actual error:
**ERROR: [mplex] Can't find next AC3 frame: @ 7093760 we have 1186 - broken bit-stream?

tried it without the -M (same)
and I don't see any other options to clean-up, cut-out or ignore errors.

Thus, i need to "clean it up" before it gets to that stage. I do have the "Always use Mythtranscode" checked so that it will "Running mythtranscode --mpeg2 to fix any errors". What I found out was that the nice --mpeg2 (seems to be new) feature does a good job of only cutting (commericials) where it needs too, but it keeps the "bad" frames, i.e., does not clean very well.

Next, I took the --mpeg2 option out, so it would re-transcode the whole thing, and clean-up. :D Voilà!!! I was very excited to see the whole video on DVD (iso). Until I played it and realized that the audio is now out of sync. :shock:

Mythtranscode (without --mpeg2) cuts the "bad" frames, but it messes up the audio (timing). :roll:

I could use a video experts advice. Am I on the right track?

User avatar
pgbennett
Developer
Posts: 259
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: DVD cuts out early

Post by pgbennett » Sun Nov 04, 2018 4:08 pm

I think that DVD creation may be unreliable and time consuming to the point there it is not worth while.

Another way to do this is transcode to x264 and play back on a computer or tablet. You can get a tablet that takes an SD card and you can put a large number of transcoded recordings on it.

I use HandBrake to transcode. Handbrake is very good at repairing errors in the video and keeping audio in sync. I have a number of scripts that automatically extract recordings from MythTV and transcode them overnight using HandBrakeCLI. This was a lot of work to develop but is now very reliable and easy.

busbee
Junior
Posts: 15
Joined: Sun Oct 14, 2018 12:07 pm
United States of America

Re: DVD cuts out early

Post by busbee » Fri Nov 09, 2018 2:51 am

I have heard good things about handbrake and ran it on the source file and it cleaned up nicely....
I'm trying to find the right spot to plug it into mythburn.py. I'm thinking of creating a new "profile" named "HB-SP", etc, then checking for "HB-" in the name and starting the command with handbrake instead of mythffmpeg for the re-encode in the encodeVideoToMPEG2 function.
I'll let ya know.

busbee
Junior
Posts: 15
Joined: Sun Oct 14, 2018 12:07 pm
United States of America

Re: DVD cuts out early

Post by busbee » Sat Nov 10, 2018 12:48 am

Ugh.. it did not work. :oops:

So I saw that "Profiles" had a nice xml file which would lend itself well to HandBrakeCLI parameters. And I was thinking that the videos where good until that point/stage. If I could substitute HandBrakeCLI for mythffmpeg to re-encode, with a few tweaks to the code and a HB- profile...
I'm pretty sure I got the code right (taking out the parts for audio parameters) because it actually ran :P . I'm not so sure about the Handbrake parameters that I put into the profile. :mrgreen:

mythreplex --demux did not like the newfile2.mpg created by HandBrakeCLI (calls it an MPEG1 file?)

Questions:
1) Can I get a little help on HandBrakeCLI parameters, am I doing it right to create an equivalent mpeg2 file?
2) Can handbrake replace mythffmpeg? They are both encoders, right?
3) I'm really curious why the video has do go thru so much encoding/demuxing/muxing:
- mythtranscode (to cut commercials, I get that),
- mythffmpeg re-encode (this is where I thought I could substitute handbrake, so is this just to clean up? Is it necessary, video is already mpeg2?)
- mythreplex -demux (seperates the audio and video, WHY?)
- M2VRequantitiser (shrink to fit dvd if necessary, I get that )
- dvdauther (is this where to video and audio come back together, or is it in M2VRequantitiser)
4) Again, why separate the audio and video?
5) I really do believe that handbrake is part of the solution, but I'm not sure where it fits in. Should I be using handbrake with mythtranscode to clean up first thing? Should I set it as a "replacement" for projectx? (Im US ATSC so I think projectx won't work for me, right?) Or, am I on the right track, replacing mythffmpeg? OR, somewhere else in the code?

here is the handbrake command:
HandBrakeCLI -v 1 -r 29.97 -e mpeg2 -b 4771 -E copy:ac3 -B 192k --pixel-aspect 4:3 -i "/var/lib/mytharchive/temp/work/1/newfile.mpg" -o "/var/lib/mytharchive/temp/work/1/newfile2.mpg"

Here the logs:

Code: Select all

2018-11-08 22:31:38 Re-encoding audio and video
2018-11-08 22:31:38 Using encoder profiles from /usr/share/mythtv/mytharchive/encoder_profiles/ffmpeg_dvd_ntsc.xml
2018-11-08 22:31:38 Encoding profile (HB-SP) found
2018-11-08 22:31:38 HandBrakeCLI -v 1 -r 29.97 -e mpeg2 -b 4771 -E copy:ac3 -B 192k --pixel-aspect 4:3 -i "/var/lib/mytharchive/temp/work/1/newfile.mpg" -o "/var/lib/mytharchive/temp/work/1/newfile2.mpg"
2018-11-08 22:32:26 Preferred audio languages eng and eng
2018-11-08 22:32:26 Video id: 0x1, Audio1: [1] 0x2 (AC3 (AC-3 / 0X332D6361), und), Audio2: [-1] - 0x-1 (N/A, N/A)
2018-11-08 22:32:26 Splitting MPEG stream into audio and video parts
2018-11-08 22:32:26 Running: mythreplex --demux --fix_sync -o "/var/lib/mytharchive/temp/work/1/stream" -v 1 "/var/lib/mytharchive/temp/work/1/newfile2.mpg"
2018-11-08 22:32:26 ************************************************************
2018-11-08 22:32:26 ERROR: Failed while running mythreplex. Command was mythreplex --demux --fix_sync -o "/var/lib/mytharchive/temp/work/1/stream" -v 1 "/var/lib/mytharchive/temp/work/1/newfile2.mpg"
2018-11-08 22:32:26 See mythburn.log for more information.
2018-11-08 22:32:26 ************************************************************
2018-11-08 22:32:26
2018-11-08 22:32:26 Terminated

Code: Select all

Running: mythreplex --demux --fix_sync -o "/var/lib/mytharchive/temp/work/1/stream" -v 1 "/var/lib/mytharchive/temp/work/1/newfile2.mpg"
Reading from /var/lib/mytharchive/temp/work/1/newfile2.mpg
Input file length: 736.65 MB
Checking for TS:
failed
Checking for AVI:
failed
Checking for PS:
confirmed(maybe)
Video output File is: /var/lib/mytharchive/temp/work/1/stream.mv2
Audio0 output File is: /var/lib/mytharchive/temp/work/1/stream0.mp2
STARTING DEMUX
Error: THIS IS AN MPEG1 FILE

Post Reply