-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x264: add compilation script #84
base: master
Are you sure you want to change the base?
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.yuv the 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-qemu
andzyng7000-zturn
platform. 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.patch
This patch deals with the fact, that current
mmap()
implementation in libphoenix needssize
argument 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.patch
This patch deals with the fact that Phoenix-RTOS does have
malloc.h
in libphoenix, but it is completely empty file (size=0), thus all usage ofmalloc.h
functions fail. However configuration script assumes, that ifLINUX
platform is built, thenmalloc.h
has to be present. Thats why this patch has to comment a line that defines
HAVE_MALLOC_H` for compilation purpose.Configure arguments
There are multiple arguments passed to
configure
script and some of them need an explanation:--disable-avs
,--disable-lavf
,--disable-opencl
force dynamic linking, so they are disabled.--disable-asm
allows 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 --help
Warnings
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-qemu
andarmv7a9-zynq7000-zturn
platform.A sample raw video file
BUS_176x144_15_orig_01.yuv
was 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
ia32
andzturn
test platforms the codec exited with success. Only fromzturn
platform the converted video was downloaded back (using base64 text coding and UART transmission) and played withvlc
video player. And there was a bus riding. So the video was converted successfully.ia32-generic-qemu
,armv7a9-zynq7000-zturn
.Checklist:
Special treatment