ffmpeg cross-compile

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

ffmpeg cross-compile

Thomas Schmiedl
Hello,

I try to cross-compile ffmpeg for my router using this toolchain
https://github.com/Freetz/freetz. It is an alternative firmware for AVM
routers
(https://web.archive.org/web/20171105112501/http://freetz.org:80/wiki/help/howtos/common/newbie.en).
I need support for 'https' and 'dash' (libxml2).

I tested with ffmpeg-4.0.tar.bz2, libxml2-2.9.8.tar.gz and
openssl-1.0.2o.tar.gz.

openssl:
./configure --host=mips-linux-gnu --target=mips-linux CC=mips-linux-gcc
AR=mips-linux-ar LD=mips-linux-ld RANLIB=mips-linux-ranlib
--prefix=/home/user/ffmpeg-mips --without-zlib --without-python

make
make install

libxml2:
./Configure linux-generic32 shared --cross-compile-prefix=mips-linux-
--prefix=/home/user/ffmpeg-mips

make
make install

ffmpeg:
./configure --prefix=/home/user/ffmpeg-mips --enable-cross-compile
--cross-prefix=mips-linux- --arch=mips --target-os=linux
--enable-openssl --enable-libxml2
--extra-cflags='-I/home/user/ffmpeg-mips/include
-Wl,-rpath=/home/user/ffmpeg-mips/lib'
--extra-ldflags='-L/home/user/ffmpeg-mips/lib
-Wl,-rpath=/home/user/ffmpeg-mips/lib'
--extra-cxxflags='-I/home/user/ffmpeg-mips/include
-Wl,-rpath=/home/user/ffmpeg-mips/lib' --disable-mips32r2
--disable-mipsdsp --disable-mipsdspr2 --disable-mipsfpu

I got this error: 'ERROR: libxml-2.0 not found using pkg-config'. But
the freetz-toolchain does not contain pkg-config. Is it possible to use
pkg-config from the Debian 9 host system?

When calling ffmpeg's configure without '--enable-libxml2', there is no
pkg-config error. But a warning: 'mips-linux-pkg-config not found,
library detection may fail.'

I'm only an end-user, maybe someone could help me?

Thanks,
Thomas
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ffmpeg cross-compile

Moritz Barsnick
On Mon, May 14, 2018 at 12:28:13 +0200, Thomas Schmiedl wrote:
> I'm only an end-user, maybe someone could help me?

Perhaps someone at the freetz site?

> I got this error: 'ERROR: libxml-2.0 not found using pkg-config'. But
> the freetz-toolchain does not contain pkg-config. Is it possible to use
> pkg-config from the Debian 9 host system?

Hmm, this file from freetz at least mentions the pkg-config file:
https://github.com/Freetz/freetz/blob/c763e9066d06d21bcd815e15b3f8fa494b3b2007/make/libs/libxml2/libxml2.mk

But yes, if you know hwo pkg-config works, you can easily "fake" a
libxml-2.0.pc file and have ffmpeg use it.

> When calling ffmpeg's configure without '--enable-libxml2', there is no
> pkg-config error. But a warning: 'mips-linux-pkg-config not found,
> library detection may fail.'

Hmm, that means you don't have a pkg-config tool for cross build
either? I would also fake this, but there may be a better way.

Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ffmpeg cross-compile

Tobias Rapp-2
On 14.05.2018 15:33, Moritz Barsnick wrote:

> On Mon, May 14, 2018 at 12:28:13 +0200, Thomas Schmiedl wrote:
>> I'm only an end-user, maybe someone could help me?
>
> Perhaps someone at the freetz site?
>
>> I got this error: 'ERROR: libxml-2.0 not found using pkg-config'. But
>> the freetz-toolchain does not contain pkg-config. Is it possible to use
>> pkg-config from the Debian 9 host system?
>
> Hmm, this file from freetz at least mentions the pkg-config file:
> https://github.com/Freetz/freetz/blob/c763e9066d06d21bcd815e15b3f8fa494b3b2007/make/libs/libxml2/libxml2.mk
>
> But yes, if you know hwo pkg-config works, you can easily "fake" a
> libxml-2.0.pc file and have ffmpeg use it.
>
>> When calling ffmpeg's configure without '--enable-libxml2', there is no
>> pkg-config error. But a warning: 'mips-linux-pkg-config not found,
>> library detection may fail.'
>
> Hmm, that means you don't have a pkg-config tool for cross build
> either? I would also fake this, but there may be a better way.

On Ubuntu there is a package "pkg-config-mips-linux-gnu" which provides
/usr/bin/mips-linux-gnu-pkg-config (actually just a symlink to
/usr/share/pkg-config-crosswrapper). Don't know how this is handled on
Debian.

Regards,
Tobias

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ffmpeg cross-compile

Carl Eugen Hoyos-2
In reply to this post by Thomas Schmiedl
2018-05-14 12:28 GMT+02:00, Thomas Schmiedl <[hidden email]>:

> I tested with ffmpeg-4.0.tar.bz2

Please remember that only current FFmpeg git head is supported here.

> I got this error: 'ERROR: libxml-2.0 not found using pkg-config'.

The reason is apparently that FFmpeg cannot know in advance
where the necessary headers are installed.
I will likely send a patch that would fix the issue for you (with
--extra-cflags=/path/to/libxml) but there is a high chance that
it will be rejected: Building for less common systems is
unfortunately not welcome;-(

My suggestion is you simply patch away the check from
configure or edit config.h and config.mak after running
configure to enable libxml2 and add the necessary path.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".