Transcode DVB Enigma2 Receiver: Using ffmpeg on the ODROID-XU4

When I stay in hotels during my travels, I notice some channels are not available on TV. Using NAT (mapping the external ip to the internal device ip) and http flux, I can see some of those TV channels on my cell phone or my laptop. If the bandwidth is low, you could use 3G or higher (350Kbs rate) access.

In my first test, with a Raspberry Pi 3, using the hardware decoder, we can transcode to just 320*240. I discovered the ODROID-MC1 at a resale website, so I got it. It uses the Exynos 5520, which is more powerful. Using it, we can transcode to 512*384.

Price comparisons

  • Raspberry Pi 3 Model B+ Desktop Starter Kit (16Gb) costs 60 € (US $70)
  • ODROID-HC1 (sd 16Gb + PSU) = 70 € (US $82)
  • ODROID-XU4 (sd 16Gb + PSU) = 85 € (US $100)

The ODROID SBCs could be a good choice, but for the moment the hardware decoder may have some bugs in the MPEG4 processing, so, we use only H.264 video format at this moment). The MPEG4/MPEG2 video decoding is very unstable, so we are forced to use the software encoder/decoder.

Raspberry Pi 3 Model B+ is good, but the CPU is less powerful. However, with the hardware decoder/encoder, its performance is acceptable. In any case, do not use the WiFi network, but use the wired network (RJ45 ethernet jack). With either board, we cannot decode 4K video, which is only available on the ODROID-C1.

Install on ODROID-XU4 or ODROID-HC1

We will use Ubuntu 18.04 (Version: 20180531 - https://goo.gl/LKPL9F). Install the software at https://goo.gl/A9gbkD. Read the Release Notes at both links for useful information. After this we install the e2transcoder software (the web GUI) and ffmpeg using the steps at https://goo.gl/p9c4Pi. The steps include:

$ su
# apt-get install mali-fbdev
# apt-get install ffmpeg
# apt-get install apache2
# apt-get install libav-tools
# apt-get install zip
# apt-get install mc
# apt-get install zip
# apt-get install php
# apt-get install libapache2-mod-php
# apt-get install sqlite
# apt-get install php-sqlite3
# apt-get install php-xml
Fetch the e2transcoder zip file using:
$ wget http://e2transcoder.sharetext.net/wp-content/uploads/files/enigma2_transcoder_072.zip
Expand the zip file and copy the contents of
repertories/DB/*.*
to
/var/www/html/
You would now see the following files and directories in the /var/www/html/ folder:
/admin
/stream
index.html (original )
Index.php
Run the following commands:
$ rm /var/www/html/admin/config.php
$ cp /var/www/html/admin/config_linux.php /var/www/html/admin/config.php
Edit the /var/www/html/admin/config.php file to contain the following information:
// if enigma2 receiver is not used must be 0, but it is not mandatory if receiver is used
$conf["callreceiver"] = 1;
// full path of stream dir
$conf["stream_dir"]="/var/www/html/stream/";
// path of avconv or ffmpeg executable, if avconv of ffmpeg installed $conf["command"] = "/usr/bin/ffmpeg";
from package only need executable name
// web url folder of stream enigma2 receiver configuration
$conf["stream_web_dir"] = "/stream/";
// enigma2 user name
$conf["db_username"] = "root";
// enigma2 password
$conf["db_password"] = "YYYYYY";
// enigma2 IP
$conf["db_ip"] ="192.168.ZZZ.ZZZ";
$conf["parameters"] = "-threads 16 -vcodec h264 -i {stream_url} -s 512x384 -vf fps=21 -maxrate:v 400k -bufsize:v 60000k -ac 1 -ar 22050 -vbr 1 -sn {stream_dir}ystream.m3u8";
// full path of avconv or ffmpeg log
$conf["stream_log"] = "/var/log/stream.log";
Folders /admin/db and /stream/ should be writable by the web server. In case of Apache, this is user “apache” for nginx www-data.
$ chown -R www-data /var/www/html/
$ chmod -R 755 /var/www/html/
$ touch /var/log/stream.log
$ chown www-data /var/log/stream.log
There is a small issue with slqlite. Locate the sqlite3.so library. In the Raspberry Pi, it is at /usr/lib/php/20151012/sqlite3.so. Locate php.ini typically at /etc/php/7.2/apache2/php.ini. In this file, find the section [sqlite3] and change to:
[sqlite3]
sqlite3.extension_dir =/usr/lib/php/20170718/sqlite3.so
Now, on your web browser, access http://ip_of_your_receiver/index.php. Enter the login information (also in config.php). Go to the "Settings" section and click on "Reload E2 Playlist". Return to "Channels". Select your Channel by clicking on it, and at the top you should see “TV:channel-name”. Be careful, you can not show TV and transcode another channel if it is not in the same transponder.. You should see the status change from, "Preparing" to “Running" (you can also check using: $ tail -f /var/log/stream.log). Go to the "Live" section and click on the play icon or enter the link in the vlc player.

Figure 01 - Login
Figure 01 - Login

Figure 02 - Main Page
Figure 02 - Main Page

Figure 03 - HTML5 player in Chrome on SmartPhone
Figure 03 - HTML5 player in Chrome on SmartPhone

Figure 04 - Settings
Figure 04 - Settings

Figure 05 - EPG
Figure 05 - EPG

For comments, questions, and suggestions, please visit the original article at https://forum.odroid.com/viewtopic.php?f=95&t=31358.

Be the first to comment

Leave a Reply