[mythtv-users] Little OT: RealTime Parallel Multi-PC Transcoding

Raymond Wagner raymond at wagnerrp.com
Tue Jun 15 17:03:17 UTC 2010


On 6/15/2010 12:22, belcampo wrote:
> In PAL-land, where I live, we've got 25fps and a GOP-size of 12frames.
> None of my DualCore CPU's can transcode, with ffmpeg, in realtime to 
> desired h264 quality. But I do have 2 more DualCores sitting there 
> doing nothing.

What exactly is the purpose of this?  Do you actually need to have 
realtime h264, or do you just want to speed up transcodes?  If the 
latter, is there any reason why you cannot just run two transcodes in 
parallel?

H264 includes the concept of video slices.  When you do a multi-threaded 
encode, you physically slice the video domain into multiple blocks, 
which are encoded independently.  You would have to make some serious 
changes to the x264 encoder to support running this in parallel on 
multiple machines, but it could be done.  (looks like someone already 
did it)

http://www.hacks.arizona.edu/2009/03/x264-mpi-rough-demo-code/

Your method of splitting apart each GOP, encoding separately, and 
stitching together afterwards would work, but would be horribly 
inefficient.  H264 should be using much larger spacing between 
keyframes, and it should be of dynamic length, dependent on changes in 
the video, rather than arbitrarily placed every 12 frames.  The only way 
to do that would be to have a first pass be running just ahead of the 
normal encode, to identify good locations for cuts.  You would want the 
video cuts to be tens of seconds long to reduce data and startup overhead.


More information about the mythtv-users mailing list