Installing Gstreamer: gst-identify doesn't show any omx codecs

I’m installing Gstreamer as shown here: Loading... I’ve got shows I’m recording via tvheadend and would like to encode them into something in a reasonable size, such as an mp4. I’ve tried having tvheadend encode as it records but it ends up eating up all the RAM on my Pi 2. So I resorted to passthrough, but now I’ve got a 6.5GB .ts file for a single hour of HD video. I’m basically trying to replicate what this guy is doing: Hardware Video Encoding progess with the Raspberry Pi | Blank's Tech Blog

In his gst-launch command he’s using “omxh264enc” as the encoder, but I don’t have that one available to me, apparently. I tried installing omxplayer from source and the re-installed Gstreamer (via the script in the first blog post) but still don’t see any of the omx codecs available. The full list should look like this: i/o blog: Enabling hardware h264 encoding with gstreamer on the Raspberry Pi (This blog post is from 2013 and talks about Gstreamer 1.0 so I didn’t use those install instructions, I used the new ones in the first blog post.) The actual error I get when running the command:

osmc@osmc:~$ gst-launch-1.0 -e filesrc location="raw_video.ts" ! tsdemux ! mpegvideoparse ! omxmpeg2videodec ! deinterlace ! videoconvert ! omxh264enc inline-header=true periodicty-idr=1 ! "video/x-h264,stream-format=byte-stream,profile=high,control-rate=variable,target-bitrate=5000000,quant-i-frames=250" ! h264parse ! mp4mux ! filesink location="output.m4v"

WARNING: erroneous pipeline: no element "omxmpeg2videodec"

And then exit back to prompt.

omxplayer is included by default in Raspian and that seems to be what most of the articles are using as the OS when doing this Gstreamer work. Of the articles I’ve come across I haven’t seen anyone using it in OSMC.

Any ideas?

You will likely need to compile gstreamer with an option such as --enable-openmax when you run ./configure.

Sam

Here’s the full install script. I don’t see an explicit --enable-openmax flag set anywhere, but the second blog post refers to this script as the one he installed and he didn’t mention any problems with omx…

#!/bin/bash

# Create a log file of the build as well as displaying the build on the tty as it runs
exec > >(tee build_gstreamer.log)
exec 2>&1

################# COMPILE GSTREAMER 1.2 ############


# Update and Upgrade the Pi, otherwise the build may fail due to inconsistencies

sudo apt-get update && sudo apt-get upgrade -y --force-yes

# Get the required libraries
sudo apt-get install -y --force-yes build-essential autotools-dev automake autoconf \
                                    libtool autopoint libxml2-dev zlib1g-dev libglib2.0-dev \
                                    pkg-config bison flex python git gtk-doc-tools libasound2-dev \
                                    libgudev-1.0-dev libxt-dev libvorbis-dev libcdparanoia-dev \
                                    libpango1.0-dev libtheora-dev libvisual-0.4-dev iso-codes \
                                    libgtk-3-dev libraw1394-dev libiec61883-dev libavc1394-dev \
                                    libv4l-dev libcairo2-dev libcaca-dev libspeex-dev libpng-dev \
                                    libshout3-dev libjpeg-dev libaa1-dev libflac-dev libdv4-dev \
                                    libtag1-dev libwavpack-dev libpulse-dev libsoup2.4-dev libbz2-dev \
                                    libcdaudio-dev libdc1394-22-dev ladspa-sdk libass-dev \
                                    libcurl4-gnutls-dev libdca-dev libdirac-dev libdvdnav-dev \
                                    libexempi-dev libexif-dev libfaad-dev libgme-dev libgsm1-dev \
                                    libiptcdata0-dev libkate-dev libmimic-dev libmms-dev \
                                    libmodplug-dev libmpcdec-dev libofa0-dev libopus-dev \
                                    librsvg2-dev librtmp-dev libschroedinger-dev libslv2-dev \
                                    libsndfile1-dev libsoundtouch-dev libspandsp-dev libx11-dev \
                                    libxvidcore-dev libzbar-dev libzvbi-dev liba52-0.7.4-dev \
                                    libcdio-dev libdvdread-dev libmad0-dev libmp3lame-dev \
                                    libmpeg2-4-dev libopencore-amrnb-dev libopencore-amrwb-dev \
                                    libsidplay1-dev libtwolame-dev libx264-dev

cd $HOME
mkdir packages
cd packages
mkdir gstreamer-1.2
cd gstreamer-1.2

git clone git://anongit.freedesktop.org/git/gstreamer/gstreamer
git clone git://anongit.freedesktop.org/git/gstreamer/gst-plugins-base
git clone git://anongit.freedesktop.org/git/gstreamer/gst-plugins-good
git clone git://anongit.freedesktop.org/git/gstreamer/gst-plugins-bad
git clone git://anongit.freedesktop.org/git/gstreamer/gst-plugins-ugly
git clone git://anongit.freedesktop.org/git/gstreamer/gst-libav
git clone git://anongit.freedesktop.org/git/gstreamer/gst-omx

cd gstreamer
git checkout -t origin/1.2
./autogen.sh
make
sudo make install
cd ..

cd gst-plugins-base
git checkout -t origin/1.2
./autogen.sh
make
sudo make install
cd ..

cd gst-plugins-good
git checkout -t origin/1.2
./autogen.sh
make
sudo make install
cd ..

cd gst-plugins-ugly
git checkout -t origin/1.2
./autogen.sh
make
sudo make install
cd ..

cd gst-libav
git checkout -t origin/1.2
./autogen.sh
make
sudo make install
cd ..

# Install libusb-1.0 to enable uvch264src
sudo apt-get install -y --force-yes libusb-1.0

cd gst-plugins-bad
git checkout -t origin/1.2
export LD_LIBRARY_PATH=/usr/local/lib/ path
sudo LDFLAGS='-L/opt/vc/lib' CPPFLAGS='-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux' ./autogen.sh
make CFLAGS+="-Wno-error"
sudo make install
cd ..

cd gst-omx
LDFLAGS='-L/opt/vc/lib' CPPFLAGS='-I/opt/vc/include -I/opt/vc/include/IL -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux' ./autogen.sh --with-omx-target=rpi
make CFLAGS+="-Wno-error"
sudo make install

Hi

Skimmed this quickly. Guess would be gst-omx is a plugin / module. It may not be building properly if you don’t have the OSMC development packages.

sudo apt-get update
sudo apt-get -y install rbp-userland-dev-osmc