Add benchmark to test ffdec_h264 "max-threads" property [BiteSize]

Bug #846088 reported by Jason Gerard DeRose
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Novacut
Triaged
High
Unassigned

Bug Description

Oneiric has the new libavcodec version with the multi-threaded H264 decoder so it would be nice to have an easy benchmark that people can run on their systems.

Although when possible Novacut will edit via proxy files, we still want to be able to immediately edit MOV files as they're imported (without first waiting for a proxy to be transcoded). And utilizing the ffdec_h264 "max-threads" property could be a key way to improve this user experience.

First, there are a few packages you might need to install:

  sudo apt-get install python3 gstreamer0.10-tools gstreamer0.10-ffmpeg

You can see all the properties available for ffdec_h264 like this:

  gst-inspect-0.10 ffdec_h264

The "loweres" property looks intriguing for real-time playback, but it doesn't seem to work. But you'll definitely want to benchmark across different values of the "max-threads" property.

Please add a script in misc/ like misc/benchmark-h264-dec.py. You'll time how long the decoding takes for each value of "max-threads", and then print a nicely formatted summary at the end. Would be great to include some system information, especially whether it's 64-bit or 32-bit, and what the CPU is. As far as timing things, use time.time() to get the start time, and time.time() again to get the finish time (end - start is the elapsed).

Here's a stub of what you need to do:

#!/usr/bin/python3

import sys
from multiprocessing import cpu_count
from subprocess import check_call

mov = sys.argv[1]
for threads in range(1, cpu_count() + 1):
    cmd=[
        '/usr/bin/gst-launch-0.10',
        'filesrc', 'location={}'.format(mov),
        '!', 'qtdemux',
        '!', 'queue',
        '!', 'ffdec_h264', 'max-threads={}'.format(threads),
        '!', 'fakesink',
    ]
    check_call(cmd)

As far as some test videos from Canon HDSLR cameras, see the HACKING.txt file, or just download this:

  wget http://uds-o.novacut.com/NPY3IW5SQJUNSP2KV47GVB24G7SWX6XF.mov

To get more ideas, checkout the hashbench3.py script in dmedia:

  http://bazaar.launchpad.net/~dmedia/dmedia/trunk/view/head:/misc/hashbench3.py

Ping jderose in #novacut (freenode) if you have any questions!

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Also note that to work on this bug, you really need a computer with at least 2 cpu cores, otherwise you'll only be benchmarking for max-threads=1.

Changed in novacut:
milestone: 11.09 → 11.10
Changed in novacut:
milestone: 11.10 → 11.11
Changed in novacut:
milestone: 11.11 → 12.01
Changed in novacut:
milestone: 12.01 → 12.02
Changed in novacut:
milestone: 12.02 → 12.03
Changed in novacut:
milestone: 12.03 → 12.04
Changed in novacut:
milestone: 12.04 → 12.05
Changed in novacut:
milestone: 12.05 → 12.06
Changed in novacut:
milestone: 12.06 → 12.07
Changed in novacut:
milestone: 12.07 → 12.08
Changed in novacut:
milestone: 12.08 → 12.09
Changed in novacut:
milestone: 12.09 → 12.10
Changed in novacut:
milestone: 12.10 → 12.11
Changed in novacut:
milestone: 12.11 → 12.12
Changed in novacut:
milestone: 12.12 → 13.01
Changed in novacut:
milestone: 13.01 → 13.02
Changed in novacut:
milestone: 13.02 → 13.03
Changed in novacut:
milestone: 13.03 → 13.04
Changed in novacut:
milestone: 13.04 → 13.05
Changed in novacut:
milestone: 13.05 → 13.06
Changed in novacut:
milestone: 13.06 → 13.07
Changed in novacut:
milestone: 13.07 → 13.08
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.