x264: add compilation script#84
Conversation
ebafb4f to
1a06d2d
Compare
|
The issue with CLI silent-failing was traced to the /* Encode frames */
for( ; !b_ctrl_c && (i_frame < param->i_frame_total || !param->i_frame_total); i_frame++ )
{
if( filter.get_frame( opt->hin, &cli_pic, i_frame + opt->i_seek ) )
break;and this An issue was made: |
Adding files that allow for compilation of x264 codec with CLI tool. Succesfull compialtion, unsuccesful in runtime, does not compress. JIRA: PP-213
1a06d2d to
4aaa604
Compare
Adressing phoenix-rtos-project#1155 issue with mmap() `size` argument need to be aligned to page size. JIRA: PP-213
4aaa604 to
dde8200
Compare
Previous implementation used `git clone` to obtain source code, now it uses `wget` as with most other ports. No mirror is yet provided. JIRA: PP-213
5c34591 to
01131fe
Compare
x264 extensively uses stack, changed to 65536 bytes JIRA: PP-213
nalajcie
left a comment
There was a problem hiding this comment.
I know this is a draft, but still left some comments ;)
|
|
||
| set -e | ||
|
|
||
| PREFIX_X264="${PREFIX_PROJECT}/phoenix-rtos-ports/x264" |
There was a problem hiding this comment.
Thanks for that! I didn`t notice this PR. I will wait for that PR to be merged and then redo this script.
linux distributions do have malloc.h which has memalign() function. Phoenix-RTOS does have the malloc.h, but it is a stub. JIRA: PP-213
Phoenix-RTOS does not support the x264 style of thread check, so preliminary script can drop it and just use one thread. This was made using patch, but there is configure option to disable it. JIRA: PP-213
JIRA: PP-213
JIRA: PP-213
JIRA: PP-213
b7a6968 to
6778959
Compare
|
Tests were performed with and without /bin/x264 --output BUS.h264 --fps 15 --preset slow --input-res 176x144 etc/BUS_176x144_15_orig_01.yuvthe encoding speed was increased about 2x, from around 4,4 frames per second to around 9,1 frames per second. For enabled asm the following frames per second encoding speeds were achieved for different presets:
|
Description
x264 is an open-source video codec available from here: https://www.videolan.org/developers/x264.html
This PR adds x264 script together with necessary patches in order to build this codec as CLI tool for video conversion. The codec was tested on
ia32-generic-qemuandzyng7000-zturnplatform. The testing is described in detail later in this description. This port creates static library and a CLI tool to run it. Static library is not installed into libs, but CLI application is installed.Some good CLI parameters explanation: https://silentaperture.gitlab.io/mdbook-guide/encoding/x264.html
Motivation and Context
Patches
There are currently two patches necessary for the x264 to work:
input.patchThis patch deals with the fact, that current
mmap()implementation in libphoenix needssizeargument to be fully divisible by page size. This is discussed later in this PR. Issue related to this patch is: phoenix-rtos/phoenix-rtos-project#1155configure.patchThis patch deals with the fact that Phoenix-RTOS does have
malloc.hin libphoenix, but it is completely empty file (size=0), thus all usage ofmalloc.hfunctions fail. However configuration script assumes, that ifLINUXplatform is built, thenmalloc.hhas to be present. Thats why this patch has to comment a line that definesHAVE_MALLOC_H` for compilation purpose.Configure arguments
There are multiple arguments passed to
configurescript and some of them need an explanation:--disable-avs,--disable-lavf,--disable-openclforce dynamic linking, so they are disabled.--disable-asmallows for platform-specific assembly optimization, but it crashes the building process without any warning or error message. This was not investigated further.--host=arm-linux- this flag tricks the compilation process that target platform has linux. This is later stripped to be justlinux. The impact of this argument being used on non-arm platforms (ia32-generic) was not checked, however codec works on ia32-generic (this is still a weak proof...)configure --helpWarnings
The compilation process of this codec heavily pollutes the stdout with warnings of type:
This issue was not addressed.
Types of changes
How Has This Been Tested?
This codec compilation was tested with success on
ia32-generic-qemuandarmv7a9-zynq7000-zturnplatform.A sample raw video file
BUS_176x144_15_orig_01.yuvwas used from https://engineering.purdue.edu/~reibman/ece634/Videos/YUV_videos/ because of it`s small size (~2MB).The test command used was:
On both
ia32andzturntest platforms the codec exited with success. Only fromzturnplatform the converted video was downloaded back (using base64 text coding and UART transmission) and played withvlcvideo player. And there was a bus riding. So the video was converted successfully.ia32-generic-qemu,armv7a9-zynq7000-zturn.Checklist:
Special treatment