MythTV / MythDVD movie ripping / playback problem (Solved!)

I have used Myth to rip a large number of my DVD's to AVI files (using either the Excellent or Good setting).  Now that I am starting to play back the movies, I have found something that is very troubling.

On many of the movies, the first 95% of the movie (e.g. 1:13 min of a 1:26 movie) plays flawlessly. However, near the end of the movie, the audio and video starts to speed up and get jerky. (Audio/video sync is also thrown off.)

I have copied the files to a different box and played them with totem and mplayer and was happy to find that the files appear to be just fine. (or maybe mplayer/totem deal with them better?)
 
It seems that the problem is with the mythv internal video player.

After a random sample of movies, I'd say that at least 50-70% (but not all!) of the movies have this problem. The problem survives reboots of the mythtv box.

I am using Xvmc for HDTV playback (with no problems), (OSD is B&W) but not for the internal video player. (OSD is in full color)

Even if I ESC from the movie and then go back into it (the internal player resumes at the same spot) the problems continue as before. If I rewind the movie, it works correctly before the "problem starting spot" but when it hits that spot, the problems resume.

I suspect it may be a problem that is caused by the MythTV ripping system, as I have re-encoded movies using mencoder that then play back correctly in the internal video player.

I was able to solve this problem (which appears to be a problem in the index of the avi files generated by MythDVD) by using mencoder to re-create the index for all of my video files.

  mencoder -idx MOVIE_TO_FIX.avi -ovc copy -oac copy -o FIXED_OUTPUT.avi

I created the following script to go through my video files and re-create the index (it takes about a minute per movie). The script will only process a movie one time (keeping track by creating a marker file in the hidden .fixed_list directory) so it's safe to run every time you rip new DVD's without repeating work needlessly:

 #!/bin/bash

for movie in *
do
 if [ -f ".fixed_list/$movie.fixed" ]
 then
   echo "$movie already fixed"
 else
   echo "Processing $movie"
   mencoder -idx "$movie" -ovc copy -oac copy -o temp_file.avi
   mv temp_file.avi "$movie"
   touch ".fixed_list/$movie.fixed"
 fi
done

Movies with a problem generated the following message when re-creating the index:

 ODML: Starting new RIFF chunk at 1023MB.m:

I'm not sure what a new RIFF chunk is, but apparently the built in MythDVD encoder is not producing them correctly. 

   

5 thoughts on “MythTV / MythDVD movie ripping / playback problem (Solved!)

  1. How do you adjust this for VOB files? I tried your mencoder command on a single ripped VOB file and it took out all of the so called duplicate frames. I have tried several options (-vf harddup, -fps) but can’t seem to find the right set of switches.
    BTW. I am not sure if we have the same problem. I ripped these files with DVD Shrink through Wine into a single VOB per show/movie. Some play fine and some don’t through the internal player. The ones that don’t play correctly have this index problem.
    FYI. I have 2 boxes. The front box is a box purchased by the now dead TVEase. The back box is a server with currently 3.41 TB of storage. Both run Ubuntu and MythTV. Shared files are mounted via NFS.

  2. Wayne,

    I’m not sure if mencoder will read/write to VOB files. You may have to extract the video, re-index it, and then put it back into the VOB file.
    Jay

  3. Wayne,

    You will want to use mythtranscode on your vob files to correct the indexing. The command you want is:

    mythtranscode –mpeg2 –buildindex –showprogress –video –infile

  4. Thanks Robert but,
    This places data in the filemarkup table however the i option during playback shows incorrect position info … A 55 minute show displays, for example, 0:00 of 6:54 at the start of the play. The length is incorrect. Also, if I FF into the show the video will jump from near the start to the end of the video at lets say 3:29. The is no entries in recordedseek just filemarkup.

  5. Thank you so much for this fix; I thought there was some nefarious copy protection scheme in play but it turns out it’s easily fixed! Works like a charm. Good shell script too.

Leave a Reply

Your email address will not be published.