Quad Core CPUs for Video Encoding - Are they Worth it
Posted: Mon 02 Mar, 2015 19.02
Over the past 8/9 years, I've ended up with 3 Freeview PVRs which are now all full of content. Across the 3 of them, I have 900GB of data translating into about 600 hours of actual programming including complete libraries of series (also a goldmine of presentation from now long forgotten channels like FTN and Virgin 1). It occurred to me the other day that these PVRs now exist pretty much solely to play back old recordings, and that it would be nice to be able to view the content in different rooms rather than have to go to the room the PVR is in that has the recording on it, and also to be able to view the content on other devices.
I've recently upgraded to a 3TB hard disk with space to burn on it, so I thought I'd look at getting the files off them and on to a computer.
Turns out that what I thought would be the difficult bit - getting the files off the PVRs - turned out to be relatively simple - all of them worked in the same way using standard PC hard drives formatted into XFS which a Live Linux CD could access, and with a .REC file for each recording with the time and date of the recording encoded into the filename which made it easy (if slow) to match the files up to the specific recordings - it was just a matter of going down the list from the PVR and writing down every programme along with it's time and date.
The .REC files are simply the MPEG2 DataStream dumped to disk with no other encoding performed. XBMC can play these files directly on my PC, but other hardware (such as my phone) can't. Even if I can find software to play them, the files are huge (up to 2GB / hour depending on the channel) which limits the practicality of being able to take much content with me.
So, I decided to transcode them into x264. I've gone for fairly moderate settings in the encoder I'm using (ffMPEG) which will compress the files down to about half the size they are now without having any appreciable drop in quality.
And here's the kicker: the encoding time. Even without anything else running, the encoder is only running at a maximum of about 20FPS - slower than real time. Start trying to use the computer for other tasks, and it can drop as low as 12FPS. 500 hours of footage taking on average 1hr20mins to transcode an hour of material will take a minimum of 27 days to transcode, and that's with the PC running 24/7 and being used for nothing else.
My CPU is, by modern standards, a bit weak - a 2.8GHz Core 2 Duo, but it's fine for everything I use it for. I've google squeezing more out of ffMPEG, some people have suggested it can't use multiple cores, so I tried changing the affinity in task manager so that it could only use 1 to see if this made a difference (with the idea I could run a separate instance of ffMPEG on the other core). Straight away this cut performance in half, so it is using both cores.
Others suggested that it isn't truly loading the processor with 1 instance running, and I could run 2 or 3 at the same time. Again, running 2 instances cuts performance by a half, running 3 cuts it to a third of a single instance etc etc.
So I am satisfied that the encoder is running as fast as it can, and I can only improve it by dropping quality to achieve faster results (which I don't want to do), or getting a more powerful processor.
I'm not going to spend big bucks replacing my PC for a one off project, but it will support a Core 2 Quad and I've noticed these going on ebay for around 30 notes, which I'd be willing to invest in if it made a difference.
I would logically expect a Core 2 Quad at the same clock speed to be able to run the encoder at double the speed and get the job in half the time, but others have advised I will only see a modest improvement moving from 2 cores to 4.
Does anyone with experience of this know what I might reasonably expect with a better processor?
I've recently upgraded to a 3TB hard disk with space to burn on it, so I thought I'd look at getting the files off them and on to a computer.
Turns out that what I thought would be the difficult bit - getting the files off the PVRs - turned out to be relatively simple - all of them worked in the same way using standard PC hard drives formatted into XFS which a Live Linux CD could access, and with a .REC file for each recording with the time and date of the recording encoded into the filename which made it easy (if slow) to match the files up to the specific recordings - it was just a matter of going down the list from the PVR and writing down every programme along with it's time and date.
The .REC files are simply the MPEG2 DataStream dumped to disk with no other encoding performed. XBMC can play these files directly on my PC, but other hardware (such as my phone) can't. Even if I can find software to play them, the files are huge (up to 2GB / hour depending on the channel) which limits the practicality of being able to take much content with me.
So, I decided to transcode them into x264. I've gone for fairly moderate settings in the encoder I'm using (ffMPEG) which will compress the files down to about half the size they are now without having any appreciable drop in quality.
And here's the kicker: the encoding time. Even without anything else running, the encoder is only running at a maximum of about 20FPS - slower than real time. Start trying to use the computer for other tasks, and it can drop as low as 12FPS. 500 hours of footage taking on average 1hr20mins to transcode an hour of material will take a minimum of 27 days to transcode, and that's with the PC running 24/7 and being used for nothing else.
My CPU is, by modern standards, a bit weak - a 2.8GHz Core 2 Duo, but it's fine for everything I use it for. I've google squeezing more out of ffMPEG, some people have suggested it can't use multiple cores, so I tried changing the affinity in task manager so that it could only use 1 to see if this made a difference (with the idea I could run a separate instance of ffMPEG on the other core). Straight away this cut performance in half, so it is using both cores.
Others suggested that it isn't truly loading the processor with 1 instance running, and I could run 2 or 3 at the same time. Again, running 2 instances cuts performance by a half, running 3 cuts it to a third of a single instance etc etc.
So I am satisfied that the encoder is running as fast as it can, and I can only improve it by dropping quality to achieve faster results (which I don't want to do), or getting a more powerful processor.
I'm not going to spend big bucks replacing my PC for a one off project, but it will support a Core 2 Quad and I've noticed these going on ebay for around 30 notes, which I'd be willing to invest in if it made a difference.
I would logically expect a Core 2 Quad at the same clock speed to be able to run the encoder at double the speed and get the job in half the time, but others have advised I will only see a modest improvement moving from 2 cores to 4.
Does anyone with experience of this know what I might reasonably expect with a better processor?