02-19-2020, 04:39 PM
(This post was last modified: 02-19-2020, 04:40 PM by PinePhoneCoder.)
According to the user manual (http://files.pine64.org/doc/datasheet/pi...l_V1.0.pdf) of the Allwinner A64, it supports Hardware accelerated video encoding.
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:
Or see here: https://github.com/dirkjanbuter/pinephon.../bin/video
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/pinephon.../bin/video