Jump to content


Photo

serviceapp - gstplayer and exteplayer3

gstreamer ffmpeg

  • Please log in to reply
985 replies to this topic

#1 mx3L

  • Senior Member
  • 616 posts

+79
Good

Posted 13 April 2016 - 16:25

Hello,

For those who don't know @samsamsam created excellent IPTVPlayer plugin, he also managed to create players for this plugin which run in separate process, so it's possible to have entire control over playback. One of these players also uses ffmpeg which was not used for playback in mipsel receivers yet.

Comparison of exteplayer3 (ffmpeg) to gstplayer (gstreamer1.0):

pros:
- uses much less memory
- needs much less cpu power -> immediate seeking, AV sync after seeking
- doesn't have problem with TS streams
- doesn't have problem with secure HLS streams

cons:
- framedrops in playback of packed mpeg4-part2
- HLS streams with variant playlists are pixelated

 

I really like the idea of separating player from enigma2 and running it as external process. We don't have to move quite big enigma2 binary to receiver in order to test. We can test player from command line without enigma2 running and AFAIK this should also mean that there are no memory leaks created by player process after it exits.

 

So I've created service 'serviceapp' for enigma2 which allows us to use these players.

 

serviceapp:

- adds service 5001: uses gstplayer
  * possibility to change sink, buffer size, buffer duration
  * possibility to enable/disable embedded subtitles support
- adds service 5002: uses exteplayer3
  * TODO add exteplayer3 settings
- adds possibility to replace default servicemp3 service(4097)
- adds support for custom plugins settings

Thought there are still some thing things missing when compared to servicemp3:
- external subtitles support
- tags support
- cuesheet support
- epg support
- fast forward/backward

 

ServiceApp enigma2 plugin:

- possibity to replace enigma2 playback system, so you can use these players not only from bouquet but for example from MoviePlayer, MediaPlayer(restart enigma2 necessary)
  * switch players gstplayer/exteplayer3 at enigma2 runtime
  * change gstplayer settings at enigma2 runtime
- change gstplayer(5001) settings at enigma2 runtime
  * sink, buffer size, buffer duration, enable/disable subtitles


Installation:
1. unpack recipes in serviceapp.tar.gz in $openpli-oe-core/meta-local/recipes-local

tar xzf serviceapp_recipes.tgz -C $openpli-oe-core_dir/meta-local/recipes-local

2. build serviceapp service + plugin

MACHINE=machinename bitbake enigma2-plugin-extensions-serviceapp

3. build @samsamsam's gstplayer + patches of mine

MACHINE=machinename bitbake gstplayer

4. (optional) You can build also experimental sink, which you can then select in ServiceApp menu, it's basically openpli dvbmediasink + mpeg4part2 unpacking + oldgen xtrend improvements mentioned in Gstreamer-1.0 topic.

MACHINE=machinename bitbake gstreamer1.0-plugin-dvbmediasink-experimental

Note, I've added this experimental sink with no intention of replacing original one. It's there so you know how can we have more sinks and make comparisons on the fly. For example this can be useful to have one sink stable and introduce new changes in experimental one, so users can freely switch between them if they want to try experimental one and report back if there are any problems, and if there are they can switch back to stable, etc..

 

5. ipk's are located in $openpli_oe_core_dir/build/tmp/deploy/mips32el and $openpli_oe_core_dir/build/tmp/deploy/machinename

 

6. For exteplayer3 there is no recipe yet, since source is not public. @samsamsam mentioned that once he cleans it up, he will make it public. For now you have to build or download pre-built ffmpeg and exteplayer3 binary.

Using pre-built ffmpeg by @samsamsam:

  1. download pre-built ffmpeg archive

wget http://iptvplayer.pl/resources/ffmpeg2.8.5_mipsel_fpu.tar.gz

  2. unpack in root directory

tar xzf ffmpeg2.8.5_mipsel_fpu.tar.gz -C /

Install exteplayer3 binary:

  1. download binary to /usr/bin/exteplayer3

wget http://iptvplayer.pl/resources/bin/mipsel/exteplayer3_ffmpeg2.8 -O /usr/bin/exteplayer3

  2. give extplayer3 execution permissions:

chmod +x /usr/bin/exteplayer3

Note there are also other versions for ffmpeg and exteplayer3:

 

ffmpeg2.8.5 - http://iptvplayer.pl...psel_fpu.tar.gz
ffmpeg2.8.5 (openssl1.0.2) - http://iptvplayer.pl...ssl1.0.2.tar.gz
exteplayer3 for ffmpeg2.8 - http://iptvplayer.pl...ayer3_ffmpeg2.8
exteplayer3 for ffmpeg3.0 - http://iptvplayer.pl...ayer3_ffmpeg3.0

 

Source:

https://github.com/mx3L/serviceapp

 

Example of bouquet with serviceapp services:

#SERVICE 4097:0:0:0:0:0:0:0:0:0:http%3a//movietrailers.apple.com/movies/sony_pictures/hoteltransylvania2/hoteltransylvania2-tlr2_h480p.mov?#User-Agent=iTunes:MOV_TRAILER_USER_AGENT
#SERVICE 5001:0:0:0:0:0:0:0:0:0:http%3a//movietrailers.apple.com/movies/sony_pictures/hoteltransylvania2/hoteltransylvania2-tlr2_h480p.mov?#User-Agent=iTunes:MOV_TRAILER_USER_AGENT_GST
#SERVICE 5002:0:0:0:0:0:0:0:0:0:http%3a//movietrailers.apple.com/movies/sony_pictures/hoteltransylvania2/hoteltransylvania2-tlr2_h480p.mov?#User-Agent=iTunes:MOV_TRAILER_USER_AGENT_EXT3

Certainly there are mistakes but hopefully not many :), any input is welcome.

Attached Files


Edited by mx3L, 13 April 2016 - 16:25.


Re: serviceapp - gstplayer and exteplayer3 #2 gorski

  • Senior Member
  • 1,699 posts

+46
Good

Posted 14 April 2016 - 00:18

Thanx for your interest in the matter!

 

From what little I have experienced (I "know" very, very little, since I am from Humanities, not [Tech] Sciences - maybe you could simplify it for us a bit? :) ), at the very least "older" machines with little fire power and small amounts of RAM would benefit a great deal from what seems to me to be an interesting development here...

 

I don't know if you are aware of this but I better at least try to contribute, if I can - there is Enigma2 by AR-P (All Russian Project) for STi 7111/7162 based STBs like Alien 1/2 (SH4, based on DuckBox TDT project), which is done in 2 ways, Gstreamer and External Player 3, here:

 

https://code.google....amiko/downloads

 

OpenAR-P_OE2.0_211_alien_epl3-git-20-01-14_v2013-03-31-540-gb01d455.zip openAR-P c eplayer для Alien1, а также клонов spark Jan 20, 2014 55.2MB

OpenAR-P_OE2.0_211_alien2_epl3-git-20-01-14_v2013-03-31-540-gb01d455.zip openAR-P c eplayer для Alien2 а также клонов spark7162

 

OpenAR-P_OE2.0_211_alien2_gst-git-03-01-13_a287e7c.zip openAR-P c gstreamer для Alien2 а также клонов spark7162  Deprecated Jan 3, 2013 48.5MB

OpenAR-P_OE2.0_211_alien_gst-git-03-01-13_a287e7c.zip openAR-P c gstreamer для Alien1, а также клонов spark  Deprecated

 

Hope it helps and best of luck!!! :)

 

P.S. I tested OpenATV etc. E2 in Alien2 with and without ffmpeg/Extplayer3, in terms of streaming (from the net) and playback (from NAS) - ffmpeg/Eplayer3 combination could pull off much more stuff, than Gstreamer based player, in such machines...


Edited by gorski, 14 April 2016 - 00:19.

<span style='font-family: comic sans ms,cursive'>"Enlightenment is man's emergence from his self-incurred immaturity. Immaturity is the inability to use one's own understanding without the guidance of another. This immaturity is self-incurred if its cause is not lack of understanding, but lack of resolution and courage to use it without the guidance of another. The motto of enlightenment is therefore: Sapere aude! Have courage to use your own understanding!</span><br /> <br /><span style='font-family: comic sans ms,cursive'>Laziness and cowardice are the reasons why such a large proportion of men, even when nature has long emancipated them from alien guidance..." I. Kant, "Political writings" (1784)</span><br /> <br /><span style='font-family: comic sans ms,cursive'><a class='bbc_url' href='<a class='bbc_url' href='http://eserver.org/p...lightenment.txt'>http://eserver.org/p...ent.txt</a>'><a class='bbc_url' href='http://www.english.upenn.edu/~mgamer/Etexts/kant.html</a>'>http://www.english.upenn.edu/~mgamer/Etexts/kant.html</a></a> - the jolly text on Enlightenment, at the basis of Modernity...</span>

Re: serviceapp - gstplayer and exteplayer3 #3 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 14 April 2016 - 00:43

Unfortunately this player is closed source ???? Not acceptable for  micro bit of code and extremely dangerous for pishing ware and even viruses this especially cause on a stb we working as root .

 

So long that all this stuff is based on closed source it's a lie at start. And I'll hope pli team will never accept this dangerous till fatal pishing    till deadly malware.



Re: serviceapp - gstplayer and exteplayer3 #4 gorski

  • Senior Member
  • 1,699 posts

+46
Good

Posted 14 April 2016 - 00:45

From what I saw, there was a promise of making it Open Source very soon... ;)


<span style='font-family: comic sans ms,cursive'>"Enlightenment is man's emergence from his self-incurred immaturity. Immaturity is the inability to use one's own understanding without the guidance of another. This immaturity is self-incurred if its cause is not lack of understanding, but lack of resolution and courage to use it without the guidance of another. The motto of enlightenment is therefore: Sapere aude! Have courage to use your own understanding!</span><br /> <br /><span style='font-family: comic sans ms,cursive'>Laziness and cowardice are the reasons why such a large proportion of men, even when nature has long emancipated them from alien guidance..." I. Kant, "Political writings" (1784)</span><br /> <br /><span style='font-family: comic sans ms,cursive'><a class='bbc_url' href='<a class='bbc_url' href='http://eserver.org/p...lightenment.txt'>http://eserver.org/p...ent.txt</a>'><a class='bbc_url' href='http://www.english.upenn.edu/~mgamer/Etexts/kant.html</a>'>http://www.english.upenn.edu/~mgamer/Etexts/kant.html</a></a> - the jolly text on Enlightenment, at the basis of Modernity...</span>

Re: serviceapp - gstplayer and exteplayer3 #5 mx3L

  • Senior Member
  • 616 posts

+79
Good

Posted 14 April 2016 - 07:17

@christophecvr

 

@samsamsam shared source of exteplayer3 with me and there are no viruses. He also already mentioned, that once he cleans it up source will be public.

Besides exteplayer3 is not tied up to serviceapp, you can use it only with gstplayer.



Re: serviceapp - gstplayer and exteplayer3 #6 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 15 April 2016 - 09:54

Note the ffmepg self can be build , only thing needed there is adapt the :

 

openpli-oe-core/meta-openpli/recipes-multimedia/ffmpeg/ffmpeg_3.%.bbappend

 

to have the required packages.

 

the main ffmepg recipe is from openemebedded

openpli-oe-core/openembedded-core/meta/recipes-multimedia/ffmpeg/ffmpeg_3.0.bb

 

(that's well in master-next).



Re: serviceapp - gstplayer and exteplayer3 #7 MastaG

  • Senior Member
  • 1,531 posts

+118
Excellent

Posted 29 April 2016 - 11:42

Hi there mx3L,

 

I'm including your serviceapp and gstplayer in my last round of testing images.

For that I'm also shipping ffmpeg by default now.

I've edited the serviceapp recipe a bit to make it compatible with PLi4 and RDEPEND on gstplayer.

 

DESCRIPTION = "serviceapp service for enigma2"
AUTHOR = "Maroš Ondrášek <mx3ldev@gmail.com>"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"

SRCREV = "${AUTOREV}"
inherit gitpkgv

DEPENDS = "enigma2"
RDEPENDS_${PN} = "gstplayer"

SRC_URI = "git://github.com/mx3L/serviceapp.git;branch=master"

S = "${WORKDIR}/git"

PV = "1+git${SRCPV}"
PKGV = "1+git${GITPKGV}"

inherit autotools pkgconfig pythonnative

EXTRA_OECONF = "\
    BUILD_SYS=${BUILD_SYS} \
    HOST_SYS=${HOST_SYS} \
    STAGING_INCDIR=${STAGING_INCDIR} \
    STAGING_LIBDIR=${STAGING_LIBDIR} \
    "

FILES_${PN} = "${libdir}/enigma2/python/Plugins/Extensions/ServiceApp/*.pyo ${libdir}/enigma2/python/Plugins/Extensions/ServiceApp/serviceapp.so"
FILES_${PN}-dev = "${libdir}/enigma2/python/Plugins/Extensions/ServiceApp/serviceapp.la"
FILES_${PN}-dbg += "${libdir}/enigma2/python/Plugins/Extensions/ServiceApp/.debug/serviceapp.so"
FILES_${PN}-src = "${libdir}/enigma2/python/Plugins/Extensions/ServiceApp/*.py"

 

However you don't happen to have a recipe for exteplayer3 right?

So in order to test it, the users have to run iptv player once and let it install exteplayer3, after that they can play around with serviceapp.



Re: serviceapp - gstplayer and exteplayer3 #8 mx3L

  • Senior Member
  • 616 posts

+79
Good

Posted 29 April 2016 - 11:47

@MastaG

Hi, please wait, I have recipes also for exteplayer3, will add here updated recipes soon.



Re: serviceapp - gstplayer and exteplayer3 #9 MastaG

  • Senior Member
  • 1,531 posts

+118
Excellent

Posted 29 April 2016 - 11:48

Alright bro :)



Re: serviceapp - gstplayer and exteplayer3 #10 mx3L

  • Senior Member
  • 616 posts

+79
Good

Posted 29 April 2016 - 12:24

updated recipes:

 

added exteplayer3 v26 recipe:

- fix VC1 playback on some mipsel receivers(et4x00)

- fix EOS detection on VU+ receivers, by @samsamsam

- fix seqfault on close, by @samsamsam

- fix mpeg4p2 playback

 

added ffmpeg bbappend, tested in openpli-oe-core:

- partially taken from @Taapat's ffmpeg bbapend - https://github.com/T...eg_3.%.bbappend

I didn't studied all options, just turned on/off some obvious ones, will look at it further

 

added serviceapp-0.2 recipe:

- add the possibility to choose the player in the MovieSelection menu, this allows the user to choose the ServiceExtEplayer3 or ServiceGstPlayer for movie playback in the MovieSelection menu, without Enigma2 playback system change, by @Taapat

- enigma2 setup skin is used by default, by @Taapat

- added description to config entries, by @Taapat

- fixed imprecise seeking when exteplayer3 was used

 

Installation:

same as in first post, but now you can also build exteplayer3

MACHINE=machinename bitbake exteplayer3

Attached Files



Re: serviceapp - gstplayer and exteplayer3 #11 mx3L

  • Senior Member
  • 616 posts

+79
Good

Posted 29 April 2016 - 12:42

Missing exteplayer3 recipe in above post, so again :/:

 

Attached Files



Re: serviceapp - gstplayer and exteplayer3 #12 MastaG

  • Senior Member
  • 1,531 posts

+118
Excellent

Posted 29 April 2016 - 13:08

just out of curiousity, what the difference between your "test_mpeg4p2_10_experimental" dvbmediasink branch and the one from chris?

did you add anything special for mpeg4 part 2 codecs?



Re: serviceapp - gstplayer and exteplayer3 #13 mx3L

  • Senior Member
  • 616 posts

+79
Good

Posted 29 April 2016 - 13:14

From first post:

it's basically openpli dvbmediasink + mpeg4part2 unpacking + oldgen xtrend improvements mentioned in Gstreamer-1.0 topic.

As for what is the difference between @christophecvr and this one, I guess you have to run diff command or ask him :), but IIRC in multiboxsink are some improvements with DTS downmix and there is also fix for using DTS timestamps when PTS are not available.



Re: serviceapp - gstplayer and exteplayer3 #14 jenseneverest

  • Senior Member
  • 65 posts

+5
Neutral

Posted 29 April 2016 - 13:31

Nice work guys, thanks to all involved. Now really looking forward to your next batch of images @mastaG

 

Excuse my ignorance.... but will these changes now enable a stream to restart ?

IE the stream will stop playing due to a network dropout (or similar issue ) and not resume, it will freeze... changing channel and going back to it will "fix it "....

 

Best regards



Re: serviceapp - gstplayer and exteplayer3 #15 MastaG

  • Senior Member
  • 1,531 posts

+118
Excellent

Posted 29 April 2016 - 14:02

Hi jenseneverest,

 

I have yet to try it for myself.

I'm currently building a bunch of testing images for my receivers.

Personally the m3u8 streams I'm watching from my enigma2 bouquets rarely freeze on my faster receivers like dm800se, zegmma star h2h..

One thing I notice is that gstreamer can be a bit heavy on slow systems like spark sh4 and dm800hd, especially when playing 720p or higher hls streams will skip and audio dropouts will occur.

 

I hope for tonight to play around with serviceapp and set exteplayer3 as the default backend.

One thing I'd really like is support for external subtitles though.

 

I'll report back my findings later :)


Edited by MastaG, 29 April 2016 - 14:03.


Re: serviceapp - gstplayer and exteplayer3 #16 mx3L

  • Senior Member
  • 616 posts

+79
Good

Posted 29 April 2016 - 14:11

 

One thing I'd really like is support for external subtitles though.

Personally I use mediaplayer2 + subssupport for external subtitles, but of course it can be added to players so it will also work with default MoviePlayer/MediaPlayer.



Re: serviceapp - gstplayer and exteplayer3 #17 MastaG

  • Senior Member
  • 1,531 posts

+118
Excellent

Posted 29 April 2016 - 14:32

Hi mx3L and samsamsam,

 

exteplayer3 fails to build on sh4:

container/container_ffmpeg.c: In function 'FFMPEGThread':
container/container_ffmpeg.c:828:30: error: #error
                             #error
                              ^
WARNING: /media/data2/openpli-oe-core/build/tmp/work/sh4-oe-linux/exteplayer3/26+gitAUTOINC+ab72ea4572-r0/temp/run.do_compile.6588:1 exit 1 from
  sh4-oe-linux-gcc -ml -m4 --sysroot=/media/data2/openpli-oe-core/build/tmp/sysroots/spark playback/playback.c output/writer/mipsel/vc1.c output/writer/mipsel/divx3.c output/writer/mipsel/mpeg4.c output/writer/mipsel/mpeg2.c output/writer/mipsel/h263.c output/writer/mipsel/h264.c output/writer/mipsel/wma.c output/writer/mipsel/amr.c output/writer/mipsel/dts.c output/writer/mipsel/lpcm.c output/writer/mipsel/pcm.c output/writer/mipsel/mp3.c output/writer/mipsel/ac3.c output/writer/mipsel/aac.c output/writer/common/misc.c output/writer/common/pes.c output/writer/mipsel/writer.c output/output.c output/linuxdvb_mipsel.c manager/video.c manager/manager.c manager/audio.c container/container_ffmpeg.c container/container.c main/exteplayer.c -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I/media/data2/openpli-oe-core/build/tmp/work/sh4-oe-linux/exteplayer3/26+gitAUTOINC+ab72ea4572-r0/git//include -I/media/data2/openpli-oe-core/build/tmp/work/sh4-oe-linux/exteplayer3/26+gitAUTOINC+ab72ea4572-r0/image//usr/lib -I/media/data2/openpli-oe-core/build/tmp/work/sh4-oe-linux/exteplayer3/26+gitAUTOINC+ab72ea4572-r0/image//usr/include -lpthread -lavformat -lavcodec -lavutil -lswresample -o exteplayer3

Ah, I see now:

#ifdef __sh__
                            // player2 won't play mono
                            if (out_channel_layout == AV_CH_LAYOUT_MONO)
                            {
                                downmix = 1;
                            }
                            /* At now whole code from this file was not checked on SH4 STB
                             * and probably need to be fixed for these STB
                             */
                            #error
#endif

So samsamsam do you simply remove the #error for your sh4 builds of exteplayer3?


Edited by MastaG, 29 April 2016 - 14:35.


Re: serviceapp - gstplayer and exteplayer3 #18 mrvica

  • Senior Member
  • 1,275 posts

+88
Good

Posted 29 April 2016 - 14:34

could ffmpeg be compiled staticaly (with all symbols and libs in it), just one file, kind of portable version, could even be started from /tmp or from USB, would be easier for testing

Re: serviceapp - gstplayer and exteplayer3 #19 MastaG

  • Senior Member
  • 1,531 posts

+118
Excellent

Posted 29 April 2016 - 14:47

Btw mx3L,

 

Do you also happen to have bitbake recipes for your mediaplayer2 and subssupport github repo's?



Re: serviceapp - gstplayer and exteplayer3 #20 mx3L

  • Senior Member
  • 616 posts

+79
Good

Posted 29 April 2016 - 15:30

@MastaG

 

subssupport recipe is in within kodi-recipes - http://forums.openpl...lo2-and-vuduo2/

mediaplayer2 is not created yet.





3 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users


    Bing (1)