1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

NetBSD/evbarmでffmpeg

Last updated at Posted at 2024-03-18

armv6(non-hf)のpkgは無くて、armv6でも使えるarmv4のpkgの中にはffmpegが無いので、armv6のc1kでffmpegをセルフビルドしてみます。pkg_addでgmakeをインストールしておきます。

基本機能だけをためしてみたいので、外部のライブラリは一切使いません。

configureしてgmakeします。

12時間以上たって最後の所で

LD      ffmpeg_g
gcc: fatal error: Killed signal terminated program ld
compilation terminated.
gmake: *** [Makefile:136: ffmpeg_g] Error 1
c1k$ 

残念無念。

仕方がないのでクロスビルドを試して見ます。

non-hfなターゲットでビルドエラーがでるので、configureにpatchをあてます。

    elif enabled arm || enabled aarch64; then
#        enable fast_float16
    fi

configureを実行します。

./configure --enable-cross-compile\
 --cross-prefix=armv6--netbsdelf-eabi-\
 --sysroot=../netbsd-10/obj/destdir.evbarm/\
 --arch=armel\
 --target-os=netbsd\
 --extra-libs=../netbsd-10/obj/destdir.evbarm/usr/lib/crti.o\
 --enable-openssl\
 --disable-doc

netbsdのtoolsにパスを通してgmakeします。

Ryzenでビルドは10分くらいでできます。

crti.oをつけないとELFにnoteが付かず実行できません。ファイルの指定ではなくて、ldのオプションなどでも出来そうですが、分かりません。

ffmpegを実機にscpして試して見ます。

c1k$ ./ffmpeg
ffmpeg version N-114212-gf5441e441f Copyright (c) 2000-2024 the FFmpeg developers
  built with gcc 10.5.0 (NetBSD nb3 20231008)
  configuration: --enable-cross-compile --cross-prefix=armv6--netbsdelf-eabi- --sysroot=../netbsd-10/obj/destdir.evbarm/ --arch=armel --target-os=netbsd --extra-libs=../netbsd-10/obj/destdir.evbarm/usr/lib/crti.o --enable-openssl --disable-doc
  libavutil      59.  1.100 / 59.  1.100
  libavcodec     61.  1.101 / 61.  1.101
  libavformat    61.  0.100 / 61.  0.100
  libavdevice    61.  0.100 / 61.  0.100
  libavfilter    10.  0.100 / 10.  0.100
  libswscale      8.  0.100 /  8.  0.100
  libswresample   5.  0.100 /  5.  0.100
Universal media converter
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

なんで、突然ffmpegなのかは分かりますよね。

ffmpegはmp3のエンコーダーも外部ライブラリが必要でした。

残念ながらarmv6でffmpegを動かすとかなり不安定です。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?