[mythtv-users] Multi-threaded h.264 decoding in 0.21

Andrew Lyon andrew.lyon at gmail.com
Sat Oct 4 16:35:23 UTC 2008


On Sat, Oct 4, 2008 at 5:28 PM, Carl-Magnus Björkell
<carl-magnus.bjorkell at pp.inet.fi> wrote:
> Johan wrote:
>> Hi,
>>
>> I'm using the latest code from 0.21 fixes branch (r18536) and trying to
>> get a smooth h.264 playback on a Intel Core2Duo 2140 1.6 GHz. I have set
>> the "max CPU" setting in the display profile to 2 since it is a dual
>> core and according to the mythfrontend.log file is 2 cores used for
>> decoding in ffmpeg but when I'm watching a h.264 stream with the
>> internal mythtv player (like live tv) I get prebuffer pauses and one of
>> the threads in mythfrontend process is using 100% CPU according to ps
>> but that means 100% on one core and it does not seem to spread the
>> decoding on 2 cores properly. Is this not really supported in 0.21? Do I
>> need to go the CoreAVC path to get this working? I have tried running
>> both as a regular user and as root but there is no difference. The
>> kernel is configured for SMP and I can see two CPU:s in /proc/cpuinfo.
>> What is the problem?
>>
>>
>> top -H output during h.264 playback (with jerky video):
>>
>> top - 15:00:55 up 1 min,  1 user,  load average: 0.56, 0.16, 0.05
>> Tasks: 102 total,   5 running,  97 sleeping,   0 stopped,   0 zombie
>> Cpu(s): 52.1%us,  0.8%sy,  0.0%ni, 45.3%id,  0.0%wa,  0.5%hi,  1.3%si,
>> 0.0%st
>> Mem:   1032168k total,   325024k used,   707144k free,     7252k buffers
>> Swap:  1959920k total,        0k used,  1959920k free,   149960k cached
>>
>>   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
>>  3366 mythtv    20   0  334m 142m  68m R  100 14.1   0:18.65 mythfrontend
>>  3275 root      RT -10 99.8m  88m  51m S    6  8.8   0:02.47 Xorg
>>  3364 mythtv    20   0  334m 142m  68m R    1 14.1   0:00.28 mythfrontend
>>  3368 mythtv    20   0  334m 142m  68m S    1 14.1   0:00.14 mythfrontend
>>  3321 mythtv    20   0  4240 2048 1540 S    0  0.2   0:00.06 xscreensaver
>>  3329 mythtv    20   0  334m 142m  68m S    0 14.1   0:01.69 mythfrontend
>>  3367 mythtv    20   0  334m 142m  68m S    0 14.1   0:00.40 mythfrontend
>>  3372 mythtv    20   0  334m 142m  68m R    0 14.1   0:00.08 mythfrontend
>>  3359 root      20   0  2308 1112  852 R    0  0.1   0:00.04 top
>>     1 root      20   0  2088  680  580 S    0  0.1   0:00.78 init
>>
>>
>> lines from my mythfrontend.log file with -v all parameter:
>>
>> 2008-10-04 14:26:18.611 AFD: Stream #0, has id 0x4100 codec id H264,
>> type Video, bitrate 0 at 0x0xaa939df0
>> 2008-10-04 14:26:18.614 VDP: Accepting: cmp(> 1000 700) dec(ffmpeg)
>> cpus(2) rend(xv-blit) osd(softblend) osdfade(disabled) deint(none,none)
>> filt()
>> 2008-10-04 14:26:18.614 VDP: Accepting: cmp(> 0 0) dec(ffmpeg) cpus(2)
>> rend(xv-blit) osd(softblend) osdfade(disabled)
>> deint(linearblend,linearblend) filt()
>> 2008-10-04 14:26:18.614 VDP: LoadBestPreferences(2048x2048, 0)
>> 2008-10-04 14:26:18.614 VDP: LoadBestPreferences(2048x2048, 60)
>> 2008-10-04 14:26:18.615 VDP: LoadBestPreferences(1280x720, 60)
>> 2008-10-04 14:26:18.615 Using 2 CPUs for decoding
>> 2008-10-04 14:26:18.618 VDP: Accepting: cmp(> 1000 700) dec(ffmpeg)
>> cpus(2) rend(xv-blit) osd(softblend) osdfade(disabled) deint(none,none)
>> filt()
>> 2008-10-04 14:26:18.619 VDP: Accepting: cmp(> 0 0) dec(ffmpeg) cpus(2)
>> rend(xv-blit) osd(softblend) osdfade(disabled)
>> deint(linearblend,linearblend) filt()
>>
>>
>
> Hey,
>
> If there hasn't been a resent change in the decoding capabilities of
> ffmpeg it still can't do multithreaded h264 decoding. And since ffmpeg
> can't, mythtv, mplayer and all other projects that depend on it can't
> either. (Please do tell if there actually HAS been a change in this area
> :) )
>
> -NRG
> --
>                 ||||||
>                ( O  O )
>   +--------oOOo------oOOo-------+
>   |                             |
>   |     Carl-Magnus Björkell    |
>   |                             |
>   +-----------------------------+
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>

There has!, ffmpeg now has multithreaded h264 decoding, I found that
2.4ghz dual core 2 was not quite sufficient to decode bbc and itv hd,
I use a combined fe+be and I think there were just too many other
processes running for myth to get enough cycles for the decoding, it
would play back perfectly for a few seconds and then stall, I upgraded
to a quad core 2.4 and can now watch both channels with perfect video
and audio is in sync, occasionally itv hd causes segfaults but I think
that too will be fixed soon.

I dont think a 1.6ghz dual core is enough for h264, especially not HD.

Andy


More information about the mythtv-users mailing list