SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Clients Development
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Clients Development This forum is for discussions relating to SageTV Open Source Clients Development.

Reply
 
Thread Tools Search this Thread Display Modes
  #261  
Old 10-05-2015, 08:05 AM
Taddeusz Taddeusz is offline
SageTVaholic
 
Join Date: Nov 2004
Location: Yukon, OK
Posts: 3,919
Quote:
Originally Posted by stuckless View Post
Just wanted to give an update on the state of video playback. To date, I have not been able to get a video a to play, but I do have much of the communication code written that is responsible for initiating the playback and reading video chunks.

I discovered to my surprise that the HDPVR .ts files that are produced for my recordings do not play, as is, on my device. This is odd, since they are h264 encoded files, but the player doesn't like the ts stream. Also when I have sagetv transcode to mp4, on the fly, the format that it produces, results in a player error on the android device, with a cryptic message like "profile 4 not supported".

Despite this, I think there is still some good progress happening... It's just taking time
The message "profile 4 not supported" is strange as that's actually not a profile. If you're on Windows you can download MediaInfo and try and figure out what it's spitting out. Would stink if your device can't support Level 4 or higher. Blu-ray is Level 4.1. Might also need to tweak the profile to be Main rather than Advanced if it's not already. Are your HDPVR recordings interlaced?
__________________
Server: i5 8400, ASUS Prime H370M-Plus/CSM, 16GB RAM, 15TB drive array + 500GB cache, 2 HDHR's, SageTV 9, unRAID 6.6.3
Client 1: HD300 (latest FW), HDMI to an Insignia 65" 1080p LCD and optical SPDIF to a Sony Receiver
Client 2: HD200 (latest FW), HDMI to an Insignia NS-LCD42HD-09 1080p LCD
Reply With Quote
  #262  
Old 10-05-2015, 08:31 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
I have always found that the HD-PVR .ts files were kind of flaky and often wouldn't play in video players without transcoding. It would have been SO much nicer if the files it produced were standard MP4 files - just like how other recording files from older Hauppauge encoding devices are pretty standard MPEG-2 files. Is this an issue on the Sage side or is this on the Hauppauge driver side?
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #263  
Old 10-05-2015, 09:20 AM
SHS's Avatar
SHS SHS is offline
Moderator
 
Join Date: Mar 2003
Location: Vinita, Oklahoma
Posts: 4,589
Quote:
Originally Posted by wayner View Post
I have always found that the HD-PVR .ts files were kind of flaky and often wouldn't play in video players without transcoding. It would have been SO much nicer if the files it produced were standard MP4 files - just like how other recording files from older Hauppauge encoding devices are pretty standard MPEG-2 files. Is this an issue on the Sage side or is this on the Hauppauge driver side?
That becuase Hauppuage is using High@L4 also keep mind you need used AAC Audio as very few player that even support AC3 or DTS like MCPlayer HD Pro "iOS" or ArkMC "Android'
Stuckless you want try setup the encoder as Base@L2 see if that help any
Reply With Quote
  #264  
Old 10-05-2015, 09:39 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
For the .ts files... this is what my HDPVR provides...

Code:
Input #0, mpegts, from 'AncientAliens-GodsAliens-3611836-0.ts':
  Duration: 00:59:51.27, start: 0.387033, bitrate: 8012 kb/s
  Program 1 
    Stream #0:0[0x1011]: Video: h264 (Main) (HDMV / 0x564D4448), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 60 fps, 60 tbr, 90k tbn, 120 tbc
    Stream #0:1[0x1100]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 118 kb/s
other than "h264" and "ts", I don't know what it produces (interlaced??, etc)

At this point, I doubt sagetv is the fault here. Files play fine on the HD300, etc, so I think I simply need to find the right combination of "supported" containers and codecs that the device will play. I have a feeling for Android, I'm going to have to do a "discovery" phase to determine what is supported natively per device. THere is what "Android" claims to support and what a device actually supports.

I know the .ts files play fine in MXPlayer, but I suspect it's either doing a better job processing the container or, it's using software decoding (not sure how to check that).
Reply With Quote
  #265  
Old 10-05-2015, 09:42 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
FYI... the error I get on the Android client log when sagetv does transcoding on the server is...

Code:
(10-04 09:19:17.785  17119-18074/sagex.miniclient.android W/VideoCapabilities﹕ Unrecognized profile 2130706433 for video/avc
10-04 09:19:17.808  17119-18074/sagex.miniclient.android I/VideoCapabilities﹕ Unsupported profile 4 for video/mp4v-es
Doesn't mean much to me.
Reply With Quote
  #266  
Old 10-05-2015, 10:12 AM
jorton jorton is offline
Sage Icon
 
Join Date: Jul 2005
Location: Canada
Posts: 1,273
Not sure this helps but I am able to play HDPVR 720P .ts content on my Nexus Player over my network in Kodi (Android) without issue with audio pass through for 5.1 Dolby Digital. I will try to find some older 1080i HDPVR .ts content and let you know how it goes later today. I used to have interlacing issues with Plex and 1080i .ts files so I switched to 720p output in my cable boxes.

If this is of no help let me know and I'll keep quiet

J
Reply With Quote
  #267  
Old 10-05-2015, 10:20 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by jorton View Post
Not sure this helps but I am able to play HDPVR 720P .ts content on my Nexus Player over my network in Kodi (Android) without issue with audio pass through for 5.1 Dolby Digital. I will try to find some older 1080i HDPVR .ts content and let you know how it goes later today. I used to have interlacing issues with Plex and 1080i .ts files so I switched to 720p output in my cable boxes.

If this is of no help let me know and I'll keep quiet

J

Eveything helps

I can play the files using MXPlayer, but I cannot play them using ExoPlayer. I suspect the different is that MXPlayer is using mplayer or ffmpeg under the hood, where ExoPlayer will ONLY play certain formats/containers, etc. I don't think it support any software decoding.

THere was player that I tried some time ago, ijkplayer, that was based on ffmpeg... and it played lots of stuff. The problem is that it only support file and http protocols, and you can't actually send it a proprietary stream
Reply With Quote
  #268  
Old 10-05-2015, 04:45 PM
jorton jorton is offline
Sage Icon
 
Join Date: Jul 2005
Location: Canada
Posts: 1,273
1080i .ts HDPVR files also playback using Kodi on my Nexus Player. The de interlacing seems a bit off though.
Reply With Quote
  #269  
Old 10-08-2015, 12:31 AM
Gustovier Gustovier is offline
Sage Aficionado
 
Join Date: Nov 2010
Location: Chicago
Posts: 460
Kodi is using its own video player (just like mxplayer) this is why it's probably working in those apps. There's androids media player which will by default support hardware acceleration for the formats that android TV vendors have enabled. All these other media players will have to be updated accordingly (for example to take advantage of all the nice codec hw decoding the nvidia shield is now offering)

Sean what player are you trying to use with the sage client. exoplayer still?
Reply With Quote
  #270  
Old 10-08-2015, 05:01 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by Gustovier View Post
Kodi is using its own video player (just like mxplayer) this is why it's probably working in those apps. There's androids media player which will by default support hardware acceleration for the formats that android TV vendors have enabled. All these other media players will have to be updated accordingly (for example to take advantage of all the nice codec hw decoding the nvidia shield is now offering)

Sean what player are you trying to use with the sage client. exoplayer still?
I've abandoned ExoPlayer since I think it's too picky on the container format stuff. It would bomb on anything that sagetv gave it (ie, .ts files failed, and trancoded files failed).

Currently I'm using libvlc for android, and initial results are looking pretty good. There are other drawbacks, at the moment, but it appears to handle the formats that sagetv is giving it.

Failing that I might look at ijkplayer.
Reply With Quote
  #271  
Old 10-09-2015, 05:57 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Status update...

Apparently playing video is hard

As noted earlier, I've abandoned ExoPlayer (for now), and I'm going with LibVLC. I when I play a video, I get full audio but no video (but still better than ExoPlayer, since for it, I got nothing).

I haven't troubleshooted it yet, so it may be hardware/software encoding issue, etc.

I also spent the last couple of day trying to "punch a hole" through the Android GLSurfaceView so that I could actually see a View behind the SageTV UI (which is where the video would play, if I could see it ). I have the hole punching done, which is how I can tell that while I have audio, I still don't get a a video

I'll play around with this for a bit, but, if nothing comes of it, then I'll switch over to ijkmediaplayer (which I used in my AndroidTV app previously).

A drawback with LibLVLC and ijkplayer is neither of these support custom media sources at the Android API level. (They both support custom video sources at the native c level, if you understand AVIOContext... so maybe we can enhance either to expose this via a jni layer to android -- that's something better suited for someone with better C skills). So for now, I'm running a nano http server and providing LibVLC with a URL that in turns feeds back to the SageTV custom IO with the server. This all works, but it's just one more layer I had a quick discussion with the author of ijkplayer (via enhancement request) and while they don't support custom video sources, right now, they do have plans for it, down the road... so there's hope, that we can get rid of this layer.
Reply With Quote
  #272  
Old 10-09-2015, 06:22 AM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Is there not an API that can render video directly TO the GLSurfaceView?
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #273  
Old 10-09-2015, 06:35 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by Fuzzy View Post
Is there not an API that can render video directly TO the GLSurfaceView?
In essence that exactly what all these players do. ie, You create a SurfaceView and you pass it to the player, and they render directly to the SurfaceView (after decoding the video frames). So contract is that you provide a stream, and they will decode it, and render it.

The Entry point to these players differ. ie, with ExoPlayer you create a DataSource which is way for the player to read bytes of data in an abstract way, so it can come from a file, url, or a custom source. LibVLC and many other players, just assume that you are using a File or URL, so they don't provide a lower level means to provide a custom data source (at least not at the Java layer).
Reply With Quote
  #274  
Old 10-09-2015, 07:05 AM
Taddeusz Taddeusz is offline
SageTVaholic
 
Join Date: Nov 2004
Location: Yukon, OK
Posts: 3,919
IMHO, Android development is a PITA. Unless your app does nothing useful there's no real way to guarantee that it will work as you (or the user) expects it to across multiple brands or even models within a brand. Android fragmentation is far worse for the developer than anyone else.

Video playback is a prime example. In iOS, in my experience, you can use the built-in player framework and it just works. Android is far more difficult for this. I think needlessly so. If I remember correctly there's not really a built-in library. You can use the system default player but then there's no guarantee on any device that it will work. It's been quite a while since I've done Android development but it left a lasting bad impression on me.
__________________
Server: i5 8400, ASUS Prime H370M-Plus/CSM, 16GB RAM, 15TB drive array + 500GB cache, 2 HDHR's, SageTV 9, unRAID 6.6.3
Client 1: HD300 (latest FW), HDMI to an Insignia 65" 1080p LCD and optical SPDIF to a Sony Receiver
Client 2: HD200 (latest FW), HDMI to an Insignia NS-LCD42HD-09 1080p LCD
Reply With Quote
  #275  
Old 10-09-2015, 07:21 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by Taddeusz View Post
IMHO, Android development is a PITA. Unless your app does nothing useful there's no real way to guarantee that it will work as you (or the user) expects it to across multiple brands or even models within a brand. Android fragmentation is far worse for the developer than anyone else.

Video playback is a prime example. In iOS, in my experience, you can use the built-in player framework and it just works. Android is far more difficult for this. I think needlessly so. If I remember correctly there's not really a built-in library. You can use the system default player but then there's no guarantee on any device that it will work. It's been quite a while since I've done Android development but it left a lasting bad impression on me.
Well, I can certainly respect your point of view But to be fair, if all I wanted to do was play a video in a format that Android supported, it would be trivial I think when you get to the video playback part of your app, on iOS, you'll quickly find out that the iOS media player doesn't "just work". the iOS media player, like the android one, just works if you feed it data it likes. That why for iOS, you almost always have to transcode the data in order to get anything play on the device or the AppleTV.

This is why players like ijkplayer exist (which is supported on both ios and android), because these device are really bad at supporting anything except for the very explicit formats that they claim to work with.

And I can assure you, the "fragmentation" propaganda is far less worry than the media would make it out to be. I've been writing for Android since 1.0, and I can't say that I've hit a "fragmentation" issue yet. I've run into LOTS of other issues, but fragmentation gives me no stress.

Now, for iOS... if could only figure out how to actually publish an app.. I could release a game a created several months ago... but sadly, while publishing something on google plays takes a couple minutes... I've yet to find the "submit" page for iOS I'm sure it's burried in there somewhere...
Reply With Quote
  #276  
Old 10-09-2015, 07:47 AM
Taddeusz Taddeusz is offline
SageTVaholic
 
Join Date: Nov 2004
Location: Yukon, OK
Posts: 3,919
Quote:
Originally Posted by stuckless View Post
Well, I can certainly respect your point of view But to be fair, if all I wanted to do was play a video in a format that Android supported, it would be trivial I think when you get to the video playback part of your app, on iOS, you'll quickly find out that the iOS media player doesn't "just work". the iOS media player, like the android one, just works if you feed it data it likes. That why for iOS, you almost always have to transcode the data in order to get anything play on the device or the AppleTV.

This is why players like ijkplayer exist (which is supported on both ios and android), because these device are really bad at supporting anything except for the very explicit formats that they claim to work with.

And I can assure you, the "fragmentation" propaganda is far less worry than the media would make it out to be. I've been writing for Android since 1.0, and I can't say that I've hit a "fragmentation" issue yet. I've run into LOTS of other issues, but fragmentation gives me no stress.

Now, for iOS... if could only figure out how to actually publish an app.. I could release a game a created several months ago... but sadly, while publishing something on google plays takes a couple minutes... I've yet to find the "submit" page for iOS I'm sure it's burried in there somewhere...
Video playback is only a single example. Probably not the best. Other examples would be preparing emails & text messages from within an app. For those things, from my experience, Android relies on the default apps for those. Then the user must essentially exit the app to complete the actions.

My other problem was being able to tell what type of device the app was running on. Whether it was a phone or tablet. The best I could ever find was using the resolution and ppi to determine the screen size. Even now that Apple has moved away from the original fixed templates for iPhone & iPad, iOS has size classes so you can design the layout by class. I never saw anything like that for Android.

Maybe I was approaching these tasks or problems from the wrong angle since I was new to the platform.

For submitting iOS apps you first have to prepare the information for your App in iTunes Connect. Then I believe you're supposed to use the Application Loader to submit your app from Xcode. I believe you can also create an archive and submit your app from the Organizer window. I don't currently have a device plugged into my Mac at home so I cannot create an archive to confirm that.
__________________
Server: i5 8400, ASUS Prime H370M-Plus/CSM, 16GB RAM, 15TB drive array + 500GB cache, 2 HDHR's, SageTV 9, unRAID 6.6.3
Client 1: HD300 (latest FW), HDMI to an Insignia 65" 1080p LCD and optical SPDIF to a Sony Receiver
Client 2: HD200 (latest FW), HDMI to an Insignia NS-LCD42HD-09 1080p LCD
Reply With Quote
  #277  
Old 10-09-2015, 08:16 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by Taddeusz View Post
Video playback is only a single example. Probably not the best. Other examples would be preparing emails & text messages from within an app. For those things, from my experience, Android relies on the default apps for those. Then the user must essentially exit the app to complete the actions.
It's funny because as developer, I always loved the fact that I use use intents to send/share and not have to re-invent it in my app. In some of my other apps, sharing something to facebook, twitter, email, etc, is a couple lines of code and it covers all the services. It is fundamentally different than iOS, I agree, but I think iOS has implemented something similar, now, if I recall.

Quote:
Originally Posted by Taddeusz View Post
My other problem was being able to tell what type of device the app was running on. Whether it was a phone or tablet. The best I could ever find was using the resolution and ppi to determine the screen size. Even now that Apple has moved away from the original fixed templates for iPhone & iPad, iOS has size classes so you can design the layout by class. I never saw anything like that for Android.
Yeah, if anything, android covers this to a fault. In android you can configure layouts by density, screen size, type, height, width, language, etc. As I said, almost too many options, which is why people probably don't realize it exists. Check out the configuration qualifiers, in this documentation. http://developer.android.com/guide/t...resources.html (and this applied not only to layout files, but images, etc).

Quote:
Originally Posted by Taddeusz View Post
For submitting iOS apps you first have to prepare the information for your App in iTunes Connect. Then I believe you're supposed to use the Application Loader to submit your app from Xcode. I believe you can also create an archive and submit your app from the Organizer window. I don't currently have a device plugged into my Mac at home so I cannot create an archive to confirm that.
That would explain it... I've spent my time looking through the apple developer site, looking for a developer console where I can configure and publish my app. I hate using Xcode, so I rarely go into it. So, I need to use XCode to create and upload the profile?? What is iTunes connect? Is that a part of Xcode? A web application?
Reply With Quote
  #278  
Old 10-09-2015, 07:55 PM
Fonceur's Avatar
Fonceur Fonceur is offline
Sage Icon
 
Join Date: Jan 2008
Location: DDO, QC
Posts: 1,915
Have you tried streaming using the HTTP Live Streaming from the media streaming plugin? I would expect Android video players to handle it better by now...

Quote:
Originally Posted by stuckless View Post
I hate using Xcode, so I rarely go into it. So, I need to use XCode to create and upload the profile?? What is iTunes connect? Is that a part of Xcode? A web application?
Apple's web site to publish apps:

https://itunesconnect.apple.com/WebO...nesConnect.woa

From the iOS dev center, you basically create the certificate/app id/profile for your app. With iTunes Connect, you do stuff similar to the Google Play Console. Then through XCode you can use the Archive command to push your app to the store and submit it through iTunes Connect.
__________________
SageTCPServer (2.3.5): Open source TCP interface to the SageTV API
MLSageTV (3.1.8)/Sage Media Server (1.13): SageTV plugin for MainLobby/CQC
TaSageTV (2.58)/TaSTVRemote (1.14): Monitor/control SageTV with an Android device
TbSageTV (1.02)/STVRemote (1.11): Monitor/control SageTV with a PlayBook 2
TiSageTV (1.64)/TiSTVRemote (1.09): Monitor/control SageTV with an iPhone/iPod/iPad
Reply With Quote
  #279  
Old 10-09-2015, 09:01 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Quote:
Originally Posted by Fonceur View Post
Have you tried streaming using the HTTP Live Streaming from the media streaming plugin? I would expect Android video players to handle it better by now...
I think he's trying to stay within the placeshifter protocol here.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #280  
Old 10-10-2015, 03:37 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by Fonceur View Post
Apple's web site to publish apps:

https://itunesconnect.apple.com/WebO...nesConnect.woa

From the iOS dev center, you basically create the certificate/app id/profile for your app. With iTunes Connect, you do stuff similar to the Google Play Console. Then through XCode you can use the Archive command to push your app to the store and submit it through iTunes Connect.
Thanks I'll definitely check it out.

Quote:
Originally Posted by Fonceur View Post
Have you tried streaming using the HTTP Live Streaming from the media streaming plugin? I would expect Android video players to handle it better by now...
Quote:
Originally Posted by Fuzzy View Post
I think he's trying to stay within the placeshifter protocol here.
Yeah the exercise isn't so much about about just getting a video to play, but to actually build a miniclient using the protocols that sagetv provides. There are many benefits to doing this over using hls, one of which is that sagetv may not need to transcode every file, as it would if I were using hls. Also, when it comes seeking (which I'm not there yet), sagetv does some other help as well, which is why seeking on the hd300 is lightening fast. SageTV does has some intelligence to figure out what formats it needs to transcode and which formats it just push natively, but the client has to be sending the right information as well. Internally SageTV does have an HLS server, but I haven't tried to activate it, yet. And it may be that I can simply activate it as part of the PUSH/PULL protocols that it supports now, but, first, I would like to get it's 2 native protocols working.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Finally, a fully functional SageTV client on android and iphone! mkanet SageTV v7 Customizations 12 01-12-2013 12:22 AM
SageTV Placeshifter for Android nyle SageTV Placeshifter 5 12-31-2011 10:40 AM
Sage should get an android client running on this Deacon Crusher Hardware Support 1 09-29-2010 11:30 AM
Android client? equalize SageTV Placeshifter 1 07-22-2010 09:37 AM


All times are GMT -6. The time now is 12:53 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.