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. |
20th September 2009, 01:56 | #1 | Link |
Registered User
Join Date: Oct 2007
Posts: 1,060
|
How to use ffmpeg-mt in MPC?
Under output, I use Haali Renderer. Under internal filter, and H.264, it says I'm using ffmpeg-mt, with 4 threads.
ffdshow is set up correctly. I have to force ffdshow video decoder under external filters to get it to work. I don't want to do that because I can't load an external subtitle under this mode. I'm using the Crowdrun footage to do some test on my Q6600. With single core (I don't know which decoder, probably libavcodec), I can get around 3fps. With ffmpeg-mt, I'm getting 100% CPU usage, but I'm only getting 1.5fps??? In ffdshow, under decoder options, I unchecked drop frame and skip H264 deblocking cause I thought that might drop fps. But nothing changed. Even with them unchecked, it still drop frames, unlike with the single core decoder. Anybody have a clue? |
20th September 2009, 13:33 | #3 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
If MPC's "internal" H.264 decoder was compiled with libavcodec taken from "normal" FFmpeg repository instead of the "FFmpeg-MT" repository, then there is no way
Of course you could always compile MPC yourself from the sources and make sure that the "FFmpeg-MT" libraries are used...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ |
20th September 2009, 14:09 | #5 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
I don't know if there are any pre-compiled MPC-HC builds publicly available that use multi-threaded libavcodec (FFmpeg-MT) for the "internal" decoders
Keep in mind that MPC-HC also has a DXVA decoder. So AFAIK if your GPU does support it, MPC-HC won't use the software decoder (libavcodec) for decoding H.264 at all. At least not by default. You can disable the internal DXVA decoder of course and make it fall back to software decoding...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 20th September 2009 at 14:34. |
20th September 2009, 15:52 | #7 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
Again: Unless MPC-HC was compiled with multi-threaded libavcodec/ffmpeg (aka "FFmpeg-MT"), then there is no way to make it use FFmpeg-MT!
At least not for the built-in "internal" decoders. You can still use ffdshow with FFmpeg-MT as an "external" filter, of course...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ |
20th September 2009, 16:20 | #8 | Link |
*****
Join Date: Feb 2005
Posts: 5,647
|
The video decoder and the loading of subtitles are two unrelated things.
As LM has already said, disable the internal decoder and use ffdshow. Then you can use ffmpeg-mt instead of libavcodec.
__________________
MPC-HC 2.2.1 |
20th September 2009, 16:27 | #9 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
I think this statement can be confusing
Just to make it clear: We don't use ffmpeg-mt instead of libavcodec. We always use the decoders provided by the "libavcodec" library, which is one part of the FFmpeg project. However there now is the multi-threaded FFmpeg repository (aka "FFmpeg-MT") in addition to the normal/stable FFmpeg repository. They'll (hopefully) be merge at some point in the future. Currently you must decided which flavor of the "libavcodec" library you link against your application, at compile-time. Well, ffdshow contains both of them, but most apps don't...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 20th September 2009 at 16:38. |
20th September 2009, 19:44 | #11 | Link |
*****
Join Date: Feb 2005
Posts: 5,647
|
The library names used in ffdshow are "libavcodec" and "ffmpeg-mt". I tried not to confuse him with details.
__________________
MPC-HC 2.2.1 |
21st September 2009, 01:31 | #13 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
Why is that? MPC-HC should always use the renderer you have selected under "Output" options, no matter what decoders (or more precisely: "transform" filters) are used.
So what renderer did you select? And which one is used instead if you force ffdshow?
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ |
21st September 2009, 02:36 | #14 | Link |
Registered User
Join Date: Oct 2007
Posts: 1,060
|
Never mind, I take that back.
I don't know why I can't load subtitle before. It popped up a message to change renderer when I try to load an external subtitle. The whole point of this thread was trying to play the Crowdrun footage on my PC. Apparently ffmpeg-mt is just really slow at decoding this particular video. I'm getting 0.3fps with ffmpeg-mt with 1 thread, but 3.5fps with libavcodec. Maybe it is not optimized for 50fps + UHD? With 1080p video the CPU usage is around the same. Last edited by Chengbin; 21st September 2009 at 02:46. |
21st September 2009, 12:06 | #17 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
How did you measure this? Please use TimeCodec to compare decoder performance!
The last time I did a comprision, the result was like this: Code:
E:\HD\freedom EP1 sample.mkv, 1920x1080, High@L4.1 [ffdshow, rev2509, 4 threads] User: 3s, kernel: 0s, total: 4s, real: 22s, fps: 142.8, dfps: 27.2 User: 3s, kernel: 0s, total: 4s, real: 22s, fps: 142.8, dfps: 27.2 <-- 100% User: 3s, kernel: 0s, total: 4s, real: 25s, fps: 140.8, dfps: 24.2 [ffdshow, rev2527, Pre-Beta 6, 4 threads] User: 3s, kernel: 0s, total: 4s, real: 22s, fps: 149.3, dfps: 27.5 User: 3s, kernel: 0s, total: 3s, real: 22s, fps: 155.2, dfps: 27.4 <-- 101% User: 3s, kernel: 0s, total: 4s, real: 24s, fps: 147.1, dfps: 24.9 [ffdshow-MT, rev2515, 4 threads] User: 2s, kernel: 0s, total: 2s, real: 8s, fps: 219.0, dfps: 68.7 User: 2s, kernel: 0s, total: 2s, real: 8s, fps: 252.7, dfps: 68.7 <-- 254% User: 2s, kernel: 0s, total: 2s, real: 9s, fps: 220.2, dfps: 67.2 [CoreAVC, Version 1.8.5] User: 0s, kernel: 0s, total: 0s, real: 7s, fps: 679.7, dfps: 82.3 User: 0s, kernel: 0s, total: 1s, real: 7s, fps: 616.0, dfps: 82.1 <-- 304% User: 0s, kernel: 0s, total: 0s, real: 7s, fps: 691.6, dfps: 82.0 [DivX H.264 Decoder, Beta-3] User: 1s, kernel: 0s, total: 1s, real: 6s, fps: 458.4, dfps: 88.4 User: 1s, kernel: 0s, total: 1s, real: 6s, fps: 512.0, dfps: 88.4 <-- 327% User: 1s, kernel: 0s, total: 1s, real: 7s, fps: 499.0, dfps: 87.6 (Note that "ffdshow-MT" was tested with FFmpeg-MT decoders, the "normal" ffdshow builds were using the Non-multithreded FFmpeg decoders)
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 21st September 2009 at 12:11. |
21st September 2009, 21:06 | #18 | Link |
Registered User
Join Date: Oct 2007
Posts: 1,060
|
ffmpeg-mt is roughly 4 times faster under threads 4 compared to thread 1.
My hypothesis was, maybe ffmpeg-mt was not optimized for UHD + 50fps video. ffmpeg-mt @ 4 threads = less than half of libavcodec. 1080p video and under, ffmpeg-mt @ 1 thread = libavcodec. |
22nd September 2009, 12:40 | #19 | Link | |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
Quote:
I just did a quick test with the "Crowdrun" video (3840x2160 @ 50fps) and ffdshow r3078: Code:
[ffdshow, using "normal" libavcodec] User: 5s, kernel: 3s, total: 8s, real: 74s, fps: 55.6, dfps: 6.7 <-- 100% [ffdshow, using "FFmpeg-MT" libavcodec, 4 threads] User: 5s, kernel: 0s, total: 5s, real: 34s, fps: 86.6, dfps: 14.5 <-- 216% [DivX H.264 decoder] User: 3s, kernel: 0s, total: 4s, real: 28s, fps: 124.2, dfps: 17.7 <-- 264%
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 22nd September 2009 at 12:54. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|