Slashdot Mirror


Which Open Source Video Apps Use SMP Effectively?

ydrol writes "After building my new Core 2 Quad Q6600 PC, I was ready to unleash video conversion activity the likes of which I had not seen before. However, I was disappointed to discover that a lot of the conversion tools either don't use SMP at all, or don't balance the workload evenly across processors, or require ugly hacks to use SMP (e.g. invoking distributed encoding options). I get the impression that open source projects are a bit slow on the uptake here? Which open source video conversion apps take full native advantage of SMP? (And before you ask, no, I don't want to pick up the code and add SMP support myself, thanks.)"

69 of 262 comments (clear)

  1. ffmpeg by bconway · · Score: 5, Informative

    Use the -threads switch.

    --
    Interested in open source engine management for your Subaru?
    1. Re:ffmpeg by morgan_greywolf · · Score: 5, Informative

      Similarly, mencoder supports threads=# where # is something between 1 and 8.

    2. Re:ffmpeg by Albanach · · Score: 4, Insightful

      Or just convert 2 videos at once, or 4 for a quad core etc. They did suggest they have lots to convert, and it's a pretty easy way to get all available cores working hard.

    3. Re:ffmpeg by sp332 · · Score: 3, Informative

      And it may or may not be useful to actually rune more than one thread per kernel. It depends on the encoder and application how many threads you shall run, so the best is to test with 1, 2 and 4 threads per kernel.

      Isn't that per-core, not per-kernel?

    4. Re:ffmpeg by mweather · · Score: 5, Informative

      Apple computers ARE PCs. They coined the damn term.

    5. Re:ffmpeg by m0rph3us0 · · Score: 4, Informative

      No it doesn't the only time you want to use multi-threading in a single CPU environment is because asynchronous methods for IO are unavailable or the code would be too difficult to re-architect to use asynchronous IO. If the application is seriously IO bound threads can even make the situation worse by causing random IO patterns.

      Ideally, the number of threads a program uses should be no more than the number of processors available. Otherwise, you are wasting time context switching instead of processing.

    6. Re:ffmpeg by i.r.id10t · · Score: 2, Informative

      Yup, with separate disks to work on to remove (mostly) the disk i/o contention, just let each process run happily away.

      --
      Don't blame me, I voted for Kodos
    7. Re:ffmpeg by m0rph3us0 · · Score: 4, Insightful

      On a two processor system this would result in multi-threading being off.

    8. Re:ffmpeg by civilizedINTENSITY · · Score: 2, Interesting

      strange that quoting history correctly and in context gets you modded flamebait...

    9. Re:ffmpeg by ydrol · · Score: 4, Informative
      Darn, I forgot a minor detail in my question. I was really asking about the various front-end apps (dvd::rip, k9copy, acidrip etc), I got the impression that none seem to notice they are running on an SMP platform and pass the necessary switches by default to the backend.

      Some may argue this is a good thing, but for the time being SMP is the way forward for faster processing as MHz has maxed out, in consumer PCS. So when they start buying octo-core CPUs they dont expect it to run at 1/8th speed by default.

      I was also being a bit lazy. I could have checked up on each app in turn, but I asked /. instead.

    10. Re:ffmpeg by Tanktalus · · Score: 5, Interesting

      That sounds like a lot of work... I just used make:

      %.mpg: %.avi
      tovid -ntsc -dvd -noask -ffmpeg -in "$<" -out "$(basename $@)"

      all: $(subst .avi,.mpg,$(wildcard */*.avi))

      Then I just ran "make -j4". All four processors working like mad, with a minimal of effort.

      (You may need to change the wildcard for your own scenario.)

    11. Re:ffmpeg by Fred_A · · Score: 2, Interesting

      Is creating a copy of my DVD for my Cowon D2 piracy now ?

      Legally it probably is in many places since I'm probably not even allowed to read them on my PC (Linux), but still...

      --

      May contain traces of nut.
      Made from the freshest electrons.
    12. Re:ffmpeg by Anonymous Coward · · Score: 3, Informative

      If thread 1 is doing work while thread 2 is blocked (io, semaphores, etc), then multithreading will be faster.

    13. Re:ffmpeg by sexconker · · Score: 2, Informative

      If you're making another copy of it to play on another device (format shifting or whatever bullshit term they used), yeah, you can probably get sued for it if some asshat wants to target you.

      Illegal? No.
      Wrong? Hell no.

      My point is that encoding apps often exist separately from editing apps (such as FCP). This is due in large part to piracy, especially when talking about free/open encoders and sites like doom9.
      Pirates are not concerned with editing/creating, they're concerned with copying and converting/compressing. Likewise, the writers of such tools/interfaces are concerned with pleasing a certain crowd of people...

      I was calling FCP trash in terms of a converter/encoder. It's much more geared toward editing. Thus, I think the ACs mention of FCP in this conext is not very pertinent.

    14. Re:ffmpeg by VGPowerlord · · Score: 4, Informative

      True, but in most contexts, "PC" is the shortened form of IBM-compatible PC (which is really outdated), and is usually just stands for Windows these days.

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    15. Re:ffmpeg by sick_soul · · Score: 2, Insightful

      Just want to inform you that threads nor any other
      multiprogramming mechanisms are necessary for
      responsive user interfaces,
      and that IO multiplexing in particular does not require
      threads at all.

      You can solve both with threads, but you don't have to.
      And in most common cases it is much better not to;
      it seems that threads continue to be one of the most
      misused and misunderstood of the programming concepts.

    16. Re:ffmpeg by elgaard · · Score: 2, Informative

      I have not tried it. But e.g. k9copy uses mencoder.
      So if you just put something like "x264ops=threads=auto" in you mencoder.conf file it might work also from k9copy.
      k9copy also have a settings menu where you can tune options to mencoder for various codecs.

    17. Re:ffmpeg by SimonTheSoundMan · · Score: 2, Informative

      Yeah, Compressor is pretty damn good. It doesn't just use all your cores, but it can also distribute the workload to other machines on a network. Whole render farms.

      Logic Node is somewhat better, however it only does audio, we have two eight core Mac pro's and three Xserv machines in our studio. The Xserve machines will be binned when the new version of Logic Pro supporting GPU processing the audio is out.

    18. Re:ffmpeg by maglor_83 · · Score: 5, Funny

      On a single core system this would result in not being able to run anything!

    19. Re:ffmpeg by hedwards · · Score: 5, Insightful

      Apple has spent a lot of time and money convincing everybody that they don't sell PCs, they sell Macs. I'm not sure what the point of arguing with both the general public as well as Apple is.

      At this point, the term PC does not include Apple computers. It's a change to the definition which happens when the vast majority of people decide amongst themselves that the definition should change.

      In terms of the topic at hand, most video apps really should be capable of using multiple cores, tasks of this sort are quite easy to finish in parallel. Either by doing ever n frames or subdividing the image into a number of regions which can be completed separately and joined at the end before writing the frame to disk.

    20. Re:ffmpeg by Albanach · · Score: 2, Insightful

      I thought about that but, seriously, transcoding is usually CPU limited. I'd really suspect it'd take a lot of simultaneous encoding to make it I/O bound.

    21. Re:ffmpeg by 3vi1 · · Score: 5, Insightful

      No - HP did (for their calculators), way before there "was" an Apple.

      Also, I don't even think Apple marketing would agree with you - or they wouldn't have "I'm a Mac... and I'm a PC" adverts.

    22. Re:ffmpeg by networkBoy · · Score: 3, Informative

      I hit I/O throttling when I do the following:
      * rip 2 dvds (two DVDR Drives)
      * transcoding previous DVD rips to XVID
      * Moving completed rips to server over 1 Gbps Ethernet link.

      At this point I can see CPU load start to drop as PCI bus I/O saturates.

      At no point do I hit disk I/O or memory limits.
      Disks are non-RAID non-striped, but rips are to separate disks (thus DVDA rips to HDA DVDB to HDB) and server upload pulls from whatever disk is not currently transcoding (transcode file on HDA, when done start transcode on HDB and move file from HDA).
      -nB

      --
      whois gawk date unzip strip find touch finger mount join nice man top fsck grep eject more yes exit umount sleep dump
    23. Re:ffmpeg by TheLink · · Score: 2, Insightful

      Ah but figuring out "make" might require too much wetware CPU time for most people ;).

      "Why is it not working? Oops messed up tabs and spaces", etc.

      --
    24. Re:ffmpeg by slimjim8094 · · Score: 2, Insightful

      Perhaps. But threads are far more versatile - if they're done well.

      So our video app has a sound-processing thread, a video processing thread, and a UI thread. If it's implemented well (don't read or write twice, have a common buffer), it'll run with the same or near performance as a one-threaded program on a one-processor/core system.

      But on a multicore/processor system no extra work is needed to take advantage of the cores. If we have three cores, it'll run automatically across cores for a massive performance gain. And we automatically take advantage of scheduling improvements.

      Yes, it can be done crappily. But threads exist for a very good reason and writing your program in one thread is more complex and far, far less flexible

      --
      I have developed a truly marvelous proof of this comment, which this signature is too narrow to contain.
    25. Re:ffmpeg by MadnessASAP · · Score: 4, Informative

      If I may offer a suggestion, I'm not too sure on what your setup is but on mine I have 2 DVD drives each on separate IDE buses and 2 SATA drives (also on separate buses) rip from the DVD to drive 1 and encode from drive 1 to 2. OF course it all depends on a variety of factors but using that certainly helped that.

      --
      I may agree with what you say, but I will defend to the death your right to face the consequences of saying it.
    26. Re:ffmpeg by Nikker · · Score: 4, Informative

      Running multiple cores with an ide interface is going to kill you regardless because you are only encoding in memory not really storing much there. Basically you have a cap of about 40MB/s for anything larger than about 40MB.

      --
      A loop, by its nature, continues. If that didn't make sense, start reading this sentence again.
    27. Re:ffmpeg by ksheff · · Score: 5, Informative

      That's the point. If the xvid encoder is single threaded, then to keep all the cores busy, one must run multiple instances of ffmpeg with each one encoding a different file. For the given Makefile, that is what make will do when the -j switch is used.

      --
      the good ground has been paved over by suicidal maniacs
    28. Re:ffmpeg by QuoteMstr · · Score: 3, Informative

      You're still missing the OP's point. Let me spell it out for you:

      Say you have four videos to encode, and four cores.

      1) You can either use one core at a time and encode one video at a time. Let's say that takes time T.
      2) You can encode one video at a time, but use all four cores while doing it. Your total time is T/4.
      3) You can encode four videos at a time, one on each core. Your total time is T/4.

      The OP was advocating strategy #3. It's a fine approach.

    29. Re:ffmpeg by QuoteMstr · · Score: 2, Interesting

      Yes, you can use threads well. But with less effort (taking into account synchronization and debugging), you can make the asynchronous tasks independent programs instead of threads. Your video and sound processing threads sound like perfect candidates for being made into independent programs.

      A task being an independent program affords several advantages. For example, it's easier to test an independent program, especially in a test harness. An independent program can be run by itself. And it's very clear what an independent program's data dependencies are. There is no risk of accidentally racing in memory access, assuming the programs don't share memory. Don't do that.

      Performance simply is not a problem. Any modern operating system will have IPC primitives that are more than good enough.

      For something like a video processing application, all three programs sharing file descriptors open to a video buffer sounds ideal. And before you complain that "disk access" is slow: on modern operating systems, main memory is just a cache for the disk anyway. With a modern page cache, using a disk file well be just as efficient as pretending you can keep arbitrarily large data structures in memory. See Varnish's architecture.

      Even if you must use threads, you should always program them as if they were independent programs, use message-passing, sockets, and so on for communication, and treat the shared address space more as a dangerous misfeature than a communication medium.

    30. Re:ffmpeg by fprintf · · Score: 2, Insightful

      It seems we are in the same place years and years later. Way back when overclocking Celeron 400s was the rage, I bought a multi-processor motherboard to run twin Intel Pentium IIs. I bought a SuSE Linux package after reading that Windows 95 would not support dual processors... you can see where this is going... except for rolling my own kernel and a few other things (like compiling code), the system largely ran on one processor even with SMP turned on in the kernel.

      So it seems we have similar complaints 8 or more years later. How disappointing. I only wish I knew how to program to the level where I could help solve this.

      --
      This post brought to you by your friendly neighborhood MBA.
    31. Re:ffmpeg by Ultra64 · · Score: 2, Insightful

      Ok, I've got to hear this one.
      What the fuck does threading have to do with video quality?

    32. Re:ffmpeg by jannesha · · Score: 2, Funny

      Clearly correct, as highlighted by Apple's own advertising:

      http://en.wikipedia.org/w/index.php?title=Mac_vs_PC

      --jjj

  2. transcode, of course! by morgan_greywolf · · Score: 5, Informative

    transocde uses separate processes for everything.

  3. x264 by Anonymous Coward · · Score: 3, Insightful

    x264 use slices and scales pretty well across multiple cores. I use it on windows via megui, but you could easily use it in Linux as well. You could use mencoder to pipe out raw video to a fifo and use x264 to do the actual conversion, for instance.

  4. VisualHub... by e4g4 · · Score: 3, Informative

    ...makes excellent use of multiple cores. It is however Mac-only. Interestingly, what it does is split a file into chunks and spawns multiple ffmpeg processes to do the conversion. Which is to say, perhaps you can do some (relatively simple) scripting with ffmpeg that will do the job.

    --
    The secret to creativity is knowing how to hide your sources. - Albert Einstein
  5. x264 and avisynth by PhrostyMcByte · · Score: 2, Informative

    x264 and avisynth can make pretty decent use of threads. check out meGUI.

  6. Beat me to it! by BLKMGK · · Score: 4, Informative

    x264 via meGUI from Doom9 is what I use to compress HD-DVD and BD movies - also on a quad core. I have some tutorials posted out and about on how I'm doing it. Near as I can tell you cannot dupe the process on Linux due to the crypto - Slysoft's AnyDVD-HD is needed.

    Playback - I use XBMC for Linux. It is also SMP enabled using the ffmpeg cabac patch. the developers of this project have been VERY aggressive at taking cutting edge improvements to the likes of ffmpeg and incorporating them into the code. Since Linux has no video acceleration of H.264 SMP really helps on high bitrate video!

    --
    Build it, Drive it, Improve it! Hybridz.org
  7. Load balancing: Why? by DigitAl56K · · Score: 4, Insightful

    don't balance the workload evenly across processors

    Why is balancing the load evenly important, as long as one thread is not bottlenecking the others? Loading a particular core or set of cores might even be beneficial depending on the cache implementation, especially when other applications are also contending for CPU time.

    Sure, a nice even load distribution might be an indicator for good design, but it doesn't have to apply in every case. I don't think software should be designed so you can be pleased with the aesthetics of the charts in task manager.

    1. Re:Load balancing: Why? by Scottie-Z · · Score: 2, Insightful

      Because, ideally, all four cores should be running at 100% -- the idea is to make maximal use of your available resources, right?

    2. Re:Load balancing: Why? by DigitAl56K · · Score: 4, Insightful

      It's still possible to load all cores 100%.

      A video decoder that I'm working with, for example, currently uses only as many threads as necessary for real-time playback. So for example if one core can do the job only one core is used. If the decoder looks like it might start falling behind more threads are given work to do. Ultimately, if your system is failing to keep up all cores will be fully leveraged.

      However, so long as only some cores are required the others are 100% available to other processes, including their cache (if it's independent). I'm not sure how power management is implemented but perhaps it's even possible for the unused cores to do power saving, leading to longer batter life for laptops/notebooks, etc.

      the idea is to make maximal use of your available resources, right?

      No, the idea is to make the best use of your resources. I'm not trying to say that load balancing is wrong. I'm just saying that processes that don't appear to be balanced are not necessarily poorly designed or operating incorrectly.

  8. Re:Which part of Open Source didn't you get? by phuul · · Score: 2, Informative
    So is ffmpeg not open source? It uses the LGPL license and from their license FAQ:

    "FFmpeg is licensed under the GNU Lesser General Public License (LGPL). However, FFmpeg incorporates several optional modules that are covered by the GNU General Public License (GPL), notably libpostproc and libswscale. If those parts get used the GPL applies to all of FFmpeg. Read the license texts to learn how this affects programs built on top of FFmpeg or reusing FFmpeg. You may also wish to have a look at the GPL FAQ. "

    Since his suggestion was to do some scripting that does essentially what VisualHub does using ffmpeg I'm not sure I see how he missed the Open Source requirement.

  9. Handbrake by vfs · · Score: 5, Informative

    Handbrake has always used both of the cores on my system for transcoding.

    1. Re:Handbrake by catmistake · · Score: 4, Informative

      that's because Handbrake uses ffmpeg

    2. Re:Handbrake by crmarvin42 · · Score: 2, Informative

      It's good for Video_TS folders in general. In fact, a handful of DVD's can't be ripped directly from the disk using handbrake and need to be copied to HD via something like MacTheRipper before being transcoded by Handbrake. I don't know what format the guy is trying to transcode from, but most people only need to transcode DVD's.

      --
      Bureaucracy expands to meet the needs of the expanding bureaucracy.-Oscar Wilde
  10. Re:Which part of Open Source didn't you get? by pushing-robot · · Score: 4, Informative

    OP is asking for open source tools. You cited a commercial one that doesn't provide source.

    VisualHub (the front-end app) may be closed, but ffmpeg is LGPL.

    And the GP was suggesting using ffmpeg, not VisualHub.

    --
    How can I believe you when you tell me what I don't want to hear?
  11. F(next) = F(current) + Delta(F(current:next)) by Lumenary7204 · · Score: 5, Insightful

    The problem with MPEG encoding and decoding is that the data itself is not well suited to multi-threaded analysis.

    Multi-threading is most efficient when it is applied to discrete data sets that have little or no dependency on each other.

    For example, suppose I have a table with four columns -- three holding input values (A, B, and C) and one holding an output value (X). If the data in a given row of the table has nothing to do with the data in any other row, multi-threading works efficiently, because none of the threads are waiting for data from any of the other threads. If I want to process multiple rows at once, I simply spawn additional threads.

    On the other hand, for data such as MPEG video, the composition of the next frame is equal to the composition of the current frame, plus some delta transformation - the changed pixels.

    This introduces a dependency which precludes efficient multi-threaded processing, because each succeeding frame depends on the output of the calculations used to generate the prior frame. Even if more than one core is dedicated to processing the video stream, one core would wind up waiting on another, because the output from the first core would be used as the input to the second.

    1. Re:F(next) = F(current) + Delta(F(current:next)) by Lumenary7204 · · Score: 2, Informative

      Note that the above example is about the video component only of a single MPEG audio/video stream.

      There is no reason that an encoder/decoder can't process audio in one thread and video in another, thereby using more than one core (which has already been discussed in other posts relating to this article).

    2. Re:F(next) = F(current) + Delta(F(current:next)) by Omega996 · · Score: 4, Insightful

      theoretically, couldn't an encoder scan the data stream for keyframes, chunk the data from keyframe to the next keyframe, and then queue up the keyframe+delta information for multiple cores? That way, each core has something to do that isn't dependent upon the completion of something else.
      i'd think that n-1 cores/threads/whatever to process the chunked data, and the last core/thread/whatever to handle overhead and i/o scheduling would run pretty nicely on a multi-core machine.

    3. Re:F(next) = F(current) + Delta(F(current:next)) by Zygfryd · · Score: 2, Informative

      http://en.wikipedia.org/wiki/Group_of_pictures

      You can encode GOPs independently. I think the only dependency between GOP encoding processes is bit allocation, which probably works well enough if you simply assign each process an equal share of the total bit budget.

    4. Re:F(next) = F(current) + Delta(F(current:next)) by John+Betonschaar · · Score: 4, Insightful

      You could of course split each frame in slices, and process these in parallel. Or skip the video N frames between each core, with N being the number of frames between MPEG keyframes. Or have core 1 do the luma and core 2 and 3 the chroma channels. Or pipeline the whole thing and have core 1 do the DCT, core 2 the dequant etc. and have core 3 reconstruct the output reference frame while core 1 already starts the next frame.

      Plenty of ways to parallelize decoding, and even more for encoding...

    5. Re:F(next) = F(current) + Delta(F(current:next)) by init100 · · Score: 2, Insightful

      I think the only dependency between GOP encoding processes is bit allocation, which probably works well enough if you simply assign each process an equal share of the total bit budget.

      Is this even needed if you use multi-pass encoding? At least for XviD, IIRC the first pass is used to accumulate statistics used to allocate the proper bit budget to each frame. Then the individual processes should be able to use the statistics file from the first pass to get the bit allocation for their current GOP in the second pass.

    6. Re:F(next) = F(current) + Delta(F(current:next)) by foxyshadis · · Score: 2, Informative

      Several implementations of this exist: For x264, there's x264farm (which includes network encoding as well).

    7. Re:F(next) = F(current) + Delta(F(current:next)) by benwaggoner · · Score: 2, Insightful

      You can encode GOPs independently. I think the only dependency between GOP encoding processes is bit allocation, which probably works well enough if you simply assign each process an equal share of the total bit budget.

      That's a pretty painful constraint for anything other than very flat constant bitrate encoding. You really want to be able to move bits between GOPs to optimize for consistant quality.

  12. Re:Simple... by j00r0m4nc3r · · Score: 5, Informative

    Running multiple instances of the same code concurrently in multiple threads is simple. Even running mutually exclusive parts of the same code concurrently in separate threads is easy. Converting complex serial algorithms to effectively utilize multiple cores is generally not simple. And writing code that can scale and balance across n number of cores/threads is extremely hard. There are all sorts of synchronization issues to deal with, scheduling issues, data transport issues, etc.. and it becomes increasingly hard to debug code the more cores/threads you throw in. I think the stigma is justified.

  13. keyframes by Anonymous Coward · · Score: 5, Informative

    Actually, the MPEG stream resets itself every n frames or so (n is often a number like 8, but can vary depending on the video content). These are called keyframes (K) and the delta frames (called P and I frames) are generated against them. Because of this, it is really easy to apply parallel processing to video encoding.

    1. Re:keyframes by DigitAl56K · · Score: 4, Informative

      Actually, the MPEG stream resets itself every n frames or so (n is often a number like 8, but can vary depending on the video content).

      That is not true for MPEG-4 unless you have specifically constrained the I/IDR interval to an extremely short interval, and doing so severely impacts the efficiency of the encoder because I-frames are extremely expensive compared to other types.

      Keyframes are usually inserted when temporal prediction fails for some percentage of blocks, or using some RD evaluation based on the cost of encoding the frame. Therefore unless the encoder has reached the maximum key interval the I frame position requires that motion estimation is performed, and thus you can't know in advance where to start a new GOP.

      In H.264 due to multiple references you would certainly have issues to contend with since long references might cross I-frame boundaries, which is why there is the distinction of "IDR" frames, and this would certainly not be possible threading at keyframe level.

      Granted, for MPEG1&2 encoders threading at keyframes is a possibility, although still not one I'd personally favor.

    2. Re:keyframes by TwinkieStix · · Score: 3, Informative

      This may be true for sending entire frames to threads, but in mpeg4, frames are broken up into chunks. Motion vectors are created that allow these chunks to move about the image from frame to frame. Other filters are used to remove blockiness, compress the image, do motion detection and macroblock detection, and do various other tasks. MPEG4, especially H.264, can be easily multi-threaded: http://ietisy.oxfordjournals.org/cgi/content/abstract/E88-D/7/1623 http://adsabs.harvard.edu/abs/2004SPIE.5308..384L http://www.electronicsweekly.com/Articles/2007/05/02/41296/aspex-targets-parallel-processor-at-blu-ray-dvd.htm When doing a two-pass encode, this is even easier because the keyframes are discovered on the first (faster) pass, so (if encoding already couldn't be threaded) it could by taking advantage of the known keyframe markers in at least the second pass. But, that's not necessary. I use handbrake to create H.264 videos under Linux all the time on my dual core machine, and both processors stay between 80%-90% utilization from start to finish regardless of the number of passes.

    3. Re:keyframes by srw · · Score: 2, Informative

      Slight correction: in MPEG, the keyframes are called I-Frames. The delta frames are B and P frames. Most MPEG2 encoders that I have used default to a 15 frame GOP.

  14. Windows? VirtualDub 1.8.x + ffdshow-tryouts by tdelaney · · Score: 3, Informative

    You don't say if you're running on Windows or Linux or something else. If you are running on Windows, the latest versions of VirtualDub have made big improvements to SMT/SMP encoding.

    VirtualDub home
    VirtualDub 1.8.1 announcement
    VirtualDub downloads

    Make sure you grab 1.8.3 - 1.8.1 was pretty good, but had a few teething problems. 1.8.2 has a major regression which is fixed in 1.8.3. The comments in the 1.8.1 announcement contain a few important tips for using the new features (some of which I posted BTW).

    The two major new features that would be of interest to you are:

    1. You can run all VirtualDub processing in one thread, and the codec in another. This works very well in conjunction with a multi-threaded codec - this one change improved my CPU utilitisation from approx 75% to 95% on my dual-core machines - with an equivalent increase in encoding performance.

    2. VD now has simple support for distributed encoding. You can use a shared queue across either multiple instances of VD on a single machine, or across multiple machines (must use UNC paths for multiple machines). Each instance of VD will pick the next job in the queue when it finishes its current job. Instances can be started in slave mode (in which case they will automatically start processing the queue).

    I use 3 machines for encoding (all dual-core). With VD 1.8.x I start VD on two of the machines in slave mode, and one in master mode. I add jobs to the queue on the master instance, and the other two instances immediately pick up the new jobs and start encoding. When I've added all the jobs, I then start the master instance working on the job queue.

    To achieve a similar effect on your quad-code, start two instances of VD on the same machine - one slave, the other master.

    It's not perfect (if you've only got one job, you won't use your maximum capacity) but it has greatly simplified my transcoding tasks, and reduced the time to transcode large numbers of files.

  15. avidemux by Unit3 · · Score: 5, Informative

    I've noticed a lot of talk about commandline options, but not the nice guis that use them. Avidemux is open source, cross-platform, gives you a decent interface, and uses multithreaded libraries like ffmpeg and x264 on the backend to do the encoding, so it generally makes optimal use of your multicore system.

    --
    -- sudo.ca
  16. Re:Simple... by sexconker · · Score: 2, Informative

    How the hell is this modded interesting (as opposed to informative)?

    Do people really not know this stuff (thus making it interesting to them)?

    For the gp and the others who still don't get it.

    Multi-threaded programming (getting your shit to run in separate threads) is easy, now.
    Multi-threaded / distributed algorithms (getting your shit to do some coherent, useful shit while scaling well) are not easy at all.

  17. Also consider this. by SignOfZeta · · Score: 2, Interesting

    If you do a lot of H.264 conversion, look into picking up a hardware encoder. There's the Turbo.264; it's Mac-only, but I'm fairly sure it's a rebranded PC device. Plug into a USB port, and it speeds up H.264 encoding -- even on single-core systems. Imagine that with your quad-core. It's not a free solution, but if you find yourself doing a *lot* of encodes, it may be worth your money.

  18. Re:Simple... by Cyrano+de+Maniac · · Score: 3, Insightful

    Exactly. Too many people assume that any given programmer can write any given program. What isn't generally realized (at least by the masses) is that programming really is about acquiring expertise in a particular domain and then solving problems in that domain through the use of computer programs. Generally some of the most effective programs I've seen have been written, on their first pass, by a person with intimate domain knowledge, and mediocre programming/computer knowledge. The program then becomes a standout when someone with intense programming and computer architecture knowledge improves the code from there (they need not be a subject domain expert, but it helps).

    I do take issue with sexconker assuming that I "just don't get it". Heh. If s/he only knew. Whatever, no biggie. I do agree that distributed algorithms are generally more difficult to implement/design than non-distributed, but that's not exactly the same thing as serial versus parallel algorithms (non-distributed generally involves access to data through a common address space, distributed doesn't, though even those pseudo-definitions come up a bit short).

    Again and again I read in industry rags and on various web sites that multi-threaded programming is hard, and nobody knows how to do it, and that it's difficult to debug, and all that. I believe what they're really saying is "The set of programmers who are accustomed to multi-threaded programming/debugging is (relatively) small, and thus applications aren't going to make good use of the shift to multicore CPU packages." Familiarity with a skill, and the supply of labor familiar with said skill, is distinct from it being easy or hard.

    Anyway, I stand by my belief that parallel programming is not as difficult as most people are led to believe. Some problems don't lend themselves well to parallel solutions, or don't merit the added complexity, but many many of them do. In ten years time I predict that most computer programming education will assume the use of threading, and that anyone who isn't competent with threading will severely limit their own job prospects.

    --
    Cyrano de Maniac
  19. Not as simple as you would think by sjf · · Score: 4, Insightful

    As other commenters have said, decoding video is not, per se, a trivially parallelized algorithm. Especially for modern codecs with lots of temporal encoding. MJPEG would be easily parallelized, buy you'd have to be dealing with fairly ancient sources...MediaComposer 1 for instance.

    However, there are different classes of "video app" that are good targets for parallelization. Real world video editing for instance: consider multiple streams of video with overlays, rotations, effects etc. Video and audio decoding can happen in parallel, you can pipeline the effects stages so that each effect is handed off to another core. Modern video editing systems do this with aplomb.

    I'm from the commercial end of this so, I can't comment much on open source alternatives. But I will say that a lot of the algorithms in certain products are highly tuned to the particular CPU type.
    And they're smart enough to distribute work across only as many cores as actually exist.

    Finally. Don't forget that optimization is hard. You have to consider the speed of the hard drive, the cost of sharing data between threads and cpu caches and a bunch of other real constraints. Any half decent cpu of the last five years or so can easily decode most video faster than it can be read and written to disk. So long as this is true, you won't get any benefit from parallelization.

  20. heroinewarrior.com by heroine · · Score: 2, Informative

    The version of Cinelerra from heroinewarrior.com uses SMP. It's highly dependant on the supporting libraries & who implemented the feature. In the worst case, use renderfarm mode & nodes for each processor. Sometimes the libraries work in SMP mode & sometimes they don't. Sometimes the feature was intended for everyone to use on any number of processors & sometimes it was written for 1 person's cheap single processor.

  21. Re:Max CPU? by Barny · · Score: 2, Interesting

    With video conversion faster storage (not low latency) is the big winner, with huge cache being a close second.

    If you want the fastest video encodes with no care to cost, get an 8-way pci-e raid card and 8 laptop sata HDD, small and very very fast in a stripe raid.

    --
    ...
    /me sighs
  22. AcidRip patches by ydrol · · Score: 2, Informative

    Cheers. I also found these Acidrip patches. PS In case anyone missed it, I really meant to ask about the front end GUI/script tools rather than the engines. PPS I'm actually using Mandriva.

  23. Re:Use Mac OS X... by Anonymous Coward · · Score: 3, Informative

    But Mac users have been living with SMP since 2001

    Just for reference:

    UNIX System V R4-MP 1993
    Windows NT 1993
    OS/2 2.11 1993
    Linux 2.0 1996