Jump to content

Change in Streaming/Transcoding settings


Recommended Posts

im85288
Posted

The latest version in the repo 0.9.520 (as of now) includes changes in the settings for selecting things like transcoding/streaming and direct play. This has been simplified to only be based on the network bandwidth set in the settings as Video Quality:

 

uap6mLP.png

 

 

LehighBri
Posted (edited)

Great stuff!  I just tried out version 0.9.520 with the new bit rate setting. I have MB3 and XBMB3C running on the same windows machine as WMC (which I used for recording TV shows) as well as my local media.

 
My local imported media plays back fine via direct play (I see "XBMB3C isNetworkQualitySufficient -> TRUE bit rate" in the log). BUT, I use the MB3 WMC plugin to pull in WMC recordings, and when I use the play to command for recordings, the log shows "XBMB3C isNetworkQualitySufficient -> FALSE default". In looking at the code, it looks like the mediaSources variable is NULL in that scenario, when in reality it should be something (perhaps recordings don't have that metadata attribute?).  And my video quality setting in this case is 1000 Mbps HD which is the highest setting, yet direct play still doesn't work for recordings.
 
Do you need to do something to handle live TV recordings differently? Or even better, can you just allow a setting of "Direct Play" which will always use direct play and won't question what bit rate my client can support (since it's a no brainer to always use direct play when all of my clients are on my local network)?
Edited by LehighBri
im85288
Posted

Hi, thanks for the feedback.. we have tried to move away from letting the user make the selection on "transcode", "stream", "direct play" etc.

 

Your right in that when there is no VideoBitRate to compare (i.e. media source) then it assumes transcoding is necessary. Further work is ongoing though here so eventually this should be resolved.

  • Like 1
LehighBri
Posted

Hi, thanks for the feedback.. we have tried to move away from letting the user make the selection on "transcode", "stream", "direct play" etc.

 

Your right in that when there is no VideoBitRate to compare (i.e. media source) then it assumes transcoding is necessary. Further work is ongoing though here so eventually this should be resolved.

 

Great, thanks.  Figured I'd try to test it out early on while things are still in development.  Keep me posted as this evolves and matures as I'm very interested in ensuring the user experience is the same whether I playback imported shows or playback recorded shows.

im85288
Posted

We could just make it default to direct play when there is no media source detected.

 

In the method isNetworkQualitySufficient change it from:

 # Any thing else is not ok
xbmc.log("XBMB3C isNetworkQualitySufficient -> FALSE default")
return False

to:

 # Any thing else is ok
 xbmc.log("XBMB3C isNetworkQualitySufficient -> TRUE default")
 return True

What do you think? 

Posted

i wouldn't. You don't want your default settings producing failures

Posted

Yea i get that you do, but i wouldn't do that for the masses. That's just going to cause waves of people to come in here reporting issues that they can't play content. by default i would try to go with something that will just work.

im85288
Posted

i wouldn't. You don't want your default settings producing failures

 

I think it should be fine, some of the logic I left out here is that with this change it will only try to Direct Play when the locationType is FileSystem and the media has no media source with which to compare the video bitrates. All other cases where transcoding is needed (i.e. channels etc) will still occur.

im85288
Posted

 

We also need the client to report somewhere in the playback screen it is transposing and potentially what it is transposing i.e. audio or video or both

 

Did you see the code sample I posted in the development thread on how to report progress and stop transcoding? In that sample, we can set things like transcoding etc

im85288
Posted

There were a couple of other code posts like stopping the transcoding: http://mediabrowser.tv/community/index.php?/topic/9084-streaming/?p=119631 and after that one on reporting the progress during playback. In that one there's a few parameters that need to be sent so that that get's calculated..probably best to continue this part in the developer thread though. 

im85288
Posted

I added the change to Direct Play things on the file system in version 0.9.522 

 

Please test and check the logs to see if things are either Transcoding or Direct Playing when applicable.

LehighBri
Posted

I added the change to Direct Play things on the file system in version 0.9.522 

 

Please test and check the logs to see if things are either Transcoding or Direct Playing when applicable.

 

I just tried v522.  When I play back imported TV shows, it works great (and that was never in debate, but I sanity checked it anyway).
 
When I playback recorded TV, I get the exception below.  I still don't know why it's saying to Transcode when my MBS and XBMC3C client and my WMC are all on the same PC.  Is the isLocalPath call the one giving the issue??
 
10:15:26 T:1080  NOTICE: XBMB3C isNetworkQualitySufficient -> TRUE bit rate
10:15:26 T:1080  NOTICE: XBMB3C getPlayUrl -> Transcode
10:15:26 T:1080   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.TypeError'>
                                            Error Contents: cannot concatenate 'str' and 'int' objects
                                            Traceback (most recent call last):
                                              File "C:\Users\ERICA\AppData\Roaming\XBMC\addons\plugin.video.xbmb3c\default.py", line 2328, in <module>
                                                PLAY(param_url, pluginhandle)
                                              File "C:\Users\ERICA\AppData\Roaming\XBMC\addons\plugin.video.xbmb3c\default.py", line 815, in PLAY
                                                playurl = PlayUtils().getPlayUrl(server, id, result)
                                              File "C:\Users\ERICA\AppData\Roaming\XBMC\addons\plugin.video.xbmb3c\resources\lib\Utils.py", line 70, in getPlayUrl
                                                playurl = playurl + "&AudioStreamIndex=" + mediaSources[0].get('DefaultAudioStreamIndex')
                                            TypeError: cannot concatenate 'str' and 'int' objects
                                            -->End of Python script error report<--
LehighBri
Posted (edited)
UPDATE: I added some additional debugging on my own, and here's what I get.
10:23:13 T:5960  NOTICE: result.getLocationType=FileSystem
10:23:13 T:5960  NOTICE: self.isLocalPath=True

 

 

I think isLocalPath needs to be examined... as why would you jump to the Transcode logic when I have a local path.  If it's a local path, I would think you should jump to the direct play logic always.  Meaning:

 

if local path, always direct play

else if not local path... then the rest of your current logic should play out...

Edited by LehighBri
im85288
Posted (edited)

Thanks for the quick testing, I pushed version 0.9.523 which should at least fix the error you posted in the first post. 

 

For the other one I'm not so sure. Looking at the older code it was:

if ":\\" in playurl:
              xbmcgui.Dialog().ok(addonSettings.getLocalizedString(30130), addonSettings.getLocalizedString(30131) + playurl)
              sys.exit()

So basically if the path pointed at a local drive like C:\ or something it would pop up the dialog warning that local paths had been detected and to turn on streaming, and I think exit? So with that in mind this version emulates that without the warning dialog, it basically transcodes the item when it is found to point at a local path.

Edited by im85288
LehighBri
Posted

Thanks for the quick testing, I pushed version 0.9.523 which should at least fix the error you posted in the first post. 

 

For the other one I'm not so sure. Looking at the older code it was:

if ":\\" in playurl:
              xbmcgui.Dialog().ok(addonSettings.getLocalizedString(30130), addonSettings.getLocalizedString(30131) + playurl)
              sys.exit()

So basically if the path pointed at a local drive like C:\ or something it would pop up the dialog warning that local paths had been detected and to turn on streaming, and I think exit? So with that in mind this version emulates that without the warning dialog, it basically transcodes the item when it is found to point at a local path.

 

Great, thanks.  523 does fix the exception, but transcoding still kicks in (because of the fact that play URL is "T:\").  I'm working with the serverwmc dev to make sure serverwmc is passing the right file path into MB3 and then this should work great (the issue is that serverwmc is passing the T:\ recording dir, instead of the UNC path which I specified in the serverwmc settings).

 

So once that's fixed, I should be all set.  Thanks again and nice work!

  • Like 1
im85288
Posted

No problem, would path substitution on the server help in this case? i.e. map from T:\ to your UNC path. Or do the paths not get effected by that for serverwmc recordings..

LehighBri
Posted

No problem, would path substitution on the server help in this case? i.e. map from T:\ to your UNC path. Or do the paths not get effected by that for serverwmc recordings..

 

Yes that could be a workaround but I want to avoid that as that's one more setting in MB3 I need to worry about.  The right answer is that ServerWMC config already has that mapping... so it's just a matter of serverwmc passing the correct path to MB3 to use for playback.

 

It's not the end of the world that this doesn't work perfectly for now, but is something I'm just hoping to help tighten up as MB3 and serverwmc integration matures and grows over time.

xnappo
Posted

If this results in streaming instead of direct play on some situations, that will also result in people coming in here with srt problems, fast forward complaints etc. It definitely needs to play from SMB if at all possible, but stream if it can't.

 

xnappo

LehighBri
Posted

If this results in streaming instead of direct play on some situations, that will also result in people coming in here with srt problems, fast forward complaints etc. It definitely needs to play from SMB if at all possible, but stream if it can't.

 

xnappo

 

For imported TV, this works great and direct play works fine.  For recorded TV, once serverwmc corrects this, we should be fine (meaning direct play should work where today it only always transcodes).

LehighBri
Posted (edited)

Quick update here.  @@krustyreturns and I have been working through this for the past couple hours and are stumped.  We double confirmed that ServerWMC has the correct UNC path for my recorded TV, but for some reason MBS is still storing the local recording path in the Json data's "Path" variable.

 

Additionally, I just created a new recording, and when I look at the json data after the recording completes and I reboot MBS completely, it does not have a Path variable at all (and it says LocationType is Remote instead of saying FileSystem) as you can see below!

14:50:10 T:6040  NOTICE: Play jsonData: {"Name":"American Dad","Id":"67f387cc76c172b089bd430750adb99c","DateCreated":"2014-08-01T18:15:24.3459065Z","IsUnidentified":false,"SortName":"american dad","ExternalUrls":[],"MediaSources":[{"Protocol":"Http","Id":"67f387cc76c172b089bd430750adb99c","Type":"Default","Name":"","VideoType":"VideoFile","MediaStreams":[],"PlayableStreamFileNames":[],"Formats":[],"RequiredHttpHeaders":{}}],"Taglines":[],"Genres":[],"PlayAccess":"Full","IsPlaceHolder":false,"RemoteTrailers":[],"ProviderIds":{},"IsHD":false,"IsFolder":false,"Type":"Recording","People":[],"Studios":[],"UserData":{"PlaybackPositionTicks":0,"PlayCount":4,"IsFavorite":false,"LastPlayedDate":"2014-08-01T18:41:17.7177465Z","Played":true,"Key":"Recording-29848314-56576"},"DisplayPreferencesId":"6f93e109f7c77df02733202779c82777","Tags":[],"Keywords":[],"PrimaryImageAspectRatio":1.335,"OriginalPrimaryImageAspectRatio":1.335,"MediaStreams":[],"VideoType":"VideoFile","PartCount":1,"MediaSourceCount":1,"ImageTags":{"Primary":"19766519a73b2cab72726781fb7064b3"},"BackdropImageTags":[],"ScreenshotImageTags":[],"Chapters":[],"LocationType":"Remote","MediaType":"Video","ProductionLocations":[],"LockedFields":[],"LockData":false}

So two questions for MBS devs:

1. Where does MBS get its Path attribute from when interacting with live TV plugins like ServerWMC?

2. Why after a recording completes (example above) does MBS not have a Path variable at all?

 

In both cases, ServerWMC can provide the UNC path, but would like to know how things are working on MBS's side in terms of how it pulls the path info and how it stores and/or updates it.  That's the key to solving this issue.  And I am running MBS 3.0.5309.26857 on windows (on the same machine as WMC).

 

EDIT: I also just tried this on the new MBS  3.0.5326.13255 server version and I get the same results.

 

 

EDIT 2: I did a quick look in the MBS server log when it hits transcoding for the situation above where there is no Path attribute returned via json (which is what XBMB3C uses), that MBS does definitely have the correct filename and path info, but for some reason, when json asks for it it doesn't exist or send back the correct path.

2014-08-01 15:06:49.6625 Info - App: C:\Users\ERICA\AppData\Roaming\MediaBrowser-Server\ffmpeg\20140612\ffmpeg.exe -fflags +genpts -async 1 -vsync -1 -i file:"\\ERICA-PC\Recorded TV\American Dad_TBSHD_2014_08_01_14_14_41.wtv" -map_metadata -1 -threads 2 -sn -codec:v:0 libx264 -preset superfast -crf 23 -maxrate 40000000 -bufsize 80000000 -vsync vfr -force_key_frames expr:gte(t,n_forced*7) -sc_threshold 0 -codec:a:0 aac -strict experimental -af "adelay=1,aresample=async=1000" -hls_time 7 -start_number 0 -hls_list_size 1440 -hls_base_url "hls/8734131142c2cae36d569213bec4b75b/" -y "C:\Users\ERICA\AppData\Roaming\MediaBrowser-Server\transcoding-temp\8734131142c2cae36d569213bec4b75b.m3u8"
Edited by LehighBri
  • Like 1
mini__me
Posted

I'm sure you guys will work this out :)

 

I've offered my services to test as well, but I think you guys have this covered ;)

im85288
Posted

@@LehighBri - your probably best off starting a new post in the live tv section with your specific questions. The change made here seems to be working fine.

LehighBri
Posted

@@LehighBri - your probably best off starting a new post in the live tv section with your specific questions. The change made here seems to be working fine.

 

Sure.  I just created a new post below which focuses on making sure MBS has the right path variable and updates it accordingly if anything changes.

 

http://mediabrowser.tv/community/index.php?/topic/9323-bug-in-caching-path-variable-for-recordings-vs-updating-them-which-leads-to-issues-in-transcode-vs-direct-play/

Posted

I'm with null_pointer. I would like the option (as it used to exist previously) to completely disable transcoding in my XBMB3C HTPC for all media served up by MBS. I ran into related issues with Plex before and it drove me both bat shit crazy and away from Plex. No matter what settings I had configured, I still ended up getting transcoded data which I did NOT want. The two boxes and gigabit network are plenty to handle any media I can throw at them and I have no need for wasting cycles transcoding them.

 

That said, I do have a second client that would benefit from the ability to only transcode DTS audio into AC3 audio and leave the video stream alone. This client is not connected to anything that can decode the DTS properly and as a result I get videos playing where the sounds are normal, but the dialogue is extremely low.

xnappo
Posted

I agree, transcoding and play from stream are useful(using it right now on vacation!), but for my home theatre I don't want to have to muck with it. I will add an off by default switch to force play from SMB when I am back in town if someone doesn't beat me to it.

 

xnappo

  • Like 1
Guest
This topic is now closed to further replies.
×
×
  • Create New...