I switched from x86 to arm64 architecture on my lambda function. I updated all the library and packages used to arm64 compatible binaries.
I download Bento4 from this link. It was working fine for x86 architecture but it is not working fine for arm64. I'm getting the following error:
OSError: [Errno 8] Exec format error: 'mp4fragment'
This is my Docker file:
FROM public.ecr.aws/lambda/python:3.8-arm64
# Install tar and xz
RUN yum install tar xz unzip -y
# Install awscli
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscli-exe-linux-aarch64.zip" -s
RUN unzip -q awscli-exe-linux-aarch64.zip
RUN ./aws/install
# Install ffmpeg
RUN curl https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-arm64-static.tar.xz -o ffmpeg.tar.xz -s
RUN tar -xf ffmpeg.tar.xz
RUN mv ffmpeg-*-arm64-static/ffmpeg /usr/bin
RUN mv ffmpeg-*-arm64-static/ffprobe /usr/bin
# Install Bento4
COPY Bento4-SDK-1-6-0-639.x86_64-unknown-linux.zip .
RUN unzip -q Bento4-SDK-1-6-0-639.x86_64-unknown-linux.zip
RUN mkdir -p /usr/bin/../utils
RUN mv Bento4-SDK-1-6-0-639.x86_64-unknown-linux/bin/* /usr/bin
RUN mv Bento4-SDK-1-6-0-639.x86_64-unknown-linux/utils/mp4-dash.py /usr/bin/../utils
RUN mv Bento4-SDK-1-6-0-639.x86_64-unknown-linux/utils/mp4-hls.py /usr/bin/../utils
RUN mv Bento4-SDK-1-6-0-639.x86_64-unknown-linux/utils/* /usr/bin/../utils