PINE64
Hardware accelerated video encoding - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PinePhone (https://forum.pine64.org/forumdisplay.php?fid=120)
+--- Forum: PinePhone Hardware (https://forum.pine64.org/forumdisplay.php?fid=122)
+--- Thread: Hardware accelerated video encoding (/showthread.php?tid=9231)



Hardware accelerated video encoding - PinePhoneCoder - 02-19-2020

According to the user manual (http://files.pine64.org/doc/datasheet/pine64/Allwinner_A64_User_Manual_V1.0.pdf) of the Allwinner A64, it supports Hardware accelerated video encoding.


Quote:A64 provides almostfull  motion  playback  of  up  to 4K high-definition  video,and  supports H.265 decoder by 4K@30fps ,H.264 decoder by 1080p@60fps, MPEG1/2/4 decoder by 1080p@60fps, VP8 decoder by 1080p@60fps, AVS/AVS+   decoder   by   1080p@60fps,VC1   decoder   by   1080p@30fps,   H.264   encoder   by 1080p@60fps with dedicated hardware.


Can anyone guide me in the right direction how to encode video hardware accelerated?

The following script records 10 seconds of video, but it uses raw video and after the recording it converts it to mp4:
Code:
#!/bin/bash
sudo chmod 777 /dev/media1
sudo chmod 777 /dev/video1
NAME=$(date +"%Y%m%dT%H%M%S")
media-ctl -d /dev/media1 --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY2X8/1280x720]'
ffmpeg -f rawvideo -pixel_format yuv420p -s 1280x720 -f video4linux2 -i /dev/video1 -vcodec copy -t 10  ~/Videos/$NAME.yuv
ffmpeg -f rawvideo -pixel_format yuv420p -s 1280x720 -i ~/Videos/$NAME.yuv ~/Videos/$NAME.mp4
rm ~/Videos/$NAME.yuv

Or see here: https://github.com/dirkjanbuter/pinephone-commands/blob/master/bin/video


RE: Hardware accelerated video encoding - xmixahlx - 02-19-2020

i imagine cedrus would be the place to start:
https://linux-sunxi.org/Sunxi-Cedrus
https://linux-sunxi.org/Cedrus

sorry if that is obvious, i'm not following pinephone things much but this crossed my path while i'm working on similar projects for pbp.


RE: Hardware accelerated video encoding - PinePhoneCoder - 02-20-2020

Thank you, that is what I was looking for. I see that only decoding (h264) is working for now.


RE: Hardware accelerated video encoding - xmixahlx - 02-20-2020

I think meg1, mpeg2, h264, and h265 are supported in decoding, but some have limitations.


RE: Hardware accelerated video encoding - PinePhoneCoder - 02-20-2020

Sorry, I was not correct by only mention h264, I did not menton all becouse I was typing from my mobile phone.