News:

--

Main Menu

Avidemux on Raspberry Pi 4

Started by Lonerider, August 20, 2019, 10:13:33 PM

Previous topic - Next topic

Gew

Any progress on this? I have a Raspberry 4 (rev.B) and saw the compiling instructions on the Avidemux web site, tried following them pretty much from the top and on-forward, but the bash script that is said to create .deb installation packages when being run with '--deb' does not do that. I have searched through the entire folder and no .deb files are to be found. I just want a basic Avidemux installation. Also, some of the libraries (libfaac and libaften, IIRC) is not available in the Raspian repos, but I'm guessing I should be able to pull through without them.

Cheers!

eumagga0x2a

Please post the command line and the output of bootStrap.bash script.

Packaging as deb only helps to remove Avidemux later as the packages are low quality (no dependency tracking). If Avidemux doesn't need to be available for all users of the system, you can run it without installation from the build directory (see the template for the wrapper script run_avidemux_template.sh.

pchristy

#32
I've been using Avidemux on a Pi400 for some time now without major issues. However, having just upgraded to 2.8.0 - and discovered this thread - I thought I ought to chuck in a few observations!

First of all, my default "go to" system is Slackware64-current (the development branch) on x86_64 machines. There is an unofficial port of this for the Pi (and similar) machines called "slarm64". An official port is on the way, but not ready yet. In the meantime, slarm64 fills the gap and is indistinguishable for all practical purposes.

Slackware's package manager is a bit different from .deb or .rpm in that it does no dependency tracking. The upside of this is that you rarely get into "dependency hell"! The downside is that it is up to you to ensure you have all required dependencies installed!

For ease of building, I wrote a slackbuild script - modifying an existing script - to build avidemux. Building avidemux into a slackware .tgz install-able file is easy this way. Avidemux is built *without* any packaging being selected into a "dummy" install from whence a slackpkg can be created using existing tools. This could easily be modified to create a .deb or .rpm by using checkinstall (for instance) instead of slackware's makepkg.

Here is the slackbuild script:

#!/bin/sh

# Copyright 2008, 2009, 2010, 2011  Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


PKGNAM=avidemux
VERSION=2.8.0
BUILD=${BUILD:-1}

# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) export ARCH=i486 ;;
    arm*) export ARCH=arm ;;
    # Unless $ARCH is already set, use uname -m for all other archs:
      *) export ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-$PKGNAM
rm -rf $PKG
mkdir -p $PKG

# We don't need to do anything about setting CFLAGS or libdirs as the internal
#avidemux build script does this for us.

cd $PKG
tar xvf $CWD/avidemux_$VERSION.tar.gz || exit 1
cd avidemux_$VERSION || exit 1

export CXXFLAGS=-std=c++11

chmod +x bootStrap.bash

./bootStrap.bash ##--debug # We don't need to set any options here.


find $PKG/avidemux_$VERSION/install | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null

  mkdir -p $PKG/avidemux_$VERSION/install/install
  cat $CWD/slack-desc > $PKG/avidemux_$VERSION/install/install/slack-desc

cd $PKG/avidemux_$VERSION/install
/sbin/makepkg -l y -c n $TMP/avidemux_$VERSION-$ARCH-$BUILD.txz

So far so good!

However, one downside of the Pi is that the processor is a little under-powered for video processing using software encoders / decoders. In theory, the SOC can do hardware encoding / decoding, but at present this appears to be a black art! However, the V4l libraries do offer a sort of hardware encode / decode option which considerably reduces the processor load.

My ffmpeg-4.4.1 install detects these:

ffmpeg -codecs | grep H.26
ffmpeg version 4.4.1 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 11.2.0 (GCC)
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --docdir=/usr/doc/ffmpeg-4.4.1/html --mandir=/usr/man --disable-debug --enable-shared --disable-static --enable-gpl --enable-version3 --enable-avresample --arch=aarch64 --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-gnutls --enable-libass --enable-libbluray --enable-libcaca --enable-libcdio --enable-frei0r --enable-openal --enable-libopus --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libmp3lame --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libpulse --enable-libsmbclient --enable-libxml2 --enable-librsvg --enable-libdrm
  libavutil      56. 70.100 / 56. 70.100
  libavcodec    58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter    7.110.100 /  7.110.100
  libavresample  4.  0.  0 /  4.  0.  0
  libswscale      5.  9.100 /  5.  9.100
  libswresample  3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
 DEV.L. flv1                FLV / Sorenson Spark / Sorenson H.263 (Flash Video) (decoders: flv ) (encoders: flv )
 DEV.L. h261                H.261
 DEV.L. h263                H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2 (decoders: h263 h263_v4l2m2m ) (encoders: h263 h263_v4l2m2m )
 D.V.L. h263i                Intel H.263
 DEV.L. h263p                H.263+ / H.263-1998 / H.263 version 2
 DEV.LS h264                H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_v4l2m2m ) (encoders: libx264 libx264rgb h264_v4l2m2m h264_vaapi )
 DEV.L. hevc                H.265 / HEVC (High Efficiency Video Coding) (decoders: hevc hevc_v4l2m2m ) (encoders: libx265 hevc_v4l2m2m hevc_vaapi )
 ..V.L. vvc                  H.266 / VVC (Versatile Video Coding)

NOTE: the v4l2m2m options

Unfortunately, avidemux doesn't appear to pick these up by default. Looking at my ffmpeg configuration, I have an option "--enable-libv4l2" set, which is where I assume the m2m encode / decode comes from.

I must admit that I've got so used to building automatically from a script that I've forgotten how to pass this option to avidemux's ffmpeg build! Perhaps someone could jog my memory!  ;)

Oh, and under slarm64, OpenGl is found by Avidemux.

Hope this helps / is of interest!
--
Pete

eumagga0x2a

Quote from: pchristy on January 02, 2022, 12:34:58 PMmust admit that I've got so used to building automatically from a script that I've forgotten how to pass this option to avidemux's ffmpeg build!

FFmpeg hw accel related build options are set in cmake/admFFmpegBuild_native.cmake, but it is not done just by enabling the backend in FFmpeg.

pchristy

OK, I can see that I probably need to add something like:
if (USE_LIBV4L2)
    xadd(--enable-libv4l2)
    set(FFMPEG_DECODERS ${FFMPEG_DECODERS} h264_v4l2m2m hevc_v4l2m2m)
    set(FFMPEG_ENCODERS ${FFMPEG_ENCODERS} h264_v4l2m2m hevc_v4l2m2m)
endif (USE_LIBV4L2)

(Ignoring for the moment that hevc probably doesn't work - just future proofing! ;) )

but then there must be something (possibly in bootStrap.bash?) to trigger this option. Bearing in mind that the v4l2m2m is an external option, I'm having a little difficulty figuring out how to do this!

In the meantime, I had a look at my x86_64 ffmpeg, and that also has the m2m options built in (Intel graphics - which are actually extremely good for video processing!). My avidemux build does not have it as an option, though it did pick up the Intel hardware options.

Perhaps this is something that avidemux should incorporate by default? It looks as if it is becoming a realistic alternative to vaapi and vdpau, if I'm reading things right...

Cheers,
--
Pete

eumagga0x2a

The CMake variable USE_LIBV4L2 needs to be set and the infrastructure in Avidemux to actually use these FFmpeg features needs to be written.

pchristy

Quote from: eumagga0x2a on January 04, 2022, 07:58:08 PMThe CMake variable USE_LIBV4L2 needs to be set and the infrastructure in Avidemux to actually use these FFmpeg features needs to be written.

I think you've found your first task for the New Year!

 ;D  ;D  ;D
--
Pete

Gew

Is the .deb packages (linked on a Dropbox on page I think 2 in this thread) worth downloading? I mean, will they install without hassle on a Raspberry Pi 4 with a Buster-based Raspian OS, or will I need to do compiling and stuff myself, like you tutor later in this thread? I'm hoping the former will work! ;)