[HowTo] Autoedit – Fully automated DVR with commercial detection

Last update: 2019/06/04
get the latest version with git pull


autoedit

A script to turn Kodi with TVHeadend into a fully automated DVR

Turn your system into a fully automated TV recorder. It’s supposed to just work without further interaction with the end users (wife and kids). In fact they should not even notice anything is happening in the background. The system should just silently do it’s task, record all the favorite series and movies, remove all the advertising junk, convert everything to a decently compressed format and cleanly add every recording to the movie or series library.

For each of these tasks there’s good open source software available. But it is not just a simple download and run. Most needs to be compiled from source and the documentation is incomplete and scattered around the web. Nothing for a beginner at least. Also you have to manually run it on each recorded video. That’s very inconvenient and absolutely not acceptable for a family box.

Follow the steps below to set up the necessary software and install a little script to do all the processing. When it’s done, you just choose what to record and let the system do all the work for you.

Requirements:

This tutorial is supposed to be for everybody who is interested in an automated DVR. Even if you are an absolute beginner you should be able to succeed. No linux or programming skills whatsoever required!

All you need is:

  • A Raspberry Pi (2 or 3 recommended, but even the first models should work). Everything except for the hardware encoding should also work on any other device including the Vero, but I can’t test this.
  • Sufficient storage attached, either via USB or network.
  • OSMC installed and set up.
  • TVHeadend server installed from the OSMC App Store. You need to have everything set up to stream and record TV. There are plenty of good articles on that if you haven’t see here.
  • Crontab from the OSMC App Store – if you want to run the CPU heavy commercial detection and transcoding on an overnight schedule (OPTIONAL).
  • Ca. 2h of leisure time. Don’t be scared, most of the time is compiling so you can do other things in between.

Let’s start:

If you are not interested in one certain feature of my script you can just skip the corresponding steps. All optional components are marked so. Otherwise follow the instructions closely. For the impatient you can simply copy everything from the blue boxes to the command line.

Install ffmpeg

On Debian 9 “Stretch”:

# 1) Make temporary directories for sources and building:
mkdir $HOME/sources
# 2) Install ffmpeg standard package and dev libraries
sudo apt-get update
sudo apt-get install ffmpeg libavcodec-dev libavformat-dev libavutil-dev

DEPRECATED! Only on Debian 8 “Jessie” and earlier:

# 1) Install dependencies:
sudo apt-get update
sudo apt-get install autoconf automake build-essential libass-dev libfreetype6-dev libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev pkg-config texinfo zlib1g-dev yasm libx264-dev cmake mercurial libfdk-aac-dev libmp3lame-dev libopus-dev
# 2) Make temporary directories for sources and building:
mkdir $HOME/sources
mkdir $HOME/sources/ffmpeg
mkdir $HOME/ffmpeg_build
# 3) Compile h.265 software de-/encoder
cd $HOME/sources/ffmpeg
hg clone https://bitbucket.org/multicoreware/x265
cd ~/sources/ffmpeg/x265/build/linux
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED:bool=off ../../source
make -j4
make install
# 4) Compile VP8/VP9 de-/encoder
cd $HOME/sources/ffmpeg
wget http://storage.googleapis.com/downloads.webmproject.org/releases/webm/libvpx-1.5.0.tar.bz2
tar xjvf libvpx-1.5.0.tar.bz2
cd libvpx-1.5.0
./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests
make -j4
make install
make clean
# 5) Compile Raspberry Pi hardware de-/encoder (MMAL and OMX)
cd $HOME/sources/ffmpeg
sudo apt-get install git
git clone git://github.com/raspberrypi/userland
cd userland-master
./buildme
# 6) ffmpeg itself
cd $HOME/sources/ffmpeg
wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
tar xjvf ffmpeg-snapshot.tar.bz2
cd ffmpeg
export LDFLAGS="-L/opt/vc/lib -L/opt/vc/lib/pkgconfig -L/opt/vc/lib/plugins"
export CPPFLAGS='-I/opt/vc/include'
PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --pkg-config-flags="--static" --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-mmal  --enable-decoder=mpeg2_mmal --enable-decoder=mpeg4_mmal --enable-decoder=h264_mmal --enable-decoder=vc1_mmal --enable-omx-rpi --enable-encoder=h264_omx
make -j4
make install
make distclean
cd $HOME
rm -R --interactive=never $HOME/sources/ffmpeg $HOME/ffmpeg_build
hash -r

Install Comskip (OPTIONAL)

(scans a video and marks commercial breaks)

# 7) Install dependencies:
cd $HOME/sources
sudo apt-get install autoconf automake git libargtable2-dev libtool
git clone git://github.com/erikkaashoek/Comskip
cd Comskip
./autogen.sh
./configure
make -j4
sudo make install
cd $HOME
rm -R --interactive=never $HOME/sources/Comskip

Install Filebot (OPTIONAL)

(renames video files to meet the Kodi standards and move files to your library folder)
8) Go to http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html and download the Java SDK „Linux ARM 32 Hard Float ABI“ (YES, ARM 32 even if you are on an RPi 3!) Take note of the Version no. which you’ll need later. In this example it is 8u131 Copy it somewhere to your Pi’s home folder (using Samba, FTP, it doesn’t matter). In the following I assume you placed it under ~/sources/jdk

cd $HOME/sources/jdk
tar -zxf jdk-8u131-linux-arm32-vfp-hflt.tar.gz
sudo mkdir /opt/jre
# 9) We are only interested in the runtime environment JRE, so we're only installing this and dump the rest. Note that the directory contains the version no. You have to adjust this with the one you wrote down.
sudo mv $HOME/sources/jdk/jdk1.8.0_131/jre /opt
sudo update-alternatives --install /usr/bin/java java /opt/jre/bin/java 100
rm -R --interactive=never $HOME/sources/jdk
# 10) Download Filebot
mkdir $HOME/sources/filebot
cd $HOME/sources/filebot
wget https://downloads.sourceforge.net/project/filebot/filebot/FileBot_4.7.9/filebot_4.7.9_armhf.deb
sudo dpkg -i $HOME/sources/filebot/filebot_4.7.9_armhf.deb
cd $HOME
rm -R --interactive=never $HOME/sources/filebot

Install Autoedit

cd /opt
git clone git://github.com/IfThenERROR/autoedit
chmod +x /opt/autoedit/autoedit
sudo update-alternatives --install /usr/bin/autoedit autoedit /opt/autoedit/autoedit 100
cp /opt/autoedit/comskip.ini $HOME/
nano /opt/autoedit/settings.txt

Change the settings to your liking. Especially the outfolder and language need to be set.

Set Cron job (OPTIONAL)

  1. To run all the magic overnight we want to create a schedule. The following runs autoedit every night on 2am. Change the time as you like.
crontab -e

Paste in the last line

0 2 * * * bash -l -c autoedit

Hit Ctrl+o and Ctrl+x to save.

Check if everything works

  1. Now let’s test all the installed parts.
java -version

Should output Java(TM) SE Runtime Environment (build 1.8.0_xxx-xxx)

ffmpeg -encoders | grep omx

Should output V..... h264_omx OpenMAX IL H.264 video encoder (codec h264)

comskip

Should output ComSkip: missing option <file>

autoedit --help

Should output Usage: bash autoedit (options) …

Tadaaaaa! Everything is ready.

Configure TVHeadend:

Now let’s hook up autoedit in TVHeadend. Open a browser and go to the TVHeadend interface (http://your_RPi_IP:9981). Go to Configuration→Recording and in the (Default Profile). In the field for „Post-Processor Command“ enter:

/usr/bin/autoedit --input "%f" --title "%t" --comskip --transcode mpeg2_mmal h264_omx 2000k --rename --wait

–input : This is the file to process, %f makes TVHeadend deliver the full path.

–title : Use this for series title. If not set autoedit will try to read the title from the metadata if present.

–episode : Use this for episode name. If not set autoedit will try to read the episode from the description in the metadata.

–comskip : Marks commercials for automatic skipping using Comskip.

–transcode [decoder] [encoder] [bitrate]: Transcodes the video using ffmpeg. The sample above does de- and encoding in RPi’s hardware and hence is pretty fast but only medium quality. For SD videos it’s near 90 fps. Make sure you use the correct settings here.

–rename : Rename the file to a Kodi compatible format using filebot.

–wait : Do not start processing immediately, just queue the video.

Also create a seccond profile for movies as filebot can’t reliably distinguish between movies and series. All settings here are the same as above, but „Post-Processor Command“ is „Post-Processor Command“ enter:

/usr/bin/autoedit --input "%f" --title "%t" --comskip --transcode mpeg2_mmal h264_omx 2000k --rename --movie --wait

Known issues:

  • Quite many TV networks suck big time in properly labeling their broadcasts. They add fancy additions to series’ titles, don’t use the correct fields in the metadata and generally mess things up a lot. I wrote the postscript as robust as possible, and tried to remove the most common junk. But still sometimes the tags are just too messed up. So it doesn’t hurt to check your recording folder and the postscript’s log some here and then. If you regularly have problems with a series you can edit the script. The corresponding code is somewhere around line 100.
  • Your video directory in the settings.txt should not contain blank spaces as Comskip is officially not able to handle these. It seems to still work, but is not thoroughly tested.
  • Also if Comskip is set to decode in hardware, the little Raspberry is to busy to play a video smoothly at the same time. So Either turn of hardware decoding in the comskip.ini, or set the script to run nightly with cron.
  • The standard package in Debian Stretch does not contain the h.265 decoder. If you wish to process videos with this compression, you need to resort to building ffmpeg from source. In this case refer to the instructions for Debian Jessie.
  • If your system crashed not all is lost. Again the script is designed to be robust. You can resume an interupted run by entering „autoedit --forcerun“. This will try to pick up where it left.
3 Likes

Nice guide.

I have been working on something similar for myself. (I have a separate Raspberry Pi running tvheadend/comskip that my OSMC Pi connects to, but its fundamentally no different to running it all on the same OSMC)

Also Comskip is currently not capable of decoding in hardware on the little Raspberry. So running on HD videos is kinda slow.

I modified the source for Comskip so that it can use the mpeg2_mmal hardware assisted decoder.

I just posted about it here → http://www.kaashoek.com/comskip/viewtopic.php?t=1806

With the faster hardware decoding it is possible to use tvheadend’s “Pre-processor command:” to run comskip in “live” mode, but since the filename is not available, you have to have your script find the file using -mtime timestamps.

Sweet! I’ll have a closer look at it and see if I can expand it to also use h264_mmal. Then we could try and improve Comskip for the RPi.

@ObvB: Could you please upload your complete modified source code? I tried to add the snippet you provided but end up in an error message when running comskip:

Codec not supported.

Please also tell which build of ffmpeg you use. What is the output of

ffmpeg -decoders | grep mmal

Here is the complete notes I have on what I did to build FFMpeg/Comskip

http://paste.osmc.io/raw/evadaleyog

Really its nothing more than those few lines I posted over at comskip.org.

pi@piserver:~ $ ffmpeg -decoders | grep mmal
ffmpeg version 3.3 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 4.9.2 (Raspbian 4.9.2-10)
configuration: --prefix=/home/pi/ffmpeg_build --pkg-config-flags=–static --extra-cflags=-I/home/pi/ffmpeg_build/include --extra-ldflags=-L/home/pi/ffmpeg_build/lib --bindir=/home/pi/bin --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --enable-mmal --enable-decoder=mpeg2_mmal --enable-decoder=mpeg4_mmal --enable-decoder=h264_mmal
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
V… h264_mmal h264 (mmal) (codec h264)
V… mpeg2_mmal mpeg2 (mmal) (codec mpeg2video)
V… mpeg4_mmal mpeg4 (mmal) (codec mpeg4)
V… vc1_mmal vc1 (mmal) (codec vc1)

Now that is interesting!

Your build parameters for ffmpeg differ, so I tried rebuilding this way. Now the modified comskip still reports the error „Unsupported codec“, but runs sucessfully and about twice as fast.

If you don’t mind, could you check the exact output to command line when you run comskip?
Here it’s like this:

pi@piserver:/mnt/t2/tvheadend $ /usr/local/bin/comskip --ini=/mnt/t2/tvheadend/comskip_live.ini -t /mnt/t2/tvheadend/CBS-Evening-News-With-Scott-Pelley-_^^^2017-06-01^18-30.ts
Comskip 0.81.089, made using ffmpeg
Donator build
The commandline used was: /usr/local/bin/comskip --ini=/mnt/t2/tvheadend/comskip_live.ini -t/mnt/t2/tvheadend/CBS-Evening-News-With-Scott-Pelley-_^^^2017-06-01^18-30.ts

Setting ini file to /mnt/t2/tvheadend/comskip_live.ini as per commandline
No INI file found in current directory.  Searching PATH...
INI file found at comskip.ini
No INI file found anywhere!!!!
Auto selecting the PID.
0:29:57 - 57021 frames in 1154.61 sec(49.39 fps), 1.00 sec(48.00 fps), 99% 57051 frames decoded in 1155.21 seconds (49.39 fps)
Commercials were found.
pi@piserver:/mnt/t2/tvheadend $

(Not quite sure why it continues to look for comskip.ini after it has already found the one specified in the command line, but it appears to do the right thing anyway) (Edit … I specified wrong path, so it didn’t find it … was working with defaults)

Not sure if it should make a difference, but I have tvheadend output in .ts format. I have tried using .mkv in the past, but I had problems (don’t recall what they were now) so I have always stuck with .ts which works well enough for me.

The video is 1080i US Network broadcast. As you can see, it does a half hour show in about 20 mins. Without mpeg2_mmal, it was taking over 40 mins, and used a lot more CPU as one might expect.


EDIT 2

OK, so I thought that because it worked on my Raspbian Rpi, that it would also work on OSMC …

But, ffmpeg ./configure failed with the option “–enable-mmal”.

Removing “–enable-mmal”, but keeping “–enable-decoder=mpeg2_mmal” (and mpeg4_mmal and h264_mmal) built ffmpeg, but …

osmc@osmc:~ $ ~/bin/ffmpeg -vcodec mpeg2_mmal -i testfile.ts -f null -
ffmpeg version 3.3 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 4.9.2 (Debian 4.9.2-10)
  configuration: --prefix=/home/osmc/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/osmc/ffmpeg_build/include --extra-ldflags=-L/home/osmc/ffmpeg_build/lib --bindir=/home/osmc/bin --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --enable-decoder=mpeg2_mmal --enable-decoder=mpeg4_mmal --enable-decoder=h264_mmal
   ...
Unknown decoder 'mpeg2_mmal'

and

osmc@osmc:~ $ /usr/local/bin/comskip -t testfile.ts
Comskip 0.81.089, made using ffmpeg
Donator build
...
Unsupported codec!
Could not open video codec

:cry:


EDIT 3

“piserver” = Raspberry Pi 2 running Raspbian, tvheadend, USB attached HD
“osmc” = Raspberry Pi 2 running OSMC

I copied the executables, ffmpeg and comskip from “piserver” to “osmc”, and it works !!!

BUT … while “piserver” can record from tvheadend, run comskip with mmal decode, and stream the same HD MPEG2 to “osmc” all at the same time without much difficulty, … “osmc” can’t handle running comskip with mmal decode while watching at the same time. The hardware apparently cannot keep up with decoding two HD streams in real time.

That is exactly the reason why I suggest scheduling all the processing to night hours. All hw accellerated de- and encoding will only put low stress on the cpu so you will most likely not notice anything at the Kodi interface. But in video playback I’d expect perceptible glitches and stuttering.

Did you follow the instructions above? On OSMC you have to compile the RPi userland first. Then it should all go smoothly.

:doh:

I was just repeating what I did on the Raspbain Pi …

I adjusted Comskip based on your suggestion. It does hw decoding of mpeg2 and h264 and is multiple times faster. Very nice! :grinning:

Still I’m surprised the cpu is still loaded higher than 1 core at 100%. Just out of curiosity, could you try out git clone git://github.com/IfThenERROR/autoedit and check if it performs equally to your quick n dirty solution?

First off, thank you fretzke for providing clear detailed instructions on how to get a fully automated commercial cutting DVR working on the raspi. Much needed tutorial.

After successfully install ffmpeg per your instructions, I then proceeded to install Comskip. Everything went fine until I attempted to make Comskip. I received this error.

osmc@osmc:~/sources/Comskip$ sudo make -j4
gcc -g -O2    -o comskip comskip-comskip.o comskip-mpeg2dec.o comskip-platform.o comskip-video_out_dx.o ccextratorwin/comskip-608.o ccextratorwin/comskip-ccextractor.o ccextratorwin/comskip-encoding.o ccextratorwin/comskip-general_loop.o ccextratorwin/comskip-myth.o -largtable2  -L/usr/local/lib -L/home/osmc/ffmpeg_build/lib -L/usr/local/lib -L/home/osmc/ffmpeg_build/lib -L/usr/local/lib -lavformat -ldl -lass -lm -lharfbuzz -lfontconfig -lexpat -lfreetype -lexpat -lenca -lm -lfribidi -lfreetype -lz -lpng12 -lvdpau -lX11 -lva -lva-x11 -lX11 -lva -lva-drm -lva -lxcb -lXau -lXdmcp -lxcb-shm -lxcb -lXau -lXdmcp -lxcb-xfixes -lxcb-render -lxcb-shape -lxcb -lXau -lXdmcp -lxcb-shape -lxcb -lXau -lXdmcp -lasound -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host -lx265 -lstdc++ -lm -lrt -ldl -lx264 -lpthread -lm -ldl -lvpx -lm -lpthread -lvpx -lm -lpthread -lvpx -lm -lpthread -lvpx -lm -lpthread -lvorbisenc -lvorbis -logg -ltheoraenc -ltheoradec -logg -lopus -lm -lopus -lm -lmp3lame -lfreetype -lz -lpng12 -lfdk-aac -lm -lass -lm -lharfbuzz -lfontconfig -lexpat -lfreetype -lexpat -lenca -lm -lfribidi -lfreetype -lz -lpng12 -lm -lz -pthread -lavcodec -ldl -lass -lm -lharfbuzz -lfontconfig -lexpat -lfreetype -lexpat -lenca -lm -lfribidi -lfreetype -lz -lpng12 -lvdpau -lX11 -lva -lva-x11 -lX11 -lva -lva-drm -lva -lxcb -lXau -lXdmcp -lxcb-shm -lxcb -lXau -lXdmcp -lxcb-xfixes -lxcb-render -lxcb-shape -lxcb -lXau -lXdmcp -lxcb-shape -lxcb -lXau -lXdmcp -lasound -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host -lx265 -lstdc++ -lm -lrt -ldl -lx264 -lpthread -lm -ldl -lvpx -lm -lpthread -lvpx -lm -lpthread -lvpx -lm -lpthread -lvpx -lm -lpthread -lvorbisenc -lvorbis -logg -ltheoraenc -ltheoradec -logg -lopus -lm -lopus -lm -lmp3lame -lfreetype -lz -lpng12 -lfdk-aac -lm -lass -lm -lharfbuzz -lfontconfig -lexpat -lfreetype -lexpat -lenca -lm -lfribidi -lfreetype -lz -lpng12 -lm -lz -pthread -lswresample -lm -lavutil -lm   -lpthread -lm 
gcc -g -O2    -o comskip-gui comskip_gui-comskip.o comskip_gui-mpeg2dec.o comskip_gui-platform.o comskip_gui-video_out_dx.o ccextratorwin/comskip_gui-608.o ccextratorwin/comskip_gui-ccextractor.o ccextratorwin/comskip_gui-encoding.o ccextratorwin/comskip_gui-general_loop.o ccextratorwin/comskip_gui-myth.o comskip_gui-video_out_sdl.o -largtable2  -L/usr/local/lib -L/home/osmc/ffmpeg_build/lib -L/usr/local/lib -L/home/osmc/ffmpeg_build/lib -L/usr/local/lib -lavformat -ldl -lass -lm -lharfbuzz -lfontconfig -lexpat -lfreetype -lexpat -lenca -lm -lfribidi -lfreetype -lz -lpng12 -lvdpau -lX11 -lva -lva-x11 -lX11 -lva -lva-drm -lva -lxcb -lXau -lXdmcp -lxcb-shm -lxcb -lXau -lXdmcp -lxcb-xfixes -lxcb-render -lxcb-shape -lxcb -lXau -lXdmcp -lxcb-shape -lxcb -lXau -lXdmcp -lasound -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host -lx265 -lstdc++ -lm -lrt -ldl -lx264 -lpthread -lm -ldl -lvpx -lm -lpthread -lvpx -lm -lpthread -lvpx -lm -lpthread -lvpx -lm -lpthread -lvorbisenc -lvorbis -logg -ltheoraenc -ltheoradec -logg -lopus -lm -lopus -lm -lmp3lame -lfreetype -lz -lpng12 -lfdk-aac -lm -lass -lm -lharfbuzz -lfontconfig -lexpat -lfreetype -lexpat -lenca -lm -lfribidi -lfreetype -lz -lpng12 -lm -lz -pthread -lavcodec -ldl -lass -lm -lharfbuzz -lfontconfig -lexpat -lfreetype -lexpat -lenca -lm -lfribidi -lfreetype -lz -lpng12 -lvdpau -lX11 -lva -lva-x11 -lX11 -lva -lva-drm -lva -lxcb -lXau -lXdmcp -lxcb-shm -lxcb -lXau -lXdmcp -lxcb-xfixes -lxcb-render -lxcb-shape -lxcb -lXau -lXdmcp -lxcb-shape -lxcb -lXau -lXdmcp -lasound -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host -lx265 -lstdc++ -lm -lrt -ldl -lx264 -lpthread -lm -ldl -lvpx -lm -lpthread -lvpx -lm -lpthread -lvpx -lm -lpthread -lvpx -lm -lpthread -lvorbisenc -lvorbis -logg -ltheoraenc -ltheoradec -logg -lopus -lm -lopus -lm -lmp3lame -lfreetype -lz -lpng12 -lfdk-aac -lm -lass -lm -lharfbuzz -lfontconfig -lexpat -lfreetype -lexpat -lenca -lm -lfribidi -lfreetype -lz -lpng12 -lm -lz -pthread -lswresample -lm -lavutil -lm  -lSDL   -lpthread -lm 
/usr/bin/ld: cannot find -lmmal_core
/usr/bin/ld: cannot find -lmmal_util
/usr/bin/ld: cannot find -lmmal_vc_client
/usr/bin/ld: cannot find -lbcm_host
/usr/bin/ld: cannot find -lx265
/usr/bin/ld: cannot find -lmmal_core
/usr/bin/ld: cannot find -lmmal_util
/usr/bin/ld: cannot find -lmmal_vc_client
/usr/bin/ld: cannot find -lbcm_host
/usr/bin/ld: cannot find -lx265
collect2: error: ld returned 1 exit status
Makefile:465: recipe for target 'comskip-gui' failed
make: *** [comskip-gui] Error 1
make: *** Waiting for unfinished jobs....
collect2: error: ld returned 1 exit status
Makefile:446: recipe for target 'comskip' failed
make: *** [comskip] Error 1

I tried to debug using ld, which returned the following.

osmc@osmc:~/sources/Comskip$ ld -lmmal_core --verbose
GNU ld (GNU Binutils for Debian) 2.25
  Supported emulations:
   armelf_linux_eabi
   armelfb_linux_eabi
using internal linker script:
==================================================
/* Script for -z combreloc: combine and sort reloc sections */
/* Copyright (C) 2014 Free Software Foundation, Inc.
   Copying and distribution of this script, with or without modification,
   are permitted in any medium without royalty provided the copyright
   notice and this notice are preserved.  */
OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm",
	      "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SEARCH_DIR("=/usr/arm-linux-gnueabihf/lib"); SEARCH_DIR("=/usr/local/lib/arm-linux-gnueabihf"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib/arm-linux-gnueabihf"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib/arm-linux-gnueabihf"); SEARCH_DIR("=/usr/lib");
SECTIONS
{
  /* Read-only sections, merged into text segment: */
  PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x00010000)); . = SEGMENT_START("text-segment", 0x00010000) + SIZEOF_HEADERS;
  .interp         : { *(.interp) }
  .note.gnu.build-id : { *(.note.gnu.build-id) }
  .hash           : { *(.hash) }
  .gnu.hash       : { *(.gnu.hash) }
  .dynsym         : { *(.dynsym) }
  .dynstr         : { *(.dynstr) }
  .gnu.version    : { *(.gnu.version) }
  .gnu.version_d  : { *(.gnu.version_d) }
  .gnu.version_r  : { *(.gnu.version_r) }
  .rel.dyn        :
    {
      *(.rel.init)
      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
      *(.rel.fini)
      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
      *(.rel.data.rel.ro .rel.data.rel.ro.* .rel.gnu.linkonce.d.rel.ro.*)
      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
      *(.rel.ctors)
      *(.rel.dtors)
      *(.rel.got)
      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
      PROVIDE_HIDDEN (__rel_iplt_start = .);
      *(.rel.iplt)
      PROVIDE_HIDDEN (__rel_iplt_end = .);
    }
  .rela.dyn       :
    {
      *(.rela.init)
      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
      *(.rela.fini)
      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
      *(.rela.ctors)
      *(.rela.dtors)
      *(.rela.got)
      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
      PROVIDE_HIDDEN (__rela_iplt_start = .);
      *(.rela.iplt)
      PROVIDE_HIDDEN (__rela_iplt_end = .);
    }
  .rel.plt        :
    {
      *(.rel.plt)
    }
  .rela.plt       :
    {
      *(.rela.plt)
    }
  .init           :
  {
    KEEP (*(SORT_NONE(.init)))
  }
  .plt            : { *(.plt) }
  .iplt           : { *(.iplt) }
  .text           :
  {
    *(.text.unlikely .text.*_unlikely .text.unlikely.*)
    *(.text.exit .text.exit.*)
    *(.text.startup .text.startup.*)
    *(.text.hot .text.hot.*)
    *(.text .stub .text.* .gnu.linkonce.t.*)
    /* .gnu.warning sections are handled specially by elf32.em.  */
    *(.gnu.warning)
    *(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)
  }
  .fini           :
  {
    KEEP (*(SORT_NONE(.fini)))
  }
  PROVIDE (__etext = .);
  PROVIDE (_etext = .);
  PROVIDE (etext = .);
  .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  .rodata1        : { *(.rodata1) }
  .ARM.extab   : { *(.ARM.extab* .gnu.linkonce.armextab.*) }
   PROVIDE_HIDDEN (__exidx_start = .);
  .ARM.exidx   : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) }
   PROVIDE_HIDDEN (__exidx_end = .);
  .eh_frame_hdr : { *(.eh_frame_hdr) }
  .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) }
  .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table
  .gcc_except_table.*) }
  /* These sections are generated by the Sun/Oracle C++ compiler.  */
  .exception_ranges   : ONLY_IF_RO { *(.exception_ranges
  .exception_ranges*) }
  /* Adjust the address for the data segment.  We want to adjust up to
     the same address within the page on the next page up.  */
  . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
  /* Exception handling  */
  .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) }
  .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
  .exception_ranges   : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) }
  /* Thread Local Storage sections  */
  .tdata	  : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
  .tbss		  : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  .preinit_array     :
  {
    PROVIDE_HIDDEN (__preinit_array_start = .);
    KEEP (*(.preinit_array))
    PROVIDE_HIDDEN (__preinit_array_end = .);
  }
  .init_array     :
  {
    PROVIDE_HIDDEN (__init_array_start = .);
    KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
    KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
    PROVIDE_HIDDEN (__init_array_end = .);
  }
  .fini_array     :
  {
    PROVIDE_HIDDEN (__fini_array_start = .);
    KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
    KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
    PROVIDE_HIDDEN (__fini_array_end = .);
  }
  .ctors          :
  {
    /* gcc uses crtbegin.o to find the start of
       the constructors, so we make sure it is
       first.  Because this is a wildcard, it
       doesn't matter if the user does not
       actually link against crtbegin.o; the
       linker won't look for a file to match a
       wildcard.  The wildcard also means that it
       doesn't matter which directory crtbegin.o
       is in.  */
    KEEP (*crtbegin.o(.ctors))
    KEEP (*crtbegin?.o(.ctors))
    /* We don't want to include the .ctor section from
       the crtend.o file until after the sorted ctors.
       The .ctor section from the crtend file contains the
       end of ctors marker and it must be last */
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
    KEEP (*(SORT(.ctors.*)))
    KEEP (*(.ctors))
  }
  .dtors          :
  {
    KEEP (*crtbegin.o(.dtors))
    KEEP (*crtbegin?.o(.dtors))
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
    KEEP (*(SORT(.dtors.*)))
    KEEP (*(.dtors))
  }
  .jcr            : { KEEP (*(.jcr)) }
  .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
  .dynamic        : { *(.dynamic) }
  . = DATA_SEGMENT_RELRO_END (0, .);
  .got            : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) }
  .data           :
  {
    PROVIDE (__data_start = .);
    *(.data .data.* .gnu.linkonce.d.*)
    SORT(CONSTRUCTORS)
  }
  .data1          : { *(.data1) }
  _edata = .; PROVIDE (edata = .);
  . = .;
  __bss_start = .;
  __bss_start__ = .;
  .bss            :
  {
   *(.dynbss)
   *(.bss .bss.* .gnu.linkonce.b.*)
   *(COMMON)
   /* Align here to ensure that the .bss section occupies space up to
      _end.  Align after .bss to ensure correct alignment even if the
      .bss section disappears because there are no input sections.
      FIXME: Why do we need it? When there is no .bss section, we don't
      pad the .data section.  */
   . = ALIGN(. != 0 ? 32 / 8 : 1);
  }
  _bss_end__ = . ; __bss_end__ = . ;
  . = ALIGN(32 / 8);
  . = SEGMENT_START("ldata-segment", .);
  . = ALIGN(32 / 8);
  __end__ = . ;
  _end = .; PROVIDE (end = .);
  . = DATA_SEGMENT_END (.);
  /* Stabs debugging sections.  */
  .stab          0 : { *(.stab) }
  .stabstr       0 : { *(.stabstr) }
  .stab.excl     0 : { *(.stab.excl) }
  .stab.exclstr  0 : { *(.stab.exclstr) }
  .stab.index    0 : { *(.stab.index) }
  .stab.indexstr 0 : { *(.stab.indexstr) }
  .comment       0 : { *(.comment) }
  /* DWARF debug sections.
     Symbols in the DWARF debugging sections are relative to the beginning
     of the section so we begin them at 0.  */
  /* DWARF 1 */
  .debug          0 : { *(.debug) }
  .line           0 : { *(.line) }
  /* GNU DWARF 1 extensions */
  .debug_srcinfo  0 : { *(.debug_srcinfo) }
  .debug_sfnames  0 : { *(.debug_sfnames) }
  /* DWARF 1.1 and DWARF 2 */
  .debug_aranges  0 : { *(.debug_aranges) }
  .debug_pubnames 0 : { *(.debug_pubnames) }
  /* DWARF 2 */
  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
  .debug_abbrev   0 : { *(.debug_abbrev) }
  .debug_line     0 : { *(.debug_line .debug_line.* .debug_line_end ) }
  .debug_frame    0 : { *(.debug_frame) }
  .debug_str      0 : { *(.debug_str) }
  .debug_loc      0 : { *(.debug_loc) }
  .debug_macinfo  0 : { *(.debug_macinfo) }
  /* SGI/MIPS DWARF 2 extensions */
  .debug_weaknames 0 : { *(.debug_weaknames) }
  .debug_funcnames 0 : { *(.debug_funcnames) }
  .debug_typenames 0 : { *(.debug_typenames) }
  .debug_varnames  0 : { *(.debug_varnames) }
  /* DWARF 3 */
  .debug_pubtypes 0 : { *(.debug_pubtypes) }
  .debug_ranges   0 : { *(.debug_ranges) }
  /* DWARF Extension.  */
  .debug_macro    0 : { *(.debug_macro) }
  .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
  /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
}


==================================================
attempt to open //usr/arm-linux-gnueabihf/lib/libmmal_core.so failed
attempt to open //usr/arm-linux-gnueabihf/lib/libmmal_core.a failed
attempt to open //usr/local/lib/arm-linux-gnueabihf/libmmal_core.so failed
attempt to open //usr/local/lib/arm-linux-gnueabihf/libmmal_core.a failed
attempt to open //usr/local/lib/libmmal_core.so failed
attempt to open //usr/local/lib/libmmal_core.a failed
attempt to open //lib/arm-linux-gnueabihf/libmmal_core.so failed
attempt to open //lib/arm-linux-gnueabihf/libmmal_core.a failed
attempt to open //lib/libmmal_core.so failed
attempt to open //lib/libmmal_core.a failed
attempt to open //usr/lib/arm-linux-gnueabihf/libmmal_core.so failed
attempt to open //usr/lib/arm-linux-gnueabihf/libmmal_core.a failed
attempt to open //usr/lib/libmmal_core.so failed
attempt to open //usr/lib/libmmal_core.a failed

Sorry for the huge blocks of code, but I figured it would provide the best info for a quick understanding of the problem with the build.

Any help or direction would be much appreciated.

1 Like

Hi t2rich,

it seems the comskip GUI causes problems. I prefer to build the program without GUI in the first place since we’re only using the command line anyway.

I will not go into more details of my quick and very dirty solution here! :wink: I adjusted the makefile in my fork of comskip. Please delete the complete folder and clone again. I hope the error is gone then.

1 Like

Works for me on my raspbian pi, the same as my hard-coded solution except of course now I tell it to use hardware decode in the .ini or command line.

Thanks for the quick reply fretze, but the error persists.

I deleted Comskip, cloned the repository again, ran a quick git pull to make sure it was up-to-date, but I can the same error as before using running make.

/usr/bin/ld: cannot find -lmmal_core
/usr/bin/ld: cannot find -lmmal_util
/usr/bin/ld: cannot find -lmmal_vc_client
/usr/bin/ld: cannot find -lbcm_host
/usr/bin/ld: cannot find -lx265
collect2: error: ld returned 1 exit status
Makefile:423: recipe for target ‘comskip’ failed
make: *** [comskip] Error 1

What version of osmc are you running? I’m on a built from source 4.9.29-5-osmc.

1 Like

I wrote the instructions on a previous version, did not take notes which one. Just retried it on the current “2017.05-2” and all is well. There is no reason for me to compile from source when Sam makes perfectly usable images available, so I never tried that though.

The missing libraries all point to optional components of ffmpeg (namingly the Raspberry’s HW decoder and x.265). Did you follow all steps of the instructions above or did you skip some optional part? If the RPi libraries compiled successfully you should have a folder /opt/vc/lib containing the optional software for the BCM Video Core. There should be a file libmmal_core.so and similar files as ld reports missing for you.

1 Like

Okay, so I started all over again, installing OSMC using the install GUI, and then updating tp the latest version (May release) using the OSMC update interface. So now my version number is 4.9.29-5-osmc running on raspi 3.

I carefully followed all instructions, checking my history to ensure that I had indeed copy and pasted all commands correctly, and I encountered my first error when trying to make h.256

osmc@osmc:~/sources/ffmpeg/x265/build/linux$ cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED:bool=off ../../source
-- cmake version 3.0.2
-- Detected ARM target processor
-- Could NOT find NUMA (missing:  NUMA_ROOT_DIR NUMA_INCLUDE_DIR NUMA_LIBRARY) 
-- hg found at /usr/bin/hg
-- x265 version 2.4+68-011e09a0d4b2
-- Configuring done
-- Generating done
-- Build files have been written to: /home/osmc/sources/ffmpeg/x265/build/linux
osmc@osmc:~/sources/ffmpeg/x265/build/linux$ make
[  1%] Building CXX object common/CMakeFiles/common.dir/arm/asm-primitives.cpp.o
*** Error in `/usr/bin/c++': double free or corruption (top): 0x01f7a7f0 ***
Aborted
common/CMakeFiles/common.dir/build.make:54: recipe for target 'common/CMakeFiles/common.dir/arm/asm-primitives.cpp.o' failed
make[2]: *** [common/CMakeFiles/common.dir/arm/asm-primitives.cpp.o] Error 134
CMakeFiles/Makefile2:258: recipe for target 'common/CMakeFiles/common.dir/all' failed
make[1]: *** [common/CMakeFiles/common.dir/all] Error 2
Makefile:117: recipe for target 'all' failed
make: *** [all] Error 2

This seems to be a common bug on raspi 3 builds using gcc 4.9.2, so I modified the Makefiles by replacing every instance of “-mcpu=native” with “-mcpu=cortex-a53”
and “-march=native” with “-march=armv8-a”. That seemed to fixed the make problem and all else went well with building and installing ffmpeg (i.e. successful build with no errors). To be sure that everything was indeed installed, I ran a quick ls /opt/vc/lib and ffmpeg -encoders | grep omx.

osmc@osmc:~/sources/Comskip$ ls /opt/vc/lib/
libbcm_host.so    libdebug_sym_static.a  libGLESv2_static.a     libmmal_vc_client.so  libvcos.so
libbrcmEGL.so     libdtovl.so            libkhrn_client.a       libopenmaxil.so       libvcsm.so
libbrcmGLESv2.so  libEGL.so              libkhrn_static.a       libOpenVG.so          libWFC.so
libbrcmOpenVG.so  libEGL_static.a        libmmal_components.so  libvcfiled_check.a    pkgconfig
libbrcmWFC.so     libelftoolchain.so     libmmal_core.so        libvchiq_arm.so       plugins
libcontainers.so  libGLESv1_CM.so        libmmal.so             libvchostif.a
libdebug_sym.so   libGLESv2.so 

osmc@osmc:~/sources/Comskip$ ffmpeg -encoders | grep omx
ffmpeg version N-86499-g1edbf5e Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 4.9.2 (Debian 4.9.2-10)
  configuration: --pkg-config-flags=--static --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-mmal --enable-decoder=mpeg2_mmal --enable-decoder=mpeg4_mmal --enable-decoder=h264_mmal --enable-decoder=vc1_mmal --enable-omx-rpi --enable-encoder=h264_omx
  libavutil      55. 66.100 / 55. 66.100
  libavcodec     57. 99.100 / 57. 99.100
  libavformat    57. 73.100 / 57. 73.100
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 92.100 /  6. 92.100
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
 V..... h264_omx             OpenMAX IL H.264 video encoder (codec h264)

I then proceeded to follow the comskip instructions. And once again I had the same error as before

osmc@osmc:~/sources/Comskip$ make -j4
gcc -DPACKAGE_NAME=\"Comskip\" -DPACKAGE_TARNAME=\"comskip\" -DPACKAGE_VERSION=\"0.81.098\" -DPACKAGE_STRING=\"Comskip\ 0.81.098\" -DPACKAGE_BUGREPORT=\"https://github.com/erikkaashoek/Comskip/issues\" -DPACKAGE_URL=\"\" -DPACKAGE=\"comskip\" -DVERSION=\"0.81.098\" -DHAVE_LIBM=1 -DHAVE_LIBPTHREAD=1 -I.  -Wall  -I/usr/local/include  -DPROCESS_CC -DDONATOR  -g -O2  -MT comskip-comskip.o -MD -MP -MF .deps/comskip-comskip.Tpo -c -o comskip-comskip.o `test -f 'comskip.c' || echo './'`comskip.c
gcc -DPACKAGE_NAME=\"Comskip\" -DPACKAGE_TARNAME=\"comskip\" -DPACKAGE_VERSION=\"0.81.098\" -DPACKAGE_STRING=\"Comskip\ 0.81.098\" -DPACKAGE_BUGREPORT=\"https://github.com/erikkaashoek/Comskip/issues\" -DPACKAGE_URL=\"\" -DPACKAGE=\"comskip\" -DVERSION=\"0.81.098\" -DHAVE_LIBM=1 -DHAVE_LIBPTHREAD=1 -I.  -Wall  -I/usr/local/include  -DPROCESS_CC -DDONATOR  -g -O2  -MT comskip-mpeg2dec.o -MD -MP -MF .deps/comskip-mpeg2dec.Tpo -c -o comskip-mpeg2dec.o `test -f 'mpeg2dec.c' || echo './'`mpeg2dec.c
gcc -DPACKAGE_NAME=\"Comskip\" -DPACKAGE_TARNAME=\"comskip\" -DPACKAGE_VERSION=\"0.81.098\" -DPACKAGE_STRING=\"Comskip\ 0.81.098\" -DPACKAGE_BUGREPORT=\"https://github.com/erikkaashoek/Comskip/issues\" -DPACKAGE_URL=\"\" -DPACKAGE=\"comskip\" -DVERSION=\"0.81.098\" -DHAVE_LIBM=1 -DHAVE_LIBPTHREAD=1 -I.  -Wall  -I/usr/local/include  -DPROCESS_CC -DDONATOR  -g -O2  -MT comskip-platform.o -MD -MP -MF .deps/comskip-platform.Tpo -c -o comskip-platform.o `test -f 'platform.c' || echo './'`platform.c
gcc -DPACKAGE_NAME=\"Comskip\" -DPACKAGE_TARNAME=\"comskip\" -DPACKAGE_VERSION=\"0.81.098\" -DPACKAGE_STRING=\"Comskip\ 0.81.098\" -DPACKAGE_BUGREPORT=\"https://github.com/erikkaashoek/Comskip/issues\" -DPACKAGE_URL=\"\" -DPACKAGE=\"comskip\" -DVERSION=\"0.81.098\" -DHAVE_LIBM=1 -DHAVE_LIBPTHREAD=1 -I.  -Wall  -I/usr/local/include  -DPROCESS_CC -DDONATOR  -g -O2  -MT comskip-video_out_dx.o -MD -MP -MF .deps/comskip-video_out_dx.Tpo -c -o comskip-video_out_dx.o `test -f 'video_out_dx.c' || echo './'`video_out_dx.c
mv -f .deps/comskip-video_out_dx.Tpo .deps/comskip-video_out_dx.Po
gcc -DPACKAGE_NAME=\"Comskip\" -DPACKAGE_TARNAME=\"comskip\" -DPACKAGE_VERSION=\"0.81.098\" -DPACKAGE_STRING=\"Comskip\ 0.81.098\" -DPACKAGE_BUGREPORT=\"https://github.com/erikkaashoek/Comskip/issues\" -DPACKAGE_URL=\"\" -DPACKAGE=\"comskip\" -DVERSION=\"0.81.098\" -DHAVE_LIBM=1 -DHAVE_LIBPTHREAD=1 -I.  -Wall  -I/usr/local/include  -DPROCESS_CC -DDONATOR  -g -O2  -MT ccextratorwin/comskip-608.o -MD -MP -MF ccextratorwin/.deps/comskip-608.Tpo -c -o ccextratorwin/comskip-608.o `test -f 'ccextratorwin/608.c' || echo './'`ccextratorwin/608.c
mv -f .deps/comskip-platform.Tpo .deps/comskip-platform.Po
gcc -DPACKAGE_NAME=\"Comskip\" -DPACKAGE_TARNAME=\"comskip\" -DPACKAGE_VERSION=\"0.81.098\" -DPACKAGE_STRING=\"Comskip\ 0.81.098\" -DPACKAGE_BUGREPORT=\"https://github.com/erikkaashoek/Comskip/issues\" -DPACKAGE_URL=\"\" -DPACKAGE=\"comskip\" -DVERSION=\"0.81.098\" -DHAVE_LIBM=1 -DHAVE_LIBPTHREAD=1 -I.  -Wall  -I/usr/local/include  -DPROCESS_CC -DDONATOR  -g -O2  -MT ccextratorwin/comskip-ccextractor.o -MD -MP -MF ccextratorwin/.deps/comskip-ccextractor.Tpo -c -o ccextratorwin/comskip-ccextractor.o `test -f 'ccextratorwin/ccextractor.c' || echo './'`ccextratorwin/ccextractor.c
mpeg2dec.c: In function ‘retreive_frame_volume’:
mpeg2dec.c:379:5: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
     int s_per_frame = (to_pts - from_pts) * (double)(is->audio_st->codec->sample_rate+1);
     ^
mpeg2dec.c:388:9: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
         buffer = & audio_buffer[(int)((from_pts - base_apts) * ((double)is->audio_st->codec->sample_rate+0.5) )];
         ^
mpeg2dec.c:401:9: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
         audio_samples -= (int)((from_pts - base_apts) * (is->audio_st->codec->sample_rate+0.5)); // incomplete frame before complete frame
         ^
mpeg2dec.c:434:9: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
         top_apts = base_apts + audio_samples / (double)(is->audio_st->codec->sample_rate);
         ^
mpeg2dec.c: In function ‘sound_to_frames’:
mpeg2dec.c:476:5: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
     if (old_sample_rate == is->audio_st->codec->sample_rate &&
     ^
mpeg2dec.c:478:9: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
         || (top_apts - base_apts) * (is->audio_st->codec->sample_rate+0.5) > AUDIOBUFFER
         ^
mpeg2dec.c:480:9: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
         || !ISSAME(((double)audio_samples /(double)(is->audio_st->codec->sample_rate+0.5))+ base_apts, top_apts)
         ^
mpeg2dec.c:496:5: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
     if (old_sample_rate != 0 && old_sample_rate != is->audio_st->codec->sample_rate) {
     ^
mpeg2dec.c:497:10: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
          Debug(5, "Audio samplerate switched from %d to %d\n", old_sample_rate, is->audio_st->codec->sample_rate );
          ^
mpeg2dec.c:499:5: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
     old_sample_rate = is->audio_st->codec->sample_rate;
     ^
mpeg2dec.c:502:5: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
     if (fabs(base_apts - (is->audio_clock - ((double)audio_samples /(double)(is->audio_st->codec->sample_rate))))> 0.0001)
     ^
mpeg2dec.c:503:9: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
         base_apts = (is->audio_clock - ((double)audio_samples /(double)(is->audio_st->codec->sample_rate)));
         ^
mpeg2dec.c:504:9: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
         if (ALIGN_AC3_PACKETS && is->audio_st->codec->codec_id == AV_CODEC_ID_AC3) {
         ^
mpeg2dec.c:529:13: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
             for (l=0;l < is->audio_st->codec->channels;l++ )
             ^
mpeg2dec.c:537:21: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
                     for (l=0;l < is->audio_st->codec->channels;l++ ) volume += *((fb[l])++) * 64000;
                     ^
mpeg2dec.c:539:21: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
                     for (l=0;l < is->audio_st->codec->channels;l++ ) volume += *((fb[0])++) * 64000;
                     ^
mpeg2dec.c:540:17: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
                 *audio_buffer_ptr++ = volume / is->audio_st->codec->channels;
                 ^
mpeg2dec.c:541:17: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
                 avg_volume += abs(volume / is->audio_st->codec->channels);
                 ^
mpeg2dec.c:546:13: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
             for (l=0;l < is->audio_st->codec->channels;l++ )
             ^
mpeg2dec.c:554:21: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
                     for (l=0;l < is->audio_st->codec->channels;l++ ) volume += *((sb[l])++);
                     ^
mpeg2dec.c:556:21: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
                     for (l=0;l < is->audio_st->codec->channels;l++ ) volume += *((sb[0])++);
                     ^
mpeg2dec.c:557:17: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
                 *audio_buffer_ptr++ = volume / is->audio_st->codec->channels;
                 ^
mpeg2dec.c:558:17: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
                 avg_volume += abs(volume / is->audio_st->codec->channels);
                 ^
mpeg2dec.c:564:5: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
     top_apts = base_apts + audio_samples / (double)(is->audio_st->codec->sample_rate);
     ^
mpeg2dec.c: In function ‘audio_packet_process’:
mpeg2dec.c:602:5: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
     if ( !ALIGN_AC3_PACKETS && is->audio_st->codec->codec_id == AV_CODEC_ID_AC3
     ^
mpeg2dec.c:615:5: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
     if (ALIGN_AC3_PACKETS && is->audio_st->codec->codec_id == AV_CODEC_ID_AC3) {
     ^
mpeg2dec.c:666:13: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
             if (ALIGN_AC3_PACKETS && is->audio_st->codec->codec_id == AV_CODEC_ID_AC3) {
             ^
mpeg2dec.c:710:9: warning: ‘avcodec_decode_audio4’ is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:4914) [-Wdeprecated-declarations]
         len1 = avcodec_decode_audio4(is->audio_st->codec, is->frame, &got_frame, pkt_temp);
         ^
mpeg2dec.c:710:9: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
mpeg2dec.c:712:9: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
         if (prev_codec_id != -1 && (unsigned int)prev_codec_id != is->audio_st->codec->codec_id)
         ^
mpeg2dec.c:716:9: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
         prev_codec_id = is->audio_st->codec->codec_id;
         ^
mpeg2dec.c:721:13: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
             if (is->audio_st->codec->codec_id == AV_CODEC_ID_AC3) ac3_packet_index = 0;
             ^
mpeg2dec.c:754:5: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
     if (ALIGN_AC3_PACKETS && is->audio_st->codec->codec_id == AV_CODEC_ID_AC3) {
     ^
mpeg2dec.c: In function ‘DoSeekRequest’:
mpeg2dec.c:1037:13: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
             avcodec_flush_buffers(is->audio_st->codec);
             ^
mpeg2dec.c:1041:13: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
             avcodec_flush_buffers(is->video_st->codec);
             ^
mpeg2dec.c: In function ‘video_packet_process’:
mpeg2dec.c:1202:5: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
     if (!hardware_decode) is->video_st->codec->flags |= CODEC_FLAG_GRAY;
     ^
mpeg2dec.c:1204:5: warning: ‘avcodec_decode_video2’ is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:4963) [-Wdeprecated-declarations]
     len1 = avcodec_decode_video2(is->video_st->codec, is->pFrame, &frameFinished,
     ^
mpeg2dec.c:1204:5: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
mpeg2dec.c:1231:9: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
         frame_delay = av_q2d(is->video_st->codec->time_base) * is->video_st->codec->ticks_per_frame ;
         ^
mpeg2dec.c:1231:9: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
mpeg2dec.c:1343:17: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
                 if (!ISSAME(3*frame_delay/ is->video_st->codec->ticks_per_frame, calculated_delay))
                 ^
mpeg2dec.c:1344:21: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
                     if (!ISSAME(1*frame_delay/ is->video_st->codec->ticks_per_frame, calculated_delay))
                     ^
mpeg2dec.c:1359:13: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
             && !ISSAME(3*frame_delay/ is->video_st->codec->ticks_per_frame, calculated_delay)
             ^
mpeg2dec.c:1360:13: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
             && !ISSAME(1*frame_delay/ is->video_st->codec->ticks_per_frame, calculated_delay)
             ^
mpeg2dec.c: In function ‘stream_component_open’:
mpeg2dec.c:1605:5: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
     codecCtx = pFormatCtx->streams[stream_index]->codec;
     ^
mpeg2dec.c:1755:13: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
             is->video_st->codec->ticks_per_frame = 1;
             ^
mpeg2dec.c: In function ‘file_open’:
mpeg2dec.c:1939:13: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
             is->fps = 1/av_q2d(is->video_st->codec->time_base);
             ^
mpeg2dec.c: In function ‘file_close’:
mpeg2dec.c:2011:5: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
     if (is->videoStream != -1) avcodec_close(is->pFormatCtx->streams[is->videoStream]->codec);
     ^
mpeg2dec.c:2015:5: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
     if (is->audioStream != -1) avcodec_close(is->pFormatCtx->streams[is->audioStream]->codec);
     ^
mpeg2dec.c:2017:5: warning: ‘codec’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:893) [-Wdeprecated-declarations]
     if (is->subtitleStream != -1)  avcodec_close(is->pFormatCtx->streams[is->subtitleStream]->codec);
     ^
mv -f ccextratorwin/.deps/comskip-608.Tpo ccextratorwin/.deps/comskip-608.Po
gcc -DPACKAGE_NAME=\"Comskip\" -DPACKAGE_TARNAME=\"comskip\" -DPACKAGE_VERSION=\"0.81.098\" -DPACKAGE_STRING=\"Comskip\ 0.81.098\" -DPACKAGE_BUGREPORT=\"https://github.com/erikkaashoek/Comskip/issues\" -DPACKAGE_URL=\"\" -DPACKAGE=\"comskip\" -DVERSION=\"0.81.098\" -DHAVE_LIBM=1 -DHAVE_LIBPTHREAD=1 -I.  -Wall  -I/usr/local/include  -DPROCESS_CC -DDONATOR  -g -O2  -MT ccextratorwin/comskip-encoding.o -MD -MP -MF ccextratorwin/.deps/comskip-encoding.Tpo -c -o ccextratorwin/comskip-encoding.o `test -f 'ccextratorwin/encoding.c' || echo './'`ccextratorwin/encoding.c
mv -f ccextratorwin/.deps/comskip-ccextractor.Tpo ccextratorwin/.deps/comskip-ccextractor.Po
gcc -DPACKAGE_NAME=\"Comskip\" -DPACKAGE_TARNAME=\"comskip\" -DPACKAGE_VERSION=\"0.81.098\" -DPACKAGE_STRING=\"Comskip\ 0.81.098\" -DPACKAGE_BUGREPORT=\"https://github.com/erikkaashoek/Comskip/issues\" -DPACKAGE_URL=\"\" -DPACKAGE=\"comskip\" -DVERSION=\"0.81.098\" -DHAVE_LIBM=1 -DHAVE_LIBPTHREAD=1 -I.  -Wall  -I/usr/local/include  -DPROCESS_CC -DDONATOR  -g -O2  -MT ccextratorwin/comskip-general_loop.o -MD -MP -MF ccextratorwin/.deps/comskip-general_loop.Tpo -c -o ccextratorwin/comskip-general_loop.o `test -f 'ccextratorwin/general_loop.c' || echo './'`ccextratorwin/general_loop.c
mv -f ccextratorwin/.deps/comskip-encoding.Tpo ccextratorwin/.deps/comskip-encoding.Po
gcc -DPACKAGE_NAME=\"Comskip\" -DPACKAGE_TARNAME=\"comskip\" -DPACKAGE_VERSION=\"0.81.098\" -DPACKAGE_STRING=\"Comskip\ 0.81.098\" -DPACKAGE_BUGREPORT=\"https://github.com/erikkaashoek/Comskip/issues\" -DPACKAGE_URL=\"\" -DPACKAGE=\"comskip\" -DVERSION=\"0.81.098\" -DHAVE_LIBM=1 -DHAVE_LIBPTHREAD=1 -I.  -Wall  -I/usr/local/include  -DPROCESS_CC -DDONATOR  -g -O2  -MT ccextratorwin/comskip-myth.o -MD -MP -MF ccextratorwin/.deps/comskip-myth.Tpo -c -o ccextratorwin/comskip-myth.o `test -f 'ccextratorwin/myth.c' || echo './'`ccextratorwin/myth.c
In file included from ccextratorwin/general_loop.c:2:0:
ccextratorwin/general_loop.c: In function ‘ts_getmoredata’:
ccextratorwin/general_loop.c:295:21: warning: the address of ‘tsheader’ will always evaluate as ‘true’ [-Waddress]
     buffered_read_4(tsheader);
                     ^
ccextratorwin/ccextractor.h:149:9: note: in definition of macro ‘buffered_read_4’
     if (buffer) { buffer[0]=filebuffer[filebuffer_pos]; \
         ^
ccextratorwin/ccextractor.h:143:15: warning: the comparison will always evaluate as ‘true’ for the address of ‘adlength’ will never be NULL [-Waddress]
     if (buffer!=NULL) memcpy (buffer,filebuffer+filebuffer_pos,bytes); \
               ^
ccextratorwin/general_loop.c:352:7: note: in expansion of macro ‘buffered_read’
       buffered_read (&adlength, 1);
       ^
In file included from ccextratorwin/myth.c:4:0:
ccextratorwin/myth.c: In function ‘get_be16’:
ccextratorwin/myth.c:290:25: warning: the address of ‘a’ will always evaluate as ‘true’ [-Waddress]
     buffered_read_byte (&a);
                         ^
ccextratorwin/ccextractor.h:158:9: note: in definition of macro ‘buffered_read_byte’
     if (buffer) { *buffer=filebuffer[filebuffer_pos]; \
         ^
ccextratorwin/myth.c:291:25: warning: the address of ‘b’ will always evaluate as ‘true’ [-Waddress]
     buffered_read_byte (&b);
                         ^
ccextratorwin/ccextractor.h:158:9: note: in definition of macro ‘buffered_read_byte’
     if (buffer) { *buffer=filebuffer[filebuffer_pos]; \
         ^
ccextratorwin/myth.c: In function ‘get_byte’:
ccextratorwin/myth.c:298:21: warning: the address of ‘b’ will always evaluate as ‘true’ [-Waddress]
  buffered_read_byte(&b);
                     ^
ccextratorwin/ccextractor.h:158:9: note: in definition of macro ‘buffered_read_byte’
     if (buffer) { *buffer=filebuffer[filebuffer_pos]; \
         ^
ccextratorwin/myth.c: In function ‘find_next_start_code’:
ccextratorwin/myth.c:340:29: warning: the address of ‘cx’ will always evaluate as ‘true’ [-Waddress]
         buffered_read_byte (&cx);
                             ^
ccextratorwin/ccextractor.h:158:9: note: in definition of macro ‘buffered_read_byte’
     if (buffer) { *buffer=filebuffer[filebuffer_pos]; \
         ^
ccextratorwin/myth.c: In function ‘mpegps_read_pes_header’:
ccextratorwin/myth.c:38:33: warning: overflow in implicit constant conversion [-Woverflow]
 #define AV_NOPTS_VALUE          (int64_t)(0x8000000000000000)
                                 ^
ccextratorwin/myth.c:433:11: note: in expansion of macro ‘AV_NOPTS_VALUE’
     pts = AV_NOPTS_VALUE;
           ^
ccextratorwin/myth.c:38:33: warning: overflow in implicit constant conversion [-Woverflow]
 #define AV_NOPTS_VALUE          (int64_t)(0x8000000000000000)
                                 ^
ccextratorwin/myth.c:434:11: note: in expansion of macro ‘AV_NOPTS_VALUE’
     dts = AV_NOPTS_VALUE;
           ^
ccextratorwin/myth.c: In function ‘ProcessVBIDataPacket’:
ccextratorwin/myth.c:559:20: warning: overflow in implicit constant conversion [-Woverflow]
         linemask = 0xffffffffffffffff;
                    ^
ccextratorwin/myth.c: In function ‘mpegps_read_packet’:
ccextratorwin/myth.c:724:1: warning: label ‘found’ defined but not used [-Wunused-label]
 found:
 ^
mv -f ccextratorwin/.deps/comskip-myth.Tpo ccextratorwin/.deps/comskip-myth.Po
mv -f .deps/comskip-mpeg2dec.Tpo .deps/comskip-mpeg2dec.Po
mv -f ccextratorwin/.deps/comskip-general_loop.Tpo ccextratorwin/.deps/comskip-general_loop.Po
mv -f .deps/comskip-comskip.Tpo .deps/comskip-comskip.Po
gcc -g -O2    -o comskip comskip-comskip.o comskip-mpeg2dec.o comskip-platform.o comskip-video_out_dx.o ccextratorwin/comskip-608.o ccextratorwin/comskip-ccextractor.o ccextratorwin/comskip-encoding.o ccextratorwin/comskip-general_loop.o ccextratorwin/comskip-myth.o -largtable2  -L/usr/local/lib -L/home/osmc/ffmpeg_build/lib -L/usr/local/lib -L/home/osmc/ffmpeg_build/lib -L/usr/local/lib -lavformat -ldl -lass -lm -lharfbuzz -lfontconfig -lexpat -lfreetype -lexpat -lenca -lm -lfribidi -lfreetype -lz -lpng12 -lvdpau -lX11 -lva -lva-x11 -lX11 -lva -lva-drm -lva -lxcb -lXau -lXdmcp -lxcb-shm -lxcb -lXau -lXdmcp -lxcb-xfixes -lxcb-render -lxcb-shape -lxcb -lXau -lXdmcp -lxcb-shape -lxcb -lXau -lXdmcp -lasound -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host -lx265 -lstdc++ -lm -lrt -ldl -lx264 -lpthread -lm -ldl -lvpx -lm -lpthread -lvpx -lm -lpthread -lvpx -lm -lpthread -lvpx -lm -lpthread -lvorbisenc -lvorbis -logg -ltheoraenc -ltheoradec -logg -lopus -lm -lopus -lm -lmp3lame -lfreetype -lz -lpng12 -lfdk-aac -lm -lass -lm -lharfbuzz -lfontconfig -lexpat -lfreetype -lexpat -lenca -lm -lfribidi -lfreetype -lz -lpng12 -lm -lz -pthread -lavcodec -ldl -lass -lm -lharfbuzz -lfontconfig -lexpat -lfreetype -lexpat -lenca -lm -lfribidi -lfreetype -lz -lpng12 -lvdpau -lX11 -lva -lva-x11 -lX11 -lva -lva-drm -lva -lxcb -lXau -lXdmcp -lxcb-shm -lxcb -lXau -lXdmcp -lxcb-xfixes -lxcb-render -lxcb-shape -lxcb -lXau -lXdmcp -lxcb-shape -lxcb -lXau -lXdmcp -lasound -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host -lx265 -lstdc++ -lm -lrt -ldl -lx264 -lpthread -lm -ldl -lvpx -lm -lpthread -lvpx -lm -lpthread -lvpx -lm -lpthread -lvpx -lm -lpthread -lvorbisenc -lvorbis -logg -ltheoraenc -ltheoradec -logg -lopus -lm -lopus -lm -lmp3lame -lfreetype -lz -lpng12 -lfdk-aac -lm -lass -lm -lharfbuzz -lfontconfig -lexpat -lfreetype -lexpat -lenca -lm -lfribidi -lfreetype -lz -lpng12 -lm -lz -pthread -lswresample -lm -lavutil -lm   -lpthread -lm 
/usr/bin/ld: cannot find -lmmal_core
/usr/bin/ld: cannot find -lmmal_util
/usr/bin/ld: cannot find -lmmal_vc_client
/usr/bin/ld: cannot find -lbcm_host
/usr/bin/ld: cannot find -lx265
collect2: error: ld returned 1 exit status
Makefile:423: recipe for target 'comskip' failed
make: *** [comskip] Error 1

In one final attempt of dismay I restarted the whole process all over again, but this time when building the h.256 encoder, I replaced every instance of “-mcpu=native” with “-mcpu=arm1176jzf-s” and “-march=native” with “-march=armv6”. This sets the build to a more general raspi ARM build as opposed to my first attempt which was tailored exactly for the raspi3 architecture. That seemed to fixed the make problem once again and all else went well with building and installing ffmpeg (i.e. successful build with no errors). But to my great dismay, tis more general method still led to the same make error with comskip.

Although I am still a novice with ‘make’, I am fairly competent with linux (my day job is a scientist working exclusively with Cent OS), but I cannot seem to figure out this build process. I am beginning to wonder if anyone else has succesfully followed these instructions on a raspi 3?

Any help or direction is much appreciated.

1 Like

Hi Taylor,

first of all please edit your post above to show all command line output as preformatted text ( the button with </> ). That way the thread stays far more readable.

Then on to your problem. I do only own an RPi 2 so I cannot test building comskip on an RPi 3, but since the 3 is fully compatible to the 2 it must be possible! :slight_smile:

To narrow it down i’d suggest the following steps:

1) Check if the bare comskip builds without error:
Try building ffmpeg without the flags --enable-libx265 --enable-mmal --enable-decoder=mpeg2_mmal --enable-decoder=mpeg4_mmal --enable-decoder=h264_mmal --enable-decoder=vc1_mmal --enable-omx-rpi --enable-encoder=h264_omx , then try building comskip. Also when building comskip just make (no -j4), that is a tad slower but produces a more human readable log.
If this succeeds, you know the problem lies with the x265 or mmal libraries.

2) Check if comskip builds when directly pointing to the RPi libraries:
Rebuild ffmpeg including all *mmal and *omx flags. Then build comskip, as above, but after ./configure run:
LDFLAGS="-L/opt/vc/lib" make
to explicitly include the RPi libs. This should not be necessarly, but would indicate missing symlinks.

3) Adjust the build for x.265
It looks like you were already on the right path with this one. But I think you missed the correct settings in the makefile. -mcpu=cortex-a53 seems right, but the default OSMC image is the same for RPi2 and 3, so it should be -march=armv7-a

If only the last step fails you can still consider just skipping that. I included the x265 lib for the sake of completeness, but due to the RPi’s limited processing speed it is close to useless.

1 Like

Hey Fretzke!
First of all, thank you so so much for writing up this guide. It is honestly the #1 reason I chose to install OSMC.
I have bounced between Libreelec, Xbian, Raspian and OSMC trying to find a noob-friendly way of setting up tvheadend w/ working comskip post processing for my RPI 3 and Hdhomerun connect.

I can finally see the light at the end of the tunnel!!

anyway, I am having the exact same issue as Taylor. Same errors at the same step. i have tried starting fresh a few times now and it always gets caught right there.

thanks again for following up with all these questions on here it is a treasure trove for the lost noob!

EDIT by starting fresh i mean doing a fresh OSMC install and only installing Tvheadend server 4.0.9(?), crontab from OSMC app store and then setting up tvheadend and the tvh PVR client htsp kodi addon where I can get it to record. Then I use putty from a windows comp to SSH and copy and paste your directions until the fatal error taylors log show happens

Hi Ucwhatic,

I’m glad if my notes are of any help. Having spent countless hours to get all the commercial flagging and file naming processes to work in a satisfactory way, I can pretty much imagine your frustration.

One would think such a fundamental function must be documented somewhere and many people have already tried this – but no. :confused:

Anyways getting comskip to compile on an RPi3 if you already got ffmpeg running with enabled hw decoder, can only be a matter of adjusting some parameters. If you or Taylor try the steps above I’m confident we can easily work this out.

Cheers!

Update on building comskip on raspi 3:

Unfortunately I tried all three of your most recent suggestions and still no luck. I got the exact same error (which was the exact same error as before) for all three methods. This error seemed especially strange for the bare comskip build considering that none of the mmal libs were enabled. To be clear, I started from scratch for all three methods.

osmc@osmc:~/sources/Comskip$ ffmpeg -encoders | grep omx
ffmpeg version N-86544-g9d11fed Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 4.9.2 (Debian 4.9.2-10)
  configuration: --pkg-config-flags=--static --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree
  libavutil      55. 66.100 / 55. 66.100
  libavcodec     57. 99.100 / 57. 99.100
  libavformat    57. 73.100 / 57. 73.100
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 94.100 /  6. 94.100
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100

Which still eventually resulted in the following error:

/usr/bin/ld: cannot find -lmmal_core
/usr/bin/ld: cannot find -lmmal_util
/usr/bin/ld: cannot find -lmmal_vc_client
/usr/bin/ld: cannot find -lbcm_host
collect2: error: ld returned 1 exit status
Makefile:423: recipe for target 'comskip' failed
make: *** [comskip] Error 1

At this point, I have no idea what is going on. Something is fundamentally wrong when compiling on the rapsi 3 versus raspi 2. FFMEG seems to work fine, but comskip seems to be configuring incorrectly. Just an idea.

Any luck @ucwhatic?