Stuttery video when ripping certain DVDs

Archive of historical bug reports.
Please use the GitHub link above to report issues.
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
Post Reply
Jamie Zawinski
Posts: 15
Joined: Wed Apr 25, 2007 1:01 am

Stuttery video when ripping certain DVDs

Post by Jamie Zawinski »

When I use Handbrake 0.8.5b1 or 0.7.1 on OSX to rip the videos from the DVD "The Work of Director Michel Gondry", the video comes out stuttery. The best example of this is the "Come Into My World" video (title 10 on the DVD side A).

I've tried various encoding formats, and the ripped video always stutters. It seems like about three times a second, it repeats several frames. Audio plays normally, only video is choppy. Audio and video remain in sync.

When I play the DVD in the Apple "DVD Player" application, it plays very smoothly.

I've noticed a few other DVDs that this happens on as well, but not all of them.

If there's anything else I can do to help you debug this, please let me know...
awk
Enlightened
Posts: 109
Joined: Sat Mar 31, 2007 11:55 pm

Post by awk »

You could try running the app with the environment variable HB_DEBUG set to 1

It'll give a certain amount of debug spew to stdout which could be helpful.

Also (though it doesn't seem like the right 'sort' of DVD - and the symptoms you're describing sound a little different) but this DVD isn't using some crufty copy protection system ? ArCCos or zero cells etc. etc. ?
Jamie Zawinski
Posts: 15
Joined: Wed Apr 25, 2007 1:01 am

Post by Jamie Zawinski »

How do I tell if it's using some crufty copy protection? (The words "zero" and "arccos" don't appear in the log.)

Here's the log of it ripping title 10 with the "AppleTV" preset. (I left out the ~620 lines it logged when opening the disc; let me know if you need those too...)



[19:37:06] thread 34351104 started ("work")
[19:37:06] 1 job(s) to process
[19:37:06] starting job
[19:37:06] + device /dev/rdisk3
[19:37:06] + title 10, chapter(s) 1 to 1
[19:37:06] + 720x480 -> 708x480, crop 0/0/10/2
[19:37:06] + deinterlace off
[19:37:06] + grayscale off
[19:37:06] + 23.976 fps, video bitrate 2500 kbps, pass 0
[19:37:06] + PixelRatio: 1, width:708, height: 480
[19:37:06] + encoder x264
[19:37:06] + audio 160 kbps, 48000 Hz
[19:37:06] + encoder faac
[19:37:06] + 80bd, Unknown (AC3) (2.0 ch)
[19:37:06] + Requested mixdown: Stereo (HB_AMIXDOWN_STEREO)
[19:37:06] + Actual mixdown: Stereo (HB_AMIXDOWN_STEREO)
[19:37:06] thread 34395648 started ("reader")
[19:37:06] + output: /Users/jwz/Desktop/MICHEL_GONDRY_SIDE_A.mp4
[19:37:06] thread 34422784 started ("muxer")
[19:37:06] thread 34423808 started ("MPEG-2 decoder (libmpeg2)")
[19:37:06] thread 34385408 started ("Renderer")
[19:37:06] encx264: encoding with stored aspect 8/9
[19:37:06] encx264: opening libx264 (pass 0)
x264 [warning]: width or height not divisible by 16 (708x480), compression will suffer.
x264 [info]: using SAR=8/9
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2
[19:37:06] thread 34394624 started ("H.264/AVC encoder (libx264)")
No accelerated IMDCT transform found
[19:37:07] thread 34393600 started ("AC3 decoder")
[19:37:07] thread 34424832 started ("AAC encoder (libfaac)")
[19:37:07] sync: expecting 6095 video frames
[19:37:07] sync: first pts is 5400
[19:44:49] reader: end of the title reached
[19:44:49] reader: done
[19:44:49] thread 34395648 exited ("reader")
[19:44:58] sync: got 6066 frames, 6095 expected
[19:44:59] thread 34394624 exited ("H.264/AVC encoder (libx264)")
[19:44:59] thread 34423808 exited ("MPEG-2 decoder (libmpeg2)")
[19:44:59] thread 34393600 exited ("AC3 decoder")
[19:44:59] thread 34385408 exited ("Renderer")
[19:44:59] thread 34423808 joined ("MPEG-2 decoder (libmpeg2)")
[19:44:59] thread 34385408 joined ("Renderer")
[19:44:59] thread 34394624 joined ("H.264/AVC encoder (libx264)")
x264 [info]: slice I:19 Avg QP:25.95 size: 31344 PSNR Mean Y:39.43 U:45.40 V:45.07 Avg:40.64 Global:39.95
x264 [info]: slice P:6047 Avg QP:29.34 size: 13072 PSNR Mean Y:35.94 U:43.74 V:43.28 Avg:37.32 Global:37.09
x264 [info]: mb I I16..4: 25.3% 0.0% 74.7%
x264 [info]: mb P I16..4: 8.0% 0.0% 12.9% P16..4: 32.9% 22.8% 5.5% 0.0% 0.0% skip:18.0%
x264 [info]: final ratefactor: 24.30
x264 [info]: SSIM Mean Y:0.9376364
x264 [info]: PSNR Mean Y:35.951 U:43.750 V:43.287 Avg:37.333 Global:37.095 kb/s:2518.25
[19:44:59] thread 34424832 exited ("AAC encoder (libfaac)")
[19:44:59] thread 34393600 joined ("AC3 decoder")
[19:44:59] thread 34424832 joined ("AAC encoder (libfaac)")
[19:44:59] thread 34395648 joined ("reader")
[19:44:59] mux: file size, 84841082 bytes
[19:44:59] mux: track 0, 79671851 bytes, 2519.24 kbps
[19:44:59] mux: video bitrate error, +608494 bytes
[19:44:59] mux: track 1, 5057424 bytes, 159.92 kbps
[19:44:59] mux: overhead, 6.24 bytes per frame
[19:44:59] thread 34422784 exited ("muxer")
[19:44:59] thread 34422784 joined ("muxer")
[19:44:59] fifo_close: trashing 0 buffer(s)
[19:44:59] fifo_close: trashing 0 buffer(s)
[19:44:59] fifo_close: trashing 0 buffer(s)
[19:44:59] fifo_close: trashing 0 buffer(s)
[19:44:59] fifo_close: trashing 0 buffer(s)
[19:44:59] fifo_close: trashing 0 buffer(s)
[19:44:59] fifo_close: trashing 0 buffer(s)
[19:44:59] fifo_close: trashing 0 buffer(s)
[19:44:59] fifo_close: trashing 5 buffer(s)
[19:44:59] thread 34351104 exited ("work")
[19:44:59] thread 34351104 joined ("work")
[19:44:59] libhb: work result = 0
[19:45:20] thread 34161664 exited ("libhb")
[19:45:20] thread 34161664 joined ("libhb")
clee
Posts: 19
Joined: Sun Oct 22, 2006 8:57 am

Re: Stuttery video when ripping certain DVDs

Post by clee »

Jamie Zawinski wrote:When I use Handbrake 0.8.5b1 or 0.7.1 on OSX to rip the videos from the DVD "The Work of Director Michel Gondry", the video comes out stuttery. The best example of this is the "Come Into My World" video (title 10 on the DVD side A).

I've tried various encoding formats, and the ripped video always stutters. It seems like about three times a second, it repeats several frames. Audio plays normally, only video is choppy. Audio and video remain in sync.

When I play the DVD in the Apple "DVD Player" application, it plays very smoothly.

I've noticed a few other DVDs that this happens on as well, but not all of them.

If there's anything else I can do to help you debug this, please let me know...
Are you turning on deinterlacing when you rip?

Our deinterlacing code is *horrible* right now, and usually results in the behaviour you described.

If not... I'll pick up a copy of this DVD and see if I can reproduce it. Any other DVDs this happens on would also be good to know!

EDIT: D'oh. You posted that log as I was posting this. And your log says deinterlacing is off, so it looks like my assumption is wrong. Yay!
Last edited by clee on Wed Apr 25, 2007 2:55 am, edited 1 time in total.
Jamie Zawinski
Posts: 15
Joined: Wed Apr 25, 2007 1:01 am

Post by Jamie Zawinski »

I've tried it both with and without de-interlacing; that doesn't seem to affect it.
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Post by jbrjake »

Try setting the frame rate to 29.97 fps, if that isn't one of the things you've already tried. I suggest it because that DVD might have segments that run at video speed, not 23.97.

EDIT: To explain a bit, in case you've been using it, the "Same as Source" drop-down in the Mac GUI is misleading to the point it's a bug. It only deals with PAL versus NTSC, not with whether the DVD is at film or video speed. It needs to be renamed and should have been before this beta...sorry.
Last edited by jbrjake on Wed Apr 25, 2007 3:03 am, edited 1 time in total.
awk
Enlightened
Posts: 109
Joined: Sat Mar 31, 2007 11:55 pm

Post by awk »

Jamie Zawinski wrote:How do I tell if it's using some crufty copy protection? (The words "zero" and "arccos" don't appear in the log.)
There's a list of 'zero cell' movies in the support forum here, though it's by no means complete, and tends to be full of the more 'mainstream' releases. It's my impression that really only recent releases from major studios have the 'feature'. Not having run into it myself I'm not sure what to look for as definitive clues.

Your log file looks pretty regular. In particular there's nothing output during the 7 or so minutes that the real transcoding is taking place (no read errors, demuxing errors that sort of thing).

I think at this point the best bet is if clee can get a hold of this title or one of the others and debug it (and check the de-interlacing thing - it's not a strong point right now).
Jamie Zawinski
Posts: 15
Joined: Wed Apr 25, 2007 1:01 am

Post by Jamie Zawinski »

Yes, setting the frame rate to 29.97 seems to fix it!

I'm not sure offhand which other DVDs exhibited this behavior; a few months back, I ripped all of my music-video DVDs so that I could watch them on shuffle in iTunes, and after I ripped them I noticed that a few of them had this stuttery behavior. I'll try to figure that out if it would be helpful.

Slightly off-topic, but what's the problem with the de-interlacer? I ripped all my stuff with de-interlacing, and haven't noticed anything egregious about it...
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Post by jbrjake »

Jamie Zawinski wrote:Yes, setting the frame rate to 29.97 seems to fix it!
Glad it worked =)
I ripped all of my music-video DVDs so that I could watch them on shuffle in iTunes, and after I ripped them I noticed that a few of them had this stuttery behavior.
I wouldn't be surprised if that change fixes it; I first encountered this problem on a concert dvd.
Slightly off-topic, but what's the problem with the de-interlacer? I ripped all my stuff with de-interlacing, and haven't noticed anything egregious about it...
It's just not as good as it could be. It uses an easy way of deinterlacing. It discards half the fields and doubles the ones that are left. I've never really gotten jerky output from it, but it's been reported several times. Anyway, there are more complicated methods that would do a better job at the cost of longer encoding times.

There's a nice visual demonstration here: http://guru.multimedia.cx/deinterlacing-filters/

HandBrake uses the method captioned as "mplayer -vf pp=fd" (fd for FFmpeg's Deinterlacer). There are some other pictures further down, of filters with smoother output.
Centros
Posts: 7
Joined: Wed Apr 25, 2007 5:16 am

I get this too

Post by Centros »

I get this too, usually on DVDs that contain animation. I have many biology animations. Some short films I have on DVD do this too. Forcing the framerate helps a lot, but does not eliminate the problem.
Jamie Zawinski
Posts: 15
Joined: Wed Apr 25, 2007 1:01 am

Post by Jamie Zawinski »

Ok, I made a quick pass through all the music-video DVDs that I've ripped, and I saw stuttery videos on (at least one track on) these DVDs:

Concrete Blonde - Still In Hollywood
Depeche Mode - Videos 86-98
Duran Duran - Greatest
Eurythmics - Greatest Hits
Lamb - Best Kept Secrets
Love and Rockets - Sorted
Massive Attack - Eleven Promos
Propaganda - The Video Collection
Sneaker Pimps - The Videos
Tricky - A Ruff Guide
Work of Director Chris Cunningham
Work of Director Michel Gondry

So before I go and re-rip these, I have some questions --


1) Is the correct frame rate always going to be 29.97? Or do I sometimes need to figure that out, somehow? If so, how?

2) Do you think a future version of Handbrake will auto-detect the proper framerate some time soon? If so, I'll wait until that's out to re-rip...

3) Likewise about de-interlacing: if that's planned to be improved soon, I might as well wait for that too. (I find watching interlaced videos really distracting, so I would like to de-interlace them when ripping.)

It's going to be a hassle re-ripping them all, since I'll have to re-type all the iTunes metadata by hand (I don't know how to copy the artist/track/year/genre info from one MOV to another), so I'd really like to only do it once.

Thanks!
clee
Posts: 19
Joined: Sun Oct 22, 2006 8:57 am

Post by clee »

Jamie Zawinski wrote:Ok, I made a quick pass through all the music-video DVDs that I've ripped, and I saw stuttery videos on (at least one track on) these DVDs:

Concrete Blonde - Still In Hollywood
Depeche Mode - Videos 86-98
Duran Duran - Greatest
Eurythmics - Greatest Hits
Lamb - Best Kept Secrets
Love and Rockets - Sorted
Massive Attack - Eleven Promos
Propaganda - The Video Collection
Sneaker Pimps - The Videos
Tricky - A Ruff Guide
Work of Director Chris Cunningham
Work of Director Michel Gondry


So before I go and re-rip these, I have some questions --

1) Is the correct frame rate always going to be 29.97? Or do I sometimes need to figure that out, somehow? If so, how?
No, not always. Just usually. If it's an NTSC disc (region 0) then almost always, yes, 29.97 is correct. If it's PAL, though, 25fps is probably correct.
2) Do you think a future version of Handbrake will auto-detect the proper framerate some time soon? If so, I'll wait until that's out to re-rip...
Well, we detect the proper *initial* framerate. The problem is that DVDs contain video content that can actually change framerate in the middle of the video stream. That's harder to fix, because as far as I know that's not something we can do mid-stream with our existing output libraries.
3) Likewise about de-interlacing: if that's planned to be improved soon, I might as well wait for that too. (I find watching interlaced videos really distracting, so I would like to de-interlace them when ripping.)
Depending on your definition of "soon" - yes. We do plan on shipping a new release with much better deinterlacing, but I'm not sure exactly when that will go in. We have an active development team, though, so it'll happen sooner or later.
It's going to be a hassle re-ripping them all, since I'll have to re-type all the iTunes metadata by hand (I don't know how to copy the artist/track/year/genre info from one MOV to another), so I'd really like to only do it once.
I'm sure there's a utility that can do that somewhere. Seems like it would be an easy thing to do, anyway; if this is the only reason that you're reticent to re-rip things, then I could probably whip up a quick 'mp4copytags' or something for you to use.

And, yes... trust me, one of the biggest frustrations of working on a project like this is that once we get cool new features, I feel like I should go re-rip all of the stuff I already ripped to take advantage of all the new hotness.
Post Reply