Jump to content

MyTV (Beta) - PseudoTV alternative


Recommended Posts

VicMoore
Posted

@grzes2411sorry, I didn't realize that I could just click the image to get all of the details. I am studding the log you provided. I will get back with you shortly.

Vic

VicMoore
Posted

@grzes2411Try the myTV plugin below and let me know if it works.  I added some code to recognize the "Emby for LG" client. If it's convenient please send me the server log.

Vic

myTV.dll

grzes2411
Posted (edited)

Now playback works, but in the Emby cockpit it sees that I am playing a movie and not a channel as in other players, and when I click this it takes me to the movie and not the channel. To confirm the picture 

 

And this video appears on the home page in continue playing

 

embyserver.txt

image.thumb.jpeg.9580674499a78e1df5dab24e282fb2a8.jpeg

Edited by grzes2411
VicMoore
Posted

@grzes2411I am glad that the movie plays OK now.  My guess is that the problem is in the Emby client running on the LG TV.  The movie plays OK now because "myTV" sent a playlist to the Emby client, rather than the movie itself.  Keep in mind that I am also just a novice and I am often wrong.

Vic

grzes2411
Posted

And is it possible to make it work like on other players, that is, that it sees the channel and not the movie and does not add to continue playback? Because such a thing was in VirtualTV that is why I gave up on it

pünktchen
Posted
15 minutes ago, grzes2411 said:

... does not add to continue playback? Because such a thing was in VirtualTV that is why I gave up on it

There options in VirtualTV to prevent that.

grzes2411
Posted

I don't know where. I only found “Remove new shows from Continue Watching” but that doesn't remove previously watched ones

grzes2411
Posted

When you click Get Image, nothing happens

VicMoore
Posted

I am making some changes to "Export" and "Import".  Currently you can only import data to the same server from which the data was exported.

In general, is anyone experiencing any problems?

Vic

Posted

Sorry been away for a while.  Will download the latest this weekend and give it a shot.

VicMoore
Posted

 

@LukeI am experiencing a problem with the TV Platform code from the VirtualTV.example code. My setup is a Samsung TV connected to an Amazon fire Cube running the "Emby for Android" client connected to my Emby Server via a common LAN. I have in Emby a TV channel with 200 music videos. The problem is that when I play that channel on the Samsung TV the music videos play from 2 to 5 music videos in proper sequence and then the client stops playing further music videos. 

 

Below is the Emby Log at the point where playing stopped. The place is marked by "======myTv STOP )))))))))))))))))". The log entries after this point show that the plugin gets the ID for the next video to play and provides the C# statement

this.mediaSourceManager.GetPlayackMediaSources(item, null, false, false, cancellationToken)

with the proper parameters. The log entries clearly show that the correct Item was found. The C# statement above does not play the item as expected.

 

2025-05-08 20:13:29.605 Info Server: http/1.1 POST http://192.168.1.28:8096/emby/Sessions/Playing/Stopped?X-Emby-Client=Emby for Android&X-Emby-Device-Name=Victor's Fire TV Cube&X-Emby-Device-Id=7327d2833b4916fb&X-Emby-Client-Version=3.4.65&X-Emby-Token=x_secret2_x&X-Emby-Language=en-us&reqformat=json. Source Ip: host1, UserAgent: Mozilla/5.0 (Linux; Android 9; AFTGAZL Build/PS7696.5226N; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/130.0.6723.170 Mobile Safari/537.36

2025-05-08 20:13:29.606 Info SessionManager: Playback stopped reported by app Emby for Android 3.4.65 on Victor's Fire TV Cube playing TEMP-1991. Stopped at 273348 ms. PlaySessionId: 90d588d82ca0425090d2c809c54a8edd

2025-05-08 20:13:29.607 Info SessionManager: Removed playSession 90d588d82ca0425090d2c809c54a8edd from session a105e79907d8eed0371d89175f6a4e3b

2025-05-08 20:13:29.607 Info Server: http/1.1 Response 204 to host1. Time: 2ms. POST http://192.168.1.28:8096/emby/Sessions/Playing/Stopped?X-Emby-Client=Emby for Android&X-Emby-Device-Name=Victor's Fire TV Cube&X-Emby-Device-Id=7327d2833b4916fb&X-Emby-Client-Version=3.4.65&X-Emby-Token=x_secret2_x&X-Emby-Language=en-us&reqformat=json

2025-05-08 20:13:29.607 Info myTVTuner: ======myTv STOP ))))))))))))))))))))))))))))))))))))))))))))

2025-05-08 20:13:29.713 Info Server: http/1.1 POST http://192.168.1.28:8096/emby/Items/2647331/PlaybackInfo?UserId=44298d2c6208420eb3bb3abd5374a062&StartTimeTicks=0&IsPlayback=true&AutoOpenLiveStream=true&MaxStreamingBitrate=4000001&X-Emby-Client=Emby for Android&X-Emby-Device-Name=Victor's Fire TV Cube&X-Emby-Device-Id=7327d2833b4916fb&X-Emby-Client-Version=3.4.65&X-Emby-Token=x_secret2_x&X-Emby-Language=en-us&reqformat=json. Source Ip: host1, UserAgent: Mozilla/5.0 (Linux; Android 9; AFTGAZL Build/PS7696.5226N; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/130.0.6723.170 Mobile Safari/537.36

2025-05-08 20:13:29.715 Info myTVTuner: ======myTv=====> Get channel stream media sources

2025-05-08 20:13:29.715 Info myTVTuner: ======myTv====== tuner channel Id 0

2025-05-08 20:13:29.717 Info myTVTuner: ======myTv====== (DbId) Program playing Id = 224409

2025-05-08 20:13:29.717 Info myTVTuner: ======myTv====== programPlayingId = 224409, Guid Id = 57f293da-5920-b09d-598a-2ac22972f5e3

2025-05-08 20:13:29.717 Info myTVTuner: ======myTv====== RunPlaylistTest

2025-05-08 20:13:29.717 Info myTVTuner: ======myTv====== Get tuner data path

2025-05-08 20:13:29.727 Info myTVTuner: ======myTv====== Scheduled Programs.Count = 2991

2025-05-08 20:13:29.727 Info myTVTuner: ======myTv====== Start Time = "2025-05-09T00:13:28.4275283Z"

2025-05-08 20:13:29.727 Info myTVTuner: ======myTv====== Media Ids = [224409,224410,224411,224412,224413,224414,224415,224418,224419,224416,224417,224403]

2025-05-08 20:13:29.727 Info myTVTuner: ======myTv====== Dictionary, key = 224409, value = 13000000

2025-05-08 20:13:29.727 Info myTVTuner: ======myTv====== add sessionId key 224409 and its value to the dictionary

2025-05-08 20:13:29.727 Info myTVTuner: ======myTv====== Playing item name = Pentatonix - Amazing Grace (Official Video)

2025-05-08 20:13:29.727 Info myTVTuner: ======myTv====== Playing presentation unique key (Guid) = 57f293da-5920-b09d-598a-2ac22972f5e3

2025-05-08 20:13:29.727 Info myTVTuner: ======myTv====== Playing display parent = Favorites

2025-05-08 20:13:29.728 Info App: User policy for vic2. EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True

2025-05-08 20:13:29.728 Info SessionManager: Adding playSession 85aba26cf9a647c7b278bfd7bfa556ee to session a105e79907d8eed0371d89175f6a4e3b

2025-05-08 20:13:29.729 Info Server: http/1.1 Response 200 to host1. Time: 15ms. POST http://192.168.1.28:8096/emby/Items/2647331/PlaybackInfo?UserId=44298d2c6208420eb3bb3abd5374a062&StartTimeTicks=0&IsPlayback=true&AutoOpenLiveStream=true&MaxStreamingBitrate=4000001&X-Emby-Client=Emby for Android&X-Emby-Device-Name=Victor's Fire TV Cube&X-Emby-Device-Id=7327d2833b4916fb&X-Emby-Client-Version=3.4.65&X-Emby-Token=x_secret2_x&X-Emby-Language=en-us&reqformat=json

 

The C# code below is from the plugin and illustrates the discussion above.

            if (item == null)
            {
                this.Logger.Info("======myTv====== Playing item = null");
                return Task.FromResult(new List<MediaSourceInfo>());
            }

            this.Logger.Info("======myTv====== Playing item name = " + item.Name);
            //this.Logger.Info("======myTv====== Playing External Id = " + item.ExternalId);

            this.Logger.Info("======myTv====== Playing presentation unique key (Guid) = " + item.Id);
            this.Logger.Info("======myTv====== Playing display parent = " + item.DisplayParent);

            //-----------------------------------------------------------------------------------
            // pass null for the user and false for the other options such as path substitution.
            // this is an internal method to get media sources, which normally would not call mediaSourceManager.GetPlayackMediaSources.
            // the user and path substitution options will end up getting applied by the outer consumer of this, which is why they don't need to be passed down lower
            return this.mediaSourceManager.GetPlayackMediaSources(item, null, false, false, cancellationToken);

 

 

 

embyserver (17).txt

VicMoore
Posted

@JatorThank's I appreciate the help.

Vic

VicMoore
Posted

 

@LukeI didn't do a good job above trying to explain my problem. Consider the LOG partial below that illustrates the problem. Let me explain.

 

in step 1 the music video "Lucy Thomas" is playing.

in step 2 the music video ends and Emby POSTs a "Playing Stopped" to the "Emby for Android" client

in step 3 the Emby session manager signals "Playback Stopped" and a 204 response is received

in step 4 the session manager removes the play session

in step 5 a 204 response is received

in step 6 the myTV service is alerted that a STOP has occured

in step 7 Emby sends a POST to the client with the new play info for the next item to play

in step 8 Emby requests from myTV the next item to play

in step 9 myTV has correctly selected the next item to play (Id 224409,  pentatronix - Amazing Grace)

in step 10 the key and value for the skip ahead tick count is added to the dictionary so it can be retrieved when the video plays

in step 11 the correct next video to play is given

in step 12 the policies are given

in step 13 the session manager adds the new playSession to play Id 224409,  pentatronix - Amazing Grace

in step 14 a 204 response code is received, so everything should be OK --  however the video does not play

 

image.png.b74b10e5944f4ab1c59f00a222d40093.png

After a few minutes the log entries below were added to the Emby Log

 

image.png.ca473a36c2637949e261e83d91c24ab5.png

 

Why does the next video not play?

Vic

 

embyserver (20).txt

Posted

Might need an app log: 

But first I would update to the new version that went out today. Thanks.

 

VicMoore
Posted

@LukeAre you saying to download the latest Emby for Android from Amazon?

Vic

VicMoore
Posted

 

@Luke I installed the latest "Emby for Android" and the problem still exists. I don't think the problem is in the client. It's in the "VirtualTV.example code".

@grzes2411suggested the following:

According to ChatGPT
 

It’s not the plugin or the method name that’s stopping playback—it’s the client rejecting the stream because the video’s bitrate exceeds its configured limit and it isn’t switching into transcode mode.

In your log you can see:

Bitrate exceeds DirectPlay limit: media bitrate: 4877618, max bitrate: 4000001
Bitrate exceeds DirectStream limit: media bitrate: 4877618, max bitrate: 4000001

What’s happening:

  • MaxStreamingBitrate is set to ~4 Mb/s in your PlaybackInfo request, but your video is ~4.88 Mb/s.

  • The client won’t DirectPlay or DirectStream it, and because your MediaSourceInfo isn’t explicitly advertising transcode support, it just stops instead of falling back to transcoding.

Fix it by:

  • Raising MaxStreamingBitrate in your PlaybackInfo to something above the actual bitrate (for example, 8000000).

  • Enabling transcoding on your source objects. For example:

     
    source.SupportsDirectPlay = false;
    source.SupportsDirectStream = true;
    source.SupportsTranscoding = true;

    This way, when the bitrate is too high, the client will automatically switch to transcode mode and start playback.

After making those changes, the next video in the channel should start playing automatically.

 

@Luke how can I set SupportsDirectPlay, SupportsDirectStream, and SupportsTranscoding in the virtualTV.example code ?

Vic

 

 

 

 

Neminem
Posted (edited)
33 minutes ago, VicMoore said:
Bitrate exceeds DirectPlay limit: media bitrate: 4877618, max bitrate: 4000001
Bitrate exceeds DirectStream limit: media bitrate: 4877618, max bitrate: 4000001

@VicMooreTry setting it to something else than auto and highter than 4mb.

Edit.

This is client side adjustment 😉

Edited by Neminem
VicMoore
Posted

@NeminemThanks for the suggestion - I tried that and it didn't work - I will try it again.

Vic

Posted
1 hour ago, VicMoore said:

 

@Luke I installed the latest "Emby for Android" and the problem still exists. I don't think the problem is in the client. It's in the "VirtualTV.example code".

@grzes2411suggested the following:

According to ChatGPT
 

It’s not the plugin or the method name that’s stopping playback—it’s the client rejecting the stream because the video’s bitrate exceeds its configured limit and it isn’t switching into transcode mode.

In your log you can see:

Bitrate exceeds DirectPlay limit: media bitrate: 4877618, max bitrate: 4000001
Bitrate exceeds DirectStream limit: media bitrate: 4877618, max bitrate: 4000001

What’s happening:

  • MaxStreamingBitrate is set to ~4 Mb/s in your PlaybackInfo request, but your video is ~4.88 Mb/s.

  • The client won’t DirectPlay or DirectStream it, and because your MediaSourceInfo isn’t explicitly advertising transcode support, it just stops instead of falling back to transcoding.

Fix it by:

  • Raising MaxStreamingBitrate in your PlaybackInfo to something above the actual bitrate (for example, 8000000).

  • Enabling transcoding on your source objects. For example:

     
    source.SupportsDirectPlay = false;
    source.SupportsDirectStream = true;
    source.SupportsTranscoding = true;

    This way, when the bitrate is too high, the client will automatically switch to transcode mode and start playback.

After making those changes, the next video in the channel should start playing automatically.

 

@Luke how can I set SupportsDirectPlay, SupportsDirectStream, and SupportsTranscoding in the virtualTV.example code ?

Vic

 

 

 

 

Don’t. Just leave them as they were in the example.

VicMoore
Posted

@LukeI appreciate the advice.  I have no clue how to fix this problem.  What should I do?  I need a hint. 

Vic

Posted
On 5/8/2025 at 9:43 PM, VicMoore said:

@JatorThank's I appreciate the help.

Vic

Just created a new channel and the random seems to be working as expected.  Thanks.

VicMoore
Posted

@JatorI am glad that it is working.

Vic

Posted
12 hours ago, VicMoore said:

@JatorI am glad that it is working.

Vic

Hey Vic.....is the random a "static random", it the library of files included are randomized once and then published, or is it a random order so that you won't have the same movies back2back down the road?

VicMoore
Posted

@JatorThe randomness was created when you built the channel. It occurred when you fetched the channel data. This creates a random list of media that is several months long. The EPG displayed in Emby scrolls across this data showing one week at a time. If you reach the end of the list, the EPG begins anew at the beginning of the list. 

Did this help?

Vic

Posted
1 hour ago, VicMoore said:

@JatorThe randomness was created when you built the channel. It occurred when you fetched the channel data. This creates a random list of media that is several months long. The EPG displayed in Emby scrolls across this data showing one week at a time. If you reach the end of the list, the EPG begins anew at the beginning of the list. 

Did this help?

Vic

Makes sense.  Is there a way to have more variability (not just one list of randoms but 2-4 random lists stacked onto each other).  That way the same order of movies don't just repeat each time they are shown?  Not necessarily an "on the fly" random list, but not just one static random list but say 2-4 stacked on top of each other, that was in the below example, Notting Hill isn't always following Love Actually.

No worries if that's not in the cards, it's not a deal breaker, just offering future enhancement opportunities.

image.png.49da9768ad8da8df6a4144031b2c7020.png

image.png.bcf41d4abaaca7d1f0044d9250187406.png

image.png.506ca9ac2f6535e9dc16773fd23ed477.png

image.png

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...