Jump to content


Photo

ffmpeg/ffprobe errors with playlist input


  • Please log in to reply
39 replies to this topic

#1 pünktchen OFFLINE  

pünktchen

    Advanced Member

  • Members
  • 2192 posts
  • Local time: 06:03 PM

Posted 16 September 2019 - 11:57 AM

@softworkz

I want to create a new Emby plugin. But before i spend my time into coding something that will not work, i'm evaluating what's possible in Emby.

The plugin will take a m3u playlist as input file, so for testing purposes i'm utilizing the IPTV plugin to verify playback.

Unfortunately this doesn't work. I only get errors in Emby's log. If i use the command line from the log in a command window i get this:

C:\Users\Administrator>D:\Emby\system\ffprobe.exe -i file:"D:\Emby\programdata\plugins\channel.m3u" -threads 0 -v info -print_format json -show_streams -show_chapters -show_format -show_data
ffprobe version 4.0.3-emby_2019_04_09-g5abbb1430d+449 Copyright (c) 2007-2018 the FFmpeg developers and softworkz for Emby LLC
  built with gcc 8.3.0 (Rev2, Built by MSYS2 project)
{
[hls,applehttp @ 000001aa656c0400] Opening 'http://localhost:8096/emby/Videos/498/stream?static=true&api_key=b7a75a5091f7414fbcaca593f5659535' for reading
[http @ 000001aa656ca080] Protocol 'http' not on whitelist 'file,crypto'!
[hls,applehttp @ 000001aa656c0400] Failed to open segment 0 of playlist 0
[hls,applehttp @ 000001aa656c0400] Error when loading first segment 'http://localhost:8096/emby/Videos/498/stream?static=true&api_key=123456789'
file:D:\Emby\programdata\plugins\channel.m3u: Invalid data found when processing input

}

This error can be solved by putting a whitelist parameter before the input parameter:

D:\Emby\system\ffprobe.exe -protocol_whitelist "file,http,https,tcp,tls" -i file:"D:\Emby\programdata\plugins\channel.m3u" -threads 0 -v info -print_format json -show_streams -show_chapters -show_format -show_data

I don't know, maybe it's also possible to compile ffprobe with the witelist already included.

The same also happens with ffmpeg, but there's also another error:

C:\Users\Administrator>D:\Emby\system\ffmpeg.exe -f m3u -i file:"D:\Emby\programdata\plugins\channel.m3u" -map_metadata -1 -map_chapters -1 -threads 1 -sn -c:v:0 libx264 -pix_fmt yuv420p  -maxrate 139808000 -bufsize 279616000 -preset veryfast -profile:v:0 high -level:v:0 4.1 -crf 23 -x264opts:0 subme=0:me_range=4:rc_lookahead=10:me=dia:no_chroma_me:8x8dct=0:partitions=none -force_key_frames "expr:gte(t,n_forced*3)" -vsync -1 -codec:a:0 libmp3lame -disposition:a:0 default -ac:a:0 2 -ab:a:0 192000  -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time 3  -individual_header_trailer 0 -segment_format mpegts -segment_write_temp 1 -segment_list_entry_prefix "hls/389eb89f812f025dcff2e0c8f0ec3ff0/" -segment_list_type m3u8 -segment_start_number 0 -segment_list "D:\Emby\programdata\transcoding-temp\389eb89f812f025dcff2e0c8f0ec3ff0.m3u8" -y "D:\Emby\programdata\transcoding-temp\389eb89f812f025dcff2e0c8f0ec3ff0%d.ts"
ffmpeg version 4.0.3-emby_2019_04_09-g5abbb1430d+449 Copyright (c) 2000-2018 the FFmpeg developers and softworkz for Emby LLC
  built with gcc 8.3.0 (Rev2, Built by MSYS2 project)
Local Time: 17:49:21
T=0.000s
T=0.031s
Unknown input format: 'm3u'

So either you omit the -f parameter when the file extension is m3u or m3u8, or you use -f hls.

 

 

@Luke

Can you please make the existing entries in the configuration screen of the IPTV plugin editable?

Right now one has to delete "false" entries and start from scratch.



#2 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 138211 posts
  • Local time: 12:03 PM

Posted 16 September 2019 - 12:03 PM

Can you please make the existing entries in the configuration screen of the IPTV plugin editable?

Right now one has to delete "false" entries and start from scratch.

That makes sense but I'm not sure when I'll be able to get to that.

#3 pünktchen OFFLINE  

pünktchen

    Advanced Member

  • Members
  • 2192 posts
  • Local time: 06:03 PM

Posted 20 September 2019 - 03:43 PM

@softworkz is there something to test for me with Emby 4.3.0.9?

#4 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 138211 posts
  • Local time: 12:03 PM

Posted 20 September 2019 - 03:44 PM

related to this?



#5 pünktchen OFFLINE  

pünktchen

    Advanced Member

  • Members
  • 2192 posts
  • Local time: 06:03 PM

Posted 20 September 2019 - 04:04 PM

Of course.

#6 softworkz OFFLINE  

softworkz

    Advanced Member

  • Developers
  • 1795 posts
  • Local time: 06:03 PM

Posted 20 September 2019 - 07:12 PM

@softworkz is there something to test for me with Emby 4.3.0.9?

 

I'm not sure whether  I understand the first post. You explain problems for which you already know the solutions..

 

But I must admit that I don't really know the iptv plugin..



#7 pünktchen OFFLINE  

pünktchen

    Advanced Member

  • Members
  • 2192 posts
  • Local time: 06:03 PM

Posted 20 September 2019 - 08:32 PM

I'm not sure whether I understand the first post. You explain problems for which you already know the solutions..

But I must admit that I don't really know the iptv plugin..

But i cannot set the necessary ffmpeg parameters. It has to be done in Emby's code.

#8 softworkz OFFLINE  

softworkz

    Advanced Member

  • Developers
  • 1795 posts
  • Local time: 06:03 PM

Posted 20 September 2019 - 08:49 PM

Emby handles m3u playlists in the context of live tv. It extracts "channels" from master playlists and individual streams ("channels") must be either constant mpegts streams or hls playlists.

It does not support any other kind of m3u use in that context - specifically not creating a sequence of different media parts.



#9 pünktchen OFFLINE  

pünktchen

    Advanced Member

  • Members
  • 2192 posts
  • Local time: 06:03 PM

Posted 21 September 2019 - 04:03 PM

Mmh, so maybe i should ask a different question:
Is there an Emby api endpoint that allows to stream multiple video items one after the other?
Or is it possible to stream a complete Emby playlist?

#10 softworkz OFFLINE  

softworkz

    Advanced Member

  • Developers
  • 1795 posts
  • Local time: 06:03 PM

Posted 21 September 2019 - 04:17 PM

Emby-integrated playlists would be the way to go, but it will never be a single (seamless) stream.

It will always be like starting a new playback - just that it's happening automatically.



#11 pünktchen OFFLINE  

pünktchen

    Advanced Member

  • Members
  • 2192 posts
  • Local time: 06:03 PM

Posted 21 September 2019 - 04:24 PM

And what would be the api call?
The streaming endpoint doesn't seem to work with the playlist id.

#12 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 138211 posts
  • Local time: 12:03 PM

Posted 21 September 2019 - 04:33 PM

This won't work as a channel plugin, which is what the IPTV plugin is I think you are better off generating an m3u that users could then feed into the m3u tuner feature. And then of course xml for matching guide data.

#13 pünktchen OFFLINE  

pünktchen

    Advanced Member

  • Members
  • 2192 posts
  • Local time: 06:03 PM

Posted 21 September 2019 - 04:56 PM

This won't work as a channel plugin, which is what the IPTV plugin is I think you are better off generating an m3u that users could then feed into the m3u tuner feature. And then of course xml for matching guide data.

Forget the IPTV plugin. I've tried to open ...stream/{playlistId}/static=true?apikey={myapikey} (cannot remember the exact syntax and cannot look at swagger right now) in VLC, but only got an error.

#14 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 138211 posts
  • Local time: 12:03 PM

Posted 21 September 2019 - 04:59 PM

Right that won't work. You can only open streams On media files.

#15 pünktchen OFFLINE  

pünktchen

    Advanced Member

  • Members
  • 2192 posts
  • Local time: 06:03 PM

Posted 21 September 2019 - 05:11 PM

Then again: Is it possible to open an Emby playlist as a stream somehow?

#16 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 138211 posts
  • Local time: 12:03 PM

Posted 21 September 2019 - 05:25 PM

Then again: Is it possible to open an Emby playlist as a stream somehow?

 

No. What you can do is get the list of items and then open them up one at a time.



#17 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 138211 posts
  • Local time: 12:03 PM

Posted 21 September 2019 - 05:27 PM

Based on your stated end goal of PseudoTV, I think your best bet is to implement ITunerHost to provide the content. Granted, it is not yet fully supported to implement a tuner host in a plugin, but it's on my to do list to move some of our current ones to plugins.

 

But I'll support you, and if this is what you want to do, i can try and look at that soon.



#18 softworkz OFFLINE  

softworkz

    Advanced Member

  • Developers
  • 1795 posts
  • Local time: 06:03 PM

Posted 21 September 2019 - 05:38 PM

I don't want to play the bad guy here, but TV is meant for playing tv streams.

Those are limited to a small range of formats and codecs for video, audio and subtitles.

That "small range" allows us to do things in the area of live tv that we can't do generally for all media formats.

Opening up the TV feature for playback of arbitrary media formats is something that we should think about carefully.



#19 pünktchen OFFLINE  

pünktchen

    Advanced Member

  • Members
  • 2192 posts
  • Local time: 06:03 PM

Posted 21 September 2019 - 06:50 PM

@softworkz Don't be a poor sport!
@Luke Thanks! But i know you have so many other things on your radar, so i will try some other approach first to solve the problem.

#20 softworkz OFFLINE  

softworkz

    Advanced Member

  • Developers
  • 1795 posts
  • Local time: 06:03 PM

Posted 21 September 2019 - 06:59 PM

@softworkz Don't be a poor sport!


I'm just trying to avoid opening Pandora's box - for both, yours and ours sake... :-)






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users