mattgadient.com

VLC Mac Stutter – the fix

Update: This is for VLC 1.x – if you’re using the newer VLC 2.x see the updated post at http://mattgadient.com/2012/08/08/vlc-2-x-mac-stutter-the-fix/

If you’re using VLC for Mac OS X and playing files over the network, you might be noticing some stutter, lag, delay, freezing, etc every so often. Basically your video’s happily playing along, and the screen will freeze for 2 or 4 seconds, then play again. You may also find that Quicktime DOESN’T stutter or freeze. Of course it doesn’t help if Quicktime won’t play your video and VLC will.

Sound like the issue you’re having? Here’s the fix…

vlc_fix_mac

  1. First, with VLC running, click VLC/Preferences in the top menu bar.
  2. Next, Click the “All” button in the bottom left. The screen will then change to look like it does in the picture above.
  3. Go to Input Codecs, Access Modules, File
  4. Now change this value from the default of 300. This determines how many seconds of video VLC will cache. I had lag spikes of up to 4 seconds at a time on the Macbook here, so I set it to 5000ms (5 seconds). If your lag spikes are longer, you can try going even higher.
  5. Click “Save”.
  6. Now RESTART VLC. Easiest way is to Right-Click the icon on the dock and choose “Quit”, then start it again.

You should be good to go! If you still get periodic spikes, you can go into the preferences and increase the cache a bit more.

The boring stuff you didn’t want to know:

From what I read/gathered, the cause seems to have something to do with the Mac OS having high latency when accessing Samba-shares (shares from Windows), and the Mac OS doing particularly poorly when it does many small reads from these shares.

What you’re basically doing with the above cache setting is caching this data well ahead of time. So when there’s a “stutter” while VLC copies in the background, you’ll never see it because you’ve cached enough that VLC recovered and grabbed the new data before the video even got to your screen. The default cache of 300ms isn’t enough, because any stutters of longer than 0.3 seconds will be very evident. By using 5000ms, VLC has 5 seconds to “catch up” from a stutter which should catch just about all of them.


 

Credit:

As much as I’d like to say I was successful the first time I looked through the zoo of options trying to find where the caching was (I assumed VLC must have some sort of caching option since most everything else does), I was unsuccessful. Credit to:

-techmonkey of the macrumors forum for linking to the thread with the fix
-cellplex of the VideoLAN forums for stating where in the preferences to look
-SumoPaint (http://www.sumopaint.com/home/) for having a nice web-based paint program since the Macbook just had a fresh install of Snow Leopard and I didn’t have another painting program installed to do my lovely screenshot circles/numbering with.

  • Mike P

    Excellent Help. Thanks

    • Igogo

      Thank you Matt.

  • Iman Izzati

    I think I downloaded the latest version and can’t seem to find caching value nor network caching. Please help

    • The location’s been changed in VLC 2.

      Anthony’s comment above sums up the new location quite well, but I’ll try to break it down a little.

      -Head to preferences
      -Click “Show All” in the bottom left
      -With “Input/Codecs” selected at the left, scroll way down on the right.
      -When you’ve scrolled down far enough you should see sliders near “File caching (ms)”, “Live capture caching (ms)”, “Disc caching (ms)”, “Network caching (ms)”.

      Adjust those settings. Network caching is the important one if you’re watching a video that’s located somewhere else on your network. Something like 9000 would work out to 9 seconds of caching.

      Beyond that, it can help to bump up File caching and Disc caching if your hard drive is being kept busy when you’re playing videos locally (if you’re doing something disc-intensive in the background for instance).

  • Anthony

    Awesome fix, thanks for taking the time to write this up.

    However, I just downloaded VLC and the preferences seem to have changed around a bit. To find the correct field to change follow the same steps above except click on “Input / codecs” and then scroll down towards the bottom until you find “Network caching(ms)” I set this to 5000 and the jitters stopped. Hope that helps.

  • Ricardo

    I’ve got the same problem as Rishu ^. I remember on Snow Leopard OS the bug could be fixed with what you posted, but now with Lion OS I’m getting the same problem again and changing the ms doesn’t fix it :S if anyone knows how to fix it, I’d be very grateful to know 🙂

    Thanks for the help!

  • Rishu

    cnt find any help……..
    my vlc got freezes automatically….
    then i’ve to force quite it..
    i ve macbook pro with kion os in it

  • Boyan

    amazing 🙂 thanks soo much … hopefully it doesnt stutter anymore… so far so good… 😀

  • Noah

    Thanks! I had figured this out on an old version and couldn’t figure out where it was on the new version of VLC. Seems to be working for me allowing me to stream 720p across the house over 802.11n

  • Gurdeep

    mine still did not work. i changed to like 9000 and still won’t 🙁

  • Sindroid

    Dude thanks for this. I been so annoyed listening to music over my Time Capsule and the track gives a 1-2 second stop every now and then which was annoying the hell out of me. But now it flows flawlessly.

  • renan

    thanks a lot men!!!

  • Scott Carstensen

    AWESOME…you rock..no I wont be scoffing whilst my wife is facebooking….haha

  • Martin

    thanks – just playing some Amy Winehouse over the network and finally decided to sort this out once and for all.

  • James

    Thanks a lot, this seems to have solved the problem for me! Only a new, though not as annoying problem seems to have arisen instead, if I rewind/fastforward/click to somewhere else in the video the sound completely disappears for a few seconds, anyone know how to fix this?

  • Jimmer

    Thanks dude ;]

  • Thanks for posting this. This has been bugging me for about 3 years now, just never bothered to look for a fix before.

  • fernando bueno

    And that is a BINGO! Many thanks indeed.

  • Hayo

    Problem solved! Thanks, I was on the edge of giving up on VLC and my FLAC collection on Mac.

  • Holly

    I love you! This solved so many of my goddam problems =) i thought i had tried everything

  • Jake

    hey this totally solved my problems! i knew it was something bout the buffer, but the other solutions i found was changing the audio output module to “Win32 waveOut extension output” which didn’t solve my case at all. thanks!!!

  • Aaron

    I have a Macbook pro 2.66 GHz Intel core 2 Duo 4 GB 1067 MHZ DDR3. Anyway, I’m a total novice and had bought this computer thinking that I could easily extract video from my Canon HD Vixia HG20, archive it to my time capsule, and play it back whenever I wanted. Well, I can, but at the espense of HUGE amounts of memory. My 1 T Time Capsule is already filled up after just a few times emptying the contents of my camera. So, anyway, I’ve tried to find a player to playback the original .MTS files that are on my camera. This player seems to be the only one that works so far, but I also get the same stuttering. I’ve tried the above mentioned fix but it does not work. I do have Snow Leopard by the way. It’s frusterating to me that Apple’s products do not simply play .MTS files. I thought they were supposed to be the bomb, but I’ve been highly disappointed in this regard.

  • mattsson

    @ShrekDonkey
    Hah, I had the exact same problem. 😀

  • Michelle

    I think this fixed my problem too….. thanks 🙂

  • ShrekDonkey

    x2. My macbook pro was stuttering while downloading files and playing movies with VLC.

    SmOOOOOOOth video at last!!!! 🙂 ty

  • matt

    this totally solved my problem. thanks very much!