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

Re: h.264 vs. vc-1 performance

Tue Dec 04, 2012 6:15 pm

You can test your network performance simply with something like:

Code: Select all

time cat moviefile.m2ts > /dev/null
It just sends the movie file to /dev/null node and displays at the end the time it took...

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

Re: h.264 vs. vc-1 performance

Tue Dec 04, 2012 8:16 pm

goujam wrote: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.
Check your nfs mount options. I'm currently using:
sudo mount 192.168.4.9:/Public -o _netdev,nfsvers=3,rw,intr,rsize=32768,wsize=32768,nolock,async /home/pi/dell

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

Re: h.264 vs. vc-1 performance

Tue Dec 04, 2012 9:31 pm

I did some tests on the network but used my laptop to test the speed on my wdtv cable as a benchmark and I got 81Mbps write and 80Mbps read.

I then checked on the cable to the pi and I got 81Mbps write and 69Mbps write. So its slower but the pi is further away than the wdtv. Now even with the lower speed its higher than the maximum required for the file I'm playing which is 48Mbps according to mediainfo.

Which points me towards Dom's suggestion, could you point me towards where I can find my NFS mount setup? I just set the NFS link using openelec but I presume it will have set the values in a file somewhere ?

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

Re: h.264 vs. vc-1 performance

Tue Dec 04, 2012 11:39 pm

goujam wrote:I did some tests on the network but used my laptop to test the speed on my wdtv cable as a benchmark and I got 81Mbps write and 80Mbps read.

I then checked on the cable to the pi and I got 81Mbps write and 69Mbps write. So its slower but the pi is further away than the wdtv. Now even with the lower speed its higher than the maximum required for the file I'm playing which is 48Mbps according to mediainfo.

Which points me towards Dom's suggestion, could you point me towards where I can find my NFS mount setup? I just set the NFS link using openelec but I presume it will have set the values in a file somewhere ?
Not quite sure with OpenelELEC

Can you ssh in and:
mkdir mnt
mount -o _netdev,nfsvers=3,rw,intr,rsize=32768,wsize=32768,nolock,async 192.168.4.9:/Public mnt

and report if that works. If it does then you can browse for mnt in your home directorty.

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

Re: h.264 vs. vc-1 performance

Wed Dec 05, 2012 7:33 am

Thanks Dom Ill try it later, Ive had a look and I think I need to make a file called Autostart.sh and put my mount options in there. Apparently when you use the gui to create the mounts in XBMC it can slow your network spped down so im hoping this form of mounting will increase my speeds!

Also does VC-1 use more cpu than other codecs, I have noticed when I play my clip of a M2ts file my CPU is at almost 100% even when playing it from a USB stick. It does have DTS-MA audio on it so it maybe using the CPU to strip the core?

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

Re: h.264 vs. vc-1 performance

Wed Dec 05, 2012 4:04 pm

goujam wrote:Thanks Dom Ill try it later, Ive had a look and I think I need to make a file called Autostart.sh and put my mount options in there. Apparently when you use the gui to create the mounts in XBMC it can slow your network spped down so im hoping this form of mounting will increase my speeds!

Also does VC-1 use more cpu than other codecs, I have noticed when I play my clip of a M2ts file my CPU is at almost 100% even when playing it from a USB stick. It does have DTS-MA audio on it so it maybe using the CPU to strip the core?
No, VC-1 shoudn't be any harder than H264. m2ts (generally any of the transport streams/program streams) is more expensive than a container like mkv, so you could try remuxing the file to mkv (without re-encoding).

You should make sure passtrough is working. Does your TV/reciever support it, and is it indicating DTS or 5.1 audio?
You can add:
hdmi_force_edid_audio=1
to config.txt to override if your TV/receiver says it supports passthrough. Then make sure passthough is enabled in xbmc (or use -p in command line omxplayer).

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

Re: h.264 vs. vc-1 performance

Wed Dec 05, 2012 6:21 pm

Yeah I'm definitely passing the audio to my receiver! I've taken the file and remuxed it to Mkv and also I have also copied the m2ts file but down mixed the audio from dts-ma to dts to see if the removal of hd audio effects the CPU.

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

Re: h.264 vs. vc-1 performance

Wed Dec 05, 2012 6:45 pm

I just did some tests, I havent mounted the NFS in Autostart.sh yet so its still the same as before. The original file buffers, I then tried the original file with the DTS-MA downmixed to DTS core the file played fine but CPU was still as high as before (pointing towards network not cpu for buffering).

I then tried the file with HD audio but changed the format from VC-1 M2ts to H.264 MKV, the file size was very simular. This file played fine and the CPU was much less, but I dont this is a fair test maybe as I changed to H.264?

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

Re: h.264 vs. vc-1 performance

Thu Dec 06, 2012 10:01 am

I've managed to playback the m2ts file now by setting the NFS mount with resize and wsize set to 32768 had to play around with the values but this works now.

I'm still seeing heavy CPU usage on the file though

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

Re: h.264 vs. vc-1 performance

Fri Dec 07, 2012 9:28 am

The file has now decided not to play again, its very strange. Think I need to play around a bit more with rsize and wsize, what would be an ideal cachemembuffersize on a 256MB pi?

peterdk
Posts: 21
Joined: Sat Feb 09, 2013 3:37 pm

Re: h.264 vs. vc-1 performance

Thu Nov 21, 2013 10:40 am

I just had a Bluray Rip of a animation film that stuttered and used VC1. It's cpu usage is around 80% and sometimes hangs. I have removed all audio tracks and only created a AC3 5.1 track, which I would suspect the pi handles ok. However, it still stutters, both from network (where full bluray rips play all fine) and from USB. I will try a dolby logic 2 encode for the audio, but it looks like something is still not working ok with VC1.

VC1 codec is enabled according to the vcgencmd.

I could upload a 2 minutes clip if that would help?

User avatar
RaTTuS
Posts: 10614
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: h.264 vs. vc-1 performance

Thu Nov 21, 2013 12:47 pm

peterdk wrote:I just had a Bluray Rip of a animation film that stuttered and used VC1. It's cpu usage is around 80% and sometimes hangs. I have removed all audio tracks and only created a AC3 5.1 track, which I would suspect the pi handles ok. However, it still stutters, both from network (where full bluray rips play all fine) and from USB. I will try a dolby logic 2 encode for the audio, but it looks like something is still not working ok with VC1.

VC1 codec is enabled according to the vcgencmd.

I could upload a 2 minutes clip if that would help?
does it stutter if it is on the SD card
[what speed is the SD card]
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

peterdk
Posts: 21
Joined: Sat Feb 09, 2013 3:37 pm

Re: h.264 vs. vc-1 performance

Thu Nov 21, 2013 1:05 pm

Well, I haven't tested it on the sd card, since the usb stick is 10+MB/s and even my 30mbps bluray rips don't have any issues using network or stick.

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

Re: h.264 vs. vc-1 performance

Thu Nov 21, 2013 2:45 pm

peterdk wrote:Well, I haven't tested it on the sd card, since the usb stick is 10+MB/s and even my 30mbps bluray rips don't have any issues using network or stick.
I think it would be a worthwhile test.
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.

peterdk
Posts: 21
Joined: Sat Feb 09, 2013 3:37 pm

Re: h.264 vs. vc-1 performance

Thu Nov 21, 2013 3:08 pm

Well.. I guess I was a little stubborn, but to my surprise it plays much better when played from internal sdcard.
SDCard is class 10 and hdparm gives 22MB/s read speed.

I still see some light stuttering, but will check with xbmc overlay to see if there are actual dropped frames or if it's just the animation.

What could be causing this difference? I have a fully wired network, and the usb stick is 10MB+? CPU usage with this movie from SD is around 80%, I can imagine that handling the network stuff or USB will cause too much CPU and therefor the stuttering. Still, with h264 encode it works all ok.

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

Re: h.264 vs. vc-1 performance

Thu Nov 21, 2013 3:30 pm

peterdk wrote:Well.. I guess I was a little stubborn, but to my surprise it plays much better when played from internal sdcard.
SDCard is class 10 and hdparm gives 22MB/s read speed.

I still see some light stuttering, but will check with xbmc overlay to see if there are actual dropped frames or if it's just the animation.

What could be causing this difference? I have a fully wired network, and the usb stick is 10MB+? CPU usage with this movie from SD is around 80%, I can imagine that handling the network stuff or USB will cause too much CPU and therefor the stuttering. Still, with h264 encode it works all ok.
Light stuttering is probably due to frame rate sync - have you enabled "adjust refresh rate to match video" - assuming your TV supports 24Hz.
If network is slow, check iperf from PC to Pi. You shoud get close to 90Mbit/s.
What network protocol? SMB is pretty inefficient from linux. You should use NFS.

peterdk
Posts: 21
Joined: Sat Feb 09, 2013 3:37 pm

Re: h.264 vs. vc-1 performance

Thu Nov 21, 2013 3:34 pm

dom wrote: Light stuttering is probably due to frame rate sync - have you enabled "adjust refresh rate to match video" - assuming your TV supports 24Hz.
If network is slow, check iperf from PC to Pi. You shoud get close to 90Mbit/s.
What network protocol? SMB is pretty inefficient from linux. You should use NFS.
Yes, I am aware of the framerate sync. I love my PI for it's perfect sync with my tv, it's as fluent as my bluray player.
I do indeed use samba for now, will setup NFS and check performance, although I normally reach 100MB/s with my server that's on the same switch.

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

Re: h.264 vs. vc-1 performance

Thu Nov 21, 2013 3:46 pm

Some good info here on SMB vs NFS
http://openelec.tv/forum/124-raspberry- ... ftp-vs-nfs

The important one is CPU usage when sustaining a high bitrate - much higher for SMB on Pi.

peterdk
Posts: 21
Joined: Sat Feb 09, 2013 3:37 pm

Re: h.264 vs. vc-1 performance

Thu Nov 21, 2013 4:24 pm

When enabling the XBMC overlay, it shows indeed that the caching fails after a while when playing from the network. However, more important is that the VC1 video decoding takes up around 25-40% of the CPU (dcpu). Resulting in total CPU of 100% sometimes when playing from network. This dcpu level is also the case when playing from the sd card. It looks a bit high too me. A 20+ mbit h264 rip consumes about 10% less dcpu on average, what probably causes the network buffering issues. Is it expected that VC1 is just more CPU intensive?

NFS is indeed faster and lighter, but still gives me issues.

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

Re: h.264 vs. vc-1 performance

Thu Nov 21, 2013 4:52 pm

peterdk wrote:When enabling the XBMC overlay, it shows indeed that the caching fails after a while when playing from the network. However, more important is that the VC1 video decoding takes up around 25-40% of the CPU (dcpu). Resulting in total CPU of 100% sometimes when playing from network. This dcpu level is also the case when playing from the sd card. It looks a bit high too me. A 20+ mbit h264 rip consumes about 10% less dcpu on average, what probably causes the network buffering issues. Is it expected that VC1 is just more CPU intensive?
What's the format of the video. Unindexed/unframed formats like m2ts require a lot more arm cpu than indexed formats (e.g. mkv).

What is in the file? Same audio? same subtitles?

peterdk
Posts: 21
Joined: Sat Feb 09, 2013 3:37 pm

Re: h.264 vs. vc-1 performance

Thu Nov 21, 2013 4:57 pm

I compared a 30mbit bluray h264 rip with a vc1 bluray rip. Not with similar video/audio. However, both had passthrough enabled, so audio-cpu was 1%. MKV files both, with subtitles. I understand a proper comparison would be a re-encode of the VC1 file to H264 with similar bitrate, I will maybe look into that. For now I use a h264 file, with a lower bitrate then the original file to make it work ok for me.

Having several bluray rips that are MKV H264 (and direct non-transcoded rips of disc) that all play fine, and now a VC1 MKV copy that hangs makes me conclude that this difference in cpu-usage is probably there.

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

Re: h.264 vs. vc-1 performance

Thu Nov 21, 2013 5:08 pm

peterdk wrote:I compared a 30mbit bluray h264 rip with a vc1 bluray rip. Not with similar video/audio. However, both had passthrough enabled, so audio-cpu was 1%. MKV files both, with subtitles. I understand a proper comparison would be a re-encode of the VC1 file to H264 with similar bitrate, I will maybe look into that. For now I use a h264 file, with a lower bitrate then the original file to make it work ok for me.

Having several bluray rips that are MKV H264 (and direct non-transcoded rips of disc) that all play fine, and now a VC1 MKV copy that hangs makes me conclude that this difference in cpu-usage is probably there.
If you produce a sample (e.g. a few hundred MB) of the VC1 file I can take a look.
I do have a VC1 Blu-Ray image in my test files (Blade Runner), and it has always played well both as a Blu-Ray folder structure and as a (un-recompressed) mkv file.

Also what version of xbmc? Older versions are generally less performant than newer versions.

peterdk
Posts: 21
Joined: Sat Feb 09, 2013 3:37 pm

Re: h.264 vs. vc-1 performance

Thu Nov 21, 2013 5:23 pm

Ok, I uploaded a 2 minute(390MB) sample of it here: http://www.umito.nl/tmp/Arriety-2minutes.mkv
I have the Dutch PGS subtitles enabled.

Note that from the internal sd card it plays just fine, but from the network hangs intermittently due to 100% cpu usage: SMB/NFS and USB.

I am using the latest Raspbmc, fully updated, 512MB Pi rev B. Performance profile: fast.

peterdk
Posts: 21
Joined: Sat Feb 09, 2013 3:37 pm

Re: h.264 vs. vc-1 performance

Thu Mar 13, 2014 5:27 pm

I revisited this Arrietty VC1 movie problem, because it now turns out that while the buffering issues are indeed solved, the file still doesn't play complete fluent. It also stutters intermittently very slightly when played from the local SD card or from NFS (with optimized mount settings). This behaviour is not something I have seen on any h264 bluray copies!

I disabled my TV's post processing and also stopped the framerate sync of xbmc, with no effect.

File is played with subtitles disabled and with AC3 passthrough. The stuttering is particularly visible after the opening shot of the city, when you see the car driving from right to left. Every second or so, there is a slight hiccup, where suddenly car jumps a little bit forward cq the background jumps a bit to the right.

CPU usage in the overlay ranges from 30 - 60 during that scene.

The file is a direct bluray rip using MakeMKV. On Windows it plays without any hiccups. The original bluray plays also perfectly smooth using the same TV.

I also tried a file with only the VC1 stream, no audio, no subtitles etc. Same problem.
Also tested unsuccesfully with latest omxplayer: 09/03/2013 9b0793f. Updated to latest firmware and kernel from git repo.

I would love to see this fixed, is there anything else I can do/provide?

Code: Select all

pi@raspbmc:~$ omxplayer -i Arriety-2minutes.mkv        
[matroska,webm @ 0x715230] Could not find codec parameters for stream 2 (Video: vc1 (WVC1 / 0x31435657), 1920x1080): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 0x715230] Could not find codec parameters for stream 3 (Audio: dts, 48000 Hz, 6 channels, fltp): no decodable DTS frames
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 0x715230] Could not find codec parameters for stream 4 (Subtitle: hdmv_pgs_subtitle): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Chapter : 	0 	Chapter 01 	    0.00
Input #0, matroska,webm, from 'Arriety-2minutes.mkv':
  Metadata:
    title           : Arrietty
    creation_time   : 2013-11-21 10:16:28
  Duration: 00:02:00.61, start: 0.000000, bitrate: 27156 kb/s
    Chapter #0.0: start 0.000000, end 120.576000
    Metadata:
      title           : Chapter 01
    Stream #0:0(jpn): Audio: dts (DTS-HD MA), 48000 Hz, 5.1(side), fltp, 1536 kb/s
    Metadata:
      title           : Lossless
    Stream #0:1(eng): Audio: ac3, 48000 Hz, 6 channels, fltp (default)
    Stream #0:2(eng): Video: vc1 (WVC1 / 0x31435657), 1920x1080, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 1k tbc
    Stream #0:3(jpn): Audio: dts, 48000 Hz, 6 channels, fltp
    Metadata:
      title           : 3/2+1
    Stream #0:4(dut): Subtitle: hdmv_pgs_subtitle

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

Re: h.264 vs. vc-1 performance

Fri Mar 14, 2014 2:38 pm

peterdk wrote: I would love to see this fixed, is there anything else I can do/provide?
I can't see any frame drops. You will need "-r" passed to omxplayer and a TV capable of 24p to view this without frame drops. Can you confirm you are testing with "-r" and TV switches to 24p mode?
(TV may report it, or you can use "tvservice -s").

Return to “General discussion”