Jump to content
pünktchen

VirtualTV plugin

Recommended Posts

pünktchen

5e065eab9d91b_thumb.png

 

You've grown up with watching live tv but on television only runs garbage? You have a big library but don't know what to watch next?

Then this for you: "VirtualTV" - my new live tv plugin that allows you to create custom channels based on conditions of your Emby library content.

 

Right now it's in beta state, so testers are welcome.

Although it's already very feature rich, it has some limitations:

  • Only up to 20 channels

What's coming next:

  • Bug fixing, if you find some. And i'm sure you will
  • Remove channel count limitation
  • Optimize configuration screen with pre-filled cloud selection dialogs for genre, tags and some other things

Known problems:

  • Needs Emby Premier to work
  • (Playback)

Emby's live tv and playback api is very limited, so i've had to make some detours to get things working. The plugin has two playback modes: "single" and "continous" playback.

In single mode the plugin creates one stream copy of the actual movie with the help of ffmpeg to set the start position and then feeds the local copy to the live tv engine. At the end of the stream live tv stops. This mode has to be your preferable choice.

In continous mode up to ten movies are queued and concatenated to one big file with the help of ffmpeg. To make this happen every video in the queu has to have some common features (video and audio codec). That's why it often happens that the video also has to be transcoded by ffmpeg.

For transcoding the plugin relies on Emby's internal transcoding engine. If there's a problem, not uncommon with hardware acceleration enabled, the plugin also has a problem. Nothing i can do about it.

The availability of subtitle tracks is mostly dependant of the Emby user playback settings. In single playback mode all available subtitle tracks should be preserved, while in continous playback mode only one (the default) subtitle track can be used and this one has to be burnded into the video (transcoding takes place).

 

To get things started copy the extracted dll from the attachment at the end of this post to Emby' s plugin folder.

Restart you server and follow the instructions:

  • First you have to setup a custom api key. This is needed for most internal requests the plugin is doing.

5e0672d9332fd_1apikey.png

 

  • Copy your api key and paste it in the general settings of the VirtualTV plugin configuration screen and save the config before proceeding.

5e06736d61867_2generalconfig.png

The export folder path is optional. It allows you to use your custom channel line up in other applications like Kodi.

 

  • Now setup your channels with a name and number and choose your playback mode.

5e06748bd304a_3generalchannels.png

 

  • In the channel conditions you'll have to select an Emby account. This account is used to get library access, respect parental rating, reading watched states and selecting the stream language.
  • At least one textual input field of the conditions has to be filled to get some program data. Fields with an asterisk are either evaluated with an "AND" or "OR" condition among each other.

5e0676e988f39_4conditionchannels.png

 

  • Finally, if you've chosen "Continous Playback" for one of you channels, take a look at the transcoding settings.

5e06777135671_5transcoding.png

 

Save your channel line up and manually trigger a "Guide Refresh".

Now have fun!

Hint: if a video is still playing, hit the record button on the video osd to mark the item as "Watched".

 

Version History:

  • 0.5.0 First release
  • 0.5.1 Ignore external subtitles for stream requests
  • 0.5.2 Added some extra logging for the Export task
  • 0.5.3 Do not throw an exception for items without runtime, instead just skip them
  • 0.6.0 Support for TVShows, option to automatically mark items as watched
  • 0.6.2 Increased channels to twenty; Fixes for "AutoMarkWatched", Fixes for playback start
  • 0.6.4 Fixed "Watched Only" condition for tv shows; Fixed http response header for the export web api; Fixed Emby crash by "AutoMarkWatched"; Added option to force ts container in single playback mode
  • 0.6.5 Added custom ffmpeg option for single playback mode
  • 0.6.6 Fixed a bug for TVShows that could lead to an infinite guide refresh; Added some hidden settings for "FFmpegDirectStream" mode
  • 0.6.7 Added option to wait some time for the intermediate transcoding file to get filled
  • 0.7.0 Added support for music videos; Added program sort options to each channel; Optimized some database queries; Changed method of recognizing local ip adress for the Export method
  • 0.8.0 To many things for a oneliner
  • 0.8.1 Support for bumpers (fixed at 3 videos) between every channel program
  • 0.8.5 Speed up Guide Refresh, Support for tv shows without season folder, Support for logical operators with Genres and Tags
  • 0.8.6 Fixed Studio movie channel condition in conjunction with other filters
  • 0.9.0 Fixed some problems with the sort option, Added new playbackmode "Playlist"

After a plugin update, always clear your browser cache. If your setting still don't load in the config screen, you have to move the "VirtualTV.xml" out of ...\plugins\configurations and restart Emby. Start from scratch.

VirtualTV_0.8.1.zip

VirtualTV.0.8.6.zip

VirtualTV.0.9.0.zip

Edited by pünktchen
  • Like 27
  • Thanks 1

Share this post


Link to post
Share on other sites
Spaceboy

Excellent! Great work @punktchen

  • Like 1

Share this post


Link to post
Share on other sites
kanipek

Very cool. Pseudo TV for Emby! Thanks very much!

  • Like 1

Share this post


Link to post
Share on other sites
Jdiesel

Niiice! I've been dying for something like this for ages

  • Like 1

Share this post


Link to post
Share on other sites
shorty1483

This is simply awesome. Just tried it out and I love it! Well done!

Share this post


Link to post
Share on other sites
shorty1483

@@pünktchen Is an implementation of parental control as a channel criteria planned, e.g. for a animation channel, but max. FSK-6. Also the integration of playlists and Collections would be really cool to have theme channels like Sky does.

 

Also I got errors on some channels, that the particular stream is not available at the moment. All my affected movies contain the video stream and one audio stream + an external subtitle (srt). Seems ffmpeg is concerned about the external sub, because every movie without it, no matter what resolution, plays without problems.

Stream map '0:2' matches no streams.To ignore this, add a trailing '?' to the map.
Full ffmpeg logs attached.

 

 

@@Luke I hope you guys take a little care of pünktchens mentions, since this is the by far coolest 3rd party plugin so far. This makes the Live TV section usable even for the lots of guys like me who do not use the real live TV feature.

 

 

btw, the PseudoTV logos totally fit in...

post-59764-0-58951200-1577491254_thumb.png

ffmpeg-directstream-c3892d7a-6a6b-4057-8479-8357d7134422_1.txt

ffmpeg-directstream-ebff6414-90a6-4927-a010-f382332c6089_1.txt

Edited by shorty1483

Share this post


Link to post
Share on other sites
pünktchen

@@pünktchen Is an implementation of parental control as a channel criteria planned, e.g. for a animation channel, but max. FSK-6.

Haha, i knew that question would arise. It's planned, but i wanted to release it around xmas and hadn't the time for this. But if you select a user that has a max. parental rating of FSK-6, it should be respected.
  • Like 2

Share this post


Link to post
Share on other sites
pünktchen

Also I got errors on some channels, that the particular stream is not available at the moment. All my affected movies contain the video stream and one audio stream + an external subtitle (srt). Seems ffmpeg is concerned about the external subs, because every movie without it, no matter what resolution, plays without problems.

Stream map '0:2' matches no streams.
To ignore this, add a trailing '?' to the map.
Full ffmpeg logs attached.
Interesting!

@@Luke before playback i'm querying for DefaultSubtitleStreamIndex with a PlaybackInfo request. Shouldn't it return nothing in case of external subtitles?

Share this post


Link to post
Share on other sites
shorty1483

@@pünktchen

 

Additionally to the above reported, I recognized that all the movies in the channels show the same Extras in the Info screen. These are Extras of totally another movie. Also they all show the same Suggestion of one movie under the Extras. post-59764-15774947023649_thumb.jpg

Edited by shorty1483

Share this post


Link to post
Share on other sites
arrbee99

I had that extras thing above, but without using this plugin at all.

 

Edit - not that I can get it to reproduce itself at the moment...

Edited by arrbee99

Share this post


Link to post
Share on other sites
pünktchen

@@pünktchen

 

Additionally to the above reported, I recognized that all the movies in the channels show the same Extras in the Info screen. These are Extras of totally another movie. Also they all show the same Suggestion of one movie under the Extras. attachicon.gifScreenshot_20191228-015613_Emby.jpg

:huh:  Extras and suggestions are by Emby not by my plugin.

  • Like 1

Share this post


Link to post
Share on other sites
shorty1483

:huh: Extras and suggestions are by Emby not by my plugin.

@@Luke

Share this post


Link to post
Share on other sites
pünktchen

@@shorty1483 new version 0.5.1 in the starting post that should ignore external subtitles.

  • Like 1

Share this post


Link to post
Share on other sites
hstamas

Sweet! Once TV shows are added I’m going to be all over this!

 

Thanks SO much!

Share this post


Link to post
Share on other sites
pünktchen

There's not much i can do with those ffmpeg errors. Basically i'm telling Emby i need a direct stream, but Emby is telling ffmpeg how to do this.

I can only try to workaround those errors by requesting a container swap for some file extensions. So please try the following in VLC:

Open the url you'll find in your log with "...stream.mkv?..." instead of "...stream.mp4?..."

  • Like 1

Share this post


Link to post
Share on other sites
Spaceboy

may be useful to note that the plugin doesnt seem to work with the stable server version from my testing. working well on my beta install though. looking forward to series being added and the server being updated so i can use it properly

Share this post


Link to post
Share on other sites
pünktchen

What do you mean by "it doesn't work"?

I'm still on Emby 4.2.1.0

Share this post


Link to post
Share on other sites
Spaceboy

What do you mean by "it doesn't work"?

I'm still on Emby 4.2.1.0

:) fair enough. on stable 4.3.1.0 the config all works and the placeholder for the channel is added o the tv guide but no programs appear after running the guide refresh

 

all works as expected on latest beta

Share this post


Link to post
Share on other sites
pünktchen

Any errors in the logs?

If not enable debug logging in Emby, do a guide refresh and pm the log.

Share this post


Link to post
Share on other sites
shorty1483

:) fair enough. on stable 4.3.1.0 the config all works and the placeholder for the channel is added o the tv guide but no programs appear after running the guide refresh

 

all works as expected on latest beta

Weird, my posted EPG image above is from this stable Version... Edited by shorty1483

Share this post


Link to post
Share on other sites
pünktchen

Weird, my posted EPG image above is from this stable Version...

Maybe he has a database that was converted from Emby 3.5...

 

Did you have chance to test what i was suggesting with VLC?

Share this post


Link to post
Share on other sites
jachin99

I'm having the same issue as above, I get the channel to show but no program information or movies show up for it.  I didn't convert from 3.5

Share this post


Link to post
Share on other sites
Spaceboy

Still testing/looking into it. I don’t remember from which version this library came. Once I found it worked on my beta but not my stable install I immediately assumed that was the issue

Share this post


Link to post
Share on other sites
shorty1483

There's not much i can do with those ffmpeg errors. Basically i'm telling Emby i need a direct stream, but Emby is telling ffmpeg how to do this.

I can only try to workaround those errors by requesting a container swap for some file extensions. So please try the following in VLC:

Open the url you'll find in your log with "...stream.mkv?..." instead of "...stream.mp4?..."

 

 

Maybe he has a database that was converted from Emby 3.5...

 

Did you have chance to test what i was suggesting with VLC?

 

Sorry mate,was busy updating ,all my APCs :D

 

I checked with stream.mp4? and stream.mkv? and both are working on latest VLC.

Share this post


Link to post
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...