Transcoding Performace

tannebil

New member
I'm using the iPhone/Touch profile modified to output 480x272 resolution. Input files are shows transferred from a Tivo S3 or HD. A 1080i, 60 minute show transcodes to H.264 in about 20 minutes while a 60-minute, 720p show takes about 70 minutes. The source file are similar sizes.

Does that seem right? I would have expected somewhat similar processing times. Is 720p that much harder to transcode to H.264?

Update: It looks like it is more complicated than 1080i vs 720p. I'm doing a 1080i show now and it's looking like 65 minutes.
 
Last edited:

Danr

Administrator
Staff member
Does that seem right? I would have expected somewhat similar processing times. Is 720p that much harder to transcode to H.264?
Shouldn't be that big a difference since the overall bit rates are very similar between 720p and 1080i. In fact when reducing to the 1080i down to 480x272 that should invoke an extra step with deinterlacing.
 

Dan203

Senior Developer
Staff member
Perhaps you have something else running on your PC that is taking up CPU cycles? Encoding is very CPU intensive, so if there is anything else running that is taking processor time then it could cause the encoding to take longer.

If you look at the task manager (Ctrl+Alt+Del in XP or Ctrl+Shift+Esc in Vista/W7) you should be able to see if anything else is taking up CPU cycles. (make sure to click the button/check box that says "Show processes from all users)

Another thing it might be... Is there any chance that in your first run, the fast one, you set it to single pass mode? By default the iPod profile is set to dual pass mode, so if you set it to single pass mode via the Options button in the Save Dialog on that first run then that could explain the time difference.

Dan
 

tannebil

New member
The iPhone/iPod Touch default profile says it is single pass encoding.

Nothing CPU-intensive was running at the same time. However, CPU-utilization is lower than expected when doing a transcode. Handbrake, Quicktime, and BeyondTV peg all four cores but with VRD, overall CPU utilization is usually around 50% with none of the cores ever hitting 100%. I know you limit to three cores but it never gets close to 75%.

I'm running an AMD Phenom9850 Quad-Core with Windows 7 HP.
 

moyekj

Member
Would be nice to have an option to control how many cores to use for encoding, ideally as part of an encoding profile but I'd settle for a global option.
 

tannebil

New member
I have two different files. Both are 1080i recording done on a TiVo S3. I use 595 to transcode the files to mp4 using the same profile (iPhone/iPod Touch modified to 480x272). During the transcode of the first file, CPU utilization was up in the 90+% range with all cores busy. During the transcode of the second file, CPU utilzation was in the 40-50% range with none of the cores exceeding about 50-60%.

Now that's distinctly unexpected. Most of my transcodes are like the second file.
 

bpratt

Member
I've seen about a 3X increase in processing times if the source and output are on the same disk. Putting them on seperate disks will take about 1/3 the time. Are you using two disks?
 

tannebil

New member
That's useful to know but the source and destination are on different disks in this case so that's not it.
 

Danr

Administrator
Staff member
I have two different files. Both are 1080i recording done on a TiVo S3. I use 595 to transcode the files to mp4 using the same profile (iPhone/iPod Touch modified to 480x272). During the transcode of the first file, CPU utilization was up in the 90+% range with all cores busy. During the transcode of the second file, CPU utilzation was in the 40-50% range with none of the cores exceeding about 50-60%.

Now that's distinctly unexpected. Most of my transcodes are like the second file.
What CPU are you using?

That is strange, all the cores should be busy when transcoding to h.264.

Its possible that the Tivo reader is slowing things down a bit. Try first converting to an MPEG2 program stream and see if that improves the performance.
 

tannebil

New member
AMD Phenom 9850 Quad-Core. Windows 7 HP 64-bit.

I did a QSF to convert the .tivo file into an mpg stream and transcoded the mpg using the default iPhone/Pod Touch profile. I didn't see any difference.

I reran the "fast" file and CPU utilization is noticeably higher (20+%) when I watch it in Task Manager or Resource Monitor.
 
Last edited:

Danr

Administrator
Staff member
Don't have a Phenom here, but if you want to upload a 50Mb source sample of fast file and a "slow" file we will be glad to try them out here.
 

tannebil

New member
I went back and double-checked things and I think it might just be a screw-up on my part. I could swear that the "slow" file was 720p while the "fast" file was 1080i and that I checked it twice but it's actually the opposite. Could that explain the difference?

I caught my mistake while using Handbrake to confirm my results. HB also transcoded the 1080i file significantly slower than 720p file and, when I checked the log, I saw the fast file was 720p. Handbrake was twice as fast as VRD on the same file but I assume that's just a function of different codecs being used by the different programs and that speed is only one measure of codec performance.

Does turning an interlaced file into a progressive file add that much extra time to the process? The 720p file is actually 50% larger than the 1080i file if that makes any difference.
 

dlflannery

Moderator
....... Handbrake was twice as fast as VRD on the same file but I assume that's just a function of different codecs being used by the different programs and that speed is only one measure of codec performance.........
H.264 encoding has a huge number of variable parameters and they can affect speed dramatically. You would have to be sure you had the same parameters for both encodes before having a valid speed comparison.

One indication is the resulting file size. Were they very close? Even that isn't conclusive but if they were different by more than 10%, you can be sure the encoding parameters were not identical.
 

tannebil

New member
Is there some way to see the encoding parameters being used by VRD? The HB file is 388MB while the VRD file is 402MB.
 

dlflannery

Moderator
Would be nice to have an option to control how many cores to use for encoding, ideally as part of an encoding profile but I'd settle for a global option.
When TVS4 transcodes to MPEG4 on my box I see only about 35% average CPU usage. It's an i7-860 CPU, with 64bit Win 7. It's reading the 1920x1080i mpeg2 file from the internal HDD and writing output to a USB drive. I saw the same performance when both reading from and writing to the internal drive, so I'm doubting it's disk I/O bound. Input file bitrate is 15.52 Mbps.

For a 480x480i mpeg2 input encoding to the same output profile, it's running more than 80% CPU usage. Input bitrate is 4.46 Mbps.

The output profile is 1280x720 2.5 Mbps average bitrate H.264 and is the same in both cases.

There are 8 CPU windows in task manager (4 cores, two hyperthreads each) and they all are participating, but only at 35% for the one case.

Does this make sense?
 
Last edited:

phd

Super Moderator
so I'm doubting it's disk I/O bound. Input file bitrate is 15.52 Mbps.
Try copying a file between the drives and check the transfer rate. See if it is about 15 MB/sec.
 

dlflannery

Moderator
Try copying a file between the drives and check the transfer rate. See if it is about 15 MB/sec.
I copied two different files from the internal HDD to the USB, both between 400 and 500 MB size. The largest one took 22 secs and was 473 MB, which calculates to 21.5 MB/sec or 172 Mbps. The other file showed similar rates.

The TVS4 processing time for the larger input file (1920x1080i) mentioned in my previous post was about 82 secs and it was 124 MB size, which is a read rate of 1.57 MB/sec or 12.1 Mbps. The output file was only 20 MB so the write rate was much lower than that.

I'm not seeing a case for I/O bound here. Even the 15 MB/sec you mentioned is almost 10 times the average (input dominated) disk I/O rates used by the transcoding process (or did you intend to say 15 Mbps ?).
 

moyekj

Member
For my case with a fairly old laptop with Core 2 Duo 2.3GHz processor I get 99% CPU (both cores pegged in Task Manager) for 480i, 720p or 1080i mpeg2 sources when saving to custom MP4 Generic H.264 profile. Would be nice to have an option to specify how many cores you wish to use.
 
Last edited:
S

Smells_Like_Feet

Guest
dlflannery:

Do you have the window's power plan set on anything other than "High Performance"? If so, Windows could be throttling back the CPU usage. Just another possibility.

- Smells_Like_Feet
 

Danr

Administrator
Staff member
http://www.videoredo.net/msgBoard/member.php?u=2418When transcoding from MPEG2 to H.264, there are 2 or 3 CPU intensive modules involved. The MPEG2 decoder, an optional frame resizer, and the H264 encoder. Each module runs in a separate thread(s). The MPEG2 decoder and the frame resizer (optional) are both single threaded. The H264 encoder is supposed to use as many threads as it can muster which should theoretically keep the CPU near 100% busy.

I couldn't find any monitoring tools that can measure individual thread performance so you might want to try some experiments. On the job that gets 35% CPU performance, try running two instances of VRD and see if the overall CPU goes up to 70%. This would tend to indicate that one thread is gating the rest.

Another experiment, is if you are not resizing, add the resizer by doing some cropping of the source. This will insure that the resizer is being used. The resizer is pretty processor intensive.

Finally, turn on the deinterlacer in smart mode. The deinterlacer is part of the resizer and in smart code is a heavy CPU user.
 
Top Bottom