davorin
Posts: 167
Joined: Tue Sep 11, 2012 2:07 pm
Location: Switzerland
Contact: Website

h.264 vs. vc-1 performance

Wed Sep 12, 2012 1:40 pm

Just wanted to raise a quick question what other people get out of their RPi regarding performance of h.264 vs. VC-1...

For me it plays smoothly a BluRay RIP of SPiderman 3 via NFS without stuttering (and software AC-3 decoding), whereas a BluRay RIP of The dark knight hangs every few seconds (VC-1 stream)...

Does VC-1 requires more software preprocessing before sending to the GPU?

Is there a way to completely disable audio on omxplayer for performance testing?

itimpi
Posts: 1090
Joined: Sun Sep 25, 2011 11:44 am
Location: Potters Bar, United Kingdom
Contact: Website

Re: h.264 vs. vc-1 performance

Wed Sep 12, 2012 1:54 pm

Have you bought a license from the Raspberry Pi store for the VC-1 codec? If not then the decoding will be done in software which might explain the difference? Hardware decoding of h264 (I.e. using the GPU) is standard on the Pi.

davorin
Posts: 167
Joined: Tue Sep 11, 2012 2:07 pm
Location: Switzerland
Contact: Website

Re: h.264 vs. vc-1 performance

Wed Sep 12, 2012 2:08 pm

I have both licenses...VC-1 and MPEG-2 (o;

Without VC-1 license it won't even play at all (o;

Interestingly Planet Earth, which is also VC-1, plays nicely...no stuttering on the episode 1 with the thousands of birds flying on the screen...peak stream rate around 40 - 50MBit/sec ;-)

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 27403
Joined: Sat Jul 30, 2011 7:41 pm

Re: h.264 vs. vc-1 performance

Wed Sep 12, 2012 2:17 pm

The HW decode was originally designed/optimised for H264, so that should work fine. I don't know how much of the H264 HW is reused for VC1 but that might explain the discrepancy. I'll ask the codec team.

James
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

davorin
Posts: 167
Joined: Tue Sep 11, 2012 2:07 pm
Location: Switzerland
Contact: Website

Re: h.264 vs. vc-1 performance

Wed Sep 12, 2012 2:25 pm

What uses less resources for accessing a movie?

Playing via NFS?
Or playing via local USB harddrive?
Or playing via SD card?

But so far since the latest firmware update I'm really impressed by the performance...before it wasn't able to play back h.264 over 15MBits/sec (o;

I still haven't put my popcorn c-300 onto play yet ;-)

davorin
Posts: 167
Joined: Tue Sep 11, 2012 2:07 pm
Location: Switzerland
Contact: Website

Re: h.264 vs. vc-1 performance

Wed Sep 12, 2012 2:26 pm

Well if you ask the codec team anyway... (o;

How far is DTS/AC3 license model going? ;-)

thanx in advance
richard

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 27403
Joined: Sat Jul 30, 2011 7:41 pm

Re: h.264 vs. vc-1 performance

Wed Sep 12, 2012 2:29 pm

davorin wrote:Well if you ask the codec team anyway... (o;

How far is DTS/AC3 license model going? ;-)

thanx in advance
richard
That's nothing to do with the codec team - that a Foundation licencing issue - the code already works fine.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 27403
Joined: Sat Jul 30, 2011 7:41 pm

Re: h.264 vs. vc-1 performance

Wed Sep 12, 2012 2:30 pm

davorin wrote:What uses less resources for accessing a movie?

Playing via NFS?
Or playing via local USB harddrive?
Or playing via SD card?

But so far since the latest firmware update I'm really impressed by the performance...before it wasn't able to play back h.264 over 15MBits/sec (o;

I still haven't put my popcorn c-300 onto play yet ;-)
Depends what you mean by resource. CPU time? Bandwidth? Memory?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

davorin
Posts: 167
Joined: Tue Sep 11, 2012 2:07 pm
Location: Switzerland
Contact: Website

Re: h.264 vs. vc-1 performance

Wed Sep 12, 2012 2:40 pm

Oh sorry..meant CPU usage....

Though networking and USB disk should be around same as they both use USB...

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 27403
Joined: Sat Jul 30, 2011 7:41 pm

Re: h.264 vs. vc-1 performance

Wed Sep 12, 2012 3:33 pm

The GPU does most of the heavy lifting for video (even non-HW accelerated stuff is still done on the GPU VPU's), but audio is decoded on the Arm, so the more complex the audio the higher the CPU load.

I've check with the team - VC-1 should work fine at 1080p30. They would be interested in any valid stream that DOESNT work properly, so if you have it available (or a subset) that would be useful. Perhaps some idea of how you ripped it and at what settings if the stream isn't available. Although first, please post what audio stream you are using. If its DTS, then you may nee to check out this thread...http://www.raspberrypi.org/phpBB3/viewt ... 88#p171788
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

davorin
Posts: 167
Joined: Tue Sep 11, 2012 2:07 pm
Location: Switzerland
Contact: Website

Re: h.264 vs. vc-1 performance

Wed Sep 12, 2012 3:51 pm

Hmm...looks like this problem...

"The dark knight" I have with several audio streams:

Code: Select all

root@raspberrypi:/mnt/Video/movies/fantasy# omxplayer -i The.Dark.Knight.2008.1080p.m2ts 
file : The.Dark.Knight.2008.1080p.m2ts reult 5385 format mpegts audio streams 4 video streams 1 chapters 0 subtitles 0
Input #0, mpegts, from 'The.Dark.Knight.2008.1080p.m2ts':
  Duration: 02:32:13.29, start: 600.000000, bitrate: 30644 kb/s
  Program 1 
    Stream #0.0[0x1011]: Video: vc1 (Advanced), yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
    Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, 5.1, s16, 640 kb/s
    Stream #0.2[0x1101]: Audio: truehd, 48000 Hz, 5.1, s32
    Stream #0.3[0x1101]: Audio: ac3, 48000 Hz, 5.1, s16, 640 kb/s
    Stream #0.4[0x1102]: Audio: dca (DTS), 48000 Hz, 5.1, s16, 1536 kb/s
If I just select the first audio track, which is AC3, it still hangs every 4 or 5 seconds for 1 second...

Using:

Code: Select all

omxplayer -o hdmi -p file
Doesn't play at all...since I just use a regular 1980x1200 monitor with HDMI->DVI adapter?

I'll try to get hands on a VC-1 stream with smaller size and upload it for testing...

davorin
Posts: 167
Joined: Tue Sep 11, 2012 2:07 pm
Location: Switzerland
Contact: Website

Re: h.264 vs. vc-1 performance

Thu Sep 13, 2012 1:16 pm

Just ripped the dark night without any audio tracks...so only the VC-1...

SNMP stats show me a streamrate of approx. 24MBits/sec and a CPU load of around 40 - 45%...

The video doesn't hang anymore...but plays with a much lower framerate of around 8 - 12 frames/sec...

Code: Select all

root@raspberrypi:/mnt/Video/movies/fantasy# omxplayer The.dark.knight.no_audio.mkv 
[matroska,webm @ 0x1f17ac0] Estimating duration from bitrate, this may be inaccurate
file : The.dark.knight.no_audio.mkv reult 1 format matroska,webm audio streams 0 video streams 1 chapters 0 subtitles 0
Video codec omx-vc1 width 1920 height 1080 profile 3 fps 23.976025

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 27403
Joined: Sat Jul 30, 2011 7:41 pm

Re: h.264 vs. vc-1 performance

Thu Sep 13, 2012 2:16 pm

That's really weird. Can you post a small excerpt from the failing rip on drop box or similar so we can try it out. Frame rate that low and CPU that high is odd.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

davorin
Posts: 167
Joined: Tue Sep 11, 2012 2:07 pm
Location: Switzerland
Contact: Website

Re: h.264 vs. vc-1 performance

Thu Sep 13, 2012 2:51 pm

Hi James...

Test file uploaded to my own server...
The link is in your mailbox (o;

Uploading now same clip with ac3 audio enclosed...

thanx in advance
richard

davorin
Posts: 167
Joined: Tue Sep 11, 2012 2:07 pm
Location: Switzerland
Contact: Website

Re: h.264 vs. vc-1 performance

Mon Sep 17, 2012 10:41 am

Testing raw NFS performance now and collect stats via Cacti...

Looks good...Cacti shows an average bandwidth of 85MBits/sec with 98MBits/sec peak ;-)
CPU load is around 30 - 35% (cat file > /dev/null and kworker together)...

Any news regarding VC-1 performance and why framerate without audio track is lower?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 27403
Joined: Sat Jul 30, 2011 7:41 pm

Re: h.264 vs. vc-1 performance

Mon Sep 17, 2012 11:12 am

I've not heard anything back from Codec team - I did pass on the information. They are busy at the moment...
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

davorin
Posts: 167
Joined: Tue Sep 11, 2012 2:07 pm
Location: Switzerland
Contact: Website

Re: h.264 vs. vc-1 performance

Mon Sep 17, 2012 3:30 pm

Some test result of raw NFS performance of the RPi B (o;

http://www.uclinux.net/blog.html


More tests and results to follow ;-)

richard

davorin
Posts: 167
Joined: Tue Sep 11, 2012 2:07 pm
Location: Switzerland
Contact: Website

Re: h.264 vs. vc-1 performance

Tue Sep 18, 2012 5:23 pm

Some more performance comparison:

http://www.uclinux.net/blog.html

This time H.264 versus MPEG-2 1080p stream....

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5659
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: h.264 vs. vc-1 performance

Tue Sep 18, 2012 5:36 pm

davorin wrote:Some more performance comparison:

http://www.uclinux.net/blog.html

This time H.264 versus MPEG-2 1080p stream....
Interesting plots. I've always advised people to use NFS rather than SMB, so it's nice to have a picture to point them at.
The network bandwidth numbers are very high! I've seen numbers like that from iperf, but had always assumed nfs would reduce that more.

The H264 using more CPU than MPEG2 is also surprising. I wonder if the ARM does some start code parsing for H264?
Are you using xbmc or omxplayer?

AC3 vs DTS is another interesting plot. When I looked DTS took significantly more CPU.

davorin
Posts: 167
Joined: Tue Sep 11, 2012 2:07 pm
Location: Switzerland
Contact: Website

Re: h.264 vs. vc-1 performance

Tue Sep 18, 2012 5:41 pm

I'm using omxplayer...latest apt-get upgrade and rpi-update from yesterday...
But I assume omxplayer is here the resource hog when feeding the GPU with the video streams...

I will update the blog posts with more details then...

Also I'm currently testing temperature plots versus different CPU speeds and stream formats...
The posted streams heated up the chip around 62 degrees Celsius...and goes back to around 51 when idle (with force_turbo=1 option set)....

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5659
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: h.264 vs. vc-1 performance

Tue Sep 18, 2012 6:00 pm

davorin wrote:I'm using omxplayer...latest apt-get upgrade and rpi-update from yesterday...
But I assume omxplayer is here the resource hog when feeding the GPU with the video streams...
Can you provide a small (e.g 100MB) sample of the H264 file you were using for these measurements?

Looks like the CBitstreamConverter class is taking about 15% of the CPU with something that might be avoidable.
I've had a look at a couple of my h264 files, and CBitstreamConverter isn't required.

davorin
Posts: 167
Joined: Tue Sep 11, 2012 2:07 pm
Location: Switzerland
Contact: Website

Re: h.264 vs. vc-1 performance

Tue Sep 18, 2012 6:14 pm

A 1000MB test file is on the way....100MB is way to short...and omxplayer won't play a file that is splitted in the middle (o;

Upload finished at the usual place on my webserver in around 17 minutes...James knows where ;-)

davorin
Posts: 167
Joined: Tue Sep 11, 2012 2:07 pm
Location: Switzerland
Contact: Website

Re: h.264 vs. vc-1 performance

Tue Sep 18, 2012 6:32 pm

Upload finished ;-)

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 27403
Joined: Sat Jul 30, 2011 7:41 pm

Re: h.264 vs. vc-1 performance

Wed Sep 19, 2012 8:38 am

Codec guy got back to me.

"It's not the codec itself that's the problem. The raw stream plays in our codec test app with an average of about 17ms per frame, using less than 2% of the VPU. The high ARM CPU usage suggests that something silly is going on in the higher layers to screw things up (Either our OpenMax/MMAL stuff or someone else's media player stuff).

The stream is a bit unusual – it has a repeated sequence start message every 25 frames or so. It's possible (I'm just speculating here) that this is causing something in the playback stack to tear down/set up something every second. Testing the raw stream with hello_video or something is probably a good idea."


So there is something odd with the stream, which may in turn be causing issues elsewhere - not in the codec itself.

hello_video is a player app that used to be supplied with the Raspi - not sure if it is still there. I don't have time to look at it at the moment -does that give you any hints?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

davorin
Posts: 167
Joined: Tue Sep 11, 2012 2:07 pm
Location: Switzerland
Contact: Website

Re: h.264 vs. vc-1 performance

Wed Sep 19, 2012 8:44 am

Hi James

You are referring to the VC-1 stream, right?

Return to “General discussion”