VideoHelp Forum




+ Reply to Thread
Results 1 to 7 of 7
  1. Hi. I am doing some encoding in Linux using mencoder from the command line. When I use libavcodec on my core2 duo, I get roughly 150fps using certain settings. Using similar settings and xvid, I get around 80fps. and it seems from the system monitor that both cores aren't being run high at the same time. There is an option to enable "threads" in -xvidencopts, and I have it set to threads=2, but it makes no difference on my machine, same fps with or without that setting. Can anyone attest to xvid using more than one core?

    Thanks
    Cheers
    Quote Quote  
  2. Get Slack disturbed1's Avatar
    Join Date
    Apr 2001
    Location
    init 4
    Search Comp PM
    Always better late than never I guess

    Depends on which version of xvid you're using. Try passing threads=1, threads=2, threads=4, and threads=6. Monitor top with each trial. If Top doesn't show more than 100% usage, then you're using an xvid version without multithread capabilities.

    Even with multithread capabilities, xvid still doesn't scale that well. libavcodec scales much better, libavcodec also spanks xvid's ass in the speed department, but I overall do believe xvid has a slight margin on quality. Keep in mind, just because it's using more than one thread doesn't always mean it will be faster. Not all codecs scale as well as x264.

    Xvid version 1.1.x (1.1.2, 1.1.3) DO NOT have multithread capabilities. You'll need a cvs (1.2.x) version. It's quite easy to do if your distro is only supplying the older version.
    Grab the sourcecode here http://www.xvid.org/Downloads.43.0.html You want the daily snapshot located in the upper right-hand side.

    If you run into issues compiling post back. To give you a hint, you need to execute ./bootstrap from the xvidcore/build/generic directory
    Linux _is_ user-friendly. It is not ignorant-friendly and idiot-friendly.
    Quote Quote  
  3. Get Slack disturbed1's Avatar
    Join Date
    Apr 2001
    Location
    init 4
    Search Comp PM
    Originally Posted by jagabo
    Search for "xvid-1.2.-127-25022006"

    http://www.google.com/search?q=xvid-1.2.-127-25022006
    Hey, great search for xvid.EXE , this is the Linux forum section
    Linux _is_ user-friendly. It is not ignorant-friendly and idiot-friendly.
    Quote Quote  
  4. Banned
    Join Date
    Jun 2007
    Location
    UNREACHABLE
    Search Comp PM
    jagabo needs more cups of coffee per day, I guess.
    Quote Quote  
  5. Heheh, I came in via the front page and didn't notice it was the Linux section. I have to confess, I didn't even read the OP's post! Just posted the link.
    Quote Quote  
  6. Banned
    Join Date
    Nov 2005
    Location
    United States
    Search Comp PM
    Originally Posted by sumpm1
    Hi. I am doing some encoding in Linux using mencoder from the command line. When I use libavcodec on my core2 duo, I get roughly 150fps using certain settings. Using similar settings and xvid, I get around 80fps. and it seems from the system monitor that both cores aren't being run high at the same time. There is an option to enable "threads" in -xvidencopts, and I have it set to threads=2, but it makes no difference on my machine, same fps with or without that setting. Can anyone attest to xvid using more than one core?

    Thanks
    congratulations, you have just seen evidence of what i like to call "the multithread headfake" and before i explain what it is allow me to give you an example:

    XP 64, with just firefox running, 10 windows and numerous tabs within each windows, AMD Phenom 9500, 4 gigs ddr2 667:

    308 active threads

    cpu usage around 15%

    main concept's H264 encoder, no source loaded:

    319 active threads

    cpu usage around 15%

    H264 encoder, source loaded by frameserving with avisynth, source is an 8 gig EVO file

    356 active threads

    cpu usage around 15%

    H264 encoder encoding to 1440 x 1080, h264 at 6000 kbps and aac at 160 kbps

    number of active threads fluctuate between 358 and 362

    cpu usage fluctates between 60% and 80% with the occasional spike to 90%

    same test using QuEnc

    QuEnc running, no source loaded

    311 active threads

    cpu usage around 15%

    QuEnc running, source loaded same as main concept

    317 active threads

    cpu usage around 15%

    QuEnc encoding, same settings as main concept

    336 active threads

    cpu usage around 50%

    so, what does the above tell us? well first and foremost is that the number of threads launched is less important than the amount of work they are capable of doing.

    with just firefox we see 300+ threads running yet cpu usage is at 15% and even with main concept's encoder launched with a source file loaded into memory and 356 threads, we still only see about 15% cpu usage.

    we also see that mainconcept's encoder launches only 2 to 6 additional threads during the encode versus 19 additional threads launched by QuEnc, yet those 19 extra threads only load the cpu to 50% capacity were as main concept's 2 to 6 additional threads load the cpu way more.

    what i'm trying to say is that more threads doesn't necessarily translate into more performance, even with multiple cores; the reasons are complex and require a thorough knowledge of threads, locks, OS architecture, etc, but in a simplified explanation is that it's difficult to keep track of threads and what they are doing and it's even more difficult to make sure that 2 threads are doing the exact same thing, thus wasting resources and ping ponging data back and forth between cores.

    personally, instead of more and more cores, i would rather have 2 cores, with integrated graphics (and software ala CUDA to take advantage of them), integrated nic and audio (by integrated i mean on the cores themselves), ddr2 ram instead of sram for the caches (this alone with speed up cpu's by a factor of 10, according to intel, who is working on such an advance), no SIMD units but really fast ALU's and more importantly, FPU's.

    as for your question, well as i have tried to demonstrate not everyone can write good multithreaded code and xvid is a perfect example of this; personally i would stick with AVC, it's not only better coded, as you have noticed by the better encode speed but it also produces higher quality video, but that's just my opinion.
    Quote Quote  



Similar Threads

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