I want to test raw/h.264 data encoding/decoding on Raspberry pi using hardware acceleration.
I am capturing raw data from webcam, and gstreamer+openMAX for streaming. Finally I store encoded data in a file. See below example.
when I run this command from pi connected through ssh, using pre-built binaries of gstreamer1.0.
pi@raspberrypi ~ $ gst-launch-1.0 v4l2src device=/dev/video0 ! omxh264enc ! \ "video/x-h264,profile=high" ! h264parse ! queue max-size-bytes=10000000 ! \ matroskamux ! filesink location=test1.mkv
CPU occupancy using top command, it's closely 97%. Data type - x-h264 width 1600 height 1200 profile 100 fps 10.000000
From forum post, I found that lot of work going on transferring the raw frames from the webcam, via the ARM to the GPU then transferring the encoded stream back to the ARM and thence to the SD card. Where as the Raspi camera does not have the same bandwidth/CPU issues since the entire path from camera to encoder is done on the GPU itself, with no ARM involvement except for accepting the stream and sending to SD card - hence low CPU use.
Is there any other way to achieve the above requirement without Raspi cam?