Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Linux, Mac OS X, & Co

Reply
 
Thread Tools Search this Thread Display Modes
Old 15th September 2003, 08:38   #1  |  Link
Schizoid
Registered User
 
Join Date: Apr 2003
Location: NC USA
Posts: 6
dvd2xvid always has bad a/v sync :(

I can never get the a/v sync spot on when I rip dvds to xvid.

First I tried Acidrip which is a mencoder frontend. This produced a rip that was just out of sync enough to be annoying.

Then I tried the same dvd but this time I ripped it with dvd::rip. This time instead of mp3 audio I made it with ogg audio and the sync is WAY off.

I know jumping around like this and using different programs doesn't help track down the problem.

Do any of you guys use these programs with any sort of success? Any tips/tricks to get it going right?
Schizoid is offline   Reply With Quote
Old 15th September 2003, 21:01   #2  |  Link
libredr
Registered User
 
Join Date: Feb 2002
Posts: 97
Hi

Can you try tuxrip and see if it works:
http://tuxrip.free.fr/index_en.html

What are your transcode version ? Do you get this a/v desync with all DVDs ? Are they region 1 or 2 ?

Also : is it a permanent shift from the beginning to the end or does it vary ? For ogg, you may try ogmmerge -s option to resync the sound (see man ogmmerge).
libredr is offline   Reply With Quote
Old 16th September 2003, 02:08   #3  |  Link
Schizoid
Registered User
 
Join Date: Apr 2003
Location: NC USA
Posts: 6
I have transcode 0.6.6

The dvds are all region one. Transcode seems to make rips that are more out of sync than the ones I got with mencoder. Mencoder is just slightly out of sync, transcode is really out of sync.

I have been messing with the -s ogmmerge program, I got the audio synced on my latest rip using -s 300.

Now that syncs it un initially, but once you get to the end of the film the video is lagging behind the audio be a few seconds at least! So now I am doing -s 0,154065/153915 etc trying to fix it up. Real pain in the butt, it's all guess and check.

I will make a rip with tuxrip and see how it goes.

Thanks for the help though!
Schizoid is offline   Reply With Quote
Old 16th September 2003, 07:57   #4  |  Link
libredr
Registered User
 
Join Date: Feb 2002
Posts: 97
Hi
Yes, transcode used to have this known problem : update to transcode 0.6.10 and you will se an improvement. I think tuxrip cannot help for sync if transcode is not the latest one.
With region 2 dvds there is no shift problem anymore since transcode 0.6.7.

Last edited by libredr; 16th September 2003 at 09:50.
libredr is offline   Reply With Quote
Old 16th September 2003, 10:39   #5  |  Link
Schizoid
Registered User
 
Join Date: Apr 2003
Location: NC USA
Posts: 6
Ok I made a rip of the same dvd with Tuxrip and my old transcode 0.6.6. You are right, it was still out of sync, again the audio was ahead of the video around 300ms. It did not seem to degrade as much over the length of the video as the previous ones which is good.

Being a bit silly I did not start tuxrip with the --xvid switch so it encoded with the standard mpeg4.

Also I noticed during the encoding process on both passes it switched in and out of interlaced mode. What is up with that??

Code:
demux_mpg: 3:2 TELECINE detected, enabling inverse telecine fx. FPS changed to 23.976!

1 duplicate frame(s)!
Pos:5643.7s 135313f (88%)  24fps Trem:  11min 641mb  A-V:0.000 [843:0]]
demux_mpg: Progressive seq detected, leaving 3:2 TELECINE mode
Warning! FPS changed 23.976 -> 29.970  (-5.994000) [4]  :0.000 [843:0]
Pos:5643.9s 135317f (88%)  24fps Trem:  11min 641mb  A-V:0.000 [843:0]
Skipping frame!
Pos:5644.0s 135322f (88%)  24fps Trem:  11min 641mb  A-V:0.000 [843:0]
Skipping frame!
Pos:5644.2s 135327f (88%)  24fps Trem:  11min 641mb  A-V:0.000 [843:0]
Skipping frame!
Pos:5644.4s 135332f (88%)  24fps Trem:  11min 641mb  A-V:0.000 [843:0]
Skipping frame!
Pos:5644.5s 135337f (88%)  24fps Trem:  11min 641mb  A-V:0.000 [843:0]
Skipping frame!
Pos:5644.7s 135342f (88%)  24fps Trem:  11min 641mb  A-V:0.000 [843:0]
Skipping frame!
Pos:5644.9s 135347f (88%)  24fps Trem:  11min 641mb  A-V:0.000 [843:0]
Skipping frame!
Pos:5645.0s 135352f (88%)  24fps Trem:  11min 641mb  A-V:0.000 [843:0]
Skipping frame!
Pos:5645.2s 135357f (88%)  24fps Trem:  11min 641mb  A-V:0.000 [843:0]
Skipping frame!
Pos:5645.4s 135362f (88%)  24fps Trem:  11min 641mb  A-V:0.000 [843:0]
Skipping frame!
Pos:5646.0s 135377f (88%)  24fps Trem:  11min 641mb  A-V:0.000 [843:0]
demux_mpg: 3:2 TELECINE detected, enabling inverse telecine fx. FPS changed to 23.976!
Pos:6430.2s 154180f (99%)  24fps Trem:   0min 635mb  A-V:0.000 [827:0]
Writing AVI index...
Fixing AVI header...

Video stream:  827.911 kbit/s  (103488 bps)  size: 665454604 bytes  6430.207 secs  154180 frames

Video encoding length : 3hrs 40min 34sec
Video encoding speed : 14.38 fps
And the speed to be frank was quite bad! 14 fps on a P4a 2.0ghz! Mencoder did it at almost 40fps average and DVD:RIP (which uses the same transcode...) averaged just under 30fps. I guess each one is just using different encoding options. Any way to speed tuxrip up a notch?

----

I am running Gentoo Linux and they now how transcode 0.6.9 in their portage tree so I am having that compiled and installed (all automatically thank god!) as I type this.

I have the 0.6.9 to 0.6.10 transcode patch but I don't have the slightest idea what to do with the file! Can you explain what one does with this?!?

Thank you for your help in all this! One thing to say about tuxrip, when it asks you to mark the beginning of the end credits it did not start mplayer with the right "On screen display" settings. I could see the "play" arrow but it was not displaying the play time, so I could not mark the start of the credits. No big deal, but maybe the tuxrip script is using the wrong switch when it starts mplayer?

If I can't figure out how to update to 0.6.10 I will just do another run with 0.6.9 and see how that goes. I'll let it work on it as I sleep .

Thanks again.
Schizoid is offline   Reply With Quote
Old 16th September 2003, 14:46   #6  |  Link
libredr
Registered User
 
Join Date: Feb 2002
Posts: 97
Hi
Without --xvid, it uses libavcodec, the ffmpeg codec, which is imo as good as xvid (but maybe latest 0.9.2 xvid is now better ?), especially whan using options to tweak it (see http://rguyom.ath.cx/ but unfortunately this page seems unavailable for the moment). It never uses any divx codec.
What were your libavcodec options ? And have you the same slowness using xvid ?

For the sync issue, at least try to get transcode 0.6.9

For the speed issue, actually video encoding is not done with transcode, but with mencoder. transcode only encodes audio. Which version of mplayer have you ? I recommend you to try the latest one (1.0pre1 or 0.91), since mencoder/mplayer have changed the way they handle NTSC titles over the versions. mencoder now detects automatically a NTSC title and does inverse telecine. Probably the problem is in the skipping frame, because with PAL DVDs, which does not needs pull-down, I get about 40fps (however, it highly depends on libavcodec options, trell, qpel, bframes, etc...). I did not notice it when doing some tests with my 2 region 1 DVDs though. Can you try the --deinterlace switch ? Also, this speed drop is maybe the price to pay to eliminate interlacing artifacts from NTSC. Does DVD:rip eliminates interlacing without a cost in fps ? (see http://www.bunkus.org/dvdripping4lin...ping_interlace)
I'll make new tests tonight.

Last edited by libredr; 16th September 2003 at 19:37.
libredr is offline   Reply With Quote
Old 19th September 2003, 19:34   #7  |  Link
libredr
Registered User
 
Join Date: Feb 2002
Posts: 97
Hi
I just tried encoding the chapter 3 of Buena vista social club Region 1, and it is perfect. However, there is a bug of NTSC detection in tuxrip085 if you use mplayer 1.0pre1, since they changed the way they display fps of the DVD (29.970 for NTSC). To correct it add

[ "$fps" = "29.970" ] && fps=29.97

after line 2287.

Then I obtained a perfect encoding : deinterlaced image, encoding speed was close to 70fps for each pass (Athlon XP2400, 35fps final since there are two passes), using libavcodec (default codec) with options : vcodec=mpeg4:vqmin=2:vqmax=20:vmax_b_frames=0:vhq:keyint=250:vme=4:v4mv
(see your $HOME/.tuxriprc file or use tuxrip --verif-prefs)

It DOES display "skipping frame", I guess this is normal and part of the Telecine pulldown conversion (29.970 fps to 23.976 fps). I compared with the non patched version of tuxrip, that does not do convert to 23.976fps and speed was about 73fps, so the "Skipping frame" has barely ant effect on encoding speed.

I could not check the A/V synchro though, since I just encoded the chapter three, which is short. I encode the full-length movie tonight to check this.

Could you check the versions of software you use for video encoding (mplayer/mencoder) ? Did you compile it yourself ? This is important : mplayer/mencoder has special processor optimizations that are enabled at compilation. See the installation guide of tuxrip for compilation procedure.

Hope this helps

Last edited by libredr; 19th September 2003 at 20:11.
libredr is offline   Reply With Quote
Old 21st September 2003, 08:09   #8  |  Link
Schizoid
Registered User
 
Join Date: Apr 2003
Location: NC USA
Posts: 6
Well right now I only seem to be able to get a sync'd rip if I use a program like dvd:rip and use mp3 audio. OGG audio doesn't seem to sync correctly no matter what I do. It does NOT seem to make any difference if I use libavcodec or divx or xvid.

I am using Gentoo Linux 1.4, here is my mplayer info:

Code:
MPlayer 0.90-3.2.3 (C) 2000-2003 Arpad Gereoffy (see DOCS)

CPU: Intel  (Family: 8, Stepping: 4)
Detected cache-line size is 64 bytes
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2
Mencoder

Code:
MEncoder 0.90-3.2.3 (C) 2000-2003 Arpad Gereoffy (see DOCS)

CPU: Intel  (Family: 8, Stepping: 4)
Detected cache-line size is 64 bytes
CPUflags: Type: 8 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
It was downloaded & compiled using Gentoo's portage program with these flags:

Code:
-dga -oss +xmms +jpeg -3dfx +sse -matrox +sdl +X +svga -ggi +oggvorbis +3dnow +aalib -gnome -xv +opengl +truetype +dvd +gtk +gif -esd +fbcon +encode +alsa -directfb +arts -dvb -gtk2 -samba
Now the portage does have mplayer 1.0_pre1 available, which I am downloading and compiling as I type this with the same flags as above.

After it is finished I will make the changes to tuxrip and try again. So my tuxrip script looks like this from line 2282 to 2292?:

Code:
   aspect=`cat $RACINE/$projet/tmp/infos.dvd | grep "^VIDEO" | awk '{print $5}' | awk -F ")" '{print $1}'`
   resXdvd=`cat $RACINE/$projet/tmp/infos.dvd | grep "^VIDEO" | awk '{print $3}' | awk -F "x" '{print $1}'`
   resYdvd=`cat $RACINE/$projet/tmp/infos.dvd | grep "^VIDEO" | awk '{print $3}' | awk -F "x" '{print $2}'`
   cat $RACINE/$projet/tmp/infos.dvd | grep "^VIDEO" | awk '{print $6}' > $RACINE/$projet/tmp/framerate
   fps=`sed -e "s/,/./" $RACINE/$projet/tmp/framerate`
   rm -f $RACINE/$projet/tmp/framerate
   [ "$fps" = "29.970" ] && fps=29.97

   echo
   echo -e "${MAINCOLOR} >>>> $p158 <<<<"
   echo
Thanks for all of your help! Mplayer 1.0_pre1 just finished so I will give it a go right now.

I found out the slow encode was just due to a rogue program hogging cpu resources during the encoding. I am a moron. I only have a P4 2.0a so 40fps is my peak, usually does high 30's.
Schizoid is offline   Reply With Quote
Old 21st September 2003, 12:10   #9  |  Link
libredr
Registered User
 
Join Date: Feb 2002
Posts: 97
Hi !
Yes your modification is correct. This is because mplayer used to display value 29.97 fps for a NTSC DVD, now it shows 29.970. The correction makes tuxrip compatible with any version now.

I have a strange case. I have two Region 1 DVDs : Buena Vista Social Club. I encoded it and it works perfect, with A/V perfectly sync. However I have a strange case with Mulholland Drive. I tried to encode the trailer (title 6) or the full-length movie (title 1) with tuxrip, and it fails. After the first pass, mencoder returns

Movie-Aspect is 1,33:1 - prescaling to correct movie aspect.
get_buffer() failed (0 -2546 0 0x40fa0030)
(standard_in) 3: parse error

After first pass, we have QFmax=0

and the second pass fails immediately. If I interrupt with escape the first pass, it works !) The trailer is 2549 frames long, and the error says get_buffer() failed (0 -2546 0 0x40fa0030), I guess the problem is at frame 2546.

However :
- mencoder 0.91 was working
- mencoder 1.0pre1 works perfectly using xvid.
Interestingly, dvdrip works with ffmpeg and mulholland drive trailer. It uses transcode to encode video.
So I guess the error is specific to the way mencoder handles ffmpeg, but occurs only with Mulholland drive !

If you observe such behaviour with mencoder 1.0pre1 and tuxrip, please let me know.
libredr is offline   Reply With Quote
Old 22nd September 2003, 11:59   #10  |  Link
Schizoid
Registered User
 
Join Date: Apr 2003
Location: NC USA
Posts: 6
Alright I have some very good news!

I have finally made two rips that came out perfectly! I turned my Thin Red Line DTS dvd into two 700mb files and it worked like a charm. The audio was off by 300ms but tuxrip took care of that . I then did a single disc rip of a crap movie I own and that worked perfectly too. Again, the audio was off by 300ms. Not sure why it is like that but at least it is consistant eh? lol.

Now I don't know if you own "Lock Stock & Two Smoking Barrels" but that is the one I cannot get to sync no matter what. I have ripped it over eight times now with various settings and different program versions and it just doesn't want to play nice. I guess I will just have to handle the dvd with a lot of care because I can't get a backup. Hopefully it is just a quirk with that disc and this problem doesn't show up with a lot of my dvds.

----

Are you the scripter who made tuxrip? If so any eta on subtitles?! Maybe it is possible to use tuxrip to make the video and then manually make an external subtitle file? Or would this induce sync issues?
Schizoid is offline   Reply With Quote
Old 22nd September 2003, 19:02   #11  |  Link
libredr
Registered User
 
Join Date: Feb 2002
Posts: 97
Hi !

Glad to hear it worked.
Actually, testers of tuxrip observed also the shift was constant. Actually, tuxrip can handle this : you just have to determine the shift only once. Then, using tuxrip --config or editing the $HOME/.tuxriprc file (line 3) : you just have to enter the shift value (-300 for you) and tuxrip will apply this value by default, for every movie you'll encode.

I have made some tests myself, and everything seems to work well. Have you tried also --presetvideo extreme : it is really slow (I do it overnight) but picture quality is amazing ! xvid is also better and better.
Also, try the --comp-check feature : you will have a compressibility check on a sample and afaik, tuxrip is the only Linux software to offer it. So you'll get a very fast idea of the compressibility of your movie.

Other good news : I wrote to the mplayer mailing list about the mulholland drive crash, and it is corrected in the CVS version of MPlayer !

Finally : I am not the coder of tuxrip, it is jotenakis. My pseudo is zeb on the HFR forum and tuxrip site. I have been working with him on the algorithm, in particular to calculate aspect ratio, cropping, etc... I also maintain the website. We have a French thread on http://forum.hardware.fr/forum2.php3?post=18446&cat=11
Next version of tuxrip with subtitle support is very close : this week or next week. I have a guide about subtitles encoding here (but in French, it is easy to follow though, and it is very close to that one : http://www.bunkus.org/dvdripping4lin...html#subtitles) : http://tuxrip.free.fr/soustitres.html The second method (without OCR) will be implemented in the next tuxrip. Manually, I use the first method (with OCR) with success, without any sync problem.

Last edited by libredr; 23rd September 2003 at 08:23.
libredr is offline   Reply With Quote
Old 25th September 2003, 11:31   #12  |  Link
Schizoid
Registered User
 
Join Date: Apr 2003
Location: NC USA
Posts: 6
Blah I don't know what happened but I just tried a new movie and it seems to have made a 1.3gb file when I told it 1 700mb cd.

DVD ripping length : 0hrs 17min 42sec
Audio encoding length : 0hrs 16min 5sec
Video encoding length : 1hrs 58min 53sec
A/V mixing length : 0hrs 8min 3sec
DVD ripping speed : 149.55 fps
Audio encoding speed : 164.53 fps
Video encoding speed : 22.17 fps
A/V mixing speed : 328.77 fps
Size of the encoded movie : 1369.968090 MB
Target size : 702 MB

It even says the target was 702mb so I must have selected the correct option.

It made both passes and finished without error, I wonder what I did wrong...try again I suppose.
Schizoid is offline   Reply With Quote
Old 25th September 2003, 11:40   #13  |  Link
libredr
Registered User
 
Join Date: Feb 2002
Posts: 97
This is very weird, never saw that before.
Which DVD was it ?

Can you send as attached documents the content of your nameofmovie/tmp directory (with log files, infos.dvd, etc...) to tuxrip@free.fr please ?
Thanks.
libredr is offline   Reply With Quote
Old 25th September 2003, 11:41   #14  |  Link
libredr
Registered User
 
Join Date: Feb 2002
Posts: 97
Try with tuxrip --test n (with n the chapter number) to test on only one chapter of the movie.

Also, apparently mplayer1.0pre1 is very buggy. I advise you to revert back to 0.91 or to try the latest CVS.
Was your encoding using xvid or libavcodec ? Try on one chapter, with both codecs (--xvid for xvid) to see if there is a difference.

Last edited by libredr; 25th September 2003 at 11:45.
libredr is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 20:30.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.