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

Re: h.264 vs. vc-1 performance

Wed Sep 19, 2012 9:54 am

Yes.
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 4:30 pm

Recreated The dark knight file just with the 8 channel AC3 and the VC-1 stream...(excluding DTS and TrueHD)...

Plays back without stuttering (o;

So too many audio channels aren't healthy for omxplayer and performance then ;-)

CPU/traffic/temperature stats follow tomorrow :-)

Code: Select all

root@raspberrypi:/mnt/Video/movies/fantasy# omxplayer dark.knight.mkv 
[matroska,webm @ 0x1078aa0] Estimating duration from bitrate, this may be inaccurate
file : dark.knight.mkv reult 2 format matroska,webm audio streams 1 video streams 1 chapters 0 subtitles 0
Video codec omx-vc1 width 1920 height 1080 profile 3 fps 23.976025
Audio codec ac3 channels 8 samplerate 48000 bitspersample 16

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

Re: h.264 vs. vc-1 performance

Wed Sep 19, 2012 4:51 pm

davorin wrote:Recreated The dark knight file just with the 8 channel AC3 and the VC-1 stream...(excluding DTS and TrueHD)...
Plays back without stuttering (o;
Just to confirm, playing VC-1+AC3 from a file that also has unused audio tracks of DTS+TrueHD stutters
Just to confirm, playing VC-1+AC3 from a file that also does not have audio tracks of DTS+TrueHD plays fine

Playing over NFS?
Looking at the code, each packet from the additional audio tracks will be allocated, read from file (and so over network), and discarded/freed. There isn't any additional processing/decoding/sending to GPU, so it shouldn't be very expensive.
I'm guessing the additional network bandwidth is enough to cause the stutters.
Obviously, a file with a hundreds of unused audio, video and subtitle streams may spend all it's time reading and discarding unnecessary packets, and may struggle to play the desired (possibly low resolution/bitrate) stream.

Might be good to estimate the ARM CPU % lost through an unused audio stream. Start with a slightly easier file, so there is no stuttering in either case, and measure the difference in average CPU.

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

Re: h.264 vs. vc-1 performance

Thu Sep 20, 2012 10:29 am

I'll go out and get me some new BluRay discs for reference MPEG2/H.264 and VC-1 tests with various combination of audio streams...

CPU stats to follow with different number of audio streams....

BTW: Did your colleague find out why omxplayer palys a low framerate when no audio track is included in a .mkv movie?

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

Re: h.264 vs. vc-1 performance

Thu Sep 20, 2012 10:35 am

davorin wrote:BTW: Did your colleague find out why omxplayer palys a low framerate when no audio track is included in a .mkv movie?
Send me the link I'll have a look.
I've got a patched omxplayer that doesn't require the extra CPU for the cars (h264/ts) clip. I'll send you that later for testing.
Also a improvement to unused audio channels (discards them a little earlier).

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

Re: h.264 vs. vc-1 performance

Thu Sep 20, 2012 2:16 pm

@davorin Try:
https://dl.dropbox.com/u/3669512/temp/omxplayer.bin
It avoids the ARM doing the bitstream convert. It seems it is not required for the cars clip (I don't think it ever is, but I'm interested to know if it breaks anything). Hopefully the CPU usage is now closer to the MPEG2 version.
If it prints out "Would have used CBitstreamConverter", it means the clip used to require bistream converting, and that is being bypassed. Most of my files don't trigger that message (but cars does).
It also discards the unused audio tracks earlier, so interested if it lowers CPU for files with unused audio tracks, and whether it breaks anything.

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

Re: h.264 vs. vc-1 performance

Thu Sep 20, 2012 3:52 pm

Odd....

Code: Select all

root@raspberrypi:/usr/bin# ldd omxplayer.bin
	not a dynamic executable
root@raspberrypi:/usr/bin# ./omxplayer.bin
bash: ./omxplayer.bin: No such file or directory

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

Re: h.264 vs. vc-1 performance

Thu Sep 20, 2012 5:14 pm

davorin wrote:Odd....

Code: Select all

root@raspberrypi:/usr/bin# ldd omxplayer.bin
	not a dynamic executable
root@raspberrypi:/usr/bin# ./omxplayer.bin
bash: ./omxplayer.bin: No such file or directory
What distribution are you on? The official wheezy/raspbian one? Or a n older softfloat one?

Code: Select all

md5sum omxplayer.bin
57578056d564f74ff67387de45772ed5  omxplayer.bin
You would try:

Code: Select all

/lib/ld-linux-armhf.so.3 ./omxplayer.bin
Possibly you need to the ffmpeg libs I built against (although not having them doesn't give me that error).

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

Re: h.264 vs. vc-1 performance

Thu Sep 20, 2012 5:26 pm

Not sure which one it was back then ;-)

Code: Select all

pi@raspberrypi /usr/bin $ uname -a
Linux raspberrypi 3.2.27+ #160 PREEMPT Mon Sep 17 23:18:42 BST 2012 armv6l GNU/Linux
BTW: Any way to display the currently used firmware version? Preferably inside /proc fs?

I'll reinstall the wheezy cheesy then (o;

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

Re: h.264 vs. vc-1 performance

Thu Sep 20, 2012 5:49 pm

davorin wrote:Not sure which one it was back then ;-)

Code: Select all

cat /etc/issue
Debian GNU/Linux wheezy/sid \n \l
Means wheezy. Otheriwise might be queeze.
Do you have a /lib/ld-linux-armhf.so.3 ? Is so then hardfloat rasbian wheezy, otherwise softfloat wheezy.
davorin wrote:BTW: Any way to display the currently used firmware version? Preferably inside /proc fs?

Code: Select all

/opt/vc/bin/vcgencmd version
shows the GPU firmware version.

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

Re: h.264 vs. vc-1 performance

Thu Sep 20, 2012 5:55 pm

I strongly assume with hardfloat the performance figures will be a little better...

Coming back tomorrow with new install and new stats (o;


cheers and thanx
richard

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

Re: h.264 vs. vc-1 performance

Fri Sep 21, 2012 1:55 pm

Coming back to Dark knight stream with different numbers of audio tracks...

Installed "2012-09-18-wheezy-raspbian.zip" and did apt-get update/upgrade/reboot...

Seems this version breaks snmpd traffic and cpu stats, as they aren't readable with the same setup anymore...anyway....here some dumps from "top":

dark.knight.2xac3.mkv, 2 * AC3 stream

Code: Select all

  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND                                                                                       
 2256 root      20   0  105m  26m 2532 R  65.2 14.5   1:21.98 omxplayer.bin                                                                                 
 2265 root      20   0     0    0    0 S   8.4  0.0   0:10.99 kworker/0:1                                                                                   
   27 root       0 -20     0    0    0 S   4.2  0.0   0:04.54 VCHIQ-0                                                                                       
dark.knight.ac3_dts.mkv, 1 * AC3, 1 * DTS

Code: Select all

  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND                                                                                       
 2285 root      20   0  101m  22m 2552 R  83.4 11.9   0:03.64 omxplayer.bin                                                                                 
 2265 root      20   0     0    0    0 S  11.1  0.0   0:13.59 kworker/0:1                                                                                   
   27 root       0 -20     0    0    0 S   2.9  0.0   0:05.57 VCHIQ-0                                                                                       
dark.knight.4xac3_dts.mkv, 4 * AC3, 1 * DTS

Code: Select all

  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND                                                                                       
 2328 root      20   0 99.0m  19m 2552 R  84.5 10.5   0:03.17 omxplayer.bin                                                                                 
 2265 root      20   0     0    0    0 S   9.8  0.0   0:25.90 kworker/0:1                                                                                   
   27 root       0 -20     0    0    0 S   3.6  0.0   0:11.05 VCHIQ-0                                                                                       
The CPU usage various heavy with the image complexity of the video...so can go from 20% to 85% with multiple audio tracks...

BTW..using these settings in config.txt

Code: Select all

arm_freq=1000
core_freq=500
sdram_freq=500
over_voltage=6
force_turbo=1

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

Re: h.264 vs. vc-1 performance

Sat Sep 22, 2012 2:42 pm

davorin wrote:Seems this version breaks snmpd traffic and cpu stats, as they aren't readable with the same setup anymore...anyway....here some dumps from "top":
We haven't deliberately removed any features, so would be good if you can report what commands used to work, and what the result is now.
davorin wrote:The CPU usage various heavy with the image complexity of the video...so can go from 20% to 85% with multiple audio tracks...
I guess you need some averaging to be sure. Did you get my modified omxplayer working?

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

Re: h.264 vs. vc-1 performance

Sun Sep 23, 2012 6:05 am

These results are with the modified omxplayer from you (o;

The stats were a different problem..upgraded at the same time cacti on my freebsd server ;-))
Had to clear the stats database and reload a fresh copy...now working again (o;

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

Re: h.264 vs. vc-1 performance

Sun Sep 23, 2012 7:11 am

The thing with the high CPU load affects highly the stuttering of the playback....peaks of high CPU usage -> movie stops for one or two seconds...

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

Re: h.264 vs. vc-1 performance

Sun Sep 23, 2012 9:05 am

davorin wrote:The thing with the high CPU load affects highly the stuttering of the playback....peaks of high CPU usage -> movie stops for one or two seconds...
Yes, when arm is 100% busy the amount of buffered data drains. When that reaches zero, it goes back to buffering mode, and movie stops for a couple of seconds.

Now, I found cars clip buffered for me (with or without my changes). Now if this used to play on squeeze, it suggests something in omxplayer source may have got worse. Did it pay better with older image?

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

Re: h.264 vs. vc-1 performance

Mon Sep 24, 2012 1:30 pm

Don't see any difference with old and new image...

Just got hold of a new Samsung TV with several HDMI inputs for testing (o;

Hmm...shouldn't HDMI audio passthrough use less CPU?
Movie is unplayable with DTS audio passthrough opposed to AC3 decoding in software...

But weird the TV can't handle AC3 audio directly...

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

Re: h.264 vs. vc-1 performance

Mon Sep 24, 2012 1:40 pm

davorin wrote:Don't see any difference with old and new image...

Just got hold of a new Samsung TV with several HDMI inputs for testing (o;

Hmm...shouldn't HDMI audio passthrough use less CPU?
Movie is unplayable with DTS audio passthrough opposed to AC3 decoding in software...

But weird the TV can't handle AC3 audio directly...
What does

Code: Select all

/opt/vc/bin/tvservice -a
Maybe your TV doesn't support passthrough?

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

Re: h.264 vs. vc-1 performance

Mon Sep 24, 2012 1:54 pm

Code: Select all

pi@raspberrypi ~ $ /opt/vc/bin/tvservice -a
     PCM supported: Max channels: 2, Max samplerate:  48kHz, Max samplesize 24 bits.
Hmm..looks bad though....seems TrueHD has PCM encapsulated? That's why I hear stuttering audio on the Cars clip...

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

Re: h.264 vs. vc-1 performance

Mon Sep 24, 2012 2:04 pm

davorin wrote:

Code: Select all

pi@raspberrypi ~ $ /opt/vc/bin/tvservice -a
     PCM supported: Max channels: 2, Max samplerate:  48kHz, Max samplesize 24 bits.
That means your TV doesn't support passthrough.
davorin wrote: Hmm..looks bad though....seems TrueHD has PCM encapsulated? That's why I hear stuttering audio on the Cars clip...
Well, I think the ARM will software decode the TrueHD stream, which is probably why you get stuttering.
If you switch to second audio track, I expect it plays better (as ac3 is cheaper to decode than TrueHD).

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

Re: h.264 vs. vc-1 performance

Mon Sep 24, 2012 2:09 pm

Just saw this omxplayer message again...

Code: Select all

root@raspberrypi:/mnt/Video/movies/animation# omxplayer -o hdmi -n 2 Despicable.me.DL.1080p.ts 
file : Despicable.me.DL.1080p.ts result 0 format mpegts audio streams 4 video streams 1 chapters 0 subtitles 0
Would have used CBitstreamConverter
Video codec omx-h264 width 1920 height 1080 profile 100 fps 23.976025
Audio codec dca channels 8 samplerate 48000 bitspersample 16
From a fresh rip of "Despicable me" BluRay disk ;-)

Any intention that in your omxplayer version the info doesn't work as before?
Liked the feature how it displayed all audio track informations ;-)

jim8
Posts: 3
Joined: Tue Sep 25, 2012 2:57 am

Re: h.264 vs. vc-1 performance

Tue Sep 25, 2012 3:13 am

:( Found one that didn't want to play.

Code: Select all

file : Star Wars Episode IV - A New Hope.wmv result 0 format asf audio streams 1 video streams 1 chapters 0 subtitles 0
Aspect : num 0 den 1 aspect 0.000000 display aspect 1.600000
Video codec omx-vc1 width 1920 height 816 profile 3 fps 25.000000
omxplayer.bin: utils/PCMRemap.cpp:457: PCMChannels* CPCMRemap::SetInputFormat(unsigned int, PCMChannels*, unsigned int, unsigned int): Assertion `sampleSize == 2' failed.
Aborted

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

Re: h.264 vs. vc-1 performance

Tue Sep 25, 2012 11:02 am

"Despicable me" with all tracks extracted plays almost flawless (o;
Only here and there a freeze of one second...

Same true for "The dark knight"...only at certain high bitrate scenes it hangs...

MPEG-2 rips play perfectly...though there are not many BluRays with this codec...

Curious for the DTS/AC3 codec in DSP/hardware (o;

goujam
Posts: 34
Joined: Tue Jul 10, 2012 6:48 am

Re: h.264 vs. vc-1 performance

Tue Dec 04, 2012 3:54 pm

I know this is an old thread but just wondered where this got to, I have a sample clip (Terminator 2 (lossless) THX sample) available from http://www.demo-world.eu/trailers/high- ... ailers.php. This has DTS-MA sound but should play the DTS core ok, im using an av reciever so the audio goes through that.

I have tried many settings but im unable to get the clip to play without stuttering in places. This is a VC-1 M2ts file im going to try it converted to MKV AVC to see if this helps. This is all tested from my NAS over a wired network using NFS. Im using openelec to play the file if that makes any difference.

goujam
Posts: 34
Joined: Tue Jul 10, 2012 6:48 am

Re: h.264 vs. vc-1 performance

Tue Dec 04, 2012 6:08 pm

I just tried running the m2ts file from USB stick and it worked perfectly so its a problem with my network maybe ?

Return to “General discussion”