Jump to content

IPTV serving Emby content


VicMoore

Recommended Posts

VicMoore

I am trying to use IPTV to watch Emby content on my TVs. I am doing this just to learn more about EMBY.  I created an m3u file and added it as an M3U player in Emby. The m3u file is as follows.

#EXTM3U
#EXTINF:-1 tvg-id="KERODT1.us" tvg-logo="https://i.imgur.com/CMANZWk.png" group-title="Undefined",23 ABC Bakersfield CA (KERO) (720p)
https://content.uplynk.com/channel/ff809e6d9ec34109abfb333f0d4444b5.m3u8
#EXTINF:-1 tvg-id="24HourFreeMovies.us" tvg-logo="https://i.imgur.com/iSVnzR1.png" group-title="Movies",24 Hour Free Movies (720p) [Not 24/7]
http://192.168.1.106:8096/emby/videos/94164/main.m3u8?DeviceId=12121212-1212-1212-12121212121212121&MediaSourceId=a40ce11f9889ce4588942ef27ac746f0&PlaySessionId=417b768fab034bc28a7048a20602a216&api_key=0be40a77c115436eada1378e03c026bd&VideoCodec=h264&AudioCodec=mp3,aac&VideoBitrate=6904000&AudioBitrate=96000&AudioStreamIndex=1&TranscodingMaxAudioChannels=2&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&ManifestSubtitles=vtt&h264-profile=high,main,baseline,constrainedbaseline,high10&h264-level=52&TranscodeReasons=VideoCodecNotSupported,AudioCodecNotSupported

Of interest in this M3U file is the URL for the second #EXTINF. This URL points to the EMBY endpoint for playing M3U8 media from the EMBY libraries. In this case it points to the movie with id=94164.

I didn't change the other fields in the #EXTINF, because they were of no interest at the moment. Of course, in the end they would reflect the correct data for the movie being played.

As expected, the movie appears in the EMBY liveTV EPG and when it is clicked it plays OK.  I now want to play a sequence of movies.  I know I can do this by joining multiple movies together with ffmpeg. Don't get me wrong.  I don't know the details. I just believe it can be done in a plugin. Is there an easier way? can the URL be changed to provide a list of ids rather than just one?

My ambition is to have the URL point to a service end point in a plugin. Again, I don't know how to do it yet, but I am willing to learn.

 I would greatly appreciate any advice on how to proceed. 

Vic

 

 

Link to comment
Share on other sites

VicMoore

Thanks @ebrThats what I would like to do but my ignorance about EMBY details hides the solution from me. How would I change the URL in the M3U file to point to a playlist instead of a movie.

Vic

In writing this reply the solution may have popped into my mind. Are you suggesting that the "id" be that of a playlist rather than a movie?

Link to comment
Share on other sites

Well, why the M3U wrapper in the first place?  I know you like to dabble in plug-ins so I guess you are trying to work towards something.  Perhaps if you back up and explain what you are looking to accomplish, we can suggest a good method.

Link to comment
Share on other sites

VicMoore

You are a good man @ebr. I am trying to create an EPG populated with EMBY content. EMBY clients select from the EPG what they want to play and it plays. So far, with the m3u file given above I create a row in the EMBY EPG.  The URL I use in the #EXTINF of the m3u file points to a specific movie in EMBY.  That works great. I click on the EPG row and the movie plays.  I would like to play multiple movies in sequence.  I can then create the xml file needed to populate the EPG and add it to the M3U tuner defined in "liveTV" within EMBY.

The endgame is to create an EMBY plugin that turns EMBY into a cable TV provider for my home. I will create in JS a cool interface that a non-technical person (my wife in particular) can use to select which EMBY content will be played on each channel.  The number of channels would be unlimited (within reason) and could be mixed with other IPTV content. This I know how to do in JS.

The missing link is "how to provide a URL that plays a list of EMBY ids."

Your comments are always welcome and they have always been helpful.

Vic 

Link to comment
Share on other sites

VicMoore

By the way. All the code created by this project will be open and free for anyone to use as they desire. 

Link to comment
Share on other sites

CBers
27 minutes ago, VicMoore said:

I am trying to create an EPG populated with EMBY content. EMBY clients select from the EPG what they want to play and it plays.

Isn't that what @pünktchenVirtual TV plugin does?
 

Sorry if I misunderstand.
 

Link to comment
Share on other sites

VicMoore

@CBersyes you are partially correct. He builds the EPG directly.  I want to do it via m3u and the liveTV interface.  This solution would allow the plugin to be put into the EMBY catalog.  It would also be open source and be aimed at non -technical users. 

But most of all, I am doing this to learn and have fun.

Vic

  • Like 1
Link to comment
Share on other sites

Hmmmm.... let me ask you this.  Let's say your wife goes to your guide interface and scrolls ahead to a time in the future and clicks on an item.  What is expected to happen?

Link to comment
Share on other sites

VicMoore

Hello @ebrI expect that a url will be returned that points to a playlist composed of the item clicked and 10 of the items that follow it in the EPG.  This is what I want but not what I know how to do. I know how to return a url that points to a specific media item in Emby.

Currently my code allows for choosing a channel and the url for that iptv channel is returned and the stream played. In this case a single EMBY item is played.

Vic

Link to comment
Share on other sites

VicMoore

@ebrI have thought about this further.  Lets say that you click a program in the EPG titled Channel 2.  This channel has a stream and that stream is playing at the current time. No matter what you click in the row for that channel, the stream will start playing at the correct time offset.  The EPG just tells you what is playing at the current time and what will be playing in the future. Like a cable channel, if you click a program in the future, the stream still plays at the current time.

Vic

Link to comment
Share on other sites

VicMoore

Thanks @LukeI appreciate your help.  I will learn a great deal from this code.  Thank you so much.

Vic

  • Thanks 1
Link to comment
Share on other sites

17 minutes ago, VicMoore said:

Thanks @LukeI appreciate your help.  I will learn a great deal from this code.  Thank you so much.

Vic

The benefit of this method over m3u is that playback will be normal Emby-native playback, which means all features will be supported. That means direct play, audio passthrough, audio track/subtitle selection, user preferences, updating watch data, etc. If you just use an m3u and point it to a file, you're going to lose out on a lot of these things, and the tradeoff may be too undesirable for some.

Link to comment
Share on other sites

VicMoore

@LukeYou have given me the means to learn.  I will study the code in detail and then I will improve it and return it to you.  I am building the plugin right now.  I will apply my javascript skills to decorate this plugin with a great visual experience.   I am having so much fun.

Vic

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

VicMoore

@LukeI changed the GUID, built the plugin and loaded it into EMBY.. It's now a TV Source in Live TV.  The plugin has no configuration page.  How do I add channel rules and the media to be added to the EPG?  

Vic

Link to comment
Share on other sites

VicMoore

@LukeDo I build an xmltv guide and add it as a "TV Guide" in "LiveTV". Then the tv source "VirtualTVExample" works off of this xml guide to stream the Emby media clicked within the TV Guide?

Vic

Sorry for bothering you - I will try to do so less in the future.  I know you are very busy.  

Link to comment
Share on other sites

The plugin stubs out a config page, so you can add options to this screen:

https://github.com/MediaBrowser/VirtualTVExample/tree/master/VirtualTVExample/web

Then based on those options, you can adjust the channels that show up:

https://github.com/MediaBrowser/VirtualTVExample/blob/master/VirtualTVExample/VirtualTVTuner.cs#L75-L97

As well as the content of each channel:

https://github.com/MediaBrowser/VirtualTVExample/blob/master/VirtualTVExample/VirtualTVTuner.cs#L452-L470

here's another tuner with options that you can use as an example:

https://github.com/MediaBrowser/Tvheadend/tree/master/TVHeadEnd/web

  • Thanks 1
Link to comment
Share on other sites

VicMoore

Thanks @Lukefor the help. I am studying the code and I will respect your time. Thanks so much for your help.

VIc

Link to comment
Share on other sites

VicMoore

@LukeI have made great progress on the VirtualTVExample code. 

From the start I have been getting a "missing method" error that I can't figure out. Could you please look at the attached log and give me a pointer to how to fix the problem.

Vic

embyserver.txt

Link to comment
Share on other sites

5 hours ago, VicMoore said:

@LukeI have made great progress on the VirtualTVExample code. 

From the start I have been getting a "missing method" error that I can't figure out. Could you please look at the attached log and give me a pointer to how to fix the problem.

Vic

embyserver.txt 38.37 kB · 1 download

OK please pull down the changes I just made to the example repo and see if that resolves it. Thanks.

  • Thanks 1
Link to comment
Share on other sites

VicMoore

Attached is the log.  The EPG populates but when you go to play an item you get a "No compatible streams are currently available"

There are many Grid format errors and one "method not found"  when images are added.

I love this code. I am having so much fun...

Vic

embyserver (1).txt

Edited by VicMoore
Link to comment
Share on other sites

VicMoore

@LukeSorry my mistake..  I forgot to add the target to the project.  

 

EVERYTHING IS WORKING...  Yea!!!!

 

I am now working on the JS frontend.

 

Thank you so much...Vic

Edited by VicMoore
  • Thanks 1
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...