Jump to content

Kill 4K Transcode Streams/Paused Time Out


bakes82
 Share

Recommended Posts

Whats the bug?
Before it was killing the stream when audio was allowed but video was not because of  a bad logic check.  (try trans coding video and see)

The audio thing should only appear for the first 5% of the movie.  For the movie 1917 it was for the first 5min maybe and the sched job is set t run every 1min so it would be seen 1-6x or if you change the timer on the job it would  be you know less :P  Idr what times the UI allows for, I know in the code I set for 1 min, but the UI might only allow for 5 of 15min as the min which would be bad.
But now that things seem to working let it run for a few days let me know lol.  I could add a % dropbox for it default to 5 and you could change to 0.

Edited by bakes82
Link to comment
Share on other sites

The bug was only the wrong killing message, it killed for video transcode and shows because of audio transcode.

And yes a dropbox would be great. 

I continue testing it with my friends and give u a response in a few days :) Thx

Link to comment
Share on other sites

Let me know if you see it again, it might happen, I dont exit the loop when one thing is meet, so if it meets 1 you get a message and then it somehow you meet 2 you could get another message.  So it guess its possible to see Killed Video, then Please dont transcode audio.

Link to comment
Share on other sites

Hey

Tested now a few days. Its working good

Theres only one Thing. It cant Stop the transcodes from Playstation or chromecast but i guess thats because theres so control from emby. I also have no Stop Button when this Devices streaming. With Android, firetv, LG, etc its working great. Thx again :)

Link to comment
Share on other sites

10 minutes ago, MangoMC said:

Hey

Tested now a few days. Its working good

Theres only one Thing. It cant Stop the transcodes from Playstation or chromecast but i guess thats because theres so control from emby. I also have no Stop Button when this Devices streaming. With Android, firetv, LG, etc its working great. Thx again :)

@Luke Does that make sense they wouldnt have a stop button/feature?  What would the equivalent be?

Link to comment
Share on other sites

@MangoMC Try this one, its beta, if the media source id doesnt mach youll get a diff error on the screen.  The web UI doesnt have a "stop" button either but I can still stop the stream with the plugin.  Are you testing the same file on the chomecast/playstation/shield/etc ?

KillStreams.dll

Link to comment
Share on other sites

No, doesnt work. Playstation is transcoding without stopping. 

And yes, the person i know with the playstation is trying with the same file like me on my firetv or android phone

Link to comment
Share on other sites

In the logs (embyserver.txt) it have any errors?  If you can post one from where it was doing the kill on the playstation maybe there is something I can see, error or no error.  Ideally it should work for all devices but we shall see, at least its working on the newer ones :P

EX:

2020-12-01 03:40:29.827 Info App: Count of streams 2
2020-12-01 03:40:29.827 Info App: AllowAudioTranscode True AllowVideoTranscode False
2020-12-01 03:40:29.827 Info App: Device Id 802f2824-a5c6-4f25-99f1-341191ff2cba - UserName Administrator - ID 58aa45fcce91bb0141110d899dc092d5 PlayState Method  AudioDirect  Video Direct 
2020-12-01 03:40:29.827 Info App: Device Id 0cb769e8-ac64-4b00-8399-6bcb486760de - UserName Administrator - ID e90c687ffb72fb7921d9ace9b039caab PlayState Method Transcode AudioDirect False Video Direct False
2020-12-01 03:40:29.830 Error TaskManager: Error
	*** Error Report ***
	Version: 4.5.2.0
	Command line: /system/EmbyServer.dll -programdata /config -ffdetect /bin/ffdetect -ffmpeg /bin/ffmpeg -ffprobe /bin/ffprobe -restartexitcode 3
	Operating system: Linux version 4.19.0-10-amd64 (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.132-1 (2020-07-24)
	Framework: .NET Core 3.1.7
	OS/Process: x64/x64
	Runtime: system/System.Private.CoreLib.dll
	Processor count: 6
	Data path: /config
	Application path: /system
	System.InvalidOperationException: System.InvalidOperationException: Sequence contains no matching element
	   at System.Linq.ThrowHelper.ThrowNoMatchException()
	   at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
	   at KillStreams.KillStreamScheduledTask.Execute(CancellationToken cancellationToken, IProgress`1 progress)
	   at Emby.Server.Implementations.ScheduledTasks.ScheduledTaskWorker.ExecuteInternal(TaskOptions options)
	Source: System.Linq
	TargetSite: Void ThrowNoMatchException()
	
Link to comment
Share on other sites

Interesting lol.  Do they get the message by chance?

 

2020-11-30 20:01:30.495 Info App: Device Id e2203431-6bae-4f2c-b68f-5a0d224af68e - UserName Lea - ID a7f624f30fb7e2c57a45749cff166cc8 PlayState Method Transcode AudioDirect False Video Direct False MediaSourceId 1a661adae0e41211864bab1bd2e7535d
2020-11-30 20:01:30.497 Info App: Height 1636 Width  3840
2020-11-30 20:01:30.530 Info App: Inside Kill Video 4k

Link to comment
Share on other sites

1 minute ago, MangoMC said:

I try it tomorrow. Its 22.20 here :), I guess lea is sleeping haha

No rush lol  Im sure there is a magic command to send to kill it, just need to find the combo.

Link to comment
Share on other sites

  • 1 month later...

Hi everyone i have tested this plugin, but unfortunatelly it doesn't kill the 4K streams / Movies it still continue to transcode content unfortunately, i have set nag transcode and it saved but still transcoded it

Link to comment
Share on other sites

4 hours ago, CyberPoison said:

Hi everyone i have tested this plugin, but unfortunatelly it doesn't kill the 4K streams / Movies it still continue to transcode content unfortunately, i have set nag transcode and it saved but still transcoded it

You provided no useable feedback. It works fine on a shield devices. I believe someone else tested above and said it doesn’t work on cheaper things like fire sticks.  It doesn’t look like all the clients have the same api options to stop stuff.   Nag transcode would obviously not kill a transcode it’s for use is limited since the player defaults to auto and picks best quality it can. Where in plex the default quality is default to 4mb.  The logs will also tell you more info .

Link to comment
Share on other sites

Yeah let me explain what happen, and let more details about my issue, because regarding my last comment doesn't look very helpfull

I tested on Chrome Browser and a play this movie image.thumb.png.7cc5911c1dcd365e1edd19a63f58064d.png
 

So i set my Kill Stream config like this
image.thumb.png.5e78781377d50e252747ae138fb2d55c.png
 

My Logs is the following

image.thumb.png.4796d513eaa68cd7a65074f0f5398bf4.png

 

Trancoding Logs maybe can help you debug it.Logs.txt
 

I usally block trancoding on emby natively for each user, because of the default quality set by the client is allway lower than the bitrate, but there is a bug on emby, the recorded lives from tv channels by scheduling is not playable on the browser directly so i a bit lost with it because i don't know what to do or how to mitigate this issue. 

I hope everything can help you, if you need my logs of emby (But i guess is not really necessary because is nothing there revelant) just tell me sorry for last post i was tired not sleeping for 13 hours, but now i'm nice and awake to write you this :)

Kind Regards

Link to comment
Share on other sites

Thats more gooder, can run the schedule task to rotate the system logs, try the same test, and then send the normal embyserver logs, thats where plugsins write logs too, the transcode logs means nothing to me 😜  

 

Try the attached DLL.  Looks like I have a WIP code that has extra logging and maybe kills streams another way also.

image.png.4a2984e1e64e0b8fbe492d25eac1375e.png

image.thumb.png.1399fcc4b14e989ca7311f60478a13ee.png

 

Logs should have something like this:

2021-01-05 19:51:33.281 Debug TaskManager: Executing Task to kill streams
2021-01-05 19:51:33.301 Info Server: http/1.1 GET http://localhost:8096/emby/ScheduledTasks?isHidden=false&X-Emby-Client=Emby Web&X-Emby-Device-Name=Firefox&X-Emby-Device-Id=963f417a-4f9e-4a31-b3e2-a3f0ebab6553&X-Emby-Client-Version=4.5.4.0. UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0
2021-01-05 19:51:33.301 Info App: Count of streams 4
2021-01-05 19:51:33.302 Info App: AllowAudioTranscode False AllowVideoTranscode False
2021-01-05 19:51:33.302 Info App: Device Id 963f417a-4f9e-4a31-b3e2-a3f0ebab6553 - UserName Administrator - ID e9c1e79c56c7074b5eee100d9e51e98d PlayState Method  AudioDirect  Video Direct  MediaSourceId 
2021-01-05 19:51:33.302 Info App: Device Id 5f41ffa9-b227-4425-aa93-3974b12f4d75 - UserName Administrator - ID 8d37030bac2e0d62abd483f17200916a PlayState Method Transcode AudioDirect False Video Direct False MediaSourceId 411c57b4a705b565a8cee58906290aa1
2021-01-05 19:51:33.303 Info App: Height 2160 Width  3840
2021-01-05 19:51:33.303 Info App: Inside Kill Video 4k // This here means the stream matches a 4k and will be killed.
2021-01-05 19:51:33.303 Info App: Device Id 5f41ffa9-b227-4425-aa93-3974b12f4d75 - UserName Administrator - ID 8d37030bac2e0d62abd483f17200916a - Supports Media Control True - Supported Commands MoveUp, MoveDown, MoveLeft, MoveRight, PageUp, PageDown, PreviousLetter, NextLetter, ToggleOsd, ToggleContextMenu, Select, Back, SendKey, SendString, GoHome, GoToSettings, VolumeUp, VolumeDown, Mute, Unmute, ToggleMute, SetVolume, SetAudioStreamIndex, SetSubtitleStreamIndex, RefreshMediaSource, DisplayContent, GoToSearch, DisplayMessage, SetRepeatMode, SetSubtitleOffset, SetPlaybackRate, ChannelUp, ChannelDown, PlayMediaSource, PlayTrailers

KillStreams.dll

Link to comment
Share on other sites

  • 2 weeks later...

Using Ur New Version From github now. Seems to work. Couldnt test it on every device but with AndroidTV it Works good. Only the 4k Audio transcode Info is still There and cant be deactivated. Dont need it and dont want to install visual Studio again to remove it :D

Edited by MangoMC
Link to comment
Share on other sites

So check the box to allow 4k audio trans code ?  Sounds like you are playing a 4k file with atmos to a receiver that doesnt support it and its transcoding the audio down.  Some people only want people to direct play thus I have an option to allow for audio trans code.

Link to comment
Share on other sites

I guess u dont understand me correct. The way to configure the plugin is ok. I want to kill Video transcode and allow Audio transcode. But when u allow Audio transcode and transcoding it. U get a message to please dont Do it. And this message is what i want to disable, asked already in November for a Feature to disable that Info message :)

Edited by MangoMC
Link to comment
Share on other sites

I reconfigured the code idk when, but you only get that message for the first xxx time frame.  Its .05% of the film.  I think people should know they should change from Atmos to DTS if the other option is available, people are dumb.

if (sessionManagerSession.PlayState.PositionTicks <=
    sessionManagerSession.NowPlayingItem.RunTimeTicks * .05)
Link to comment
Share on other sites

Its 99% me getting that message lol. My Soundbar only handles ac3 and eac3 and the german Audio is very rare on 4k with dd or dd+

But 0,5% is ok :)

Link to comment
Share on other sites

Hi, 

 

Not sure am I doing everything ok, but I can't make your plugin to work.

I am using emby in docker, the newest stable version.

So I downloaded the newest plugin release from your github, I put it inside of my plugins folder, I restarted the server.

Then I checked and I saw plugin appeared under plugins, I left configuration as default.

I tried to play a 4k movie on Microsoft Edge on my pc, and movie got transcoded, but it never kill the stream, I done the same test with my android phone and nothing happens. I left it to play for a few min and the stream never got killed. 

When I went under logs, it seems like server recognize that I have this plugin, but plugin never gets activated during playback.

So only parts of the log which has a word killstream are:

2021-01-16 08:39:27.137 Info App: Loading KillStreams, Version=2021.1.12.1, Culture=neutral, PublicKeyToken=null from /config/plugins/KillStreams.dll
2021-01-16 08:39:28.314 Debug XmlSerializer: Deserializing file /config/plugins/configurations/KillStreams.xml
2021-01-16 08:39:29.083 Info App: Starting entry point KillStreams.ServerEntryPoint
2021-01-16 08:39:29.083 Info App: Entry point completed: KillStreams.ServerEntryPoint. Duration: 8.15E-05 seconds

Is there something I mess up, or maybe just on this type of devices, your plugin doesn't work?

 

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
 Share

×
×
  • Create New...