Jump to content
pünktchen

ffmpeg/ffprobe errors with playlist input

Recommended Posts

softworkz

I haven't understood the value of your intended solution but I've understood what you want to do.

 

So here's my personal advice for creating an appropriate solution:

  • First, we need to realize and accept that Emby features - as they are available to plugin developers - don't really help you much here
    .
  • You seem to be on the way already to run your own ffmpeg sessions.
    I would do this completely outside of EmbyServer inside a separate "companion application"
    This separate application will mimic an IPTV service - just that it creates streams on demand only instead of continuously.
    .
  • At the side of Emby, you will simply add an M3U tuner with local URLs pointing to your iptv service application
    .
  • Your plugin will only do the things that you need for interaction, but it will not do any media processing at all
    .
  • On the side of your iptv service, you could either use the concat approach, or you could also make your "iptv service" serve via HLS protocol to Emby
    With HLS, you would be able to stop your ffmpeg session at any time and restart another one for a new source file - while continuing at the previous last segment number
    Of course you need to make sure that you are always transcoding to the exact same format.
    .
  • Don't encode to HEVC. That costs too much CPU and Emby will transcode it back to H.264 anyway

Share this post


Link to post
Share on other sites
softworkz

It's the other way: http://ffmpeg.org/ffmpeg-formats.html#concat

"All files must have the same streams (same codecs, same time base, etc.)."

 

Yes, that's why you need to run it on the outputs of your transcodings. There's some explanation here about extending the concat list file in a delayed way: https://trac.ffmpeg.org/wiki/Concatenate

 

I can't say that I've ever tried that, but I've read about it.

Share this post


Link to post
Share on other sites
pünktchen
  • You seem to be on the way already to run your own ffmpeg sessions.

    I would do this completely outside of EmbyServer inside a separate "companion application"

    This separate application will mimic an IPTV service - just that it creates streams on demand only instead of continuously.

The stream/file is created on demand when a user starts watching a specific live tv channel, not when the Emby server starts.

 

  • At the side of Emby, you will simply add an M3U tuner with local URLs pointing to your iptv service application

    .

  • On the side of your iptv service, you could either use the concat approach, or you could also make your "iptv service" serve via HLS protocol to Emby

    With HLS, you would be able to stop your ffmpeg session at any time and restart another one for a new source file - while continuing at the previous last segment number

    Of course you need to make sure that you are always transcoding to the exact same format.

So you are saying i should create my own streaming server application that delivers streams and guide data?

Mmh, if had known this already some years ago then i had my own "Emby" server right now.

 

  • Don't encode to HEVC. That costs too much CPU and Emby will transcode it back to H.264 anyway

This was just for testing.

Edited by pünktchen

Share this post


Link to post
Share on other sites
softworkz

So you are saying i should create my own streaming server application that delivers streams and guide data?

Mmh, if had known this already some years ago then i had my own "Emby" server right now.

 

No. Then you would have your own TV channel, not an Emby Server. That's very different.

Share this post


Link to post
Share on other sites
pünktchen

Another question:

What about tcp is input for a live tv m3u playlist?

Emby accepts file, rtp, udp, rtsp and http but tcp is missing somehow?

Share this post


Link to post
Share on other sites
Luke

So you are saying i should create my own streaming server application that delivers streams and guide data?

 

I think you should implement ITunerHost, and temporarily, an IListingsProvider as well for guide data. I think (in theory), you should be able to use the current api's to at least get it to play single static files. I can commit to quick server-side fixes that might help you move things along. If you're able to get enough interested users, then we can gradually commit more to helping you.

 

With this approach the tradeoff is that you won't be able to seek between different programs, but you'll get to keep your direct play, hd audio passthrough, hdr, etc. You lose all of these things when you try to put them together into one playlist.

 

As you're aware of the private testing threads for new tuner hardware, one of the things we're also looking at is EPG data coming straight from the tuner. That means when all is said and done, you would only need an ITunerHost and not a separate IListingsProvider. But as of today, you'd have to do a listings provider, and users would have to hook them up together in the UI.

Share this post


Link to post
Share on other sites
softworkz

@@Luke - That doesn't make sense. When he is creating a custom program, he will always need to create custom listings because the data from the streams won't match the timings of his own program schedule.

 

@@pünktchen - Are you intending to deliver recorded TV only or any kind of videos on Emby server?

Share this post


Link to post
Share on other sites
softworkz

Also I don't understand what would be the benefit of playing back a single video through the TV feature instead of playing it normally through Emby?

Share this post


Link to post
Share on other sites
pünktchen

I think you should implement ITunerHost, and temporarily, an IListingsProvider as well for guide data. I think (in theory), you should be able to use the current api's to at least get it to play single static files. I can commit to quick server-side fixes that might help you move things along. If you're able to get enough interested users, then we can gradually commit more to helping you.

 

With this approach the tradeoff is that you won't be able to seek between different programs, but you'll get to keep your direct play, hd audio passthrough, hdr, etc. You lose all of these things when you try to put them together into one playlist.

It seems the IListingProvider doesn't have all fields that are needed for ListingProviderInfo.

I've already tried that and cannot get further in Emby at the screen where i choose a country and my custom provider.

 

Anyway when it's all about one static file - the currently running program of a channel - then i already have this within my virtual live tv channel plugin.

 

Seeking between different programs of the same channel isn't my goal. The problem is when one show ends, the next show should start automatically.

Share this post


Link to post
Share on other sites
pünktchen

@@pünktchen - Are you intending to deliver recorded TV only or any kind of videos on Emby server?

Any kind of video.

Share this post


Link to post
Share on other sites
pünktchen

Also I don't understand what would be the benefit of playing back a single video through the TV feature instead of playing it normally through Emby?

The reason behind my idea is, my wife and i often find us searching the guide to then watch a movie with commercials on live tv although we have this movie in the library...

Share this post


Link to post
Share on other sites
Luke

It seems the IListingProvider doesn't have all fields that are needed for ListingProviderInfo.

I've already tried that and cannot get further in Emby at the screen where i choose a country and my custom provider.

 

Anyway when it's all about one static file - the currently running program of a channel - then i already have this within my virtual live tv channel plugin.

 

Seeking between different programs of the same channel isn't my goal. The problem is when one show ends, the next show should start automatically.

 

 

I need to work out putting the xml provider into a plugin and then that should resolve whatever kinks you're seeing. I think the best way to handle continuous playback would be that whenever live tv ends due to EOF, we'd simply start playing the same channel again and it would move onto the next item. This should be a safe non-disruptive change since it would never happen with regular live tv. That would require updates to apps. It's not something I'd commit to now, but if you get a proof of concept going and there's enough interested users, then we can commit to providing more core support.

Share this post


Link to post
Share on other sites
softworkz

The reason behind my idea is, my wife and i often find us searching the guide to then watch a movie with commercials on live tv although we have this movie in the library...

 

But why do you want continuous/concatenated playback then? How does that come into play?

 

 

And how is your approach for solving that family situation:

  • Do you want Emby to indicate existing local versions of a video while browsing a regular guide?

    .

  • Or do you want to create your own artificial guide that is made up of existing videos?

    (and browse that instead of looking at a 'real' guide)

Share this post


Link to post
Share on other sites
pünktchen

But why do you want continuous/concatenated playback then? How does that come into play?

Just imagine a cartoon channel, a comedy channel or crime channel with random tv show episodes.

 

Or do you want to create your own artificial guide that is made up of existing videos?

(and browse that instead of looking at a 'real' guide)

This one.

Share this post


Link to post
Share on other sites
pünktchen

I need to work out putting the xml provider into a plugin and then that should resolve whatever kinks you're seeing. I think the best way to handle continuous playback would be that whenever live tv ends due to EOF, we'd simply start playing the same channel again and it would move onto the next item. This should be a safe non-disruptive change since it would never happen with regular live tv. That would require updates to apps. It's not something I'd commit to now, but if you get a proof of concept going and there's enough interested users, then we can commit to providing more core support.

That sounds promising.

Share this post


Link to post
Share on other sites
soerenderfor

So it is a "TV guide" - but not from TV but from movies in own library, right?

 

If that so, i like the idea.

Share this post


Link to post
Share on other sites
pünktchen

So it is a "TV guide" - but not from TV but from movies in own library, right?

 

If that so, i like the idea.

Yes, that's the plan.

Share this post


Link to post
Share on other sites
pünktchen

@@softworkz totally independent of my plugin idea

16:40:22.523 [http @ 000002cdff497a00] Protocol 'http' not on whitelist 'file,crypto'!

is still happening for ffprobe and ffmpeg. When will you implement the whitelist parameter?

It's not uncommen to use absolute URLs in a hls video on demand playlist: https://developer.apple.com/documentation/http_live_streaming/example_playlists_for_http_live_streaming/video_on_demand_playlist_construction

#EXTM3U
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-TARGETDURATION:10
#EXT-X-VERSION:4
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:10.0,
http://example.com/movie1/fileSequenceA.ts
#EXTINF:10.0,
http://example.com/movie1/fileSequenceB.ts
#EXTINF:10.0,
http://example.com/movie1/fileSequenceC.ts
#EXTINF:9.0,
http://example.com/movie1/fileSequenceD.ts
#EXT-X-ENDLIST

Share this post


Link to post
Share on other sites
softworkz

 

@@softworkz totally independent of my plugin idea

16:40:22.523 [http @ 000002cdff497a00] Protocol 'http' not on whitelist 'file,crypto'!

is still happening for ffprobe and ffmpeg. When will you implement the whitelist parameter?

It's not uncommen to use absolute URLs in a hls video on demand playlist: https://developer.apple.com/documentation/http_live_streaming/example_playlists_for_http_live_streaming/video_on_demand_playlist_construction

#EXTM3U
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-TARGETDURATION:10
#EXT-X-VERSION:4
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:10.0,
http://example.com/movie1/fileSequenceA.ts
#EXTINF:10.0,
http://example.com/movie1/fileSequenceB.ts
#EXTINF:10.0,
http://example.com/movie1/fileSequenceC.ts
#EXTINF:9.0,
http://example.com/movie1/fileSequenceD.ts
#EXT-X-ENDLIST

 

Could you please show a full example of what this is about?

(please excuse when we talked about it before, but I can't remember..)

Share this post


Link to post
Share on other sites
pünktchen

It's like that:

In Emby's live tv you load a "channels.m3u" that has no links to seperate ts streams but to m3u8 playlists.

If those m3u8 playlists are master playlists with an absolute url (starting with http://) to their media playlist or

if those m3u8 playlists are media playlists with absolute urls (starting with http://) to their media segments then

ffprobe and ffmpeg is throwing that "whitelist error".

That's a default security setting of ffmpeg. It doesn't allow you to load any protocol (file, http, https, tcp and so on) by forwarding it from the input, except the protocol is set on the whitelist flag that has to be before the "-i" parameter.

Share this post


Link to post
Share on other sites
Luke

I think I'm just working him too hard :)

Share this post


Link to post
Share on other sites
softworkz

Still not clear @@softworkz ?

 

Not really. An example would be helpful..

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