kdawgud wrote:
I did some CPU usage profiling while mythv was doing other tasks such as commercial flagging and transcoding, and I noticed that while commercial flagging, once again only 50-60% of the cpu's resources are being used. Transcoding, however, is able to use a the full 100% the entire time.
Check the CPU usage option in the backend setup. It's probably set for "low CPU". If you look in "top", you'll see a "nice" value (process priority) of 17. See what the transcode runs at, and make them the same. 0 is normal. 17 is being very "polite". The minimum value is 19, which is "only if you don't have anything better to do, otherwise I'll just wait here and not bother anyone".
If you find that commflag still uses less CPU than transcode when the "nice" values are equal, then I expect it's due to the commflag being more I/O intensive. Or rather, less CPU intensive. Transcode has to do more transformation. It's going to be manipulating every frame, so it's CPU-intensive by nature. Commflag is just searching through, looking for breaks. It's going to run out of work pretty quickly, and need to get more from the disk.
I HAVE NOT LOOKED AT THE CODE!! So take this with a grain of salt.
But I think I've got an idea of what's going on here.
Suppose you've got two people looking through a manuscript of "gone with the wind". The pages are in a filing cabinet in the next room, and they can only have one page in the reading room at a time.
They each have a kid running to the filing cabinet for them.
One of the readers is tasked with highlighting the parts having to do with sex.
The other is tasked with translating the book into French.
As you look at them, the French translator is busy all the time. But the sex censor speeds through his pages, but then spends a lot of time waiting for the kid to fetch the next page. Plus, his kid seems to always be in the way, blocking access to the file cabinet, and making it hard for anyone else to use it. He's only 50% busy, but he's pretty much monopolizing the filing cabinet.
That's how I envision all of this, anyway. As Dennis Miller says, "I could be wrong".