I'm using Mencoder on a Raspberry Pi B (1st gen) with modernized raspbian (i.e. the new builds that work on RP2) to make timelapse films. In general it works well, but i wanted to add x264 codec support. I compiled it following these instructions:
https://www.mplayerhq.hu/MPlayer/DOCS/HTML/en/codec-installation.html
It compiled successfully with 'sudo ./configure', but the resulting binary appears to be non-optimal. GCC showed this at compile time (sample of the GCC output):
gcc -Wshadow -O3 -ffast-math -Wall -I. -I. -std=gnu99 -mcpu=cortex-a8 -mfpu=neon -fomit-frame-pointer -fno-tree-vectorize -c -o encoder/lookahead.o encoder/lookahead.c
The resulting code "runs" with beautiful results, but VERY slowly:
Pos: 32.4s 971f (46%) **0.02fps** Trem: 1397min 34mb A-V:0.000 [4230:0]]
Last I checked, the Raspberry Pi 1st generation doesn't support NEON or cortex-a8. So i found some flags optimized for it's older ArmV6 CPU:
sudo ./configure --extra-cflags="-march=armv6zk -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard"
./configure yields no warnings, but this will not compile/make correctly. Numerous .o files are created with the new flags, but it fails on (insert file) with the error:
gcc -Wshadow -O3 -ffast-math -Wall -I. -I. -march=armv6zk -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -std=gnu99 -fomit-frame-pointer -fno-tree-vectorize -c -o encoder/slicetype-cl.o encoder/slicetype-cl.c
gcc -I. -I. -c -DSTACK_ALIGNMENT=4 -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8 -o common/arm/cpu-a.o common/arm/cpu-a.S
gcc -I. -I. -c -DSTACK_ALIGNMENT=4 -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8 -o common/arm/pixel-a.o common/arm/pixel-a.S
gcc -I. -I. -c -DSTACK_ALIGNMENT=4 -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8 -o common/arm/mc-a.o common/arm/mc-a.S
gcc -I. -I. -c -DSTACK_ALIGNMENT=4 -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8 -o common/arm/dct-a.o common/arm/dct-a.S
gcc -I. -I. -c -DSTACK_ALIGNMENT=4 -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8 -o common/arm/quant-a.o common/arm/quant-a.S
common/arm/quant-a.S: Assembler messages:
common/arm/quant-a.S:362: Error: selected processor does not support ARM mode `rbit r1,r1'
common/arm/quant-a.S:363: Error: selected processor does not support ARM mode `rbit r1,r1'
Makefile:217: recipe for target 'common/arm/quant-a.o' failed
make: *** [common/arm/quant-a.o] Error 1
Any idea's? I wish I could live with the sub-optimal code, but it runs at a net deficit (needs to run once every 24 hours, but takes ~35 hours to run the x264 compression). Previously I was using mencoder's default lavc MPEG4 option; it's A LOT FASTER.
Should I cross-compile instead? I don't think i'm running out of memory on the Pi during compilation.
Thank you.