This post is here to support my 1080p@60fps h264 posts, but may also be of general interest.
Intro
Your video decoder needs to be set up effectively to smoothly playback HD and/or 60fps h264 content. In particular you need to take advantage of multiple CPU cores where possible. However, depending on how (and when) you set up your players & codecs you may not be using your multithreading possibilities, massively reducing your playback potential. This post describes how to check/correct your setup in this regard. This method is for Windows only (XP, Vista or Win 7). It assumes your system has a multi-core processor (2+ cores).
---
Some systems are perfectly capable of playing high-bitrate videos but struggle because of a sub-optimal player/codec setup. Typical problems are using old versions of players/codecs, or installing too many conflicting players/codec packs hence creating a tangle of decoding steps. I can't go into all the potential problems here, but will focus on getting h264 rips decoding efficiently with an up to date software installation.
These steps are in no way guaranteed to work, but should at least identify where the bottleneck in your system is when decoding h264 video.
Required Software
Get the latest software (it's important - updating often brings speed-ups):
- By far the easiest solution is to download and install the latest version of the K-Lite codec pack Get the Mega pack and choose the default settings. The current version of this installs multithreading support for h264 out of the box. It also checks your current setup. See the note below about DXVA though.
- For a more manual setup, download and install the latest Media Player Classic - Home Cinema, the FFDShow decoders and Haali's Media Splitter
- Uninstalling any other codec packs/players might help untangle an over-installed system. However, be wary if you rely on them for more unusual video types or web-cam output etc.
- You may get the option of enabling DXVA support - this allows your graphics card (GPU) to do the decoding rather than your CPU. Whilst this might work well on some machines, DXVA can have driver or synchronisation problems on others. For this reason I suggest you try DXVA only if CPU decoding is ineffective. I am not going to cover DXVA setup in this guide other than mention that it is an option in the K-Lite installation / configuration.
Notes:
- The CCCP codec pack is similar to the K-Lite pack, but unfortunately it's not up to date
- I am only going to discuss the use of Media Player Classic - Home Cinema (MPC-HC) as a player
- You can eliminate tearing (horizontal "ripping" effect in video playback) in MPC-HC as well improve some display issues: right click in the video area and look in the "Render Settings" sub-menu. Choosing "Reset>>Reset to optimal..." usually sets good baseline settings for your system. You can experiment with the "VSync" menu to eliminate tearing. Be careful in this menu though.
ㅤ
Check Efficiency of your Video Decoding
- Close down all major programs except your standard background tasks
- Run task manager [in XP press press Ctrl, Alt & Delete all together, in Vista/Win7 press Ctrl, Shift and Esc all together]
- Click the "Performance" tab. Look at the "CPU Usage History" graphs, there is one for each processor in your systems (x2 if you have HyperThreading)
- Play a high resolution/fps h264 video (MeguIV videos are h264). You can test other players with these steps, but the fix below is just for MPC-HC/FFDShow/K-Lite
Ideally you should see similar activity on all the graphs - the video decoding distributed across all the processors. However, there are several potential problem scenarios:
- If nearly all the activity is on one processor graph then your system is not working at peak performance and you need to enable multithreading (see below)
- If any one of the processor graphs maxes out then the video will drop frames or stutter. Clearly this is more likely if all the activity is on one processor
- If all your processors are maxing out, then your CPU is not powerful enough to play the video. DXVA might help in this case (GPU video decoding), although it requires a decent graphics processor. Try installing/configuring the K-Lite codec pack and checking the DXVA settings
- If the processors are working but not maxing out and you are still getting video stutter, then your graphics card (or on-board graphics) could be the weak point, particularly with high resolution videos - you need to upgrade. A less likely possiblity is a slow hard drive (try putting the vid on a different drive if you have more than one).
- If there is very little activity on any graph then you may already be using DXVA (the GPU is doing the decoding). If you are getting stutter or desynchronization then your GPU is not up to the task. Install / configure the K-Lite codec pack and switch off DXVA. The other possibility in this scenario is that you have a powerful machine and it just isn't breaking a sweat
ㅤ
Enable Multithreaded Decoding
If all the activity was on one processor graph and the other processors were idle then you should follow these steps:
- Run MPC-HC
- In the menus choose "View >> Options..."
- Select "Output" on the left. Now look at the "DirectShow Video" panel:
ㅤㅤ- On Windows XP ensure you have one of "VMR7 (Renderless)", "VMR9 (Renderless)" or "Overlay" selected. You can switch between these settings later if you are still having trouble (e.g. Overylay may be faster than VMRx). You may also want to tweak the VMR7/9 settings panel at this time.
ㅤㅤ- On Windows Vista or Windows 7 ensure "EVR Custom Pres." is selected. If it doesn't work or improve things, then try again with "VMR7 (Renderless)"
ㅤㅤ- Some systems may get a small boost by checking "YUV Mixing" on this tab, for some it might not help or work
- Now select "Internal Filters" on the left
ㅤㅤ- In the left-hand list headed "Source Filters" uncheck "Matroska". This will allow Haali's media splitter to handle MKV files instead of MPC's internal splitter
ㅤㅤ- In the right-hand list headed "Transform Filters", uncheck "H264/AVC (DXVA)" and "H264/AVC (FFmpeg)" if they are there. This will allow FFDShow to decode h264 video instead of MPC-HC.
- Press OK on this Options dialog and close MPC-HC
- Now in the Windows/Start menu (All Programs) run "FFDShow >> Video decoder configuration". This program is in the K-Lite start menu folder if you're using K-Lite.
- At the top of the list at the left, select "Codecs" if it isn't already selected
- In the pane on the right find the entry "H.264/AVC" under "Format", it's probably the first one.
- Drop down the list under the "Decoder" column for this entry and ensure it is on "ffmpeg-mt". It may already be on this setting
ㅤㅤ- [Note: if you ever find a vid that doesn't play, then find and enable it's Decoder in this list]
- Optional steps for slower machines, this may help, or it may spoil the output:
ㅤㅤ- Scroll to the bottom of the list on the left and select "Queue and misc"
ㅤㅤ- Check "Queue ouput samples" and "Use queue only in:" (and optionally "Enable queue in VMR9-YV12")
ㅤㅤ- Add the text "mpc-hc.exe;" to the "Use queue only in:" text box - each entry in this list should be seperated by a semicolon, check it's OK
- Press OK on this configuration dialog
Now test the video again and check your task manager processor graphs. If you're still seeing all the work on one processor then you may have "codec tangle". You could try uninstalling all players/codecs then just installing K-Lite.
If you do get multithreading but don't get the speed, you could try one of the other options that I suggested in the various steps (e.g. "Overlay" on XP, or "YUV Mixing")
Hope that helps someone...
Vit
Intro
Your video decoder needs to be set up effectively to smoothly playback HD and/or 60fps h264 content. In particular you need to take advantage of multiple CPU cores where possible. However, depending on how (and when) you set up your players & codecs you may not be using your multithreading possibilities, massively reducing your playback potential. This post describes how to check/correct your setup in this regard. This method is for Windows only (XP, Vista or Win 7). It assumes your system has a multi-core processor (2+ cores).
---
Some systems are perfectly capable of playing high-bitrate videos but struggle because of a sub-optimal player/codec setup. Typical problems are using old versions of players/codecs, or installing too many conflicting players/codec packs hence creating a tangle of decoding steps. I can't go into all the potential problems here, but will focus on getting h264 rips decoding efficiently with an up to date software installation.
These steps are in no way guaranteed to work, but should at least identify where the bottleneck in your system is when decoding h264 video.
Required Software
Get the latest software (it's important - updating often brings speed-ups):
- By far the easiest solution is to download and install the latest version of the K-Lite codec pack Get the Mega pack and choose the default settings. The current version of this installs multithreading support for h264 out of the box. It also checks your current setup. See the note below about DXVA though.
- For a more manual setup, download and install the latest Media Player Classic - Home Cinema, the FFDShow decoders and Haali's Media Splitter
- Uninstalling any other codec packs/players might help untangle an over-installed system. However, be wary if you rely on them for more unusual video types or web-cam output etc.
- You may get the option of enabling DXVA support - this allows your graphics card (GPU) to do the decoding rather than your CPU. Whilst this might work well on some machines, DXVA can have driver or synchronisation problems on others. For this reason I suggest you try DXVA only if CPU decoding is ineffective. I am not going to cover DXVA setup in this guide other than mention that it is an option in the K-Lite installation / configuration.
Notes:
- The CCCP codec pack is similar to the K-Lite pack, but unfortunately it's not up to date
- I am only going to discuss the use of Media Player Classic - Home Cinema (MPC-HC) as a player
- You can eliminate tearing (horizontal "ripping" effect in video playback) in MPC-HC as well improve some display issues: right click in the video area and look in the "Render Settings" sub-menu. Choosing "Reset>>Reset to optimal..." usually sets good baseline settings for your system. You can experiment with the "VSync" menu to eliminate tearing. Be careful in this menu though.
ㅤ
Check Efficiency of your Video Decoding
- Close down all major programs except your standard background tasks
- Run task manager [in XP press press Ctrl, Alt & Delete all together, in Vista/Win7 press Ctrl, Shift and Esc all together]
- Click the "Performance" tab. Look at the "CPU Usage History" graphs, there is one for each processor in your systems (x2 if you have HyperThreading)
- Play a high resolution/fps h264 video (MeguIV videos are h264). You can test other players with these steps, but the fix below is just for MPC-HC/FFDShow/K-Lite
Ideally you should see similar activity on all the graphs - the video decoding distributed across all the processors. However, there are several potential problem scenarios:
- If nearly all the activity is on one processor graph then your system is not working at peak performance and you need to enable multithreading (see below)
- If any one of the processor graphs maxes out then the video will drop frames or stutter. Clearly this is more likely if all the activity is on one processor
- If all your processors are maxing out, then your CPU is not powerful enough to play the video. DXVA might help in this case (GPU video decoding), although it requires a decent graphics processor. Try installing/configuring the K-Lite codec pack and checking the DXVA settings
- If the processors are working but not maxing out and you are still getting video stutter, then your graphics card (or on-board graphics) could be the weak point, particularly with high resolution videos - you need to upgrade. A less likely possiblity is a slow hard drive (try putting the vid on a different drive if you have more than one).
- If there is very little activity on any graph then you may already be using DXVA (the GPU is doing the decoding). If you are getting stutter or desynchronization then your GPU is not up to the task. Install / configure the K-Lite codec pack and switch off DXVA. The other possibility in this scenario is that you have a powerful machine and it just isn't breaking a sweat
ㅤ
Enable Multithreaded Decoding
If all the activity was on one processor graph and the other processors were idle then you should follow these steps:
- Run MPC-HC
- In the menus choose "View >> Options..."
- Select "Output" on the left. Now look at the "DirectShow Video" panel:
ㅤㅤ- On Windows XP ensure you have one of "VMR7 (Renderless)", "VMR9 (Renderless)" or "Overlay" selected. You can switch between these settings later if you are still having trouble (e.g. Overylay may be faster than VMRx). You may also want to tweak the VMR7/9 settings panel at this time.
ㅤㅤ- On Windows Vista or Windows 7 ensure "EVR Custom Pres." is selected. If it doesn't work or improve things, then try again with "VMR7 (Renderless)"
ㅤㅤ- Some systems may get a small boost by checking "YUV Mixing" on this tab, for some it might not help or work
- Now select "Internal Filters" on the left
ㅤㅤ- In the left-hand list headed "Source Filters" uncheck "Matroska". This will allow Haali's media splitter to handle MKV files instead of MPC's internal splitter
ㅤㅤ- In the right-hand list headed "Transform Filters", uncheck "H264/AVC (DXVA)" and "H264/AVC (FFmpeg)" if they are there. This will allow FFDShow to decode h264 video instead of MPC-HC.
- Press OK on this Options dialog and close MPC-HC
- Now in the Windows/Start menu (All Programs) run "FFDShow >> Video decoder configuration". This program is in the K-Lite start menu folder if you're using K-Lite.
- At the top of the list at the left, select "Codecs" if it isn't already selected
- In the pane on the right find the entry "H.264/AVC" under "Format", it's probably the first one.
- Drop down the list under the "Decoder" column for this entry and ensure it is on "ffmpeg-mt". It may already be on this setting
ㅤㅤ- [Note: if you ever find a vid that doesn't play, then find and enable it's Decoder in this list]
- Optional steps for slower machines, this may help, or it may spoil the output:
ㅤㅤ- Scroll to the bottom of the list on the left and select "Queue and misc"
ㅤㅤ- Check "Queue ouput samples" and "Use queue only in:" (and optionally "Enable queue in VMR9-YV12")
ㅤㅤ- Add the text "mpc-hc.exe;" to the "Use queue only in:" text box - each entry in this list should be seperated by a semicolon, check it's OK
- Press OK on this configuration dialog
Now test the video again and check your task manager processor graphs. If you're still seeing all the work on one processor then you may have "codec tangle". You could try uninstalling all players/codecs then just installing K-Lite.
If you do get multithreading but don't get the speed, you could try one of the other options that I suggested in the various steps (e.g. "Overlay" on XP, or "YUV Mixing")
Hope that helps someone...
Vit