Jump to content

emby not closing previous stream, 2 instances in ffmpeg, freezing


eeeeeesy
Go to solution Solved by eeeeeesy,

Recommended Posts

eeeeeesy

Live TV: emby for android tv not closing previous stream leading to 2 instances in ffmpeg is causing freezing playback and unnecessary streams playing in the background on my emby server for windows when usiing emby for android tv on regular android on the beelink gtking device.

 

i created my own channels coming from my plex library linked to dizquetv which feeds to xteve, which feeds to emby all through ffmpeg.

my channels are freezing because there are 2 instances of channels playing in ffmpeg coming to the same feed, so the previous channel is not getting killed properly. i know this because when i look in the plex dashboard i can see my previously playing show or movie is still playing even though i changed the channel. also when i close the stream i see in ffmpeg console that there is still a stream playing. so what the dev needs to do is in your play command you need to add the kill stream command just before the play stream command to ensure the previous stream gets killed before every new stream. 

 

ffmpeg-transcode-f18f0329-33d5-4afe-ad7a-d7f84484af59_1.txtffmpeg-transcode-57368ead-6ec6-4039-9e1e-6bf4946376d6_1.txtffmpeg-transcode-44dcade5-6513-41ef-9393-f78c6803e93b_1.txtffmpeg-transcode-711e791b-4af1-4b49-8dfc-1483ca892e3f_1.txtembyserver.txt

Edited by eeeeeesy
Link to comment
Share on other sites

eeeeeesy
7 hours ago, Luke said:

Hi, how are you stopping playback when changing from one channel to another?

i press the right mouse click button on my controller to go back

Link to comment
Share on other sites

eeeeeesy

its not just hapening when i stop a stream though. it also happens when i switch from a live tv stream that is already playing to play another stream on live tv too

Edited by eeeeeesy
Link to comment
Share on other sites

eeeeeesy

i can recreate the issuse if i play the same channel a second time that is already playing. the stream is not stopped before reloading the channel so it just makes a second instance in ffmpeg so that there is a ghost stream playing in the background while the new stream is playing which causes a conflict with the channel trying run 2 streams rather than killing the previous stream 

Edited by eeeeeesy
Link to comment
Share on other sites

Hi.  I'm not sure I follow exactly how you have this setup but do you ever have this issue if you back out of playback to the guide and then select a different channel?

Link to comment
Share on other sites

eeeeeesy
1 minute ago, ebr said:

Hi.  I'm not sure I follow exactly how you have this setup but do you ever have this issue if you back out of playback to the guide and then select a different channel?

yes that happens too. but so far is not happening after i disabled "allow video stream copy" in live tv settings

Link to comment
Share on other sites

eeeeeesy

my plex library linked to dizquetv which feeds to xteve, which feeds to emby to play through ffmpeg

 

dizquetv allows me to make my own channels from a library but currently only has the option to read from plex libraries until the dev gets time to add support for standalone external folders or allows reading from emby libraries later too. so then i take the xmltv and the m3u from dizquetv and load them into xteve which allows me to combine my other iptv channels with my custom made dizquetv channels into one m3u and xmltv file. i then have taken the m3u and xmltv links from xteve and loaded it into emby rather than plex because i will no longer use plex since they break live tv with every update. emby is my only hope and so far i like emby way more than plex so i purchased emby premium. then xteve serves the streams through ffmpeg to dizquetvs ffmpeg to embys ffmpeg.

Link to comment
Share on other sites

eeeeeesy
6 hours ago, eeeeeesy said:

im trying a setting out. i have disabled "allow video stream copy" in live tv settings just now.

its still happening even with this setting

Link to comment
Share on other sites

As a test, if you start a channel, then back out of it and wait 30 seconds, then start a channel again - do you have this issue?

Link to comment
Share on other sites

eeeeeesy

if i start then stop then start then stop quickly it recreates the problem. and after doing that creates the ghost channel i waited 30 seconds and the channel still did not get killed as i see it still playing in the plex dashboard and the counter is still climbing like it is actively still playing. i also see it playing in ffmpeg for dizquetv.

Edited by eeeeeesy
Link to comment
Share on other sites

eeeeeesy
2 hours ago, ebr said:

As a test, if you start a channel, then back out of it and wait 30 seconds, then start a channel again - do you have this issue?

 

Link to comment
Share on other sites

Quick question.  When you say two are playing, is this what you see in Emby Dashboard?
If you are talking about seeing two ffmpeg processes running that could be as one could belong to Emby and one to xTevE.

Link to comment
Share on other sites

eeeeeesy
49 minutes ago, cayars said:

Quick question.  When you say two are playing, is this what you see in Emby Dashboard?
If you are talking about seeing two ffmpeg processes running that could be as one could belong to Emby and one to xTevE.

i know 3 ffmpegs are being used. i only see one stream in plex dashboard until re-create the ghost stream. the only ffmpeg i can see a stream running on is the dizquetv ffmpeg which has a stream still running even though it was stopped. emby does not show the ghost stream.

Link to comment
Share on other sites

24 minutes ago, eeeeeesy said:

to be more precise, the ghost channel is created if i start the channel and stop it before it fully buffers

You mean before it starts playing?  If so, yes, I think that is still a known issue in general - that sometimes streams can get stranded if you try to stop them before they even start.

Link to comment
Share on other sites

eeeeeesy
21 minutes ago, ebr said:

You mean before it starts playing?  If so, yes, I think that is still a known issue in general - that sometimes streams can get stranded if you try to stop them before they even start.

ok nice. that narrows down the problem so i know its not something i can do about it.

 

could you please maybe possibly try to fix it as an early christmas present, pretty please? if not its all good i can wait.

Link to comment
Share on other sites

horstepipe

I'm having similar problems with Emby server v4.7.0.18.

If a channel is unavailable (at server side) and doesn't start at client side, Emby keeps blocking the connection. So if I have 3 simultanious streams allowed, one is being blocked until I restart Emby server.

So looks like there is way for improvement.

Just tell me what you need.

 

Best regards

  • Like 1
Link to comment
Share on other sites

eeeeeesy
23 minutes ago, horstepipe said:

I'm having similar problems with Emby server v4.7.0.18.

If a channel is unavailable (at server side) and doesn't start at client side, Emby keeps blocking the connection. So if I have 3 simultanious streams allowed, one is being blocked until I restart Emby server.

So looks like there is way for improvement.

Just tell me what you need.

 

Best regards

yeah same here because i have 2 simultanious streams enabled per user. so if theres a ghost stream still playing in the background, i cant stream because its using up one of my connections.

Edited by eeeeeesy
  • Like 1
Link to comment
Share on other sites

horstepipe

@Luke I sent you a Emby server log via PM, this is the recent server beta v4.7.0.19 - using Emby Theater for Windows.

If I start an unavailable channel, three connections are being blocked and not released. I am not able to quit the stream or do anything else at Emby theater as I'm getting an endless spinning wheel. So I need to "hardly" quit it via the "x" button. The connections are still being used.

Link to comment
Share on other sites

eeeeeesy
On 12/10/2021 at 5:29 PM, ebr said:

You mean before it starts playing?  If so, yes, I think that is still a known issue in general - that sometimes streams can get stranded if you try to stop them before they even start.

the Virtual TV plugin solves this problem but i dont really wanty to use that plugin because its still in beta and it doesnt allow me to randomize individual channels. Can you just take the code from the plugin and put it in the main emby live tv so that it will solve the ghost channel issue? i think theres a function that kills closed streams after 10 seconds of being disconnected. you can use that so people who pay to use live tv dont have to wait until after christmas to watch their christmas channels like me.

Link to comment
Share on other sites

eeeeeesy

@Luke     @ebr     is the ghost stream or stranded stream issue being worked on? i never heard back from you. it happens when using external plugins like ersatzTV and DizqueTV which have their own instances of ffmpeg. ebr said its a known issue.

Edited by eeeeeesy
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...