VideoHelp Forum
+ Reply to Thread
Results 1 to 9 of 9
Thread
  1. Member usta's Avatar
    Join Date
    Jun 2009
    Location
    Netherlands
    Search Comp PM
    I see that the most of the converters nowadays support multi-threaded video encoding, especially those based on ffmpeg.
    Most of the PCs around are dual core or quad core. So, how do I check to see if the video conversion is really multi-threaded?

    For example, on a dual-core PC with ffmpeg, I specify the thread count to be 2 (or 4?) and see in Task Manager the 2 cores jumping high at about the same level. Is this the only way to see what is going on, or is there a way to check that there are indeed 2/4 threads running?
    Quote Quote  
  2. From Task Manager use the Set Affinity option to limit the number of cores. See if it runs slower with fewer cores.

    Also, typically, a single threaded encoder will max out at around 50 percent CPU on a dual core, 25 percent on a quad core, etc.
    Quote Quote  
  3. That's pretty much the way. Actually, there will be many threads running for a given application. The important part is how much of the encoding etc can be done in parallel such that it can be spread across multiple processors when available. Task Manager can show the number of threads for each process but the number tells you nothing about parallel processing. Also, seeing the activity per core may be misleading. Even a non-parallel encoder etc may get shuffled from one core to another by Windows. What you can try is to tell Windows to only allow the software to use one core instead of two and see if the performance drops noticeably. To do this, right-click the process in Task Manager at set the processor affinity as desired. Under some circumstances, Windows may choose to ignore you since it is more of a hint than a directive.
    John Miller
    Quote Quote  
  4. Originally Posted by JohnnyMalaria
    right-click the process in Task Manager at set the processor affinity as desired. Under some circumstances, Windows may choose to ignore you since it is more of a hint than a directive.
    I've never seen it fail to work.

    One other method is to set the number of cores in BOOT.INI (/NUMPROC=N). It's a pain rebooting all the time though.
    Quote Quote  
  5. Member usta's Avatar
    Join Date
    Jun 2009
    Location
    Netherlands
    Search Comp PM
    Thank you for the answers.
    I've experimented with a short video conversion and here are the results:
    * Disabling multi-threading in video converter = (was equal to) limiting process affinity to 1 CPU, in terms of the encoding speed.
    * The time of encoding in above case was the same. However, in single affinity CPU case I saw the usage of only 1 core at the top, while the other core was down almost zero. When I disabled the multi-threading in video converter, both cores started to show high activity (non-synchronized pattern), but the encoding time was the same as above.
    * Enabling muliti-threading and leaving the CPU affinity to use both cores has produced the fastest speed and showed both cores running at a synchronized pattern. The speed gain was 16%.

    Conclusion: enabling multi-threading produces speedy conversion. The only way to see this is to observe a similar CPU running core patterns in Task Manager.
    Please feel free to discuss other things related to multi-threading in this topic.
    Quote Quote  
  6. Originally Posted by usta
    * The time of encoding in above case was the same. However, in single affinity CPU case I saw the usage of only 1 core at the top, while the other core was down almost zero. When I disabled the multi-threading in video converter, both cores started to show high activity (non-synchronized pattern), but the encoding time was the same as above.
    As noted, Windows XP bounces execution threads around cores to even out heating. So even a single threaded application will run on all the cores -- but it will only be running on one core at a time.

    Originally Posted by usta
    * Enabling muliti-threading and leaving the CPU affinity to use both cores has produced the fastest speed and showed both cores running at a synchronized pattern. The speed gain was 16%.
    That's not much of an improvement. Were you doing a lot of filtering? The filter chain is often single threaded so it can become a bottleneck. Xvid can get about a 60 to 70 percent improvement in encoding speed going from one core to two. X264 can get nearly double. With no other bottlenecks.
    Quote Quote  
  7. Originally Posted by jagabo
    Originally Posted by JohnnyMalaria
    right-click the process in Task Manager at set the processor affinity as desired. Under some circumstances, Windows may choose to ignore you since it is more of a hint than a directive.
    I've never seen it fail to work.

    One other method is to set the number of cores in BOOT.INI (/NUMPROC=N). It's a pain rebooting all the time though.
    Oh - my brain is too tardy today. I was thinking of SetThreadIdealProcessor.
    Quote Quote  
  8. Member usta's Avatar
    Join Date
    Jun 2009
    Location
    Netherlands
    Search Comp PM
    Originally Posted by jagabo
    That's not much of an improvement. Were you doing a lot of filtering? The filter chain is often single threaded so it can become a bottleneck. Xvid can get about a 60 to 70 percent improvement in encoding speed going from one core to two. X264 can get nearly double. With no other bottlenecks.
    I'm not using many filters. To keep things simple, only resizing filter.
    My first experiment was with Format Factory. Now, I've tried another tool (Avidemux), and tried to convert an avi video into xvid MP4. First with MT enabled in configuration panel, then with MT disabled. The time difference was even less (about 10%!). Am I missing something?
    Quote Quote  
  9. I don't see much difference between 1 and 4 threads (Q6600) with AviDemux's xvid encoder -- although CPU usage goes up from about 30 percent to 50 percent. Try its x264 encoder instead. You should see a big difference there.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!