omxplayer and RTSP over TCP
#1
Hello,

please, I cannot solve my problem with playing IP camera RTSP stream over TCP.
Using Raspbian's omxplayer with argument: --avdict  'rtsp_transport:tcp' forces omxplayer to try TCP protocol first -  and I can enjoy nice uncorrupted video.

I do not see any method or workaround to pass arguments to kodi's build in omxplayer. advancedsettings.xml are useless. Also no success to set up omxplayer as external player (it works but no picture on Raspberry3).

I do not believe that I am only one, this request should be common issue.

Thank you
Reply
#2
No solution, but I'll just say I see a similar issue running OSMC on a Raspberry Pi3.  The OMXPlayer won't play LiveTV (NextPVR backend), at least not MPEG2 (I have the MPEG2 license).  All I get is a black screen and no audio.  The Player Process screen shows audio and video info, so it seems to think it's playing something.  Anyway, using the built in player works, so I just use that.
Reply
#3
(2017-12-18, 00:04)pkscout Wrote: No solution, but I'll just say I see a similar issue running OSMC on a Raspberry Pi3.  The OMXPlayer won't play LiveTV (NextPVR backend), at least not MPEG2 (I have the MPEG2 license).  All I get is a black screen and no audio.  The Player Process screen shows audio and video info, so it seems to think it's playing something.  Anyway, using the built in player works, so I just use that.
 Thank you for your idea. 
And can report  little progress.
Because the same strange behavior here, black screen and omxplayer is playing my stream somewhere (nothing in log file) I had tried few args and "--layer 100" works and my omxplayer is visible. 
omxplayer (Build date: Wed, 05 Jul 2017 16:40:39 +0100  Version   : 5a25a57 [debian]) + Raspbian GNU/Linux 9 (stretch) + kodi v17.6 and playercorefactory.xml:

<playercorefactory>
 <players>
   <player name="OmxPlayer" type="ExternalPlayer" audio="false" video="true">
     <filename>omxplayer</filename>
     <args> --avdict 'rtsp_transport:tcp' --display 0 --layer 100 "{1}"</args>
     <hidexbmc>true</hidexbmc>
   </player>
 </players>
 <rules action="prepend">
   <rule name="rtsp" protocols="rtsp" player="OmxPlayer" />
 </rules>
</playercorefactory>

but, another problem,   I can not control external player from kodi  - at least to terminate process - my only solution is switch off the raspberry pi.. Sad
Reply
#4
On the Raspberry Pi, like it is now, you cannot use an external player, that is for sure. As you said, Kodi has omxplayer buit-in, but I am not sure if you can pass arguments into it, I think not, correct me if I am wrong.
Anyway, what is the codec type of the stream ? I am asking this because on Raspbian you cannot play some codecs like MJPEG unless you enable the camera module in raspi-config or add start_x=1 in /boot/config.txt (it is the same thing). Try that, reboot after changing it. Disable omxplayer and enable mmal in Kodi settings.
Reply
#5
(2017-12-18, 03:35)rascas Wrote: On the Raspberry Pi, you cannot use an external player, that is for sure. As you said, Kodi has omxplayer buit-in, but I am not sure if you can pass arguments into it, I think not, correct me if I am wrong.
Anyway, what is the codec type of the stream ? I am asking this because on Raspbian you cannot play some codecs like MJPEG unless you enable the camera module in raspi-config or add start_x=1 in /boot/config.txt (it is the same thing). Try that, reboot after changing it. Disable omxplayer and enable mmal in Kodi settings.
 In my case these are MPEG2 streams (it's LiveTV from NextPVR).  If I record the exact same thing and then play it from the drive, OMX plays it just fine.  It's just the streaming LiveTV that doesn't work.

I went ahead and got a debug log using both OMXPlayer and MMAL and started a thread on the OSMC forums (since I'm using OSMC and not the vanilla Raspian).  I'll report back if they come up with anything over there.
Reply
#6
(2017-12-18, 05:33)pkscout Wrote:
(2017-12-18, 03:35)rascas Wrote: On the Raspberry Pi, you cannot use an external player, that is for sure. As you said, Kodi has omxplayer buit-in, but I am not sure if you can pass arguments into it, I think not, correct me if I am wrong.
Anyway, what is the codec type of the stream ? I am asking this because on Raspbian you cannot play some codecs like MJPEG unless you enable the camera module in raspi-config or add start_x=1 in /boot/config.txt (it is the same thing). Try that, reboot after changing it. Disable omxplayer and enable mmal in Kodi settings.
 In my case these are MPEG2 streams (it's LiveTV from NextPVR).  If I record the exact same thing and then play it from the drive, OMX plays it just fine.  It's just the streaming LiveTV that doesn't work.

I went ahead and got a debug log using both OMXPlayer and MMAL and started a thread on the OSMC forums (since I'm using OSMC and not the vanilla Raspian).  I'll report back if they come up with anything over there. 
Unpleasant surprise for me that  we can not to pass args to built-in omxplayer (demuxer).

Thanks for inspiration, I switched from raspbian to OSMC and I have installed command line omxplayer to OSMC,  using instructions here: https://www.gaggl.com/2013/01/installing...pberry-pi/ :
sudo apt-get install libpcre3 fonts-freefont-ttf fbset libpcre3-dev libpcrecpp0 libva-dev libva-x11-1 libva1
sudo wget http://omxplayer.sconde.net/builds/omxpl..._armhf.deb
sudo dpkg -i omxplayer_0.3.7~git20170130~62fb580_armhf.deb

and with putty ssh I can run:

sudo omxplayer --avdict 'rtsp_transport:tcp' --display 0 --layer 100 rtsp://user:password@my_stream

My IP Cam video (1080p h.264) magically show up in front of kodi.
In contrary to omxplayer runnig as a external player, now  I successfully terminated process simple pressing Ctrl-C

pretty dirty solution.  playercorefactory.xml needs new function,  keys binding with option to send keystrokes to launched external player.
Maybe there is another simple workaround..
Reply
#7
omxplayer as in standalone application is actually very different from kodi built-in omxplayer, they use the same api (OMX) tho 

> playercorefactory.xml needs new function, ...
feel free to write this new function, kodi is open source, you know ...
standalone omxplayer can be controlled via dbus, feel free to write an addon using python and dbus (much easier than to implement this in c++ for kodi core) to launch and control (standalone) omxplayer.
Reply
#8
BTW, the response over on the OSMC forums was basically:

¯\_(ツ)_/¯ 

The OMXplayer in Kodi is inconsistent with streams.  For me it works fine with things like YouTube, Vimeo, etc.  But any LiveTV MPEG2 stream just doesn't work.  If I turn off ALL hardware decoding then OMXPlayer plays the MPEG2 stream, but only at about 10 fps.  I finally just gave up and went with VideoPlayer with MMAL support, as it works with hardware decoding.
Reply
#9
Do you have an mpeg-2 hardware decode license installed and active on your pi?
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply
#10
(2017-12-23, 16:50)DarrenHill Wrote: Do you have an mpeg-2 hardware decode license installed and active on your pi?
Yup.  With OMXPlayer hardware encoding enabled, the MPEG2 stream from the PVR software (NextPVR) just shows a blank screen.  With VideoPlayer and MMAL hardware encoding, it's fine.  And with both hardware encoding options off, then it's 10fps or so.  I *think* with hardware encoding off on both that OSMC uses OMXPlayer by default.
Reply
#11
(2017-12-23, 23:49)pkscout Wrote:
(2017-12-23, 16:50)DarrenHill Wrote: Do you have an mpeg-2 hardware decode license installed and active on your pi?
Yup.  With OMXPlayer hardware encoding enabled, the MPEG2 stream from the PVR software (NextPVR) just shows a blank screen.  With VideoPlayer and MMAL hardware encoding, it's fine.  And with both hardware encoding options off, then it's 10fps or so.  I *think* with hardware encoding off on both that OSMC uses OMXPlayer by default.  
@pkscout,

I know this is an "old" thread, but it looks pretty relevant to a problem I've been having with VideoPlayer and MMAL hardware encoding.  Do you experience a problem with seek step back "stalling" using VideoPlayer and MMAL hardware encoding?  I do, and apparently it translates back to a Kodi bug that's been out there for almost a year.  I don't get the same stalling problem with OMX, but, as you've noted, I can't watch live TV with OMX either.  Right now, I've switched hardware acceleration off for both OMX and MMAL.

Thanks for any insight.
Reply
#12
(2018-03-14, 00:36)FrogFan Wrote: I know this is an "old" thread, but it looks pretty relevant to a problem I've been having with VideoPlayer and MMAL hardware encoding.  Do you experience a problem with seek step back "stalling" using VideoPlayer and MMAL hardware encoding?  I do, and apparently it translates back to a Kodi bug that's been out there for almost a year.  I don't get the same stalling problem with OMX, but, as you've noted, I can't watch live TV with OMX either.  Right now, I've switched hardware acceleration off for both OMX and MMAL.

Thanks for any insight. 
I do get a stall every once in awhile if I seek backwards, but not more than once a week or so.  And I do *a lot* of back seeking 10 seconds when I've overshot the commercial break on a recording.  Usually everything work itself out if I'm patient, but sometimes I have to SSH into the OSMC box and reboot it to get things unstuck.  So really no other insight than "yes, I see that from time to time."
Reply
#13
(2018-03-14, 00:43)pkscout Wrote:
(2018-03-14, 00:36)FrogFan Wrote: I know this is an "old" thread, but it looks pretty relevant to a problem I've been having with VideoPlayer and MMAL hardware encoding.  Do you experience a problem with seek step back "stalling" using VideoPlayer and MMAL hardware encoding?  I do, and apparently it translates back to a Kodi bug that's been out there for almost a year.  I don't get the same stalling problem with OMX, but, as you've noted, I can't watch live TV with OMX either.  Right now, I've switched hardware acceleration off for both OMX and MMAL.

Thanks for any insight. 
I do get a stall every once in awhile if I seek backwards, but not more than once a week or so.  And I do *a lot* of back seeking 10 seconds when I've overshot the commercial break on a recording.  Usually everything work itself out if I'm patient, but sometimes I have to SSH into the OSMC box and reboot it to get things unstuck.  So really no other insight than "yes, I see that from time to time."  
 Thank you!  It's good to know others are having this problem.  I get the back seeking problem (like you, after overshooting commercials) 2 or 3 times per hour long show though, so it's hard for me to be patient <smiles>.  I got spoiled using my Windows 7 laptop for Kodi.  No back seeking problems at all with it.  I'll try acceleration off for both for awhile and see what happens.
Reply

Logout Mark Read Team Forum Stats Members Help
omxplayer and RTSP over TCP0