pünktchen 1258 Posted November 15, 2016 Share Posted November 15, 2016 I'd like to trigger RecordingStatusChanged after timer creation. Any insights how to do this? Thanks in advance! Link to comment Share on other sites More sharing options...
Luke 37046 Posted November 15, 2016 Share Posted November 15, 2016 Don't do that if it's in response to a timer being created by Emby. It's not necessary and won't have any value. If you want to report a timer has been created externally, it could have value, but we should create a separate event so that we don't refresh the whole guide just for that. You only trigger this event when the guide needs to be refreshed, so we're talking major changes like guide data configuration change, tuner hardware change, etc. Link to comment Share on other sites More sharing options...
pünktchen 1258 Posted November 15, 2016 Author Share Posted November 15, 2016 Ah, okay. I've thought there's a refresh problem with in-progress recordings and that RecordingStatusChanged would help here... But i think i've found the root cause why recordings don't playback any longer: public Task<MediaSourceInfo> GetRecordingStream(string recordingId, string streamId, CancellationToken cancellationToken) doesn't return recordingId anymore! Has something changed in beta or dev, that i need to know? Link to comment Share on other sites More sharing options...
Luke 37046 Posted November 16, 2016 Share Posted November 16, 2016 What do you mean doesn't return recording id? Link to comment Share on other sites More sharing options...
pünktchen 1258 Posted November 16, 2016 Author Share Posted November 16, 2016 I mean the recordingId is just empty (btw. streamId is also empty, but i don't need this currently). I don't know when this started, because i don't take every beta update. But it must be a change in the last seven days i think. If i start playback of recordings in of the apps, Emby is calling GetRecordingStream in the plugin. The recordingId is then passed as a parameter to further methods, which start streaming of the recordings in the tv backend. Without this id no streaming is possible. A picture says more than words: Link to comment Share on other sites More sharing options...
Spaceboy 2493 Posted November 16, 2016 Share Posted November 16, 2016 also having this problem, no playback of in progress recordings in android tv Link to comment Share on other sites More sharing options...
Luke 37046 Posted November 17, 2016 Share Posted November 17, 2016 It's being looked into, thanks. Link to comment Share on other sites More sharing options...
Spaceboy 2493 Posted November 17, 2016 Share Posted November 17, 2016 (edited) also having this problem, no playback of in progress recordings in android tv now working again although i am still seeing occasional regular situations where playback of in progress recordings ends early when the same file plays back fine once complete and fully detected. using mxplayer cheers Edited November 17, 2016 by Spaceboy Link to comment Share on other sites More sharing options...
pünktchen 1258 Posted November 17, 2016 Author Share Posted November 17, 2016 now working again although i am still seeing occasional regular situations where playback of in progress recordings ends early when the same file plays back fine once complete and fully detected. using mxplayer cheersThis will hopefully get better when all apps get timeshifting. Link to comment Share on other sites More sharing options...
Luke 37046 Posted November 17, 2016 Share Posted November 17, 2016 I don't recommend doing in-progress recordings with an external player. It's one of those things that should work, but since we have no ability to debug what's going on in the player it's hard for us to provide any kind of support on it. Link to comment Share on other sites More sharing options...
Spaceboy 2493 Posted November 17, 2016 Share Posted November 17, 2016 I don't recommend doing in-progress recordings with an external player. It's one of those things that should work, but since we have no ability to debug what's going on in the player it's hard for us to provide any kind of support on it. mmm i'd love to be able to use either of the internal options but neither work for UK DVBS2 unfortunately Link to comment Share on other sites More sharing options...
Spaceboy 2493 Posted November 28, 2016 Share Posted November 28, 2016 now working again although i am still seeing occasional regular situations where playback of in progress recordings ends early when the same file plays back fine once complete and fully detected. using mxplayer cheers ok, this seems to be highly linked to the actual recording finishing. playback of the in progress recording seems to end early at that point. would a log help diagnose the situation? Link to comment Share on other sites More sharing options...
pünktchen 1258 Posted November 28, 2016 Author Share Posted November 28, 2016 ok, this seems to be highly linked to the actual recording finishing. playback of the in progress recording seems to end early at that point. would a log help diagnose the situation? No, a log wouldn't help here. You are still talking about playback on Android, right? As mentioned before it should work in browsers already and you just have to wait until timeshifting gets ported to the other apps. Some technical background about current situation: Beside Kodi nearly no other Android player is able to directly open a file from a smb share. You always need a smb client that handles your request. (for example via ES File Explorer). That's the reason why Emby (even if you think it's direct playing) streams your recordings via http to the players. But i cannot feed Emby with the actual file path of an inprogress recording, because Emby refuses to open a file that is still growing. What i'm doing now is, i let MPExtended stream the recording right from the beginning and feed Emby with the streaming url. Emby is now reading the MPExtended stream as fast as possible and if it reaches the end of the stream (not necessarily the end of the recording), it just quits! To prevent this from happening, i'm saying to Emby "read the stream at it's native framerate". But unfortunately this is not accurate! With timeshifting enabled via browser playback, Emby doesn't quit anymore at the end of the stream. Instead Emby is waiting until another packet arrives and writes this to a local file.This file in turn is then streamed to the player and you are able to seek within this file. Link to comment Share on other sites More sharing options...
Luke 37046 Posted November 29, 2016 Share Posted November 29, 2016 because Emby refuses to open a file that is still growing. Emby doesn't refuse anything. You are free to pass the file path if you wish, however ffmpeg doesn't support this. It reads the duration when it first opens the file which means in the middle of the recording it will stop because it thinks it has reached the end of the file. Even with the read at native framerate option it will still reach the end. So you can pass the file if you want, but then when it cuts out you're just going to say "emby not working". (And hopefully you won't spread mis-information around causing people think "not working"). The way to handle this situation is to pass something into ffmpeg that is not seekable, such as an http stream, therefore it's unable to read the duration and will just stream indefinitely. Link to comment Share on other sites More sharing options...
pünktchen 1258 Posted November 29, 2016 Author Share Posted November 29, 2016 Emby doesn't refuse anything. You are free to pass the file path if you wish, however ffmpeg doesn't support this. It reads the duration when it first opens the file which means in the middle of the recording it will stop because it thinks it has reached the end of the file. Even with the read at native framerate option it will still reach the end. So you can pass the file if you want, but then when it cuts out you're just going to say "emby not working". (And hopefully you won't spread mis-information around causing people think "not working"). You are just nitpicking here. I know it's ffmpeg. But isn't Emby utilizing ffmpeg?! It's like you are saying "My Apple device has a bad display" and Apple answers "It's not us, it is Samsung - they are making our displays". The comsumers don't care about the detailed insights... The way to handle this situation is to pass something into ffmpeg that is not seekable, such as an http stream, therefore it's unable to read the duration and will just stream indefinitely. Please read my post again. This is exactly what i'm doing already in combination with "read at native framerate", but it's still not working every time for the user. Link to comment Share on other sites More sharing options...
Luke 37046 Posted November 29, 2016 Share Posted November 29, 2016 Thanks, I figured. Just making sure the readers know Link to comment Share on other sites More sharing options...
Spaceboy 2493 Posted January 20, 2017 Share Posted January 20, 2017 No, a log wouldn't help here. You are still talking about playback on Android, right? As mentioned before it should work in browsers already and you just have to wait until timeshifting gets ported to the other apps. Some technical background about current situation: Beside Kodi nearly no other Android player is able to directly open a file from a smb share. You always need a smb client that handles your request. (for example via ES File Explorer). That's the reason why Emby (even if you think it's direct playing) streams your recordings via http to the players. But i cannot feed Emby with the actual file path of an inprogress recording, because Emby refuses to open a file that is still growing. What i'm doing now is, i let MPExtended stream the recording right from the beginning and feed Emby with the streaming url. Emby is now reading the MPExtended stream as fast as possible and if it reaches the end of the stream (not necessarily the end of the recording), it just quits! To prevent this from happening, i'm saying to Emby "read the stream at it's native framerate". But unfortunately this is not accurate! With timeshifting enabled via browser playback, Emby doesn't quit anymore at the end of the stream. Instead Emby is waiting until another packet arrives and writes this to a local file.This file in turn is then streamed to the player and you are able to seek within this file. hello, does it change anything if i now report that playback of all in progress recordings always stop when the recording stops and never under any other circumstances. so its actually when the file stops growing that it goes wrong. when this happens all you can do is go to the recordings screen and keep refreshing the recording until emby picks up the full details of recording time. at that point you can then navigate through the recording back to the point where it stopped but it can take anywhere between 1 and up to 20 mins on occasion Link to comment Share on other sites More sharing options...
Luke 37046 Posted January 20, 2017 Share Posted January 20, 2017 Currently Emby just uses a 5-minute cache without any kind of intelligence. This has the drawback of both refreshing when not needed, and not refreshing when it is needed. @@pünktchen, are you able receive notifications from the tv server to the plugin? If you can, and if we can get these events working, then we can have a nice long cache period with immediate refreshing when it is needed. Link to comment Share on other sites More sharing options...
pünktchen 1258 Posted January 20, 2017 Author Share Posted January 20, 2017 hello, does it change anything if i now report that playback of all in progress recordings always stop when the recording stops and never under any other circumstances. so its actually when the file stops growing that it goes wrong. when this happens all you can do is go to the recordings screen and keep refreshing the recording until emby picks up the full details of recording time. at that point you can then navigate through the recording back to the point where it stopped but it can take anywhere between 1 and up to 20 mins on occasionAre you still using the plugin version of this post: https://emby.media/community/index.php?/topic/41088-Last-Few-Problems&do=findComment&comment=385058 Link to comment Share on other sites More sharing options...
pünktchen 1258 Posted January 20, 2017 Author Share Posted January 20, 2017 @@pünktchen, are you able receive notifications from the tv server to the plugin? If you can, and if we can get these events working, then we can have a nice long cache period with immediate refreshing when it is needed.Not that i know. I'll have to investigate it. Link to comment Share on other sites More sharing options...
Luke 37046 Posted January 20, 2017 Share Posted January 20, 2017 If there is nothing, it might be cheaper to have the plugin poll the tv server every 60 seconds and trigger the event if needed, then we can cache for long periods of time and react to change quicker....as opposed to the current 5 minute cache. Link to comment Share on other sites More sharing options...
Spaceboy 2493 Posted January 21, 2017 Share Posted January 21, 2017 Are you still using the plugin version of this post: https://emby.media/community/index.php?/topic/41088-Last-Few-Problems&do=findComment&comment=385058 i could have been, it wasnt easy to tell what version that was. but i wasnt on the latest version so i've upgraded. Should this solve the issue? it'll be a few days before i can test Link to comment Share on other sites More sharing options...
pünktchen 1258 Posted January 24, 2017 Author Share Posted January 24, 2017 If there is nothing, it might be cheaper to have the plugin poll the tv server every 60 seconds and trigger the event if needed, then we can cache for long periods of time and react to change quicker....as opposed to the current 5 minute cache. What should i poll, timers or recordings? Also some other interesting observations of in progress recordings: If i provide the file path of a recording (not a streaming url) in conjunction with "ReadAtNativeFramerate", playback quits after reaching the runtime that was detected at playback start. This is normal behaviour with ffmpeg i've thought. But if i set "SupportsProbing" to false, the in progress recording plays forever! So ffmpeg itself doesn't seem to have a problem with a still growing file. Any explanation for this? The only real differences in ffmpeg command line parameters are these: With probing -maxrate 616000 -bufsize 1232000 -copyts -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero Without probing -maxrate 1808000 -bufsize 3616000 -fflags +genpts -sc_threshold 0 Link to comment Share on other sites More sharing options...
Luke 37046 Posted January 24, 2017 Share Posted January 24, 2017 i think if you gave it a file path and enabled probing it probably thought it was a fixed length file based on the duration at the time of the probe. Link to comment Share on other sites More sharing options...
pünktchen 1258 Posted January 24, 2017 Author Share Posted January 24, 2017 That was my guess also. The only runtime i see in the logs with probing enabled is "RunTimeTicks" from media source info. So i've set a custom value for RunTimeTicks, that represents the full recording length. Unfortunately this isn't respected, neighter with probing enabled, nor with probing disabled. Can you change this please, so if we already deliver some media source infos, that they take priority? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now