]> git.cworth.org Git - apitrace/commit
Add option '--snapshot-format=' to allow write raw RGB directly to stdout
authorShuang He <shuang.he@intel.com>
Wed, 24 Apr 2013 02:01:15 +0000 (10:01 +0800)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Wed, 24 Apr 2013 06:32:04 +0000 (07:32 +0100)
commit90808c138de511a81b6b85d22a9400007d91336b
tree61c76ba0b9e3371a5f0013ea96a778a9a355c9cc
parent472fa28fe03219b20a50da287238c873e20884c5
Add option '--snapshot-format=' to allow write raw RGB directly to stdout

This allows to create h264 video with gstreamer-vaapi very fast, and save much more disk space.
Using PNM format couldn't reach same performance, since PNM decoding seems inefficient in gstreamer.
Following are some experiment data with smokinguns demo 1920x1080 resolution on Ivybridge:
1. With png saving, it runs at around 4.5 FPS, which has compression rate 5.15x against raw RGB data
   Reference command:
        glretrace -s snapshot/ smokinguns.trace

2. Using PNM with gstreamer-vaapi, which could run at around 9 FPS, which has compression rate
   485x (QP dependent) against raw RGB data.
   Reference command:
        glretrace -s - smokinguns.trace | gst-launch-0.10 fdsrc blocksize=409600 ! queue \
        ! pnmdec ! videoparse format=rgb width=1920 height=1080 ! ffmpegcolorspace ! queue \
! vaapiupload direct-rendering=0 ! queue ! vaapiencodeh264 ! filesink location=xxx.264

3. With following command that directly write raw RGB stream and encoded into H264 video, it
   runs at around 18.5 FPS, which has compression rate 485x (QP dependent) against raw RGB data,
   Reference command:
        glretrace --snapshot-format=RGB -s - smokinguns.trace | gst-launch-0.10 fdsrc blocksize=409600 ! queue \
! videoparse format=rgb width=1920 height=1080 ! queue ! ffmpegcolorspace ! queue \
! vaapiupload direct-rendering=0 ! queue ! vaapiencodeh264 ! filesink location=xxx.264

v2: Use --snapshot-format= option to specify which format is used to write to stdout output
v3: Use enum for snapshotFormat and add example in README.markdown
README.markdown
image/CMakeLists.txt
image/image.hpp
image/image_raw.cpp [new file with mode: 0644]
retrace/retrace_main.cpp